diff --git a/apps/server/scripts/acp-replay-agent.ts b/apps/server/scripts/acp-replay-agent.ts index c68366828e91..7ebb1467b411 100644 --- a/apps/server/scripts/acp-replay-agent.ts +++ b/apps/server/scripts/acp-replay-agent.ts @@ -146,7 +146,11 @@ function matchesExpected(expected: unknown, actual: unknown): boolean { return Object.is(expected, actual); } -function stopWithFailure(detail: string, actual?: unknown): void { +function stopWithFailure( + detail: string, + actual?: unknown, + failedRequestId?: JsonRpcMessage["id"], +): void { if (stopped) return; stopped = true; const entry = transcript.entries[cursor]; @@ -158,6 +162,16 @@ function stopWithFailure(detail: string, actual?: unknown): void { }; writeStatus(failure); process.stderr.write(`ACP replay mismatch: ${JSON.stringify(failure)}\n`); + // Reject what the client still awaits, so a test fails with the mismatch instead of hanging. + const message = `ACP replay mismatch at ${entry?.label ?? "end of transcript"}: ${detail}${ + actual === undefined ? "" : ` ${JSON.stringify(actual)}` + }`; + const ids = [...pendingClientRequestIds.values()]; + if (failedRequestId !== undefined && failedRequestId !== null) ids.push(failedRequestId); + for (const id of ids) { + send({ jsonrpc: "2.0", id, error: { code: -32603, message } }); + } + pendingClientRequestIds.clear(); process.exitCode = 1; process.stdin.pause(); } @@ -284,14 +298,11 @@ function handleMessage(message: JsonRpcMessage): void { } const entry = transcript.entries[cursor]; if (entry?.type !== "expect_outbound" || !matchesExpected(entry.frame, actual)) { - stopWithFailure("Unexpected outbound ACP frame", actual); - if (actual.kind === "request" && message.id !== undefined && message.id !== null) { - send({ - jsonrpc: "2.0", - id: message.id, - error: { code: -32603, message: "ACP replay frame mismatch" }, - }); - } + stopWithFailure( + "Unexpected outbound ACP frame", + actual, + actual.kind === "request" ? message.id : undefined, + ); return; } if (actual.kind === "request" && message.id !== undefined && message.id !== null) { diff --git a/apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts index 30304449c0f0..ee3548d7f535 100644 --- a/apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/KiroAdapterV2.test.ts @@ -2,6 +2,7 @@ import * as NodeCrypto from "@effect/platform-node/NodeCrypto"; import * as NodeServices from "@effect/platform-node/NodeServices"; import { assert, describe, it } from "@effect/vitest"; import { + CheckpointId, MessageId, type ModelSelection, NodeId, @@ -293,13 +294,54 @@ const openSessionFrames = (input: { }), ]; +/** Kiro keys an MCP server's OAuth tokens by a hash of the server; the value is a JSON string. */ +const MCP_TOKENS_KEY = "kiro.mcp.4f1c2a9e.tokens"; +const MCP_TOKENS = JSON.stringify({ access_token: "stored-token", token_type: "Bearer" }); + +const kiroSecretRequest = (method: string, params: unknown): Frame => ({ + type: "emit_inbound", + label: method, + frame: { kind: "request", method, params }, +}); +const kiroSecretResponse = (method: string, result: unknown): Frame => ({ + type: "expect_outbound", + label: `${method}.result`, + frame: { kind: "response", method, result }, +}); + +const kiroSecretRejection = (method: string): Frame => ({ + type: "expect_outbound", + label: `${method}.error`, + frame: { kind: "response", method, error: "" }, +}); + +/** + * A temp KIRO_HOME whose `secrets.json` holds `secrets`, the flat map kiro-cli + * keeps there. HOME points elsewhere so only KIRO_HOME can find the file. + */ +const makeKiroHome = Effect.fn("makeKiroHome")(function* (secrets: Record) { + const fileSystem = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const root = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-kiro-home-" }); + const kiroHome = path.join(root, "kiro-home"); + const home = path.join(root, "home"); + yield* fileSystem.makeDirectory(kiroHome); + yield* fileSystem.makeDirectory(home); + const secretsPath = path.join(kiroHome, "secrets.json"); + yield* fileSystem.writeFileString(secretsPath, JSON.stringify(secrets, null, 2)); + return { secretsPath, environment: { HOME: home, KIRO_HOME: kiroHome } }; +}); + const runKiroScript = Effect.fn("runKiroScript")(function* (input: { readonly scenario: string; readonly frames: ReadonlyArray; + /** Frames for the runtime a rollback starts, replayed by a second agent process. */ + readonly replacementFrames?: ReadonlyArray; readonly model?: string; /** Option selections (e.g. reasoningEffort) for the session and `startTurn`. */ readonly options?: ModelSelection["options"]; readonly runtimeMode?: RuntimeMode; + readonly environment?: NodeJS.ProcessEnv; /** Holds the script's inbound frames at labels the test releases. */ readonly replayGate?: ProviderReplayGate; readonly testHooks?: Parameters[0]["testHooks"]; @@ -323,6 +365,7 @@ const runKiroScript = Effect.fn("runKiroScript")(function* (input: { requestId: RuntimeRequestId, decision: ProviderApprovalDecision, ) => Effect.Effect; + readonly rollbackToStart: Effect.Effect; }) => Effect.Effect; }) { const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner; @@ -331,17 +374,26 @@ const runKiroScript = Effect.fn("runKiroScript")(function* (input: { const replayDir = yield* fileSystem.makeTempDirectoryScoped({ prefix: `t3-kiro-${input.scenario}-`, }); - const statusPath = path.join(replayDir, "status.json"); - const transcript = yield* decodeAcpReplayTranscript( - { - provider: KIRO_PROVIDER, - protocol: "acp.ndjson-jsonrpc", - version: "1", - scenario: input.scenario, - entries: input.frames as never, - }, - KIRO_PROVIDER, + const scripts = yield* Effect.forEach( + [input.frames, ...(input.replacementFrames === undefined ? [] : [input.replacementFrames])], + (frames, index) => + decodeAcpReplayTranscript( + { + provider: KIRO_PROVIDER, + protocol: "acp.ndjson-jsonrpc", + version: "1", + scenario: input.scenario, + entries: frames as never, + }, + KIRO_PROVIDER, + ).pipe( + Effect.map((transcript) => ({ + transcript, + statusPath: path.join(replayDir, `status-${index}.json`), + })), + ), ); + let runtimesMade = 0; const instanceId = ProviderInstanceId.make(`kiro-${input.scenario}`); const scriptPath = yield* path.fromFileUrl( new URL("../../../scripts/acp-replay-agent.ts", import.meta.url), @@ -349,12 +401,21 @@ const runKiroScript = Effect.fn("runKiroScript")(function* (input: { const adapter = yield* makeKiroAdapterV2({ instanceId, settings: ENABLED_KIRO_SETTINGS, - environment: {}, + environment: input.environment ?? {}, selfInvocation: yield* resolveSelfInvocation(), - makeRuntime: (runtimeInput) => - makeAcpReplayRuntime({ - transcript, - statusPath, + makeRuntime: (runtimeInput) => { + const script = scripts[runtimesMade++]; + if (script === undefined) { + // An unscripted runtime is a retry after the last one failed; report why it failed. + const last = scripts[scripts.length - 1]!; + return makeAcpReplayCompletenessAssertion( + fileSystem, + last.statusPath, + last.transcript, + ).pipe(Effect.andThen(Effect.die(`No replay script for Kiro runtime ${runtimesMade}`))); + } + return makeAcpReplayRuntime({ + ...script, scriptPath, childProcessSpawner, fileSystem, @@ -365,7 +426,8 @@ const runKiroScript = Effect.fn("runKiroScript")(function* (input: { ? runtime : { ...runtime, cancel: input.wrapCancel(runtime.cancel) }, ), - ), + ); + }, ...(input.testHooks === undefined ? {} : { testHooks: input.testHooks }), }); // Held frames must not outlive a failed drive and wedge teardown. @@ -441,10 +503,26 @@ const runKiroScript = Effect.fn("runKiroScript")(function* (input: { startTurnOn, interrupt: (providerTurnId) => session.interruptTurn({ providerThread, providerTurnId }), respond: (requestId, decision) => session.respondToRuntimeRequest({ requestId, decision }), + rollbackToStart: session + .rollbackThread({ + providerThread, + providerThreadTurns: [], + target: { + type: "thread_start", + checkpointId: CheckpointId.make(`checkpoint-kiro-${input.scenario}`), + appRunOrdinal: 0, + }, + }) + .pipe(Effect.asVoid), }); }).pipe(Effect.scoped); - // Closing the session stops the replay agent; every scripted frame must be used. - yield* makeAcpReplayCompletenessAssertion(fileSystem, statusPath, transcript); + // Closing the session stops the replay agents; every scripted frame must be used. + yield* Effect.forEach( + scripts, + ({ statusPath, transcript }) => + makeAcpReplayCompletenessAssertion(fileSystem, statusPath, transcript), + { discard: true }, + ); }); const collectTurn = (events: Stream.Stream) => @@ -780,6 +858,78 @@ describe("KiroAdapterV2", () => { }).pipe(Effect.provide(testLayer), Effect.scoped), ); + it.effect("advertises secret storage, reads Kiro's secrets file and never writes it", () => + Effect.gen(function* () { + const kiroHome = yield* makeKiroHome({ [MCP_TOKENS_KEY]: MCP_TOKENS }); + const refreshed = JSON.stringify({ access_token: "refreshed", token_type: "Bearer" }); + const otherKey = "kiro.mcp.other.tokens"; + yield* runKiroScript({ + scenario: "secret-storage", + environment: kiroHome.environment, + frames: [ + // Kiro reads stored MCP OAuth tokens from the client only when it opts in. + outbound("initialize", { + protocolVersion: "", + info: "", + capabilities: "", + clientCapabilities: { + fs: "", + terminal: "", + session: "", + elicitation: "", + _meta: { kiro: { hooks: { enabled: true, v2: true }, secretStorage: true } }, + }, + clientInfo: "", + }), + answer("initialize", KIRO_V3_INITIALIZE), + outbound("session/new", { cwd: "", mcpServers: "" }), + kiroSecretRequest("_kiro/secret/get", { key: MCP_TOKENS_KEY }), + kiroSecretResponse("_kiro/secret/get", { value: MCP_TOKENS }), + kiroSecretRequest("_kiro/secret/get", { key: "kiro.mcp.missing.tokens" }), + kiroSecretResponse("_kiro/secret/get", { value: null }), + // kiro-cli rewrites this file unlocked, so T3 never writes it. + kiroSecretRequest("_kiro/secret/store", { key: otherKey, value: refreshed }), + kiroSecretRejection("_kiro/secret/store"), + kiroSecretRequest("_kiro/secret/delete", { key: MCP_TOKENS_KEY }), + kiroSecretRejection("_kiro/secret/delete"), + answer("session/new", sessionSetup([modeOption])), + ...closeSession, + ], + drive: () => Effect.void, + }); + const fileSystem = yield* FileSystem.FileSystem; + assert.deepStrictEqual(JSON.parse(yield* fileSystem.readFileString(kiroHome.secretsPath)), { + [MCP_TOKENS_KEY]: MCP_TOKENS, + }); + }).pipe(Effect.provide(testLayer), Effect.scoped), + ); + + it.effect("answers Kiro's secret reads on the runtime a rollback starts", () => + Effect.gen(function* () { + const kiroHome = yield* makeKiroHome({ [MCP_TOKENS_KEY]: MCP_TOKENS }); + const openFrames = [ + outbound("initialize"), + answer("initialize", KIRO_V3_INITIALIZE), + outbound("session/new", { cwd: "", mcpServers: "" }), + ]; + yield* runKiroScript({ + scenario: "secret-get-after-rollback", + environment: kiroHome.environment, + // Rollback stops this runtime's process without `session/close`. + frames: [...openFrames, answer("session/new", sessionSetup([modeOption]))], + // The replacement `session/new` reconnects MCP servers, which reads their tokens. + replacementFrames: [ + ...openFrames, + kiroSecretRequest("_kiro/secret/get", { key: MCP_TOKENS_KEY }), + kiroSecretResponse("_kiro/secret/get", { value: MCP_TOKENS }), + answer("session/new", sessionSetup([modeOption])), + ...closeSession, + ], + drive: ({ rollbackToStart }) => rollbackToStart, + }); + }).pipe(Effect.provide(testLayer), Effect.scoped), + ); + it.effect("sends a model Kiro does not list, and fails with Kiro's own message", () => runKiroScript({ scenario: "unlisted-model", diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_cloud_config/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_cloud_config/kiro_transcript.ndjson index e4b6ab19b2f3..11826616da7c 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_cloud_config/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_cloud_config/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_cloud_config","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13,"editedFrames":"Copied from turn_interrupt/kiro_transcript.ndjson. Added by hand: the background `fetch_cloud_config` tool call and its completion, as @hstern recorded them from kiro-cli 2.31.0 with an Identity Center login, in an order that failed there: the call before `session/prompt`, its completion after the `user_message_id_assigned` echo. The tool call id is invented; the reported frames omitted it."}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_compaction/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_compaction/kiro_transcript.ndjson index 6dce2f2ccb9f..fc7e5e7858d3 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_compaction/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_compaction/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_compaction","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":15}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_effort/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_effort/kiro_transcript.ndjson index 2b613ee1100f..eab15f7ca82f 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_effort/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_effort/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_effort","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_fork_from_turn/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_fork_from_turn/kiro_transcript.ndjson index aac368e4d483..3793b3e65a3a 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_fork_from_turn/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_fork_from_turn/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_fork_from_turn","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":39}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} @@ -39,7 +39,7 @@ {"type":"emit_inbound","label":"response:session/prompt","frame":{"kind":"response","method":"session/prompt","result":{"stopReason":"end_turn"}}} {"type":"emit_inbound","label":"notification:session/update:session_info_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"session_info_update","_meta":{"kiro":{"contextUsage":{"usagePercentage":9.52649974822998},"breakdown":{"contextFiles":{"tokens":0,"percent":0,"items":[]},"tools":{"tokens":5481,"percent":0.5,"mcp":{"tokens":0,"percent":0},"builtin":{"tokens":5481,"percent":0.5}},"memory":{"tokens":0,"percent":0},"kiroResponses":{"tokens":10,"percent":0.1},"yourPrompts":{"tokens":778,"percent":8.9},"sessionFiles":{"tokens":0,"percent":0,"items":[]}},"kind":"context_usage","usagePercentage":9.52649974822998}}}}}} {"type":"runtime_exit","status":"success"} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000002","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_message_steering/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_message_steering/kiro_transcript.ndjson index 519feac99d2c..a30aa3d58e9e 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_message_steering/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_message_steering/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_message_steering","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_model_switch/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_model_switch/kiro_transcript.ndjson index b7a821f4ad9b..c1c708820de3 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_model_switch/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_model_switch/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_model_switch","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":15}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_full_access_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_full_access_transcript.ndjson index 05a5adb1f805..cf53fb42bce0 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_full_access_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_full_access_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_full_access_write","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_supervised_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_supervised_transcript.ndjson index fa569a6db304..6d5766f89aea 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_supervised_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_permission_modes/kiro_supervised_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_supervised_write","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_subagent_interrupt/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_subagent_interrupt/kiro_transcript.ndjson index 65151441473e..7e30b034d68f 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_subagent_interrupt/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_subagent_interrupt/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_subagent_interrupt","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_unknown_model/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_unknown_model/kiro_transcript.ndjson index bfa904c81556..07385dea396b 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/kiro_unknown_model/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/kiro_unknown_model/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_unknown_model","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.27.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":14}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/kiro_transcript.ndjson index 0ca4d283e87a..1d23e580375e 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/multi_turn/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"multi_turn","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":15}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/kiro_transcript.ndjson index 2f5d9833e73c..10a3f17df88e 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/provider_thread_resume/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"provider_thread_resume","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":26}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} @@ -27,7 +27,7 @@ {"type":"expect_outbound","label":"request:session/close","frame":{"kind":"request","method":"session/close","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001"}}} {"type":"emit_inbound","label":"response:session/close","frame":{"kind":"response","method":"session/close","result":{}}} {"type":"runtime_exit","status":"success"} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/load","frame":{"kind":"request","method":"session/load","params":{"mcpServers":"","cwd":"","sessionId":"sess_00000000-0000-4000-8000-000000000001"}}} {"type":"emit_inbound","label":"notification:session/update:user_message_chunk","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"user_message_chunk","content":{"type":"text","text":"\n## T3 Code interaction mode: Default\n\nPrefer making reasonable assumptions and carrying out the user's request. Ask a concise question only when a missing user decision would materially change the result. Treat this mode as active until T3 Code supplies a different interaction-mode instruction.\n\n\n\nRespond with exactly: provider thread resume fixture first turn complete\n\nIn case you're asked: you are running in T3 Code through the Kiro harness, as claude-haiku-4.5. No need to mention this otherwise. You can embed images and videos in your response using Markdown with absolute file paths.\n\n\nWhen the t3-code MCP server exposes link_pull_request, you must use it to register every pull request you create or work on for this thread. Call link_pull_request with the full PR URL immediately after creating a PR or starting work on an existing PR. For a stack, call it for every layer, not just the current branch or the top PR. This applies when creating or updating PRs through gh, gh stack, another CLI, or the host API: those operations do not register the PRs with this thread. Linking an already-linked PR is safe. Before finishing PR work, call list_thread_pull_requests and link any PR from your work that is missing. Do not link unrelated PRs mentioned only as background. If a linking call fails, report that failure instead of claiming the PR is linked. When asked to monitor, watch, or babysit a PR and watch_pull_request is available, call it and end your turn: T3 Code wakes you when checks finish, someone else comments, or the branch conflicts, so do not poll or run your own watcher. When you hand the work back to the user, call unwatch_pull_request first so the thread returns to their inbox.\n"},"_meta":{"kiro":{"userMessageTag":"prompt_00000000-0000-4000-9000-000000000005","messageId":"00000000-0000-4000-9000-000000000001","timestamp":"2026-10-19T20:48:11.510Z","replay":true}}}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/queued_turn/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/queued_turn/kiro_transcript.ndjson index 73a21b301051..ab733c7ae72a 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/queued_turn/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/queued_turn/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"queued_turn","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":15}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/simple/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/simple/kiro_transcript.ndjson index 1e9a0c041244..60a08c76243b 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/simple/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/simple/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"simple","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/subagent/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/subagent/kiro_transcript.ndjson index 5f26257d395f..16bd91306dc3 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/subagent/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/subagent/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"subagent","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/kiro_transcript.ndjson index cd6d095d1a91..e57d0b71f766 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/tool_call_read_only_on_request/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_tool_call_read_only_on_request","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/kiro_transcript.ndjson index 46a0f9ca5db4..bb12247b828e 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"turn_interrupt","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.32.0","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/kiro_transcript.ndjson b/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/kiro_transcript.ndjson index 14887375f172..e427d07a0ef5 100644 --- a/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/kiro_transcript.ndjson +++ b/apps/server/src/orchestration-v2/testkit/fixtures/turn_interrupt_mid_tool/kiro_transcript.ndjson @@ -1,5 +1,5 @@ {"type":"transcript_start","provider":"kiro","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"kiro_turn_interrupt_mid_tool","metadata":{"generatedBy":"live-kiro-recorder","kiroVersion":"2.33.1","normalization":"Session ids are fixed sess_ UUIDs and other UUIDs (message and request ids) are numbered in first-seen order, the workspace is , HOME is /home/kiro-replay and the recording user is kiro-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are . Kiro's log directory, user-scoped commands and agents, and the _kiro/* broadcasts T3 ignores (governance, steering documents, powers, tools, hooks, MCP status, session roster) are removed. Timestamps are kept as recorded.","droppedFrames":13}} -{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true}}}},"clientInfo":""}}} +{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"","capabilities":"","clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}},"_meta":{"kiro":{"hooks":{"enabled":true,"v2":true},"secretStorage":true}}},"clientInfo":""}}} {"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":2,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":true,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"close":{},"delete":{},"fork":{"_meta":{"kiro":{"messageId":true}}}},"_meta":{"kiro":{"checkpoints":true,"sessionList":true,"policyNotifications":true,"extensionMethods":["_kiro/knowledge","_kiro/memory/list","_kiro/memory/get","_kiro/memory/create","_kiro/memory/update","_kiro/memory/delete","_kiro/codeIntelligence","_kiro/session/context","_kiro/session/compact","_kiro/session/export","_kiro/session/history","_kiro/config/template","_kiro/workflow/new","_kiro/workflow/invoke","_kiro/workflow/load","_kiro/workflow/inspect","_kiro/workflow/list","_kiro/workflow/pause","_kiro/workflow/cancel","_kiro/workflow/delete","_kiro/workflow/listRecipes","_kiro/workflow/listWatchHandlers","_kiro/workflow/resumeAll","_kiro/workflow/retry","_kiro/workflow/update","_kiro/workflow/resume","_kiro/sourceProviders/list","_kiro/sourceProviders/listResources"],"sessionSources":["local","remote"],"sessionListScopes":["workspace","user"],"executionTargets":["local","cloud-sandbox"],"sourceProviders":true,"replayMarking":true}}},"authMethods":[{"id":"aws-builder-id","name":"AWS Builder ID"},{"id":"aws-iam-identity-center","name":"AWS IAM Identity Center"}]}}} {"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"","mcpServers":""}}} {"type":"emit_inbound","label":"notification:session/update:available_commands_update","frame":{"kind":"notification","method":"session/update","params":{"sessionId":"sess_00000000-0000-4000-8000-000000000001","update":{"sessionUpdate":"available_commands_update","availableCommands":[{"name":"architecture-selection","description":"Steering: architecture-selection","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:architecture-selection","commandId":"architecture-selection","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"architecture-selection"}}},{"name":"quick-spec","description":"Steering: quick-spec","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:quick-spec","commandId":"quick-spec","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"quick-spec"}}},{"name":"bug-fix","description":"Steering: bug-fix","input":{"hint":"optional context"},"_meta":{"kiro":{"type":"steering","contextQuery":"global:bug-fix","commandId":"bug-fix","resource":{"resourceType":"steering","source":{"origin":"bundled"}},"originalName":"bug-fix"}}},{"name":"general-task-execution","description":"General-purpose sub-agent with access to all tools for executing arbitrary tasks","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"general-task-execution","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"general-task-execution"}}},{"name":"context-gatherer","description":"Investigates the codebase to answer a specific question about it. Deeply analyzes existing code by tracing execution paths, mapping architecture and abstraction layers, understanding patterns, and documenting dependencies, returning a thorough, direct written analysis that explains how the relevant code works and points to the specific files and lines involved. Use it to understand code before you change it: before designing or implementing a change to code you don't already fully understand, start with context-gatherer so your edits are grounded in how the code actually works. When a task requires understanding code you don't already know, dispatch context-gatherer to do that exploration before running your own searches or reads. Rules: 1. Provide a clear, specific prompt that includes your intent: a detailed task description of the context you need and what you're trying to accomplish. 2. The subagent explores the codebase and returns an analysis of your query 3. Trust the returned results. You may still inspect additional code yourself when you need context beyond what was returned. 4. Reuse existing context-gatherer output for related follow-up questions; do not re-invoke on the same question with different phrasing. 5. For multiple distinct questions, dispatch several context-gatherers in parallel, each targeting a different aspect of the codebase.","input":{"hint":"task to delegate"},"_meta":{"kiro":{"type":"custom-agent","commandId":"context-gatherer","resource":{"resourceType":"agent","source":{"origin":"bundled"}},"originalName":"context-gatherer"}}}]}}}} diff --git a/docs/user/providers-kiro.md b/docs/user/providers-kiro.md index 6b94ca14f2e5..26a140a80375 100644 --- a/docs/user/providers-kiro.md +++ b/docs/user/providers-kiro.md @@ -38,6 +38,13 @@ not listed yet. Refresh the Kiro provider after adding or removing an agent. The thread's model still applies when an agent sets its own `model`. An agent that was removed leaves the thread on Kiro's current agent. +## MCP Servers + +Kiro threads load the MCP servers in your Kiro configuration. To use one that signs in with OAuth, +sign in to it once with `kiro-cli` on the machine running the T3 Code server (`/mcp`, then +re-authenticate). Kiro threads in T3 Code reuse that sign-in but never change it, so when it +expires, sign in again with `kiro-cli`. + ## Permission Modes Kiro asks before tool calls such as writes and commands, and T3 Code answers by the permission mode: diff --git a/packages/provider-kiro/src/server/adapter.ts b/packages/provider-kiro/src/server/adapter.ts index 6815b60e8f22..c2924e45ecf2 100644 --- a/packages/provider-kiro/src/server/adapter.ts +++ b/packages/provider-kiro/src/server/adapter.ts @@ -50,6 +50,7 @@ import { kiroPermissionDisposition, makeKiroAcpRuntime, } from "./acpSupport.ts"; +import { makeKiroSecretStorage } from "./secretStorage.ts"; export const KIRO_PROVIDER = ProviderDriverKind.make("kiro"); /** T3's slug for "Kiro default", and Kiro's documented default model id. */ @@ -523,8 +524,11 @@ function kiroPromptFailure(cause: unknown) { }); } -function makeKiroAcpAdapterFlavor(options: KiroAdapterV2Options): AcpAdapterV2Flavor { - const makeRuntime = +function makeKiroAcpAdapterFlavor( + options: KiroAdapterV2Options, + secretStorage: Effect.Success>, +): AcpAdapterV2Flavor { + const makeNativeRuntime = options.makeRuntime ?? ((input: AcpAdapterV2RuntimeInput) => { const { runtimePolicy: _runtimePolicy, processEnvironment, ...runtimeInput } = input; @@ -534,6 +538,9 @@ function makeKiroAcpAdapterFlavor(options: KiroAdapterV2Options): AcpAdapterV2Fl environment: { ...options.environment, ...processEnvironment }, }); }); + // Not `registerExtensions`: a replacement runtime (rollback, failed resume) wires that after `start()`. + const makeRuntime = (input: AcpAdapterV2RuntimeInput) => + makeNativeRuntime(input).pipe(Effect.tap(secretStorage.installHandlers)); const stripSteeringNote = makeKiroSteeringNoteFilter(); return { driver: KIRO_PROVIDER, @@ -541,8 +548,9 @@ function makeKiroAcpAdapterFlavor(options: KiroAdapterV2Options): AcpAdapterV2Fl capabilities: KiroProviderCapabilitiesV2, // Kiro V3 loads the user's hooks only when the client opts in. `v2` makes // Kiro run them itself; `enabled` alone hands them to the client as - // `_kiro/hooks/*` requests, which T3 does not answer. - clientCapabilitiesMeta: { kiro: { hooks: { enabled: true, v2: true } } }, + // `_kiro/hooks/*` requests, which T3 does not answer. Kiro keeps MCP OAuth + // credentials only through `secretStorage` (see makeKiroSecretStorage). + clientCapabilitiesMeta: { kiro: { hooks: { enabled: true, v2: true }, secretStorage: true } }, makeRuntime, promptFailure: kiroPromptFailure, ignoreSessionUpdate: makeKiroCloudConfigFilter(), @@ -579,9 +587,10 @@ function makeKiroAcpAdapterFlavor(options: KiroAdapterV2Options): AcpAdapterV2Fl export const makeKiroAdapterV2 = Effect.fn("makeKiroAdapterV2")(function* ( options: KiroAdapterV2Options, ) { + const secretStorage = yield* makeKiroSecretStorage(options.environment); return yield* makeAcpAdapterV2({ instanceId: options.instanceId, - flavor: makeKiroAcpAdapterFlavor(options), + flavor: makeKiroAcpAdapterFlavor(options, secretStorage), selfInvocation: options.selfInvocation, ...(options.nativeLogging === undefined ? {} : { nativeLogging: options.nativeLogging }), ...(options.testHooks === undefined ? {} : { testHooks: options.testHooks }), diff --git a/packages/provider-kiro/src/server/secretStorage.ts b/packages/provider-kiro/src/server/secretStorage.ts new file mode 100644 index 000000000000..8295487aae2e --- /dev/null +++ b/packages/provider-kiro/src/server/secretStorage.ts @@ -0,0 +1,53 @@ +import * as HostProcess from "@t3tools/shared/HostProcess"; +import * as Effect from "effect/Effect"; +import * as FileSystem from "effect/FileSystem"; +import * as Path from "effect/Path"; +import * as Schema from "effect/Schema"; + +import type * as AcpSessionRuntime from "@t3tools/provider-acp/server/AcpSessionRuntime"; + +const SecretKey = Schema.Struct({ key: Schema.String }); +const decodeSecrets = Schema.decodeUnknownEffect( + Schema.fromJsonString(Schema.Record(Schema.String, Schema.String)), +); + +/** kiro-cli's own secrets file, so sessions reuse the MCP sign-ins it stored. */ +const kiroSecretsPath = ( + path: Path.Path, + environment: NodeJS.ProcessEnv, + homeDirectory: string, +) => { + const kiroHome = environment.KIRO_HOME?.trim(); + return kiroHome && path.isAbsolute(kiroHome) + ? path.join(kiroHome, "secrets.json") + : path.join(environment.HOME?.trim() || homeDirectory, ".kiro", "secrets.json"); +}; + +/** + * Answers `_kiro/secret/get`, which Kiro sends once the client advertises `secretStorage`. + * Read-only: kiro-cli rewrites this file without a lock, so a T3 write could drop its sign-ins. + * `_kiro/secret/store` and `_kiro/secret/delete` stay unhandled (method not found). + */ +export const makeKiroSecretStorage = Effect.fn("makeKiroSecretStorage")(function* ( + environment: NodeJS.ProcessEnv, +) { + const fileSystem = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const secretsPath = kiroSecretsPath(path, environment, yield* HostProcess.HomeDirectory); + + const get = Effect.fn("KiroSecretStorage.get")( + function* (key: string) { + const secrets = yield* fileSystem + .readFileString(secretsPath) + .pipe(Effect.flatMap(decodeSecrets)); + return { value: Object.hasOwn(secrets, key) ? (secrets[key] ?? null) : null }; + }, + Effect.orElseSucceed(() => ({ value: null })), + ); + + // Installed before the runtime starts: Kiro reads secrets while `session/new` connects MCP servers. + const installHandlers = (runtime: AcpSessionRuntime.AcpSessionRuntime["Service"]) => + runtime.handleExtRequest("_kiro/secret/get", SecretKey, ({ key }) => get(key)); + + return { get, installHandlers }; +});