From 3bb1475b3721c0c41f641ba6515c2db89ce7ba19 Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:24:09 -0500 Subject: [PATCH 1/3] feat(voice): add AssemblyAI cloud transcription Model: gpt-6.1-sol Task: implementation Agent: Codex (cherry picked from commit 083270eb523fd7742b5e1490de042089e1aa7ffc) (cherry picked from commit 7e4faf1d9c82461448347c9eea6f01e0b468adc6) --- apps/server/src/serverSettings.test.ts | 10 +++- .../sourceControlHostSecrets.test.ts | 7 ++- apps/server/src/speech/CloudSpeech.test.ts | 54 ++++++++++++++++++- apps/server/src/speech/CloudSpeech.ts | 30 +++++++++-- .../settings/CloudVoiceConfiguration.tsx | 2 +- .../settings/VoiceSettingsPanel.tsx | 1 + docs/user/voice-input.md | 2 + packages/contracts/src/settings.ts | 8 ++- packages/contracts/src/speech.ts | 8 ++- 9 files changed, 112 insertions(+), 10 deletions(-) diff --git a/apps/server/src/serverSettings.test.ts b/apps/server/src/serverSettings.test.ts index 873649cb168f5..0ed8033768e8e 100644 --- a/apps/server/src/serverSettings.test.ts +++ b/apps/server/src/serverSettings.test.ts @@ -1823,6 +1823,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings" openai: SECRET_REDACTED, xai: SECRET_REDACTED, openrouter: "", + assemblyai: "", }); assert.equal(legacy.sourceControlHosts.bitbucket?.accessToken, SECRET_REDACTED); assert.equal(legacy.usageLimitSources[hub]?.managementKey, SECRET_REDACTED); @@ -1853,6 +1854,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings" openai: usageReference, xai: "literal-fixture", openrouter: "", + assemblyai: "", }); assert.deepEqual(echoed.easDeviceHosts[0]?.accessToken, easReference); assert.deepEqual(echoed.simlockDeviceHosts[0]?.agentToken, simlockReference); @@ -1938,7 +1940,12 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings" "ghe.acme.test": work, }); assert.equal(removed.usageLimitSources[hub]?.managementKey, ""); - assert.deepEqual(removed.cloudSpeechCredentials, { openai: "", xai: work, openrouter: "" }); + assert.deepEqual(removed.cloudSpeechCredentials, { + openai: "", + xai: work, + openrouter: "", + assemblyai: "", + }); assert.equal(removed.easDeviceHosts[0]?.accessToken, ""); assert.deepEqual(Object.keys(removed.secretProviders), ["work"]); }).pipe(Effect.provide(layerServerSettingsWithSecrets())), @@ -1951,6 +1958,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings" "cloudSpeechCredentials.openai", "cloudSpeechCredentials.xai", "cloudSpeechCredentials.openrouter", + "cloudSpeechCredentials.assemblyai", "easDeviceHosts.[].accessToken", "simlockDeviceHosts.[].agentToken", "usageLimitSources.*.managementKey", diff --git a/apps/server/src/sourceControl/sourceControlHostSecrets.test.ts b/apps/server/src/sourceControl/sourceControlHostSecrets.test.ts index 9f73b2512841c..5acf7a8739971 100644 --- a/apps/server/src/sourceControl/sourceControlHostSecrets.test.ts +++ b/apps/server/src/sourceControl/sourceControlHostSecrets.test.ts @@ -176,7 +176,12 @@ it.effect("reads a collected reference again once it is invalidated", () => resolver, Effect.succeed({ sourceControlHosts: hosts, - cloudSpeechCredentials: { openai: source("voice#key"), xai: "", openrouter: "" }, + cloudSpeechCredentials: { + openai: source("voice#key"), + xai: "", + openrouter: "", + assemblyai: "", + }, usageLimitSources, textGenerators: {}, easDeviceHosts, diff --git a/apps/server/src/speech/CloudSpeech.test.ts b/apps/server/src/speech/CloudSpeech.test.ts index 112c7a88d9b3b..f85244780c4be 100644 --- a/apps/server/src/speech/CloudSpeech.test.ts +++ b/apps/server/src/speech/CloudSpeech.test.ts @@ -49,7 +49,12 @@ it.effect.each(["openai", "xai"] as const)("sends only to %s using its own saved yield* service.setKey(provider === "openai" ? "xai" : "openai", Redacted.make("other")); expect((yield* Effect.flip(transcribe()))._tag).toBe("CloudSpeechError"); yield* service.setKey(provider, Redacted.make("chosen")); - expect(yield* service.configured).toEqual({ openai: true, xai: true, openrouter: false }); + expect(yield* service.configured).toEqual({ + openai: true, + xai: true, + openrouter: false, + assemblyai: false, + }); yield* Effect.flip(transcribe(new Uint8Array(3))); expect(upstream).not.toHaveBeenCalled(); expect(yield* transcribe()).toBe("hello"); @@ -198,3 +203,50 @@ it.effect("removing a key while a catalog read is pending prevents the upload", expect(exit._tag).toBe("Failure"); }), ); + +it.effect( + "AssemblyAI sends WAV and config only to the Sync API and bounds clips before upload", + () => + Effect.gen(function* () { + const upstream = vi.fn(async () => Response.json({ text: "hello T3" })); + const service = yield* CloudSpeech.CloudSpeech.pipe( + Effect.provide( + CloudSpeech.layer.pipe( + Layer.provide(FetchHttpClient.layer), + Layer.provide(ServerSettings.ServerSettingsService.layerTest()), + Layer.provide(Layer.mock(SecretResolver.SecretResolver)({})), + ), + ), + ); + yield* service.setKey("assemblyai", Redacted.make("assembly-fixture")); + const transcribe = (samples: number) => + service + .transcribe("assemblyai", new Uint8Array(new Float32Array(samples).buffer), { + ...DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS, + speechLanguage: "en", + speechCustomWords: [{ term: "Closura", aliases: [] }], + }) + .pipe(Effect.provideService(FetchHttpClient.Fetch, upstream)); + expect(yield* transcribe(1600)).toBe("hello T3"); + const [url, init] = upstream.mock.calls[0]!; + expect(String(url)).toBe("https://sync.assemblyai.com/v1/transcribe"); + expect(init?.redirect).toBe("error"); + const headers = new Headers(init?.headers); + expect(headers.get("authorization")).toBe("assembly-fixture"); + expect(headers.get("X-AAI-Model")).toBe("universal-3-5-pro"); + const form = init?.body as FormData; + expect(JSON.parse(String(form.get("config")))).toEqual({ + language_code: "en", + word_boost: ["Closura"], + }); + expect((form.get("audio") as Blob).type).toBe("audio/wav"); + expect(yield* Effect.flip(transcribe(1_920_001))).toMatchObject({ reason: "audio-duration" }); + expect(yield* Effect.flip(transcribe(100))).toMatchObject({ reason: "audio-duration" }); + expect(upstream).toHaveBeenCalledTimes(1); + upstream.mockResolvedValueOnce(new Response("private diagnostic", { status: 401 })); + expect(yield* Effect.flip(transcribe(1600))).toMatchObject({ reason: "rejected-key" }); + yield* service.setKey("assemblyai", null); + expect((yield* service.configured).assemblyai).toBe(false); + expect(yield* Effect.flip(transcribe(1600))).toMatchObject({ reason: "missing-key" }); + }), +); diff --git a/apps/server/src/speech/CloudSpeech.ts b/apps/server/src/speech/CloudSpeech.ts index 3b7eab6b5242b..b846bff387df4 100644 --- a/apps/server/src/speech/CloudSpeech.ts +++ b/apps/server/src/speech/CloudSpeech.ts @@ -28,6 +28,7 @@ import { removeSpeechFillerWords } from "./fillerWords.ts"; import { decodeSpeechPcm, SpeechInvalidAudioError } from "./SpeechService.ts"; const endpoints = { + assemblyai: { url: "https://sync.assemblyai.com/v1/transcribe" }, openai: { url: "https://api.openai.com/v1/audio/transcriptions", model: "gpt-transcribe" }, xai: { url: "https://api.x.ai/v1/stt", model: "grok-voice-transcribe-2.0" }, openrouter: { url: "https://openrouter.ai/api/v1/audio/transcriptions" }, @@ -92,6 +93,19 @@ function audioBody( return HttpClientRequest.bodyFormData(form); } +function assemblyAiBody(audio: ArrayBuffer, language: string, options: SpeechTranscriptionOptions) { + const form = new FormData(); + form.set( + "config", + JSON.stringify({ + ...(language !== "auto" ? { language_code: language } : {}), + word_boost: options.speechCustomWords.map(({ term }) => term), + }), + ); + form.set("audio", new Blob([audio], { type: "audio/wav" }), "dictation.wav"); + return HttpClientRequest.bodyFormData(form); +} + function openRouterBody(model: string, audio: ArrayBuffer, language: string) { return HttpClientRequest.bodyJsonUnsafe({ model, @@ -130,10 +144,11 @@ export const layer = Layer.effect( Effect.map((value) => value.cloudSpeechCredentials), ); const configured = credentials.pipe( - Effect.map(({ openai, xai, openrouter }) => ({ + Effect.map(({ openai, xai, openrouter, assemblyai }) => ({ openai: Boolean(openai), xai: Boolean(xai), openrouter: Boolean(openrouter), + assemblyai: Boolean(assemblyai), })), ); const execute = (request: HttpClientRequest.HttpClientRequest) => @@ -197,6 +212,8 @@ export const layer = Layer.effect( message: "Invalid PCM audio.", }), }); + if (provider === "assemblyai" && (samples.length < 1280 || samples.length > 1_920_000)) + return yield* new CloudSpeechError({ provider, reason: "audio-duration" }); const language = effectiveSpeechLanguage(cloudSpeechLanguages, options.speechLanguage); if (provider === "openrouter" && !(yield* models).some((entry) => entry.id === model)) return yield* new CloudSpeechError({ provider, reason: "model-unavailable" }); @@ -209,10 +226,17 @@ export const layer = Layer.effect( if (!isApiKey(key)) return yield* unreadable(); const audio = wave(samples); const request = HttpClientRequest.post(endpoints[provider].url).pipe( - HttpClientRequest.bearerToken(Redacted.make(key)), + provider === "assemblyai" + ? HttpClientRequest.setHeaders({ + authorization: key, + "X-AAI-Model": "universal-3-5-pro", + }) + : HttpClientRequest.bearerToken(Redacted.make(key)), provider === "openrouter" ? openRouterBody(model!, audio, language) - : audioBody(provider, audio, language, options), + : provider === "assemblyai" + ? assemblyAiBody(audio, language, options) + : audioBody(provider, audio, language, options), ); const unavailable = () => new CloudSpeechError({ provider, reason: "unavailable" }); // A catalog fetch or vault lookup may have outlived the credential it started with. diff --git a/apps/web/src/components/settings/CloudVoiceConfiguration.tsx b/apps/web/src/components/settings/CloudVoiceConfiguration.tsx index 95dcee4cffb45..b3579f5def758 100644 --- a/apps/web/src/components/settings/CloudVoiceConfiguration.tsx +++ b/apps/web/src/components/settings/CloudVoiceConfiguration.tsx @@ -218,7 +218,7 @@ export function CloudVoiceConfiguration({ const destination = (): CloudDestination => routed && isModelId(model) ? { kind: "cloud", provider: "openrouter", environmentId: id, model } - : { kind: "cloud", provider: provider as "openai" | "xai", environmentId: id }; + : { kind: "cloud", provider: provider as "openai" | "xai" | "assemblyai", environmentId: id }; const enable = () => chooseAudioDestination(destination()); const canSubmit = routed ? modelChosen && keyReady && (!active || modelChanged || keyChanged) diff --git a/apps/web/src/components/settings/VoiceSettingsPanel.tsx b/apps/web/src/components/settings/VoiceSettingsPanel.tsx index 91d73a0d07f15..a2c8a682263e2 100644 --- a/apps/web/src/components/settings/VoiceSettingsPanel.tsx +++ b/apps/web/src/components/settings/VoiceSettingsPanel.tsx @@ -140,6 +140,7 @@ import { useScopedSettings, useUpdateScopedSettings } from "./useScopedSettings" const OFF = "off"; function CloudSpeechLogo({ provider }: { provider: CloudSpeechProvider }) { + if (provider === "assemblyai") return ; if (provider === "openrouter") return ; return ( diff --git a/docs/user/voice-input.md b/docs/user/voice-input.md index 4da5e0b750a87..71989004169e9 100644 --- a/docs/user/voice-input.md +++ b/docs/user/voice-input.md @@ -159,3 +159,5 @@ same environment, language, and dictionary as the composer, but skips transcript cleanup even when it is on, so you see what the model heard. Browser recording needs HTTPS or localhost and microphone permission; for a remote server over plain HTTP, use the desktop app. + +AssemblyAI uses the Sync API with Universal-3.5 Pro and your existing AssemblyAI API key. Each recording must be between 80 milliseconds and two minutes. Choose AssemblyAI under the cloud providers in Settings → Voice. diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 0013e288983e0..142b7ec7587c4 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -391,7 +391,7 @@ export const VoiceTranscriptionDestination = Schema.Union([ Schema.Struct({ kind: Schema.Literal("cloud"), environmentId: EnvironmentId, - provider: Schema.Literals(["openai", "xai"]), + provider: Schema.Literals(["openai", "xai", "assemblyai"]), }), Schema.Struct({ kind: Schema.Literal("cloud"), @@ -1355,6 +1355,7 @@ export const CloudSpeechCredentials = Schema.Struct({ openai: CloudSpeechCredential, xai: CloudSpeechCredential, openrouter: CloudSpeechCredential, + assemblyai: CloudSpeechCredential, }); export const ServerSettings = Schema.Struct({ @@ -1391,7 +1392,9 @@ export const ServerSettings = Schema.Struct({ enableAgentBrowserAccess: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), cloudSpeechCredentials: CloudSpeechCredentials.pipe( - Schema.withDecodingDefault(Effect.succeed({ openai: "", xai: "", openrouter: "" })), + Schema.withDecodingDefault( + Effect.succeed({ openai: "", xai: "", openrouter: "", assemblyai: "" }), + ), ), speechModelId: Schema.String.pipe( Schema.withDecodingDefault(Effect.succeed("handy-computer/parakeet-unified-en-0.6b-gguf")), @@ -1853,6 +1856,7 @@ export const ServerSettingsPatch = Schema.Struct({ openai: Schema.optionalKey(SettingsSecretValue), xai: Schema.optionalKey(SettingsSecretValue), openrouter: Schema.optionalKey(SettingsSecretValue), + assemblyai: Schema.optionalKey(SettingsSecretValue), }), ), speechModelId: Schema.optionalKey(Schema.String), diff --git a/packages/contracts/src/speech.ts b/packages/contracts/src/speech.ts index ff3362f67fc0c..ea9e331eae641 100644 --- a/packages/contracts/src/speech.ts +++ b/packages/contracts/src/speech.ts @@ -8,23 +8,26 @@ export const CloudSpeechApiKey = TrimmedNonEmptyString.check( Schema.isPattern(/^(?![a-z][a-z\d+.-]*:\/\/)[!-~]+$/i), ); -export const CloudSpeechProvider = Schema.Literals(["openai", "xai", "openrouter"]); +export const CloudSpeechProvider = Schema.Literals(["openai", "xai", "openrouter", "assemblyai"]); export type CloudSpeechProvider = typeof CloudSpeechProvider.Type; export const CLOUD_SPEECH_LABELS = { openai: "OpenAI", xai: "Grok Voice Transcribe", openrouter: "OpenRouter", + assemblyai: "AssemblyAI", } as const; export const CLOUD_SPEECH_PROVIDER_NAMES = { openai: "OpenAI", xai: "xAI", openrouter: "OpenRouter", + assemblyai: "AssemblyAI", } as const; /** Servers that predate OpenRouter report only the first two providers. */ export const CloudSpeechKeys = Schema.Struct({ openai: Schema.Boolean, xai: Schema.Boolean, openrouter: Schema.optionalKey(Schema.Boolean), + assemblyai: Schema.optionalKey(Schema.Boolean), }); export type CloudSpeechKeys = typeof CloudSpeechKeys.Type; @@ -45,6 +48,7 @@ export class CloudSpeechError extends Schema.TaggedError()( { provider: CloudSpeechProvider, reason: Schema.Literals([ + "audio-duration", "missing-key", "key-changed", "unreadable-key", @@ -59,6 +63,8 @@ export class CloudSpeechError extends Schema.TaggedError()( override get message() { const name = CLOUD_SPEECH_PROVIDER_NAMES[this.provider]; switch (this.reason) { + case "audio-duration": + return `${name} dictation accepts recordings from 80 milliseconds to two minutes. Record a shorter clip.`; case "missing-key": return `Add your ${name} API key in Settings → Voice.`; case "key-changed": From f3cbc150bf030a3c98728ef62f5346bd29ed3272 Mon Sep 17 00:00:00 2001 From: Kameron Smith <112618179+nullStack65@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:34:20 -0500 Subject: [PATCH 2/3] feat(threads): port founder inboxes onto upstream v0.1.10 Port of 7ba015815392253801d8f5bc8031f82185386ca7 (PR59, organize shared T3 fleet into founder inboxes) onto upstream v0.1.10 7d32075e37 for the Omarchy 0.1.10 host. Organizational owner/assignee/audience/attention metadata and the device-local All/Kameron/Jeff/Shared/Agents picker only; every thread stays visible under All. No access control or security segregation. Conflict resolutions (behavior preserved on both sides): - project MCP tools: keep upstream clampedPositiveInt import and add ThreadInboxRoutingPatch; - subagent projection: keep upstream `...inherited` (drops delegatedFrom for subagents) and add the child agent-only inbox derived from the parent; - ThreadLaunchService: keep upstream initialMessage/workspaceStrategy and pass through optional inboxOrigin/inboxRouting. Native v0.1.10 free-form thread tags and the client-runtime working/return inbox sorting are separate upstream features; this port neither replaces nor depends on them. (cherry picked from commit 7ba015815392253801d8f5bc8031f82185386ca7) Task: CLO-866 Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 6b05faeb6c6777da66dc91ae77c6731840c20d5d) --- .../src/environment/ServerEnvironment.ts | 1 + apps/server/src/mcp/OrchestratorMcpService.ts | 8 ++ .../src/mcp/ThreadMetadataMcpService.ts | 10 +- .../src/mcp/toolkits/orchestrator/tools.ts | 2 +- .../src/mcp/toolkits/project/handlers.ts | 6 + apps/server/src/mcp/toolkits/project/tools.ts | 2 + .../src/orchestration-v2/Orchestrator.ts | 27 ++++ .../src/orchestration-v2/ProjectionStore.ts | 2 + .../SubagentProjection.test.ts | 9 ++ .../ThreadLaunchService.test.ts | 32 +++++ .../orchestration-v2/ThreadLaunchService.ts | 6 + apps/server/src/ws.ts | 6 + apps/web/src/components/Sidebar.tsx | 26 +++- .../ThreadNotificationCoordinator.tsx | 13 +- .../components/sidebar/SidebarInboxBar.tsx | 49 +++++++ .../components/threadActionMenu.logic.test.ts | 32 ++++- .../src/components/threadActionMenu.logic.ts | 49 +++++++ apps/web/src/state/threads.ts | 2 + .../client-runtime/src/operations/commands.ts | 12 +- .../src/state/threadCommands.ts | 13 +- packages/contracts/src/environment.ts | 1 + packages/contracts/src/index.ts | 2 + packages/contracts/src/orchestrationV2.ts | 8 ++ packages/contracts/src/orchestratorMcp.ts | 5 + packages/contracts/src/settings.ts | 5 + packages/contracts/src/threadInbox.test.ts | 120 ++++++++++++++++++ packages/contracts/src/threadInbox.ts | 112 ++++++++++++++++ .../contracts/src/threadMetadataMcp.test.ts | 13 ++ packages/contracts/src/threadMetadataMcp.ts | 10 +- .../src/server/subagentProjection.ts | 11 ++ 30 files changed, 581 insertions(+), 13 deletions(-) create mode 100644 apps/web/src/components/sidebar/SidebarInboxBar.tsx create mode 100644 packages/contracts/src/threadInbox.test.ts create mode 100644 packages/contracts/src/threadInbox.ts diff --git a/apps/server/src/environment/ServerEnvironment.ts b/apps/server/src/environment/ServerEnvironment.ts index 813efbe53ea30..d7d309280e211 100644 --- a/apps/server/src/environment/ServerEnvironment.ts +++ b/apps/server/src/environment/ServerEnvironment.ts @@ -291,6 +291,7 @@ export const make = Effect.gen(function* () { ...(desktopAppUpdate ? { desktopAppUpdate: true, desktopAppChannelSwitch: true } : {}), serverBrowser: true, peerLinks: true, + threadInbox: true, mcpModeLimitHeader: true, linkFence: true, mcpApprovalCodes: true, diff --git a/apps/server/src/mcp/OrchestratorMcpService.ts b/apps/server/src/mcp/OrchestratorMcpService.ts index 5c5c9636406e1..97d578f527b57 100644 --- a/apps/server/src/mcp/OrchestratorMcpService.ts +++ b/apps/server/src/mcp/OrchestratorMcpService.ts @@ -943,6 +943,7 @@ function listItemFromShell( nowMs: number, ): OrchestratorMcpThreadListItem { return { + ...(shell.inbox === undefined ? {} : { inbox: shell.inbox }), threadId: shell.id, projectId: shell.projectId, title: shell.title, @@ -981,6 +982,7 @@ function threadDetail( const latest = ThreadManagementService.latestRun(projection); const active = ThreadManagementService.latestActiveRun(projection); return { + ...(projection.thread.inbox === undefined ? {} : { inbox: projection.thread.inbox }), threadId: projection.thread.id, projectId: projection.thread.projectId, title: projection.thread.title, @@ -3094,6 +3096,12 @@ const make = Effect.gen(function* () { const created = yield* threadManagement .dispatch({ type: "thread.create", + inboxOrigin: { kind: "agent", id: parent.thread.id }, + ...(request.inboxRouting !== undefined + ? { inboxRouting: request.inboxRouting } + : parent.thread.inbox === undefined + ? {} + : { inboxRouting: parent.thread.inbox }), createdBy: "agent", creationSource: "mcp", commandId, diff --git a/apps/server/src/mcp/ThreadMetadataMcpService.ts b/apps/server/src/mcp/ThreadMetadataMcpService.ts index 355fba952653f..929fbed082797 100644 --- a/apps/server/src/mcp/ThreadMetadataMcpService.ts +++ b/apps/server/src/mcp/ThreadMetadataMcpService.ts @@ -65,6 +65,13 @@ function metadataCommand(input: { readonly update: ThreadMetadataMcpUpdateInput; }): Extract { switch (input.update.action) { + case "route": + return { + type: "thread.metadata.update", + commandId: input.commandId, + threadId: input.threadId, + inboxRouting: input.update.inboxRouting!, + }; case "rename": return { type: "thread.metadata.update", @@ -88,10 +95,11 @@ function resultFromThread(input: { readonly sequence: number; readonly thread: Pick< OrchestrationV2AppThread, - "id" | "title" | "titleRegeneration" | "linkedPullRequest" | "updatedAt" + "id" | "title" | "titleRegeneration" | "linkedPullRequest" | "updatedAt" | "inbox" >; }): ThreadMetadataMcpUpdateResult { return { + ...(input.thread.inbox === undefined ? {} : { inbox: input.thread.inbox }), threadId: input.thread.id, action: input.action, commandId: input.commandId, diff --git a/apps/server/src/mcp/toolkits/orchestrator/tools.ts b/apps/server/src/mcp/toolkits/orchestrator/tools.ts index 629a5352587f0..252693b321565 100644 --- a/apps/server/src/mcp/toolkits/orchestrator/tools.ts +++ b/apps/server/src/mcp/toolkits/orchestrator/tools.ts @@ -266,7 +266,7 @@ const ThreadReadTool = Tool.make("t3_thread_read", { const ThreadUpdateTool = Tool.make("t3_thread_update", { description: - "Rename a thread (`action:'rename'` with `title`) or regenerate its title. Omit `threadId` for this thread. Workspace and branch cannot change here.", + "Route a thread with action:'route' and inboxRouting (owner, assignee, audience, attentionKind), or rename a thread (`action:'rename'` with `title`) or regenerate its title. Omit `threadId` for this thread. Workspace and branch cannot change here.", // Keeps the input's action/field check, which rebuilding the struct would drop. parameters: ThreadMetadataMcpUpdateInput.mapFields( Struct.assign({ environmentId: OrchestratorMcpEnvironmentTarget }), diff --git a/apps/server/src/mcp/toolkits/project/handlers.ts b/apps/server/src/mcp/toolkits/project/handlers.ts index 7a2fb5381227e..46774dedbc5ab 100644 --- a/apps/server/src/mcp/toolkits/project/handlers.ts +++ b/apps/server/src/mcp/toolkits/project/handlers.ts @@ -266,6 +266,12 @@ export const layer = McpToolAccess.toLayer(ProjectToolkit, { }); } const result = yield* ThreadMessageIntake.launchThread({ + inboxOrigin: { kind: "agent", id: caller?.id ?? "agent" }, + ...(input.inboxRouting !== undefined + ? { inboxRouting: input.inboxRouting } + : caller?.inbox === undefined + ? {} + : { inboxRouting: caller.inbox }), commandId, threadId, projectId, diff --git a/apps/server/src/mcp/toolkits/project/tools.ts b/apps/server/src/mcp/toolkits/project/tools.ts index 7de832eea28ad..957404aea573c 100644 --- a/apps/server/src/mcp/toolkits/project/tools.ts +++ b/apps/server/src/mcp/toolkits/project/tools.ts @@ -1,6 +1,7 @@ import { McpAttachmentInput } from "../attachment/input.ts"; import { clampedPositiveInt, + ThreadInboxRoutingPatch, NonNegativeInt, ModelSelection, TrimmedNonEmptyString, @@ -139,6 +140,7 @@ const ThreadLaunchTool = Tool.make("t3_thread_launch", { "No project: a new Scratch folder. Not with `projectId` or `workspaceStrategy`.", }), ), + inboxRouting: Schema.optional(ThreadInboxRoutingPatch), title: TrimmedNonEmptyString, modelSelection: Schema.optional(ModelSelection), runtimeMode: Schema.optional(RuntimeMode), diff --git a/apps/server/src/orchestration-v2/Orchestrator.ts b/apps/server/src/orchestration-v2/Orchestrator.ts index 2805935d38890..495764336e6ef 100644 --- a/apps/server/src/orchestration-v2/Orchestrator.ts +++ b/apps/server/src/orchestration-v2/Orchestrator.ts @@ -6,6 +6,8 @@ import type { OrchestrationV2ThreadHistoryPage, ProjectId, } from "@t3tools/contracts"; +import { makeThreadInbox, routeThreadInbox } from "@t3tools/contracts"; +import { ServerEnvironmentIdentity } from "../environment/ServerEnvironment.ts"; import { latestExecutedRun, latestRootProviderFailure, @@ -3778,6 +3780,23 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio const now = yield* DateTime.now; const emitEvent = emit(events, command); const thread: OrchestrationV2AppThread = { + ...(command.inboxOrigin === undefined && + command.inboxRouting === undefined && + command.createdBy !== "agent" + ? {} + : { + inbox: makeThreadInbox({ + actor: + command.inboxOrigin ?? + (command.createdBy === "agent" ? { kind: "agent", id: "agent" } : null), + ...(command.inboxRouting === undefined ? {} : { routing: command.inboxRouting }), + executorEnvironmentId: yield* Effect.serviceOption(ServerEnvironmentIdentity).pipe( + Effect.flatMap((identity) => + Option.isSome(identity) ? identity.value.getEnvironmentId : Effect.succeed(null), + ), + ), + }), + }), createdBy: command.createdBy, creationSource: command.creationSource, id: command.threadId, @@ -4850,6 +4869,14 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio }; return { ...thread, + ...(command.inboxRouting === undefined + ? {} + : { + inbox: routeThreadInbox( + thread.inbox ?? makeThreadInbox({ actor: null }), + command.inboxRouting, + ), + }), ...(command.title === undefined ? {} : { title: command.title }), ...(command.limitRecovery === undefined ? {} : { limitRecovery }), ...(command.limitRecovery !== undefined && diff --git a/apps/server/src/orchestration-v2/ProjectionStore.ts b/apps/server/src/orchestration-v2/ProjectionStore.ts index 5b71a6ac042f1..b98ccff45e783 100644 --- a/apps/server/src/orchestration-v2/ProjectionStore.ts +++ b/apps/server/src/orchestration-v2/ProjectionStore.ts @@ -1785,6 +1785,7 @@ export function threadShellFromProjection( }); return { createdBy: projection.thread.createdBy, + ...(projection.thread.inbox === undefined ? {} : { inbox: projection.thread.inbox }), creationSource: projection.thread.creationSource, id: projection.thread.id, projectId: projection.thread.projectId, @@ -2124,6 +2125,7 @@ function shellFromState(input: { ...(input.state.thread.historyOrigin === undefined ? {} : { historyOrigin: input.state.thread.historyOrigin }), + ...(input.state.thread.inbox === undefined ? {} : { inbox: input.state.thread.inbox }), ...(input.state.thread.linkOrigin === undefined ? {} : { linkOrigin: input.state.thread.linkOrigin }), diff --git a/apps/server/src/orchestration-v2/SubagentProjection.test.ts b/apps/server/src/orchestration-v2/SubagentProjection.test.ts index 2f764233ba97b..00ff1049c6e27 100644 --- a/apps/server/src/orchestration-v2/SubagentProjection.test.ts +++ b/apps/server/src/orchestration-v2/SubagentProjection.test.ts @@ -1,5 +1,7 @@ import { assert, it } from "@effect/vitest"; import { + makeThreadInbox, + matchesInboxView, CommandId, EnvironmentId, type ModelSelection, @@ -89,6 +91,7 @@ function makeParentThread(): OrchestrationV2AppThread { it("resets a subagent child's snooze, title job and remote delegation but keeps its workspace", () => { const parentThread: OrchestrationV2AppThread = { ...makeParentThread(), + inbox: makeThreadInbox({ actor: { kind: "human", id: "jeff" } }), titleRegeneration: { requestId: CommandId.make("command:parent-title"), startedAt: snoozedAt }, delegatedFrom: { environmentId: EnvironmentId.make("linked-environment"), @@ -111,6 +114,12 @@ it("resets a subagent child's snooze, title job and remote delegation but keeps creationSource: "provider", }); + assert.equal(childThread.inbox?.owner, "jeff"); + assert.deepEqual(childThread.inbox?.requestedBy, parentThread.inbox?.requestedBy); + assert.isFalse(matchesInboxView(childThread.inbox, "jeff")); + assert.isFalse(matchesInboxView(childThread.inbox, "kameron")); + assert.isTrue(matchesInboxView(childThread.inbox, "agents")); + assert.isTrue(matchesInboxView(childThread.inbox, "all")); assert.isNull(childThread.snoozedUntil); assert.isNull(childThread.snoozedAt); assert.isNull(childThread.titleRegeneration); diff --git a/apps/server/src/orchestration-v2/ThreadLaunchService.test.ts b/apps/server/src/orchestration-v2/ThreadLaunchService.test.ts index c9316bd231fc1..5b7bc8ad06166 100644 --- a/apps/server/src/orchestration-v2/ThreadLaunchService.test.ts +++ b/apps/server/src/orchestration-v2/ThreadLaunchService.test.ts @@ -3308,3 +3308,35 @@ it.effect("replays an accepted send after the project disables the instance", () } }).pipe(Effect.provide(Layer.mergeAll(harness.layer, layerFiles))); }); + +it.effect( + "persists founder routing in projections and shells and retains it on launch replay", + () => { + const harness = makeHarness(); + return Effect.gen(function* () { + const launches = yield* ThreadLaunch.ThreadLaunchService; + const threads = yield* ThreadManagement.ThreadManagementService; + const input = { + ...launchInput({ command: "inbox-launch", thread: "inbox-thread" }), + inboxOrigin: { kind: "human" as const, id: "jeff" as const }, + }; + const launched = yield* launches.launch(input); + const original = (yield* threads.getThreadProjection(launched.threadId)).thread.inbox; + assert.equal(original?.owner, "jeff"); + assert.deepEqual((yield* threads.getThreadShell(launched.threadId))?.inbox, original); + yield* threads.dispatch({ + type: "thread.metadata.update", + commandId: CommandId.make("route-inbox"), + threadId: launched.threadId, + inboxRouting: { assignee: { kind: "human", id: "kameron" }, attentionKind: "FYI" }, + }); + yield* launches.launch(input); + const routed = (yield* threads.getThreadProjection(launched.threadId)).thread.inbox; + assert.equal(routed?.owner, "kameron"); + assert.equal(routed?.attentionKind, "FYI"); + assert.deepEqual(routed?.origin, original?.origin); + assert.deepEqual(routed?.requestedBy, original?.requestedBy); + assert.deepEqual((yield* threads.getThreadShell(launched.threadId))?.inbox, routed); + }).pipe(Effect.provide(harness.layer)); + }, +); diff --git a/apps/server/src/orchestration-v2/ThreadLaunchService.ts b/apps/server/src/orchestration-v2/ThreadLaunchService.ts index eb452b883d761..e02256286955b 100644 --- a/apps/server/src/orchestration-v2/ThreadLaunchService.ts +++ b/apps/server/src/orchestration-v2/ThreadLaunchService.ts @@ -4,6 +4,8 @@ import * as TerminalManager from "../terminal/Manager.ts"; import { resolveProjectSettings } from "@t3tools/shared/projectSettings"; import { CommandId, + type InboxActor, + type ThreadInboxRoutingPatch, type ChatAttachment, type MessageId, type ModelSelection, @@ -88,6 +90,8 @@ export interface ThreadLaunchInitialMessage { export interface ThreadLaunchInput { readonly commandId: CommandId; + readonly inboxOrigin?: InboxActor; + readonly inboxRouting?: ThreadInboxRoutingPatch; readonly threadId?: ThreadId; readonly reuseExistingThread?: boolean; readonly projectId: ProjectId; @@ -1321,6 +1325,8 @@ const make = Effect.gen(function* () { ...(initialMessage === undefined ? {} : { initialMessage: { ...initialMessage, workspaceStrategy } }), + ...(input.inboxOrigin === undefined ? {} : { inboxOrigin: input.inboxOrigin }), + ...(input.inboxRouting === undefined ? {} : { inboxRouting: input.inboxRouting }), }); const claimed = yield* claimDispatch.pipe( Effect.mapError( diff --git a/apps/server/src/ws.ts b/apps/server/src/ws.ts index 6defac543eaac..f9979dcbf7f4d 100644 --- a/apps/server/src/ws.ts +++ b/apps/server/src/ws.ts @@ -2166,6 +2166,12 @@ export const layerWsRpc = ( Effect.andThen( ThreadMessageIntake.launchThread({ commandId: input.commandId, + ...(input.inboxOrigin === undefined + ? {} + : { inboxOrigin: input.inboxOrigin }), + ...(input.inboxRouting === undefined + ? {} + : { inboxRouting: input.inboxRouting }), ...(input.threadId === undefined ? {} : { threadId: input.threadId }), ...(input.reuseExistingThread === undefined ? {} diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index e6cdb90d5c86d..d9610ae185b13 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -1,3 +1,6 @@ +import { matchesInboxView } from "@t3tools/contracts"; +import { SidebarInboxBar } from "./sidebar/SidebarInboxBar"; +import { threadRoutingUpdateFromMenuAction } from "./threadActionMenu.logic"; import { attachSidebarTree } from "../lib/sidebarTree"; import { type EnvironmentId, type ScopedProjectRef } from "@t3tools/contracts"; import type { EnvironmentServerConfig } from "@t3tools/client-runtime/connection"; @@ -1100,10 +1103,17 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve ); const threads = useQuietThreadShells(); const promotingDraftThreadKeys = usePromotingDraftThreadKeys(); + const inboxView = useClientSettings((settings) => settings.founderInboxView); + const inboxThreads = threads.filter( + (thread) => + threadSearchQuery.trim().length > 0 || + matchesInboxView(thread.source.inbox, inboxView) || + (inboxView === "agents" && thread.source.createdBy === "agent"), + ); const listedThreads = promotingDraftThreadKeys.length === 0 - ? threads - : threads.map((thread) => + ? inboxThreads + : inboxThreads.map((thread) => promotingDraftThreadKeys.includes(threadShellKey(thread)) ? asLaunchingThread(thread) : thread, @@ -2658,6 +2668,9 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve ), canTurnIntoProject: canTurnThreadIntoProject(threadRef), supports: { + inboxRouting: + serverConfigs.get(thread.environmentId)?.environment.capabilities.threadInbox === + true, settlement: configLoaded, autoSettleOptOut: supportsAutoSettleOptOut, snooze: configLoaded, @@ -2672,6 +2685,14 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve ); if (clicked._tag === "Failure" || clicked.value === null) return; if (threadActionRequiresOperate(clicked.value) && !checkThreadOperations([thread])) return; + const inboxRouting = threadRoutingUpdateFromMenuAction(clicked.value); + if (inboxRouting) { + await updateThreadMetadata({ + environmentId: thread.environmentId, + input: { threadId: thread.id, inboxRouting }, + }); + return; + } if (clicked.value?.startsWith("snooze:")) { const preset = clicked.value === "snooze:custom" @@ -3196,6 +3217,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve activeSearchResultIndex={activeSearchResultIndex} onClearSearch={clearThreadSearch} /> + } > diff --git a/apps/web/src/components/ThreadNotificationCoordinator.tsx b/apps/web/src/components/ThreadNotificationCoordinator.tsx index 0268da23dd2e1..9fdc3945481a2 100644 --- a/apps/web/src/components/ThreadNotificationCoordinator.tsx +++ b/apps/web/src/components/ThreadNotificationCoordinator.tsx @@ -1,3 +1,4 @@ +import { matchesInboxView } from "@t3tools/contracts"; import { type EnvironmentThreadShell, type PendingSubagentRequest, @@ -112,7 +113,15 @@ export function startThreadNotifications( const live = registry.get(environmentThreadShells.anyEnvironmentHidingAtom) ? new Set(registry.get(environmentThreadShells.threadRefsAtom).map(threadKey)) : null; - const shouldClose = (key: string) => hidden.has(key) || (live !== null && !live.has(key)); + const outsideInbox = new Set(); + for (const [environmentId, state] of watched) { + for (const [threadId, entry] of state.previous) { + if (!matchesInboxView(entry.thread.source.inbox, getClientSettings().founderInboxView)) + outsideInbox.add(threadKey({ environmentId, threadId })); + } + } + const shouldClose = (key: string) => + outsideInbox.has(key) || hidden.has(key) || (live !== null && !live.has(key)); closeToasts(shouldClose); const count = pending.size; for (const [tag, entry] of pending) { @@ -134,6 +143,7 @@ export function startThreadNotifications( kind: ThreadNotificationKind, ) => { const { thread, status } = state; + if (!matchesInboxView(thread.source.inbox, getClientSettings().founderInboxView)) return; if ( registry .get(environmentThreadShells.hiddenThreadKeysAtom) @@ -419,6 +429,7 @@ export function startThreadNotifications( }; const onSettings = () => { + closeHiddenPending(); applyMode(); syncEnvironments(); }; diff --git a/apps/web/src/components/sidebar/SidebarInboxBar.tsx b/apps/web/src/components/sidebar/SidebarInboxBar.tsx new file mode 100644 index 0000000000000..8307abc3069d1 --- /dev/null +++ b/apps/web/src/components/sidebar/SidebarInboxBar.tsx @@ -0,0 +1,49 @@ +import type { InboxView } from "@t3tools/contracts"; +import { updateClientSettings, useClientSettings } from "../../hooks/useSettings"; + +/** A local view of the shared pool; All and search always include every thread. */ +export function SidebarInboxBar() { + const view = useClientSettings((settings) => settings.founderInboxView); + const owner = useClientSettings((settings) => settings.founderInboxOwner); + return ( +
+ + +
+ ); +} diff --git a/apps/web/src/components/threadActionMenu.logic.test.ts b/apps/web/src/components/threadActionMenu.logic.test.ts index bd9dfdcdcc4b6..12234c2d70a28 100644 --- a/apps/web/src/components/threadActionMenu.logic.test.ts +++ b/apps/web/src/components/threadActionMenu.logic.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from "vite-plus/test"; -import { buildThreadActionMenuItems, type ThreadActionMenuState } from "./threadActionMenu.logic"; +import { + threadRoutingUpdateFromMenuAction, + buildThreadActionMenuItems, + type ThreadActionMenuState, +} from "./threadActionMenu.logic"; const baseState: ThreadActionMenuState = { canOperate: true, @@ -75,3 +79,29 @@ describe("buildThreadActionMenuItems", () => { expect(items.find((item) => item.id === "turn-into-project")?.disabled).toBe(true); }); }); + +it("offers inbox routing only on capable environments and retains ordinary operate grants", () => { + expect(buildThreadActionMenuItems(baseState).some((item) => item.id === "inbox")).toBe(false); + const items = buildThreadActionMenuItems({ + ...baseState, + canOperate: false, + supports: { ...baseState.supports, inboxRouting: true }, + }); + expect( + items.find((item) => item.id === "inbox")?.children?.every((child) => child.disabled), + ).toBe(true); + expect(threadRoutingUpdateFromMenuAction("inbox:jeff")).toEqual({ + owner: "jeff", + assignee: { kind: "human", id: "jeff" }, + audience: "jeff", + attentionKind: "action", + }); + expect(threadRoutingUpdateFromMenuAction("inbox:agents")).toEqual({ + owner: null, + assignee: null, + audience: "agent-only", + attentionKind: "background", + }); + expect(threadRoutingUpdateFromMenuAction("attention:FYI")).toEqual({ attentionKind: "FYI" }); + expect(threadRoutingUpdateFromMenuAction("rename")).toBeNull(); +}); diff --git a/apps/web/src/components/threadActionMenu.logic.ts b/apps/web/src/components/threadActionMenu.logic.ts index 1e3eddd0b9389..4882857251d44 100644 --- a/apps/web/src/components/threadActionMenu.logic.ts +++ b/apps/web/src/components/threadActionMenu.logic.ts @@ -1,7 +1,12 @@ +import type { ThreadInboxRoutingPatch } from "@t3tools/contracts"; import type { ContextMenuItem } from "@t3tools/contracts"; import type { SnoozePreset } from "@t3tools/client-runtime/state/thread-settled"; export type ThreadActionMenuId = + | "inbox" + | `inbox:${"kameron" | "jeff" | "shared" | "agents"}` + | "attention" + | `attention:${"action" | "FYI" | "background"}` | "find" | "new-thread-on-branch" | "filter-by-project" @@ -84,6 +89,7 @@ export interface ThreadActionMenuState { /** Archive rejects attached providers, so disable it while running. */ readonly isRunning: boolean; readonly supports: { + readonly inboxRouting?: boolean; readonly settlement: boolean; readonly autoSettleOptOut: boolean; readonly snooze: boolean; @@ -117,6 +123,29 @@ export function buildThreadActionMenuItems( state: ThreadActionMenuState, ): ReadonlyArray> { const items: ReadonlyArray> = [ + ...(state.supports.inboxRouting + ? [ + { + id: "inbox" as const, + label: "Route to inbox", + children: [ + { id: "inbox:kameron" as const, label: "Kameron" }, + { id: "inbox:jeff" as const, label: "Jeff" }, + { id: "inbox:shared" as const, label: "Shared" }, + { id: "inbox:agents" as const, label: "Agents / neither founder" }, + ], + }, + { + id: "attention" as const, + label: "Attention", + children: [ + { id: "attention:action" as const, label: "Needs action" }, + { id: "attention:FYI" as const, label: "FYI" }, + { id: "attention:background" as const, label: "Background" }, + ], + }, + ] + : []), ...(state.canFind ? [{ id: "find" as const, label: "Find in thread", icon: "text-search" }] : []), @@ -267,3 +296,23 @@ export function buildThreadActionMenuItems( : item, ); } + +export function threadRoutingUpdateFromMenuAction(action: string): ThreadInboxRoutingPatch | null { + if (action === "inbox:kameron" || action === "inbox:jeff") { + const founder = action === "inbox:kameron" ? "kameron" : "jeff"; + return { + owner: founder, + assignee: { kind: "human", id: founder }, + audience: founder, + attentionKind: "action", + }; + } + if (action === "inbox:shared") + return { owner: null, assignee: null, audience: "shared", attentionKind: "FYI" }; + if (action === "inbox:agents") + return { owner: null, assignee: null, audience: "agent-only", attentionKind: "background" }; + if (action === "attention:action") return { attentionKind: "action" }; + if (action === "attention:FYI") return { attentionKind: "FYI" }; + if (action === "attention:background") return { attentionKind: "background" }; + return null; +} diff --git a/apps/web/src/state/threads.ts b/apps/web/src/state/threads.ts index 6d2ce2a07c90b..bfa59ed5af3f9 100644 --- a/apps/web/src/state/threads.ts +++ b/apps/web/src/state/threads.ts @@ -20,6 +20,7 @@ import { environmentCatalog } from "../connection/catalog"; import { connectionAtomRuntime } from "../connection/runtime"; import { serverEnvironment } from "./server"; import { environmentShell } from "./shell"; +import { getClientSettings } from "../hooks/useSettings"; export const threadFamilies = createThreadFamilyAtoms( connectionAtomRuntime, @@ -32,6 +33,7 @@ export const olderSettledThreads = createOlderSettledThreadAtoms( export const threadEnvironment = createThreadEnvironmentAtoms( connectionAtomRuntime, threadFamilies.snapshotAtom, + { getInboxOrigin: () => ({ kind: "human", id: getClientSettings().founderInboxOwner }) }, ); const environmentThreads = createEnvironmentThreadStateAtoms(connectionAtomRuntime); export const environmentThreadDetails = createEnvironmentThreadDetailAtoms( diff --git a/packages/client-runtime/src/operations/commands.ts b/packages/client-runtime/src/operations/commands.ts index 50717d0cafd41..7030e105577ad 100644 --- a/packages/client-runtime/src/operations/commands.ts +++ b/packages/client-runtime/src/operations/commands.ts @@ -1,6 +1,8 @@ import { remapComposerContextAttachments } from "@t3tools/shared/composerContextReferences"; import { type ThreadLinkedPullRequest, + type InboxActor, + type ThreadInboxRoutingPatch, CommandId, CheckpointId, CheckpointScopeId, @@ -47,6 +49,8 @@ import { } from "../rpc/client.ts"; interface CommandMetadata { + readonly inboxOrigin?: InboxActor; + readonly inboxRouting?: ThreadInboxRoutingPatch; readonly commandId?: CommandId; readonly createdAt?: string; readonly creationSource?: OrchestrationV2CreationSource; @@ -471,6 +475,8 @@ export const createThread = Effect.fn("EnvironmentCommands.createThread")(functi return yield* dispatch({ type: "thread.create", commandId: yield* allocateCommandId(input), + ...(input.inboxOrigin === undefined ? {} : { inboxOrigin: input.inboxOrigin }), + ...(input.inboxRouting === undefined ? {} : { inboxRouting: input.inboxRouting }), createdBy: "user", creationSource: input.creationSource ?? "web", threadId: input.threadId, @@ -691,10 +697,12 @@ export const updateThreadMetadata = Effect.fn("EnvironmentCommands.updateThreadM input.worktreePath !== undefined || input.regenerateTitle !== undefined || input.linkedPullRequest !== undefined || - input.limitRecovery !== undefined + input.limitRecovery !== undefined || + input.inboxRouting !== undefined ) { result = yield* dispatch({ type: "thread.metadata.update", + ...(input.inboxRouting === undefined ? {} : { inboxRouting: input.inboxRouting }), ...(input.limitRecovery === undefined ? {} : { limitRecovery: input.limitRecovery }), commandId, threadId: input.threadId, @@ -786,6 +794,8 @@ export const startThreadTurn = Effect.fn("EnvironmentCommands.startThreadTurn")( }; return yield* request(ORCHESTRATION_V2_WS_METHODS.launchThread, { commandId, + ...(input.inboxOrigin === undefined ? {} : { inboxOrigin: input.inboxOrigin }), + ...(input.inboxRouting === undefined ? {} : { inboxRouting: input.inboxRouting }), creationSource: input.creationSource ?? "web", threadId: input.threadId, ...(bootstrap === undefined ? { reuseExistingThread: true } : {}), diff --git a/packages/client-runtime/src/state/threadCommands.ts b/packages/client-runtime/src/state/threadCommands.ts index 0e9de03f5c066..e28d8aa90899a 100644 --- a/packages/client-runtime/src/state/threadCommands.ts +++ b/packages/client-runtime/src/state/threadCommands.ts @@ -1,4 +1,4 @@ -import { CommandId, type ModelSelection, type ThreadId } from "@t3tools/contracts"; +import { CommandId, type ModelSelection, type ThreadId, type InboxActor } from "@t3tools/contracts"; import * as SecureRandom from "effect/crypto/SecureRandom"; import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; @@ -24,6 +24,8 @@ import { waitForTitleRegenerationOutcome } from "./threadTitleRegeneration.ts"; import { type InterruptThreadTurnInput, type UpdateThreadMetadataInput, + type CreateThreadInput, + type StartThreadTurnInput, archiveThread, closeGuestShare, resolveGuestMessage, @@ -77,7 +79,12 @@ export type LoadEarlierThreadHistoryInput = { export function createThreadEnvironmentAtoms( runtime: Atom.AtomRuntime, snapshotAtom: (environmentId: EnvironmentId) => Atom.Atom, + options: { readonly getInboxOrigin?: () => InboxActor | undefined } = {}, ) { + const withInboxOrigin = (input: I) => { + const origin = input.inboxOrigin ?? options.getInboxOrigin?.(); + return origin === undefined ? input : { ...input, inboxOrigin: origin }; + }; const scheduler = createAtomCommandScheduler(); const concurrency = { mode: "serial" as const, @@ -162,7 +169,7 @@ export function createThreadEnvironmentAtoms( create: createEnvironmentCommand(runtime, { label: "environment-data:commands:thread:create", - execute: createThread, + execute: (input: CreateThreadInput) => createThread(withInboxOrigin(input)), scheduler, concurrency, }), @@ -307,7 +314,7 @@ export function createThreadEnvironmentAtoms( }), startTurn: createEnvironmentCommand(runtime, { label: "environment-data:commands:thread:start-turn", - execute: startThreadTurn, + execute: (input: StartThreadTurnInput) => startThreadTurn(withInboxOrigin(input)), scheduler, concurrency, }), diff --git a/packages/contracts/src/environment.ts b/packages/contracts/src/environment.ts index 603b6c6cc862d..6188f5f901db5 100644 --- a/packages/contracts/src/environment.ts +++ b/packages/contracts/src/environment.ts @@ -175,6 +175,7 @@ export const ExecutionEnvironmentCapabilities = Schema.Struct({ in them. Absent on servers from before linking, which clients must not offer linking for. */ peerLinks: Schema.optionalKey(Schema.Boolean), + threadInbox: Schema.optionalKey(Schema.Boolean), /** Server's `/mcp` narrows an OAuth client's modes from `T3-Mode-Limit`, so a linked environment's calls keep its agent's limits. Another environment links to this one only when it is set. */ diff --git a/packages/contracts/src/index.ts b/packages/contracts/src/index.ts index 8dd47df33a21f..7087bc252e443 100644 --- a/packages/contracts/src/index.ts +++ b/packages/contracts/src/index.ts @@ -73,3 +73,5 @@ export * from "./secretRequest.ts"; export * from "./secretReference.ts"; export * from "./settingsSecretValue.ts"; export * from "./clientRpcPermissions.ts"; + +export * from "./threadInbox.ts"; diff --git a/packages/contracts/src/orchestrationV2.ts b/packages/contracts/src/orchestrationV2.ts index 38d2e98ef72c2..21823136a1bd7 100644 --- a/packages/contracts/src/orchestrationV2.ts +++ b/packages/contracts/src/orchestrationV2.ts @@ -3,6 +3,7 @@ import { withRecordIdTable } from "./orchestrationV2IdTable.ts"; import * as DateTime from "effect/DateTime"; import * as Effect from "effect/Effect"; import * as Schema from "effect/Schema"; +import { ThreadInbox, ThreadInboxRoutingPatch, InboxActor } from "./threadInbox.ts"; import * as SchemaAST from "effect/SchemaAST"; import * as SchemaGetter from "effect/SchemaGetter"; import * as SchemaTransformation from "effect/SchemaTransformation"; @@ -465,6 +466,7 @@ const OrchestrationV2LastTitleRegeneration = Schema.Struct({ export const OrchestrationV2AppThread = Schema.Struct({ ...OrchestrationV2CreationFields, + inbox: Schema.optionalKey(ThreadInbox), id: ThreadId, projectId: ProjectId, title: TrimmedNonEmptyString, @@ -2193,6 +2195,7 @@ export type OrchestrationV2LatestVisibleMessageSummary = export const OrchestrationV2ThreadShell = Schema.Struct({ ...OrchestrationV2CreationFields, + inbox: Schema.optionalKey(ThreadInbox), id: ThreadId, projectId: ProjectId, title: Schema.String, @@ -3087,6 +3090,8 @@ export const OrchestrationV2Command = Schema.Union([ Schema.Struct({ type: Schema.Literal("thread.create"), ...OrchestrationV2CreationFields, + inboxOrigin: Schema.optionalKey(InboxActor), + inboxRouting: Schema.optionalKey(ThreadInboxRoutingPatch), commandId: CommandId, threadId: ThreadId, projectId: ProjectId, @@ -3245,6 +3250,7 @@ export const OrchestrationV2Command = Schema.Union([ type: Schema.Literal("thread.metadata.update"), commandId: CommandId, threadId: ThreadId, + inboxRouting: Schema.optionalKey(ThreadInboxRoutingPatch), title: Schema.optional(TrimmedNonEmptyString), regenerateTitle: Schema.optional(Schema.Boolean), branch: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)), @@ -3889,6 +3895,8 @@ export type OrchestrationV2ArchivedShellSnapshot = typeof OrchestrationV2Archive export const OrchestrationV2ThreadLaunchInput = Schema.Struct({ commandId: CommandId, + inboxOrigin: Schema.optionalKey(InboxActor), + inboxRouting: Schema.optionalKey(ThreadInboxRoutingPatch), creationSource: Schema.optional(OrchestrationV2CreationSource), threadId: Schema.optional(ThreadId), reuseExistingThread: Schema.optional(Schema.Boolean), diff --git a/packages/contracts/src/orchestratorMcp.ts b/packages/contracts/src/orchestratorMcp.ts index ed6a62bf1eb7f..3d987a2773ad1 100644 --- a/packages/contracts/src/orchestratorMcp.ts +++ b/packages/contracts/src/orchestratorMcp.ts @@ -272,7 +272,10 @@ export const OrchestratorMcpTaskCancelResult = Schema.Struct({ }); export type OrchestratorMcpTaskCancelResult = typeof OrchestratorMcpTaskCancelResult.Type; +import { ThreadInbox, ThreadInboxRoutingPatch } from "./threadInbox.ts"; + export const OrchestratorMcpCreateThreadRequest = Schema.Struct({ + inboxRouting: Schema.optional(ThreadInboxRoutingPatch), prompt: Schema.optional(OrchestratorMcpPrompt), title: Schema.optional(OrchestratorMcpTitle), target: Schema.optional(OrchestratorMcpTarget), @@ -393,6 +396,7 @@ export const OrchestratorMcpThreadBackgroundTask = Schema.Struct({ export type OrchestratorMcpThreadBackgroundTask = typeof OrchestratorMcpThreadBackgroundTask.Type; export const OrchestratorMcpThreadListItem = Schema.Struct({ + inbox: Schema.optionalKey(ThreadInbox), threadId: ThreadId, projectId: ProjectId, title: Schema.String, @@ -457,6 +461,7 @@ export const OrchestratorMcpThreadReadInput = Schema.Struct({ export type OrchestratorMcpThreadReadInput = typeof OrchestratorMcpThreadReadInput.Type; export const OrchestratorMcpThreadDetail = Schema.Struct({ + inbox: Schema.optionalKey(ThreadInbox), threadId: ThreadId, projectId: ProjectId, title: Schema.String, diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 142b7ec7587c4..aedceab598a0a 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -1,4 +1,5 @@ import { EasDeviceHostConfigs, SimlockDeviceHostConfigs, SshDeviceHostConfigs } from "./device.ts"; +import { Founder, InboxView } from "./threadInbox.ts"; import { AuthOrchestrationOperateScope, AuthAccessWriteScope, @@ -403,6 +404,8 @@ export const VoiceTranscriptionDestination = Schema.Union([ export type VoiceTranscriptionDestination = typeof VoiceTranscriptionDestination.Type; export const ClientSettingsSchema = Schema.Struct({ + founderInboxOwner: Founder.pipe(Schema.withDecodingDefault(Effect.succeed("kameron" as const))), + founderInboxView: InboxView.pipe(Schema.withDecodingDefault(Effect.succeed("kameron" as const))), notificationMode: NotificationMode.pipe( Schema.withDecodingDefault(Effect.succeed("off" as const)), ), @@ -2037,6 +2040,8 @@ export function requiredScopesForProjectMutation( } export const ClientSettingsPatch = Schema.Struct({ + founderInboxOwner: Schema.optionalKey(Founder), + founderInboxView: Schema.optionalKey(InboxView), notificationMode: Schema.optionalKey(NotificationMode), inAppNotificationsEnabled: Schema.optionalKey(Schema.Boolean), diffColorScheme: Schema.optionalKey(DiffColorScheme), diff --git a/packages/contracts/src/threadInbox.test.ts b/packages/contracts/src/threadInbox.test.ts new file mode 100644 index 0000000000000..fba1beb843e84 --- /dev/null +++ b/packages/contracts/src/threadInbox.test.ts @@ -0,0 +1,120 @@ +import { describe, expect, it } from "vite-plus/test"; +import { EnvironmentId } from "./baseSchemas.ts"; +import { + makeThreadInbox, + routeThreadInbox, + matchesInboxView, + founderInboxLane, + compositeThreadKey, +} from "./threadInbox.ts"; +const kameron = { kind: "human", id: "kameron" } as const; +const jeff = { kind: "human", id: "jeff" } as const; +const bot = { kind: "agent", id: "lead" } as const; +describe("shared fleet organizational inbox", () => { + it("keeps host collisions distinct", () => { + expect(compositeThreadKey("crown", "same")).not.toBe(compositeThreadKey("air", "same")); + expect(compositeThreadKey("a:b", "c")).not.toBe(compositeThreadKey("a", "b:c")); + }); + it("defaults founder-created work into that founder's inbox", () => { + const k = makeThreadInbox({ actor: kameron }); + const j = makeThreadInbox({ actor: jeff }); + expect(matchesInboxView(k, "kameron")).toBe(true); + expect(matchesInboxView(j, "kameron")).toBe(false); + expect(matchesInboxView(j, "jeff")).toBe(true); + expect(matchesInboxView(k, "jeff")).toBe(false); + expect(matchesInboxView(j, "all")).toBe(true); + expect(matchesInboxView(k, "all")).toBe(true); + }); + it("hides bot-only work by default while All and Agents retain it", () => { + const inbox = makeThreadInbox({ actor: bot }); + expect(matchesInboxView(inbox, "kameron")).toBe(false); + expect(matchesInboxView(inbox, "jeff")).toBe(false); + expect(matchesInboxView(inbox, "all")).toBe(true); + expect(matchesInboxView(inbox, "agents")).toBe(true); + }); + it("routes bot action and FYI assignments to either founder", () => { + for (const id of ["kameron", "jeff"] as const) { + const inbox = makeThreadInbox({ actor: bot, routing: { assignee: { kind: "human", id } } }); + expect(matchesInboxView(inbox, id)).toBe(true); + expect(founderInboxLane(inbox, id)).toBe("action"); + expect(founderInboxLane(routeThreadInbox(inbox, { attentionKind: "FYI" }), id)).toBe("FYI"); + expect(matchesInboxView(inbox, "all")).toBe(true); + } + }); + it("explicit reassignment wins over origin and retains provenance", () => { + const original = makeThreadInbox({ + actor: jeff, + executorEnvironmentId: EnvironmentId.make("air"), + }); + const assigned = routeThreadInbox(original, { assignee: kameron, owner: "kameron" }); + expect(matchesInboxView(assigned, "kameron")).toBe(true); + expect(matchesInboxView(assigned, "jeff")).toBe(false); + expect(assigned.origin).toEqual(jeff); + expect(assigned.requestedBy).toEqual(jeff); + expect(assigned.executorEnvironmentId).toEqual(original.executorEnvironmentId); + }); + it("inherits parent routing for child work without changing its requester", () => { + const parent = makeThreadInbox({ actor: jeff, routing: { attentionKind: "FYI" } }); + const child = makeThreadInbox({ + actor: bot, + parent, + executorEnvironmentId: EnvironmentId.make("r720"), + }); + expect(child.owner).toBe("jeff"); + expect(child.assignee).toEqual(jeff); + expect(child.requestedBy).toEqual(jeff); + expect(child.origin).toEqual(bot); + expect(founderInboxLane(child, "jeff")).toBe("FYI"); + expect(child.executorEnvironmentId).toBe("r720"); + }); + it("supports shared views and routing to neither founder", () => { + const shared = makeThreadInbox({ actor: kameron, routing: { audience: "shared" } }); + expect(matchesInboxView(shared, "shared")).toBe(true); + const neither = routeThreadInbox(shared, { + owner: null, + assignee: bot, + audience: "agent-only", + attentionKind: "background", + }); + expect(matchesInboxView(neither, "kameron")).toBe(false); + expect(matchesInboxView(neither, "jeff")).toBe(false); + expect(matchesInboxView(neither, "all")).toBe(true); + }); + it("keeps unclassified history visible in All without rewriting it", () => { + expect(matchesInboxView(undefined, "all")).toBe(true); + expect(matchesInboxView(undefined, "kameron")).toBe(false); + expect(matchesInboxView(undefined, "jeff")).toBe(false); + expect(founderInboxLane(undefined, "kameron")).toBe("unknown"); + }); +}); + +it("keeps unassigned agent-only action out of both founder inboxes", () => { + const inbox = makeThreadInbox({ + actor: bot, + routing: { owner: null, assignee: null, attentionKind: "action" }, + }); + expect(matchesInboxView(inbox, "kameron")).toBe(false); + expect(matchesInboxView(inbox, "jeff")).toBe(false); + expect(matchesInboxView(inbox, "agents")).toBe(true); + expect(matchesInboxView(inbox, "all")).toBe(true); + const assigned = routeThreadInbox(inbox, { owner: "jeff", assignee: jeff }); + expect(matchesInboxView(assigned, "jeff")).toBe(true); + expect(matchesInboxView(assigned, "kameron")).toBe(false); +}); + +it("keeps founder-owned agent-only children out of founder inboxes", () => { + const parent = makeThreadInbox({ actor: jeff }); + const child = makeThreadInbox({ + actor: bot, + parent, + routing: { audience: "agent-only", assignee: bot, attentionKind: "action" }, + }); + expect(child.owner).toBe("jeff"); + expect(matchesInboxView(child, "kameron")).toBe(false); + expect(matchesInboxView(child, "jeff")).toBe(false); + expect(matchesInboxView(child, "agents")).toBe(true); + expect(matchesInboxView(child, "all")).toBe(true); + const assigned = routeThreadInbox(child, { assignee: jeff }); + expect(matchesInboxView(assigned, "jeff")).toBe(true); + expect(matchesInboxView(assigned, "kameron")).toBe(false); +}); diff --git a/packages/contracts/src/threadInbox.ts b/packages/contracts/src/threadInbox.ts new file mode 100644 index 0000000000000..d1095320294f0 --- /dev/null +++ b/packages/contracts/src/threadInbox.ts @@ -0,0 +1,112 @@ +import * as Schema from "effect/Schema"; +import { EnvironmentId, ThreadId, TrimmedNonEmptyString } from "./baseSchemas.ts"; + +/** Organizational labels on the shared fleet. These never authorize access. */ +export const Founder = Schema.Literals(["kameron", "jeff"]); +export type Founder = typeof Founder.Type; +export const InboxActor = Schema.Union([ + Schema.Struct({ kind: Schema.Literal("human"), id: Founder }), + Schema.Struct({ kind: Schema.Literal("agent"), id: TrimmedNonEmptyString }), +]); +export type InboxActor = typeof InboxActor.Type; +export const ThreadInboxRouting = Schema.Struct({ + owner: Schema.NullOr(Founder), + assignee: Schema.NullOr(InboxActor), + audience: Schema.Literals(["kameron", "jeff", "shared", "agent-only"]), + attentionKind: Schema.Literals(["action", "FYI", "background"]), +}); +export type ThreadInboxRouting = typeof ThreadInboxRouting.Type; +export const ThreadInboxRoutingPatch = Schema.Struct({ + owner: Schema.optionalKey(ThreadInboxRouting.fields.owner), + assignee: Schema.optionalKey(ThreadInboxRouting.fields.assignee), + audience: Schema.optionalKey(ThreadInboxRouting.fields.audience), + attentionKind: Schema.optionalKey(ThreadInboxRouting.fields.attentionKind), +}); +export type ThreadInboxRoutingPatch = typeof ThreadInboxRoutingPatch.Type; +export const ThreadInbox = Schema.Struct({ + ...ThreadInboxRouting.fields, + origin: Schema.NullOr(InboxActor), + requestedBy: Schema.NullOr(InboxActor), + actor: Schema.NullOr(InboxActor), + executorEnvironmentId: Schema.NullOr(EnvironmentId), +}); +export type ThreadInbox = typeof ThreadInbox.Type; +export const INBOX_CAPABILITY = "closura-founder-inbox-v2" as const; +export const InboxView = Schema.Literals(["kameron", "jeff", "shared", "agents", "all"]); +export type InboxView = typeof InboxView.Type; +export const compositeThreadKey = (environmentId: string, threadId: string) => + JSON.stringify([environmentId, threadId]); +export const InboxThreadRef = Schema.Struct({ environmentId: EnvironmentId, threadId: ThreadId }); + +export function makeThreadInbox(input: { + readonly actor: InboxActor | null; + readonly requestedBy?: InboxActor | null; + readonly executorEnvironmentId?: EnvironmentId | null; + readonly parent?: ThreadInbox | null; + readonly routing?: ThreadInboxRoutingPatch; +}): ThreadInbox { + const actor = input.actor; + const routing = input.routing; + const target = routing?.assignee?.kind === "human" ? routing.assignee.id : undefined; + const owner = + routing?.owner !== undefined + ? routing.owner + : (target ?? input.parent?.owner ?? (actor?.kind === "human" ? actor.id : null)); + const assignee = + routing?.assignee !== undefined + ? routing.assignee + : (input.parent?.assignee ?? (owner ? { kind: "human" as const, id: owner } : actor)); + const audience = routing?.audience ?? target ?? input.parent?.audience ?? owner ?? "agent-only"; + return { + owner, + assignee, + audience, + attentionKind: + routing?.attentionKind ?? + (target ? "action" : (input.parent?.attentionKind ?? (owner ? "action" : "background"))), + origin: actor, + actor, + requestedBy: input.requestedBy ?? input.parent?.requestedBy ?? actor, + executorEnvironmentId: input.executorEnvironmentId ?? null, + }; +} + +/** Preserve immutable origin/requester/executor when routing an existing thread. */ +export const routeThreadInbox = ( + inbox: ThreadInbox, + routing: ThreadInboxRoutingPatch, +): ThreadInbox => ({ + ...inbox, + ...routing, + ...(routing.assignee?.kind === "human" + ? { + owner: routing.owner === undefined ? routing.assignee.id : routing.owner, + audience: routing.audience ?? routing.assignee.id, + attentionKind: + routing.attentionKind ?? + (inbox.attentionKind === "background" ? "action" : inbox.attentionKind), + } + : {}), +}); + +export function founderInboxLane(inbox: ThreadInbox | null | undefined, founder: Founder) { + if (!inbox) return "unknown"; + const assigned = inbox.assignee?.kind === "human" ? inbox.assignee.id : inbox.owner; + if (inbox.audience === "agent-only" && inbox.assignee?.kind !== "human") return "hidden"; + if (assigned !== founder) return "hidden"; + return inbox.attentionKind; +} + +/** All deliberately includes every thread, including unclassified history. */ +export function matchesInboxView(inbox: ThreadInbox | null | undefined, view: InboxView) { + if (view === "all") return true; + if (view === "agents") + return ( + inbox?.origin?.kind === "agent" || + inbox?.assignee?.kind === "agent" || + inbox?.audience === "agent-only" + ); + if (view === "shared") return inbox?.audience === "shared"; + const lane = founderInboxLane(inbox, view); + return lane === "action" || lane === "FYI"; +} diff --git a/packages/contracts/src/threadMetadataMcp.test.ts b/packages/contracts/src/threadMetadataMcp.test.ts index 884741b762d65..022e197ef5c40 100644 --- a/packages/contracts/src/threadMetadataMcp.test.ts +++ b/packages/contracts/src/threadMetadataMcp.test.ts @@ -20,3 +20,16 @@ describe("ThreadMetadataMcpUpdateInput", () => { ); }); }); + +it("accepts agent routing and rejects ambiguous metadata actions", () => { + assert.deepEqual( + decodeUpdate({ + action: "route", + inboxRouting: { assignee: { kind: "human", id: "jeff" }, attentionKind: "FYI" }, + }).inboxRouting, + { assignee: { kind: "human", id: "jeff" }, attentionKind: "FYI" }, + ); + assert.throws(() => decodeUpdate({ action: "route" })); + assert.throws(() => decodeUpdate({ action: "rename", title: "x", inboxRouting: {} })); + assert.throws(() => decodeUpdate({ action: "route", inboxRouting: { owner: "other" } })); +}); diff --git a/packages/contracts/src/threadMetadataMcp.ts b/packages/contracts/src/threadMetadataMcp.ts index e5332ac56ab47..6fcb89671c48d 100644 --- a/packages/contracts/src/threadMetadataMcp.ts +++ b/packages/contracts/src/threadMetadataMcp.ts @@ -7,6 +7,7 @@ import { ThreadId, TrimmedNonEmptyString, } from "./baseSchemas.ts"; +import { ThreadInbox, ThreadInboxRoutingPatch } from "./threadInbox.ts"; import { ThreadLinkedPullRequest } from "./threadPullRequest.ts"; import { ThreadTitleRegeneration } from "./threadTitle.ts"; @@ -40,19 +41,21 @@ const ThreadMetadataClientRequestId = TrimmedNonEmptyString.check(Schema.isMaxLe ) .annotate({ description: "Stable idempotency key to reuse when retrying this mutation." }); -export const ThreadMetadataMcpAction = Schema.Literals(["rename", "regenerate_title"]); +export const ThreadMetadataMcpAction = Schema.Literals(["rename", "regenerate_title", "route"]); export type ThreadMetadataMcpAction = typeof ThreadMetadataMcpAction.Type; export const ThreadMetadataMcpUpdateInput = Schema.Struct({ threadId: Schema.optional(ThreadId), action: ThreadMetadataMcpAction, title: Schema.optional(ThreadMetadataTitle), + inboxRouting: Schema.optional(ThreadInboxRoutingPatch), clientRequestId: Schema.optional(ThreadMetadataClientRequestId), }).check( Schema.makeFilter((input) => - (input.action === "rename") === (input.title !== undefined) + (input.action === "rename") === (input.title !== undefined) && + (input.action === "route") === (input.inboxRouting !== undefined) ? true - : "rename requires title; regenerate_title does not accept one.", + : "rename requires title; route requires inboxRouting; other actions reject those fields.", ), ); export type ThreadMetadataMcpUpdateInput = typeof ThreadMetadataMcpUpdateInput.Type; @@ -65,6 +68,7 @@ export const ThreadMetadataMcpUpdateResult = Schema.Struct({ title: Schema.String, titleRegeneration: Schema.NullOr(ThreadTitleRegeneration), linkedPullRequest: Schema.NullOr(ThreadLinkedPullRequest), + inbox: Schema.optionalKey(ThreadInbox), updatedAt: IsoDateTime, }); export type ThreadMetadataMcpUpdateResult = typeof ThreadMetadataMcpUpdateResult.Type; diff --git a/packages/provider-core/src/server/subagentProjection.ts b/packages/provider-core/src/server/subagentProjection.ts index f1b0a41905fb3..74808a3555e0b 100644 --- a/packages/provider-core/src/server/subagentProjection.ts +++ b/packages/provider-core/src/server/subagentProjection.ts @@ -18,6 +18,7 @@ import type { ThreadId, TurnItemId, } from "@t3tools/contracts"; +import { makeThreadInbox } from "@t3tools/contracts"; import { backgroundWorkHoldsCompletion } from "@t3tools/shared/orchestrationV2PendingBackgroundWork"; import { runRanAfter } from "@t3tools/shared/orchestrationV2ThreadError"; import * as DateTime from "effect/DateTime"; @@ -66,6 +67,16 @@ export function makeSubagentChildThread(input: { const { delegatedFrom: _delegatedFrom, ...inherited } = input.parentThread; return { ...inherited, + inbox: makeThreadInbox({ + actor: { kind: "agent", id: input.childThreadId }, + routing: { + audience: "agent-only", + assignee: { kind: "agent", id: input.childThreadId }, + attentionKind: "background", + }, + ...(input.parentThread.inbox === undefined ? {} : { parent: input.parentThread.inbox }), + executorEnvironmentId: input.parentThread.inbox?.executorEnvironmentId ?? null, + }), createdBy: input.createdBy, creationSource: input.creationSource, id: input.childThreadId, From 1461341a134fcf79bb652e51e4048e43d72b1ee1 Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:58:12 +0000 Subject: [PATCH 3/3] build(closura): portable Linux desktop build with a noble sysroot The supported desktop build compiles node-pty from source, so on an Ubuntu 26.04 builder its pty.node needs GLIBC_2.42 and scripts/linux-glibc.ts rightly refuses it (ceiling 2.39). Add a wrapper that keeps that gate and the build unchanged and compiles with Ubuntu noble's gcc-13 against a glibc 2.39 sysroot from pinned, SHA-256-verified snapshot packages. It needs no root, and --provide-build-tools adds noble binutils/make for the stock noble ARC runner image. It also pins the inputs the earlier server candidate got wrong: the four public cloud keys from .env.example (relay URL, Clerk publishable key, JWT template, CLI OAuth client) are passed, no update repository is set, the official v0.1.10 native helpers are reused only while native/ equals v0.1.10, and the version goes through --build-version instead of editing tracked files. Task: CLO-866 Model: claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 6ebd01cb49f1b4fa628620eace143132bb65af36) --- scripts/closura/build-linux-desktop-noble.sh | 160 +++++++++++++++++++ scripts/closura/noble-desktop-toolchain.lock | 62 +++++++ 2 files changed, 222 insertions(+) create mode 100755 scripts/closura/build-linux-desktop-noble.sh create mode 100644 scripts/closura/noble-desktop-toolchain.lock diff --git a/scripts/closura/build-linux-desktop-noble.sh b/scripts/closura/build-linux-desktop-noble.sh new file mode 100755 index 0000000000000..c9223eed78e45 --- /dev/null +++ b/scripts/closura/build-linux-desktop-noble.sh @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +# Linux x64 desktop build compiled with Ubuntu noble gcc-13 and a glibc 2.39 sysroot, so +# node-pty passes scripts/linux-glibc.ts on newer hosts and on the stock noble ARC runner +# (--provide-build-tools adds binutils/make there). Inputs are pinned; no update feed is set. +# Usage: --work SHORT_DIR --output-dir DIR --build-version X.Y.Z [--provide-build-tools] [--preflight-only] +set -euo pipefail + +SNAPSHOT="20261117T000000Z" +UPSTREAM_BASE="7d32075e3757ded707914e2450c3e392a9665765" # pingdotgg/t3code v0.1.10 +OFFICIAL_DEB_URL="https://github.com/pingdotgg/t3code/releases/download/v0.1.10/T3-Code-0.1.10-amd64.deb" +OFFICIAL_DEB_SHA256="c06f7eee35ad0d066ba023539c46901d2d6b9121842077f83d3b4fe7f877d360" +MAGICK_URL="https://github.com/ImageMagick/ImageMagick/releases/download/7.1.2-36/ImageMagick-7.1.2-36-portable-Q16-HDRI-linux-x64.tar.xz" +MAGICK_SHA256="72c8dd0268f824f621e1628737b79d8e80bc63a5d46a69950dabb13c5de80c91" +RUST_TARGET="x86_64-unknown-linux-gnu" + +work="" out="" version="" provide_tools=0 preflight_only=0 +while [ $# -gt 0 ]; do + case "$1" in + --work) work="$2"; shift 2 ;; + --output-dir) out="$2"; shift 2 ;; + --build-version) version="$2"; shift 2 ;; + --provide-build-tools) provide_tools=1; shift ;; + --preflight-only) preflight_only=1; shift ;; + *) echo "unknown argument: $1" >&2; exit 2 ;; + esac +done +[ -n "$work" ] && [ -n "$out" ] && [ -n "$version" ] || { + echo "usage: $0 --work DIR --output-dir DIR --build-version X.Y.Z [--provide-build-tools] [--preflight-only]" >&2 + exit 2 +} + +repo="$(cd "$(dirname "$0")/../.." && pwd)" +lock="$repo/scripts/closura/noble-desktop-toolchain.lock" +fail() { echo "build-linux-desktop-noble: $*" >&2; exit 1; } + +# ---- preflight ------------------------------------------------------------- +[ "$(uname -s)-$(uname -m)" = "Linux-x86_64" ] || fail "needs x86_64 Linux" +missing=() +for tool in curl sha256sum dpkg-deb tar xz python3 git node; do + command -v "$tool" >/dev/null || missing+=("$tool") +done +if [ "$provide_tools" -eq 0 ]; then + for tool in make as ld ar readelf; do command -v "$tool" >/dev/null || missing+=("$tool"); done +fi +[ ${#missing[@]} -eq 0 ] || fail "missing host tools: ${missing[*]}${provide_tools:+ (try --provide-build-tools for binutils/make)}" +want_node="$(python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["engines"]["node"])' "$repo/package.json")" +have_node="$(node --version | sed 's/^v//')" +[ "$have_node" = "$want_node" ] || fail "node $have_node on PATH; package.json engines require $want_node" +[ -d "$repo/node_modules" ] || fail "dependencies are not installed (run vp install)" +git -C "$repo" cat-file -e "$UPSTREAM_BASE^{commit}" 2>/dev/null \ + || fail "upstream v0.1.10 commit $UPSTREAM_BASE is not in this clone; fetch it to verify native/" +git -C "$repo" diff --quiet "$UPSTREAM_BASE" HEAD -- native \ + || fail "native/ differs from upstream v0.1.10; the official prebuilt helpers would not match this source" +for rel in native/resource-monitor/target native/hyprland-snap-shot/target native/kde-snap-shot/target; do + git -C "$repo" check-ignore -q "$rel/$RUST_TARGET/release/x" || fail "$rel is not gitignored" +done +[ -f "$lock" ] || fail "missing $lock" +echo "preflight ok: node $have_node, native/ == upstream v0.1.10, provide-build-tools=$provide_tools" +[ "$preflight_only" -eq 1 ] && exit 0 + +mkdir -p "$work" "$out" +work="$(cd "$work" && pwd)"; out="$(cd "$out" && pwd)" +debs="$work/debs"; sysroot="$work/sysroot"; crt="$work/compiler-runtime"; tools="$work/build-tools" +bin="$work/bin"; tmp="$work/tmp" +mkdir -p "$debs" "$sysroot" "$crt" "$tools" "$bin" "$tmp" + +fetch() { # url sha256 dest + if [ ! -f "$3" ] || ! printf '%s %s\n' "$2" "$3" | sha256sum -c --quiet - 2>/dev/null; then + curl -fsSL --retry 3 --connect-timeout 20 --max-time 900 -o "$3.part" "$1" + printf '%s %s\n' "$2" "$3.part" | sha256sum -c --quiet - || fail "SHA-256 mismatch for $1" + mv "$3.part" "$3" + fi +} + +# ---- noble packages (extracted, never installed) ----------------------------- +while read -r group sha path pkg; do + case "$group" in ''|'#'*) continue ;; esac + file="$debs/$(basename "$path")" + fetch "https://snapshot.ubuntu.com/ubuntu/$SNAPSHOT/$path" "$sha" "$file" + case "$group" in + sysroot) dpkg-deb -x "$file" "$sysroot" ;; + compiler-runtime) dpkg-deb -x "$file" "$crt" ;; + build-tools) dpkg-deb -x "$file" "$tools" ;; + *) fail "unknown lock group $group for $pkg" ;; + esac +done < "$lock" +ln -sfn usr/lib "$sysroot/lib" +ln -sfn usr/lib64 "$sysroot/lib64" + +# cc1/cc1plus use host libraries when present; otherwise noble's (no libc in that dir). +compiler_ld="" +if ldd "$sysroot/usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus" | grep -q 'not found'; then + compiler_ld="$crt/usr/lib/x86_64-linux-gnu" +fi +tools_ld="$tools/usr/lib/x86_64-linux-gnu" +write_wrapper() { # name command-prefix ld-path + { + echo '#!/bin/sh' + if [ -n "$3" ]; then echo "LD_LIBRARY_PATH=\"$3\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}\"; export LD_LIBRARY_PATH"; fi + echo "exec $2 \"\$@\"" + } > "$bin/$1" + chmod +x "$bin/$1" +} +cc_ld="$compiler_ld" +if [ "$provide_tools" -eq 1 ]; then cc_ld="${compiler_ld:+$compiler_ld:}$tools_ld"; fi +for name in cc gcc; do + write_wrapper "$name" "\"$sysroot/usr/bin/x86_64-linux-gnu-gcc-13\" --sysroot=\"$sysroot\"" "$cc_ld" +done +for name in c++ g++; do + write_wrapper "$name" "\"$sysroot/usr/bin/x86_64-linux-gnu-g++-13\" --sysroot=\"$sysroot\"" "$cc_ld" +done +{ + echo '#!/bin/sh' + echo "PKG_CONFIG_SYSROOT_DIR=\"$sysroot\" PKG_CONFIG_LIBDIR=\"$sysroot/usr/lib/x86_64-linux-gnu/pkgconfig:$sysroot/usr/share/pkgconfig\" LD_LIBRARY_PATH=\"$tools_ld\" exec \"$tools/usr/bin/pkgconf\" \"\$@\"" +} > "$bin/pkg-config" +chmod +x "$bin/pkg-config" +if [ "$provide_tools" -eq 1 ]; then + for t in as ld ld.bfd ar ranlib nm objcopy objdump readelf strip; do + write_wrapper "$t" "\"$tools/usr/bin/x86_64-linux-gnu-$t\"" "$tools_ld" + done + write_wrapper make "\"$tools/usr/bin/make\"" "" +fi + +# ---- ImageMagick (Linux icon resizing) --------------------------------------- +fetch "$MAGICK_URL" "$MAGICK_SHA256" "$work/imagemagick.tar.xz" +mkdir -p "$work/imagemagick" +tar -xJf "$work/imagemagick.tar.xz" -C "$work/imagemagick" +ln -sfn "$(ls -d "$work"/imagemagick/ImageMagick-*/bin/magick)" "$bin/magick" + +# ---- official v0.1.10 native helpers (native/ verified unchanged above) ------- +fetch "$OFFICIAL_DEB_URL" "$OFFICIAL_DEB_SHA256" "$work/official.deb" +rm -rf "$work/official" +dpkg-deb -x "$work/official.deb" "$work/official" +res="$(ls -d "$work"/official/opt/*/resources)" +install -D -m 755 "$res/resource-monitor/t3-resource-monitor" \ + "$repo/native/resource-monitor/target/$RUST_TARGET/release/t3-resource-monitor" +install -D -m 755 "$res/hyprland-capture/t3-hyprland-snap-shot" \ + "$repo/native/hyprland-snap-shot/target/$RUST_TARGET/release/t3-hyprland-snap-shot" +install -D -m 755 "$res/kde-capture/t3-kde-snap-shot" \ + "$repo/native/kde-snap-shot/target/$RUST_TARGET/release/t3-kde-snap-shot" + +# ---- build ---------------------------------------------------------------------- +public_config=() +while IFS= read -r line; do public_config+=("$line"); done < <( + grep -E '^T3CODE_(CLERK_PUBLISHABLE_KEY|CLERK_JWT_TEMPLATE|CLERK_CLI_OAUTH_CLIENT_ID|RELAY_URL)=' "$repo/.env.example" +) +[ ${#public_config[@]} -eq 4 ] || fail ".env.example does not define the four public cloud keys" + +cd "$repo" +env -u T3CODE_DESKTOP_UPDATE_REPOSITORY -u GITHUB_REPOSITORY \ + "${public_config[@]}" \ + PATH="$bin:$PATH" TMPDIR="$tmp" CC="$bin/cc" CXX="$bin/c++" \ + T3CODE_TELEMETRY_CHANNEL=dev \ + T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR=true \ + T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS=true \ + node scripts/build-desktop-artifact.ts --platform linux --target AppImage --arch x64 \ + --build-version "$version" --output-dir "$out" + +echo "artifacts:" +(cd "$out" && sha256sum -- *.AppImage *.deb) diff --git a/scripts/closura/noble-desktop-toolchain.lock b/scripts/closura/noble-desktop-toolchain.lock new file mode 100644 index 0000000000000..e5da9f26ed3a1 --- /dev/null +++ b/scripts/closura/noble-desktop-toolchain.lock @@ -0,0 +1,62 @@ +# Ubuntu 24.04 (noble) packages for a glibc-2.39 Linux desktop build. Generated 2026-11-17 from +# InRelease-signature-verified noble, noble-updates and noble-security amd64 indexes. +# Format: = +# sysroot: compiler + --sysroot (glibc 2.39, libstdc++, libsecret/glib headers). +# compiler-runtime: cc1/cc1plus shared libraries, used only if the host lacks them. +# build-tools: binutils, make, pkgconf for hosts without them (the stock ARC runner image). +sysroot c7535331fbb183c802c3bf4b6b210872dcc12d0421b3212b3c4b940f2c59ed3a pool/main/g/gcc-13/cpp-13_13.3.0-6ubuntu2~24.04.1_amd64.deb cpp-13=13.3.0-6ubuntu2~24.04.1 +sysroot 2ca48bf0c2d6465bc39322899715a85d934b4d7442dd5586a7bebbe3ce0f806b pool/main/g/gcc-13/cpp-13-x86-64-linux-gnu_13.3.0-6ubuntu2~24.04.1_amd64.deb cpp-13-x86-64-linux-gnu=13.3.0-6ubuntu2~24.04.1 +sysroot 0f3ef964b8a91a9cd7bebfd126839a21941c55547cadcf4aa00204bc8cc43985 pool/main/g/gcc-13/g++-13_13.3.0-6ubuntu2~24.04.1_amd64.deb g++-13=13.3.0-6ubuntu2~24.04.1 +sysroot 0bd6af6164252d4ea9170d201ee4c10a3120fe0fc04985a00be3bc9076353844 pool/main/g/gcc-13/g++-13-x86-64-linux-gnu_13.3.0-6ubuntu2~24.04.1_amd64.deb g++-13-x86-64-linux-gnu=13.3.0-6ubuntu2~24.04.1 +sysroot 7438ff160b020a74970672189ecae25d0ca650de6d7f543f12a3134192cffbd9 pool/main/g/gcc-13/gcc-13_13.3.0-6ubuntu2~24.04.1_amd64.deb gcc-13=13.3.0-6ubuntu2~24.04.1 +sysroot e859aca26585bb91113a451f1e66bc0e5283cb08797d679aacc1d936ae6dff8e pool/main/g/gcc-13/gcc-13-base_13.3.0-6ubuntu2~24.04.1_amd64.deb gcc-13-base=13.3.0-6ubuntu2~24.04.1 +sysroot a134b0319a82d14581b3a14820d2832af4ec9778ed8b9b4ddaeecfb0555ec325 pool/main/g/gcc-13/gcc-13-x86-64-linux-gnu_13.3.0-6ubuntu2~24.04.1_amd64.deb gcc-13-x86-64-linux-gnu=13.3.0-6ubuntu2~24.04.1 +sysroot 49ef9eb8716c4d7ec8921b87328052e75efecf89ab5975b5e43360e8cb7aa27c pool/main/u/util-linux/libblkid-dev_2.39.3-9ubuntu6.6_amd64.deb libblkid-dev=2.39.3-9ubuntu6.6 +sysroot 3bcf169cd65e2539059b2287924090fc629f9bf90f595fc25465a7efe950ee82 pool/main/u/util-linux/libblkid1_2.39.3-9ubuntu6.6_amd64.deb libblkid1=2.39.3-9ubuntu6.6 +sysroot d821b41fc59cb4978ecd53bc83e5c964ac15d305c8d2ac4c8a35aebe55010fb9 pool/main/g/glibc/libc6_2.39-0ubuntu8.12_amd64.deb libc6=2.39-0ubuntu8.12 +sysroot d81dd6dc9d515762cc93f338efa6219252acf3e2e87b5b89dd7dc517741e6eed pool/main/g/glibc/libc6-dev_2.39-0ubuntu8.12_amd64.deb libc6-dev=2.39-0ubuntu8.12 +sysroot 454456436ca767817a860557263d7cc2489f0a410f03efff4c0bb236d579ec09 pool/main/g/gcc-14/libcc1-0_14.2.0-4ubuntu2~24.04.1_amd64.deb libcc1-0=14.2.0-4ubuntu2~24.04.1 +sysroot 2edff420ef80b4a3f3751e65c33423ef30e563122a58b759e4854ea8d84ba1b1 pool/main/libx/libxcrypt/libcrypt-dev_4.4.36-4build1_amd64.deb libcrypt-dev=1:4.4.36-4build1 +sysroot 9474785cd6f398512bf8c305c3901dbb111569dccb6f5832002373c0a8ac5832 pool/main/libx/libxcrypt/libcrypt1_4.4.36-4build1_amd64.deb libcrypt1=1:4.4.36-4build1 +sysroot 7009959b8a3b77206325026917fb45150ac81bf6139468abc0841d5a29c8619d pool/main/libf/libffi/libffi-dev_3.4.6-1build1_amd64.deb libffi-dev=3.4.6-1build1 +sysroot 637e6a7744de08cd331a41f4efd0d24e6ea9064843dea9d1c6ca87bdb5f038a2 pool/main/libf/libffi/libffi8_3.4.6-1build1_amd64.deb libffi8=3.4.6-1build1 +sysroot cd689db2691edaa10f37329307292796bb599e722e0505c79e14caaa1fe9a93a pool/main/g/gcc-13/libgcc-13-dev_13.3.0-6ubuntu2~24.04.1_amd64.deb libgcc-13-dev=13.3.0-6ubuntu2~24.04.1 +sysroot aa7fadbe33b78bcf99885318040601c550c208929565b179891d9a3cc2aa68cd pool/main/g/gcc-14/libgcc-s1_14.2.0-4ubuntu2~24.04.1_amd64.deb libgcc-s1=14.2.0-4ubuntu2~24.04.1 +sysroot 957b9eeaa83cf6f2d5d5d76dbb8aa31d3297e6781d8a02fa08dcc897ae650a0b pool/main/libg/libgcrypt20/libgcrypt20_1.10.3-2ubuntu0.2_amd64.deb libgcrypt20=1.10.3-2ubuntu0.2 +sysroot 06cecc29957bdf1a2731dc74e12c64af7d8ef67798c9225aeb211f3d5b9f7f7c pool/main/libg/libgcrypt20/libgcrypt20-dev_1.10.3-2ubuntu0.2_amd64.deb libgcrypt20-dev=1.10.3-2ubuntu0.2 +sysroot ff1b650f655b36dfe202fdbae6bb02b363c7257b6dd23e4f95ab61f716190df3 pool/main/g/glib2.0/libglib2.0-0t64_2.80.0-6ubuntu3.10_amd64.deb libglib2.0-0t64=2.80.0-6ubuntu3.10 +sysroot 6d1d88d68192256603c0de05d084b8ef06ed9b16753215ec2c1ef9ef5fa15014 pool/main/g/glib2.0/libglib2.0-dev_2.80.0-6ubuntu3.10_amd64.deb libglib2.0-dev=2.80.0-6ubuntu3.10 +sysroot 54e6a40671bd698e260be85765429fe42111b2aac3357c89ee3e1d78a5379b7b pool/main/libg/libgpg-error/libgpg-error-dev_1.47-3build2.1_amd64.deb libgpg-error-dev=1.47-3build2.1 +sysroot 93654ee8180a73a0363f25c51dc673d67cbabcbecd164187b8a2deb54d007aef pool/main/libg/libgpg-error/libgpg-error0_1.47-3build2.1_amd64.deb libgpg-error0=1.47-3build2.1 +sysroot 87b7ed1fedfa79aedfb3772c539db2047857c4b0a3cf663161a657a752a3ca2e pool/main/u/util-linux/libmount-dev_2.39.3-9ubuntu6.6_amd64.deb libmount-dev=2.39.3-9ubuntu6.6 +sysroot 8f2c25589f187dacfdc5bb6be2af0aee6c2ba7b4d2edd1ca4b26753469f07aae pool/main/u/util-linux/libmount1_2.39.3-9ubuntu6.6_amd64.deb libmount1=2.39.3-9ubuntu6.6 +sysroot f41da7cb7e979d6b037ea92650c72ec8ec532ec3c93aa8d5b997207de56695ea pool/main/p/pcre2/libpcre2-8-0_10.42-4ubuntu2.2_amd64.deb libpcre2-8-0=10.42-4ubuntu2.2 +sysroot 572714fe3fbe1b49ffb4c5a483223c663a51948e0d8590add1620917326f3d21 pool/main/p/pcre2/libpcre2-dev_10.42-4ubuntu2.2_amd64.deb libpcre2-dev=10.42-4ubuntu2.2 +sysroot 7d7263ffc92c33042328f99c93433a846e8d9e549876dab18ba18606e6541ecd pool/main/libs/libsecret/libsecret-1-0_0.21.4-1build3_amd64.deb libsecret-1-0=0.21.4-1build3 +sysroot 54d8d5bca0a94450723e4ca529e0fdfa98dacb5c5808336adcc724e07148e358 pool/universe/libs/libsecret/libsecret-1-dev_0.21.4-1build3_amd64.deb libsecret-1-dev=0.21.4-1build3 +sysroot 6abaa6c26f46ef17764c4a753e0e84de1cdadde5634fd2987621fdc617988d19 pool/main/libs/libselinux/libselinux1_3.5-2ubuntu2.1_amd64.deb libselinux1=3.5-2ubuntu2.1 +sysroot 2cc37cb9251f49a11f9c34bc8605c2aace8ded76f50b951ad28ded42d6ab3f68 pool/main/libs/libselinux/libselinux1-dev_3.5-2ubuntu2.1_amd64.deb libselinux1-dev=3.5-2ubuntu2.1 +sysroot 85e47c1d7bcccbc059ea99d4c379659236f63b1716af8d796072875d418402bf pool/main/libs/libsepol/libsepol-dev_3.5-2build1_amd64.deb libsepol-dev=3.5-2build1 +sysroot ee5633e863e19c3381ed97842ce35ed32ede96a3d1ae4e94c051d3036fe21347 pool/main/g/gcc-13/libstdc++-13-dev_13.3.0-6ubuntu2~24.04.1_amd64.deb libstdc++-13-dev=13.3.0-6ubuntu2~24.04.1 +sysroot a51f8de7829211db961a31f02158058ad1a95f92ac6d0a5dff6350e2821c54c0 pool/main/g/gcc-14/libstdc++6_14.2.0-4ubuntu2~24.04.1_amd64.deb libstdc++6=14.2.0-4ubuntu2~24.04.1 +sysroot 62b040ead6d4522339b4e3d6534e678d5b82b827ffa4364e7dd7892d8d33fb9d pool/universe/s/sysprof/libsysprof-capture-4-dev_46.0-1build1_amd64.deb libsysprof-capture-4-dev=46.0-1build1 +sysroot e4b7b9c5023ba727908868661e1113d28ed9b68e47aed00e314723dad4b2b31d pool/main/l/linux/linux-libc-dev_6.8.0-149.149_amd64.deb linux-libc-dev=6.8.0-149.149 +sysroot 376249c8de139568221dbb242318cc8cb8f02299e3a62b7432948e1754fbddf9 pool/main/z/zlib/zlib1g_1.3.dfsg-3.1ubuntu2.3_amd64.deb zlib1g=1:1.3.dfsg-3.1ubuntu2.3 +sysroot 419902a649e1078f24596cdf31ced9c839519828790f59888056fcdcd58e8a28 pool/main/z/zlib/zlib1g-dev_1.3.dfsg-3.1ubuntu2.3_amd64.deb zlib1g-dev=1:1.3.dfsg-3.1ubuntu2.3 +compiler-runtime 285f8a505dfa8e1b33f357a9d8d3477ad35bf18c0b34771a6df4c25923f3ae0d pool/main/g/gmp/libgmp10_6.3.0+dfsg-2ubuntu6.1_amd64.deb libgmp10=2:6.3.0+dfsg-2ubuntu6.1 +compiler-runtime 4e040926e50fb961fae9bf95660189d468336a4a17bc321872c434fc8f777e7f pool/main/i/isl/libisl23_0.26-3build1.1_amd64.deb libisl23=0.26-3build1.1 +compiler-runtime cebe6098bb3d66fdacac9dc6fe406a651216d9c00f27c3f9c159d15d96cdf864 pool/main/m/mpclib3/libmpc3_1.3.1-1build1.1_amd64.deb libmpc3=1.3.1-1build1.1 +compiler-runtime aebc1c8b69a1f98bb43dfc268daecd181116dbf40b13ee4e822eb4bdd52b493a pool/main/m/mpfr4/libmpfr6_4.2.1-1build1.1_amd64.deb libmpfr6=4.2.1-1build1.1 +compiler-runtime dfcf25061e07aad7efd3f4f880ba5ad4d4d09ebe7fc8cc77ab6b8a161d6d4727 pool/main/libz/libzstd/libzstd1_1.5.5+dfsg2-2build1.1_amd64.deb libzstd1=1.5.5+dfsg2-2build1.1 +build-tools b3b5a84181a38fd191820b2cdcc1a3eeb1cd6333ad472f2092f96e81047e9c74 pool/main/b/binutils/binutils_2.42-4ubuntu2.10_amd64.deb binutils=2.42-4ubuntu2.10 +build-tools d136073f5e2153f3df11c1d08d66727b9466b28ff483f50085f14bbe3464b5ee pool/main/b/binutils/binutils-common_2.42-4ubuntu2.10_amd64.deb binutils-common=2.42-4ubuntu2.10 +build-tools 1e510a15f30208d39edcd840e48f26a77bbca7c417805eeccb1e3f7de198ef29 pool/main/b/binutils/binutils-x86-64-linux-gnu_2.42-4ubuntu2.10_amd64.deb binutils-x86-64-linux-gnu=2.42-4ubuntu2.10 +build-tools 064dce00ce94e1fc2d33779cb0071088f4c8aac79e85345f2e78a020f7d14699 pool/main/b/binutils/libbinutils_2.42-4ubuntu2.10_amd64.deb libbinutils=2.42-4ubuntu2.10 +build-tools da352eb7fa6c4369d2a6c1e5e680f574eda2e38576563326b18d9e47e61c4078 pool/main/b/binutils/libctf-nobfd0_2.42-4ubuntu2.10_amd64.deb libctf-nobfd0=2.42-4ubuntu2.10 +build-tools 7ec86d697c3668503c85f308a6832f092075b5880ad002f22185264da0bd4645 pool/main/b/binutils/libctf0_2.42-4ubuntu2.10_amd64.deb libctf0=2.42-4ubuntu2.10 +build-tools 1b7e3c2fc162e8358ca6e5a3fffdb4d0d632f790630323215841bb36a63c0ab8 pool/main/b/binutils/libgprofng0_2.42-4ubuntu2.10_amd64.deb libgprofng0=2.42-4ubuntu2.10 +build-tools 0cf79113f5d193ce9af2be2ff4b2c3b30dd4e55a0b6c47f7d28f6c849ff3aa60 pool/main/j/jansson/libjansson4_2.14-2build2_amd64.deb libjansson4=2.14-2build2 +build-tools fc3a57e8f931ec06cb7c51acc56878f1fec247ff02a7adcab26905c2faeb2792 pool/main/p/pkgconf/libpkgconf3_1.8.1-2build1_amd64.deb libpkgconf3=1.8.1-2build1 +build-tools 72093fb456864db55f1352bfa5e952a94f7abaff64e71dff1fbf001db1984564 pool/main/b/binutils/libsframe1_2.42-4ubuntu2.10_amd64.deb libsframe1=2.42-4ubuntu2.10 +build-tools 1fe6a815b56c7b6e9ce4086a363f09444bbd0a0d30e230c453d0b78e44b57a99 pool/main/m/make-dfsg/make_4.3-4.1build2_amd64.deb make=4.3-4.1build2 +build-tools 7a812f05ee1610154b433e2ad54f6e4163fcbb306b9fb31afe959afb2e5e1545 pool/main/p/pkgconf/pkgconf-bin_1.8.1-2build1_amd64.deb pkgconf-bin=1.8.1-2build1