Skip to content

Commit 8d868c6

Browse files
refactor(web): import composer context id helpers from shared
The helpers moved to @t3tools/shared/composerContextReferences so mobile can fold agent-spawned thread ids the same way web does. Web call sites now import them from there directly instead of through a re-export in the web module. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent aeab4e3 commit 8d868c6

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ import {
199199
type TerminalContextSelection,
200200
} from "../../lib/terminalContext";
201201
import { useComposerPathSearch } from "../../lib/composerPathSearchState";
202-
import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";
202+
import {
203+
replaceComposerContextReferences,
204+
toKindScopedComposerContextId,
205+
} from "@t3tools/shared/composerContextReferences";
203206
import {
204207
getRestingComposerImagePreviewCounts,
205208
resolveRestingComposerControlsLayout,
@@ -228,7 +231,6 @@ import {
228231
formatInlineContextReference,
229232
insertInlineContextReference,
230233
inlineContextReferenceReplacement,
231-
toKindScopedComposerContextId,
232234
} from "~/lib/composerContextReferences";
233235
import {
234236
asKnownContextRecord,

‎apps/web/src/composerDraftStore.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ import {
6060
ensureInlineContextReferences,
6161
formatInlineContextReference,
6262
removeInlineContextReference,
63-
toComposerContextId,
64-
toKindScopedComposerContextId,
6563
} from "./lib/composerContextReferences";
6664
import {
6765
fileContextReference,
@@ -77,7 +75,11 @@ import { persist, type PersistStorage, type StorageValue } from "zustand/middlew
7775
import { useShallow } from "zustand/react/shallow";
7876
import { createDeferredStorage, createMemoryStorage } from "./lib/storage";
7977
import { getDefaultServerModel } from "./providerModels";
80-
import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";
78+
import {
79+
replaceComposerContextReferences,
80+
toComposerContextId,
81+
toKindScopedComposerContextId,
82+
} from "@t3tools/shared/composerContextReferences";
8183
import { UnifiedSettings } from "@t3tools/contracts/settings";
8284
import { ReviewCommentContextSchema, type ReviewCommentContext } from "./reviewCommentContext";
8385
const isRuntimeMode = Schema.is(RuntimeMode);

‎apps/web/src/lib/composerContextRecords.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import { encodeComposerContextFragment } from "@t3tools/shared/composerContextCl
2424
import {
2525
collectComposerContextReferences,
2626
sanitizeComposerContextLabel,
27+
toKindScopedComposerContextId,
2728
} from "@t3tools/shared/composerContextReferences";
2829

2930
import {
3031
type ComposerContextReference,
3132
producerIdFromComposerContextId,
32-
toKindScopedComposerContextId,
3333
} from "./composerContextReferences";
3434
import type { ComposerFileAttachment, ComposerImageAttachment } from "~/composerDraftStore";
3535
import type { AttachmentUploadState } from "./attachmentUploadState";

‎apps/web/src/lib/composerContextReferences.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import {
55
replaceComposerContextReferences,
66
} from "@t3tools/shared/composerContextReferences";
77

8-
export {
9-
toComposerContextId,
10-
toKindScopedComposerContextId,
11-
} from "@t3tools/shared/composerContextReferences";
12-
138
/**
149
* Prompt-string operations on inline context references, independent of kind. Each context
1510
* kind's draft record supplies a `ComposerContextReference` (kind, id, label); the prompt owns

‎apps/web/src/lib/terminalContext.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { ThreadId } from "@t3tools/contracts";
2-
import { formatComposerContextReference } from "@t3tools/shared/composerContextReferences";
3-
import { toKindScopedComposerContextId } from "./composerContextReferences";
2+
import {
3+
formatComposerContextReference,
4+
toKindScopedComposerContextId,
5+
} from "@t3tools/shared/composerContextReferences";
46

57
export interface TerminalContextSelection {
68
terminalId: string;

‎apps/web/src/lib/threadContextAttachment.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import type { EnvironmentId, OrchestrationV2ThreadTranscript } from "@t3tools/contracts";
2+
import { toKindScopedComposerContextId } from "@t3tools/shared/composerContextReferences";
23
import { threadTranscriptHeader } from "@t3tools/shared/threadTranscript";
34
import * as DateTime from "effect/DateTime";
45

5-
import { toKindScopedComposerContextId } from "./composerContextReferences";
6-
76
export function threadContextAttachment(
87
environmentId: EnvironmentId,
98
transcript: OrchestrationV2ThreadTranscript,

0 commit comments

Comments
 (0)