Fix shared type imports for Next build
+
+ Resolved the web production build failure on the Electron/Codex branch by normalizing
+ sibling imports in packages/types/src. The fix keeps the change surface
+ narrow: only TypeScript module specifiers changed, with no runtime contract updates.
+
Summary
+
+ The shared type package was exporting and importing local files with explicit
+ .ts suffixes. Next 16 type-checking rejected that layout during
+ bun --cwd=apps/web run build. This turn removed those suffixes across the
+ affected files and verified that the web production build now completes successfully.
+
Changes Made
+-
+
- Updated
packages/types/src/index.tsto re-export sibling modules without explicit.tssuffixes.
+ - Updated sibling imports in
desktop-ai.ts,events.ts,live.ts,options-flow.ts, andsynthetic-market.ts.
+ - Left all schemas, exported names, and runtime behavior unchanged. +
- Added this turn document under
docs/turns/.
+
Context
+
+ Recent Electron/Codex work introduced a new packages/types/src/desktop-ai.ts
+ surface and switched the package to source-based workspace exports. That was compatible
+ with the desktop runtime path, but the web production build still runs under Next's
+ stricter TypeScript pipeline, which flagged the explicit .ts sibling imports.
+
Important Implementation Details
+-
+
- The fix intentionally stops at module specifiers; it does not alter package exports, tsconfig flags, or build tooling. +
- This keeps the desktop branch behavior stable while making the source package consumable by Next's type-checking rules. +
- The check for remaining explicit local
.tsimports inpackages/types/srcnow returns no matches.
+
Relevant Diff Snippets
++ Snippets below use unified diff formatting compatible with tools documented by + diffs.com. +
+diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
+-export * from "./events.ts";
+-export * from "./live.ts";
+-export * from "./options-flow.ts";
++export * from "./events";
++export * from "./live";
++export * from "./options-flow";
+ diff --git a/packages/types/src/desktop-ai.ts b/packages/types/src/desktop-ai.ts
+-} from "./events.ts";
+-import { OptionFlowFiltersSchema } from "./options-flow.ts";
++} from "./events";
++import { OptionFlowFiltersSchema } from "./options-flow";
+ Expected Impact for End-Users
++ The Electron/Codex branch can now produce a successful web build again, which unblocks + shipping and testing of the desktop AI settings and Copilot surfaces without a separate + manual tsconfig workaround. +
+Validation
+-
+
rg -n "from "\\./.*\\.ts"|from '\\./.*\\.ts'|export \\* from "\\./.*\\.ts"|export \\* from '\\./.*\\.ts'" packages/types/srcreturned no matches after the patch.
+ bun test packages/types/testspassed: 12 tests, 0 failures.
+ bun installcompleted successfully in this worktree so the web build could run.
+ bun --cwd=apps/web run buildcompleted successfully on Next 16.2.6.
+
Issues, Limitations, and Mitigations
+-
+
- This fix is scoped to the current source import strategy. If the package later moves to compiled output exports, the import policy should be revisited deliberately. +
- The original failure was branch-specific, so validation was performed on
lavender/codex-login-management-electronrather thanmain.
+
Follow-up Work
+-
+
- Consider adding a lightweight lint or script check that rejects new explicit sibling
.tsimports inpackages/types/src.
+ - No additional product follow-up is required for
islandflow-c8fonce this branch is reviewed and merged.
+