@gajae-code/coding-agent 0.11.11 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -3
- package/dist/types/cli/read-cli.d.ts +1 -0
- package/dist/types/commands/deep-interview.d.ts +9 -0
- package/dist/types/commands/harness.d.ts +22 -0
- package/dist/types/commands/read.d.ts +6 -0
- package/dist/types/config/model-registry.d.ts +4 -0
- package/dist/types/config/provider-auth-health.d.ts +14 -0
- package/dist/types/config/provider-ranking.d.ts +59 -0
- package/dist/types/config/settings-schema.d.ts +29 -1
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/extensibility/extensions/types.d.ts +22 -2
- package/dist/types/extensibility/shared-events.d.ts +6 -0
- package/dist/types/gjc-runtime/deep-interview-ambiguity.d.ts +5 -12
- package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +17 -32
- package/dist/types/gjc-runtime/deep-interview-stage.d.ts +37 -0
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +4 -135
- package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
- package/dist/types/gjc-runtime/memory-guard-owner-claims.d.ts +47 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +52 -1
- package/dist/types/gjc-runtime/state-writer.d.ts +5 -46
- package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
- package/dist/types/gjc-runtime/team-runtime.d.ts +2 -1
- package/dist/types/gjc-runtime/team-store.d.ts +12 -0
- package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +92 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +7 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +8 -0
- package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -5
- package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
- package/dist/types/main.d.ts +1 -1
- package/dist/types/memories/index.d.ts +2 -0
- package/dist/types/modes/acp/acp-agent.d.ts +8 -0
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
- package/dist/types/modes/components/read-tool-group.d.ts +4 -4
- package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/controllers/event-controller.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +5 -0
- package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
- package/dist/types/sdk/bus/index.d.ts +15 -1
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +2 -1
- package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/host.d.ts +2 -0
- package/dist/types/sdk/host/query/handlers.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +44 -10
- package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
- package/dist/types/session/session-manager.d.ts +25 -13
- package/dist/types/session/streaming-output.d.ts +60 -5
- package/dist/types/skill-state/active-state.d.ts +0 -4
- package/dist/types/skill-state/workflow-hud.d.ts +3 -0
- package/dist/types/tools/browser/launch.d.ts +7 -0
- package/dist/types/tools/fetch.d.ts +17 -1
- package/dist/types/tools/output-meta.d.ts +21 -1
- package/dist/types/tools/read-internals.d.ts +12 -0
- package/dist/types/tools/read.d.ts +45 -1
- package/dist/types/tools/resource-gc.d.ts +4 -0
- package/dist/types/tools/tool-result.d.ts +7 -1
- package/package.json +9 -13
- package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
- package/scripts/capture-sticky-viewport-showcase.ts +292 -0
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/scripts/verify-gjc-sdk-canonicalization.ts +122 -18
- package/scripts/verify-sticky-viewport-showcase.ts +611 -0
- package/src/capability/index.ts +8 -0
- package/src/cli/read-cli.ts +2 -1
- package/src/cli.ts +1 -0
- package/src/commands/deep-interview.ts +29 -9
- package/src/commands/harness.ts +35 -12
- package/src/commands/read.ts +11 -2
- package/src/commands/team.ts +1 -1
- package/src/config/model-registry.ts +21 -2
- package/src/config/provider-auth-health.ts +42 -0
- package/src/config/provider-ranking.ts +119 -0
- package/src/config/settings-schema.ts +23 -1
- package/src/config/settings.ts +246 -108
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +229 -82
- package/src/defaults/gjc/skills/ralplan/SKILL.md +58 -25
- package/src/defaults/gjc/skills/team/SKILL.md +1 -1
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +25 -15
- package/src/eval/py/executor.ts +7 -2
- package/src/extensibility/extensions/types.ts +28 -4
- package/src/extensibility/shared-events.ts +5 -0
- package/src/gjc-runtime/deep-interview-ambiguity.ts +47 -82
- package/src/gjc-runtime/deep-interview-recorder.ts +227 -310
- package/src/gjc-runtime/deep-interview-runtime.ts +109 -270
- package/src/gjc-runtime/deep-interview-stage.ts +1016 -0
- package/src/gjc-runtime/deep-interview-state.ts +12 -943
- package/src/gjc-runtime/gc-render.ts +1 -0
- package/src/gjc-runtime/gc-runtime.ts +11 -1
- package/src/gjc-runtime/memory-guard-owner-claims.ts +389 -0
- package/src/gjc-runtime/ralplan-runtime.ts +742 -85
- package/src/gjc-runtime/state-runtime.ts +2 -1
- package/src/gjc-runtime/state-writer.ts +70 -222
- package/src/gjc-runtime/team-launch.ts +34 -5
- package/src/gjc-runtime/team-runtime.ts +970 -33
- package/src/gjc-runtime/team-store.ts +32 -0
- package/src/gjc-runtime/team-worker-memory-guard.ts +363 -0
- package/src/gjc-runtime/team-workers.ts +1 -0
- package/src/gjc-runtime/tmux-owner-isolation.ts +18 -0
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +20 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +13 -7
- package/src/gjc-runtime/workflow-manifest.generated.json +97 -350
- package/src/gjc-runtime/workflow-manifest.ts +34 -179
- package/src/hooks/native-skill-hook.ts +17 -4
- package/src/hooks/skill-state.ts +1 -23
- package/src/internal-urls/docs-index.generated.ts +8 -9
- package/src/internal-urls/local-root-gc.ts +127 -0
- package/src/main.ts +9 -5
- package/src/memories/index.ts +10 -0
- package/src/modes/DESIGN.md +47 -0
- package/src/modes/acp/acp-agent.ts +43 -7
- package/src/modes/acp/acp-event-mapper.ts +14 -7
- package/src/modes/acp/acp-mode.ts +39 -3
- package/src/modes/components/assistant-message.ts +123 -22
- package/src/modes/components/irc-sidebar.ts +176 -62
- package/src/modes/components/model-selector.ts +61 -4
- package/src/modes/components/oauth-selector.ts +42 -12
- package/src/modes/components/read-tool-group.ts +82 -14
- package/src/modes/components/session-observer-overlay.ts +187 -32
- package/src/modes/components/settings-selector.ts +60 -18
- package/src/modes/components/tool-execution.ts +138 -27
- package/src/modes/controllers/event-controller.ts +109 -27
- package/src/modes/controllers/extension-ui-controller.ts +19 -2
- package/src/modes/controllers/input-controller.ts +18 -3
- package/src/modes/controllers/selector-controller.ts +83 -37
- package/src/modes/interactive-mode.ts +62 -3
- package/src/modes/irc-observation-ledger.ts +71 -15
- package/src/modes/runtime-init.ts +19 -2
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/ui-helpers.ts +94 -1
- package/src/prompts/agents/architect.md +9 -1
- package/src/prompts/agents/critic.md +9 -0
- package/src/prompts/system/system-prompt.md +0 -1
- package/src/prompts/tools/read.md +4 -2
- package/src/runtime-mcp/smithery-auth.ts +17 -2
- package/src/runtime-mcp/smithery-connect.ts +11 -1
- package/src/sdk/broker/lifecycle.ts +25 -6
- package/src/sdk/bus/control-drain-lease.ts +104 -0
- package/src/sdk/bus/index.ts +341 -38
- package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
- package/src/sdk/bus/prompt-reconciliation.ts +2 -1
- package/src/sdk/bus/reconciliation-store.ts +224 -0
- package/src/sdk/host/control/dispatch.ts +5 -1
- package/src/sdk/host/control/operations.ts +1 -1
- package/src/sdk/host/host.ts +23 -1
- package/src/sdk/host/query/handlers.ts +55 -0
- package/src/sdk/mcp/server.ts +46 -18
- package/src/sdk/protocol/operation-inventory.generated.json +29 -0
- package/src/sdk/protocol/operation-registry.ts +7 -2
- package/src/sdk/session.ts +13 -1
- package/src/session/agent-session.ts +466 -50
- package/src/session/memory-guard-checkpoint-participant.ts +131 -0
- package/src/session/session-manager.ts +764 -17
- package/src/session/streaming-output.ts +262 -43
- package/src/setup/provider-onboarding.ts +19 -4
- package/src/skill-state/active-state.ts +0 -10
- package/src/skill-state/workflow-hud.ts +25 -2
- package/src/skill-state/workflow-mutation-guard.ts +65 -7
- package/src/tools/ask.ts +89 -69
- package/src/tools/browser/launch.ts +41 -6
- package/src/tools/fetch.ts +114 -23
- package/src/tools/output-meta.ts +176 -9
- package/src/tools/path-utils.ts +5 -1
- package/src/tools/read-internals.ts +44 -0
- package/src/tools/read.ts +1542 -310
- package/src/tools/resource-gc.ts +182 -18
- package/src/tools/tool-result.ts +14 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/dist/types/gjc-runtime/deep-interview-draft.d.ts +0 -8
- package/dist/types/gjc-runtime/deep-interview-payload.d.ts +0 -41
- package/dist/types/gjc-runtime/deep-interview-repair.d.ts +0 -17
- package/src/gjc-runtime/deep-interview-draft.ts +0 -843
- package/src/gjc-runtime/deep-interview-payload.ts +0 -262
- package/src/gjc-runtime/deep-interview-repair.ts +0 -1674
package/src/sdk/mcp/server.ts
CHANGED
|
@@ -301,9 +301,16 @@ export function createSdkMcpServer(options: SdkMcpServerOptions = {}) {
|
|
|
301
301
|
export async function runSdkMcpStdio(options: SdkMcpServerOptions = {}): Promise<void> {
|
|
302
302
|
const server = createSdkMcpServer(options);
|
|
303
303
|
let buffer = "";
|
|
304
|
+
const inflight = new Set<Promise<void>>();
|
|
304
305
|
process.stdin.setEncoding("utf8");
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
|
|
307
|
+
const track = (work: Promise<void>): void => {
|
|
308
|
+
inflight.add(work);
|
|
309
|
+
void work.finally(() => inflight.delete(work));
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
await new Promise<void>((resolve, reject) => {
|
|
313
|
+
const onData = (chunk: string) => {
|
|
307
314
|
buffer += chunk;
|
|
308
315
|
let index = buffer.indexOf("\n");
|
|
309
316
|
while (index >= 0) {
|
|
@@ -311,22 +318,43 @@ export async function runSdkMcpStdio(options: SdkMcpServerOptions = {}): Promise
|
|
|
311
318
|
buffer = buffer.slice(index + 1);
|
|
312
319
|
index = buffer.indexOf("\n");
|
|
313
320
|
if (!line) continue;
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
321
|
+
track(
|
|
322
|
+
(async () => {
|
|
323
|
+
let request: JsonRpcRequest;
|
|
324
|
+
try {
|
|
325
|
+
request = JSON.parse(line) as JsonRpcRequest;
|
|
326
|
+
} catch {
|
|
327
|
+
process.stdout.write(
|
|
328
|
+
`${JSON.stringify({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "parse_error" } })}\n`,
|
|
329
|
+
);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const response = await server.handleJsonRpc(request);
|
|
333
|
+
// JSON-RPC notifications (no id) receive no response.
|
|
334
|
+
if (request.id !== undefined) process.stdout.write(`${JSON.stringify(response)}\n`);
|
|
335
|
+
})(),
|
|
336
|
+
);
|
|
328
337
|
}
|
|
329
|
-
}
|
|
330
|
-
|
|
338
|
+
};
|
|
339
|
+
const onEnd = () => {
|
|
340
|
+
process.stdin.off("data", onData);
|
|
341
|
+
process.stdin.off("end", onEnd);
|
|
342
|
+
process.stdin.off("error", onError);
|
|
343
|
+
resolve();
|
|
344
|
+
};
|
|
345
|
+
const onError = (error: Error) => {
|
|
346
|
+
process.stdin.off("data", onData);
|
|
347
|
+
process.stdin.off("end", onEnd);
|
|
348
|
+
process.stdin.off("error", onError);
|
|
349
|
+
reject(error);
|
|
350
|
+
};
|
|
351
|
+
process.stdin.on("data", onData);
|
|
352
|
+
process.stdin.on("end", onEnd);
|
|
353
|
+
process.stdin.on("error", onError);
|
|
331
354
|
});
|
|
355
|
+
|
|
356
|
+
// Stdin EOF must not drop in-flight tools/call handlers (WS connect/query).
|
|
357
|
+
// Awaiting them also prevents the process from exiting before responses flush,
|
|
358
|
+
// and lets clients close so the event loop can drain deterministically.
|
|
359
|
+
await Promise.allSettled([...inflight]);
|
|
332
360
|
}
|
|
@@ -1565,6 +1565,24 @@
|
|
|
1565
1565
|
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
1566
1566
|
]
|
|
1567
1567
|
},
|
|
1568
|
+
{
|
|
1569
|
+
"sourceId": "registry:Q28",
|
|
1570
|
+
"sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
|
|
1571
|
+
"sourceKind": "registry",
|
|
1572
|
+
"decision": "include",
|
|
1573
|
+
"sdkId": "skill.invoke_status",
|
|
1574
|
+
"adapterMappings": {
|
|
1575
|
+
"telegram": "prohibited",
|
|
1576
|
+
"discord": "prohibited",
|
|
1577
|
+
"slack": "prohibited",
|
|
1578
|
+
"mcp": "generic_safe",
|
|
1579
|
+
"acp": "generic_safe",
|
|
1580
|
+
"daemonCli": "generic_safe"
|
|
1581
|
+
},
|
|
1582
|
+
"testIds": [
|
|
1583
|
+
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
1584
|
+
]
|
|
1585
|
+
},
|
|
1568
1586
|
{
|
|
1569
1587
|
"sourceId": "registry:R01",
|
|
1570
1588
|
"sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
|
|
@@ -2903,6 +2921,17 @@
|
|
|
2903
2921
|
"testIds": "not_applicable"
|
|
2904
2922
|
}
|
|
2905
2923
|
},
|
|
2924
|
+
{
|
|
2925
|
+
"sourceId": "agent_session:restoreFromMemoryGuardCheckpoint",
|
|
2926
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
2927
|
+
"sourceKind": "agent_session",
|
|
2928
|
+
"decision": "exclude",
|
|
2929
|
+
"rationale": "internal owner-recovery staged restore builder after durable claims/fencing, never a user-facing SDK operation",
|
|
2930
|
+
"exclusionMetadata": {
|
|
2931
|
+
"adapterMappings": "not_applicable",
|
|
2932
|
+
"testIds": "not_applicable"
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2906
2935
|
{
|
|
2907
2936
|
"sourceId": "agent_session:promoteRecoveryHydrationAfterOwnershipReadyFence",
|
|
2908
2937
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -160,6 +160,10 @@ const queries = [
|
|
|
160
160
|
"Read the authoritative reconciliation status of a submitted prompt by command/turn IDs or clientRef.",
|
|
161
161
|
],
|
|
162
162
|
["models.profiles.list", "List the effective built-in and configured model profiles for this session."],
|
|
163
|
+
[
|
|
164
|
+
"skill.invoke_status",
|
|
165
|
+
"Read the authoritative reconciliation status of a skill.invoke by command/turn IDs or clientRef.",
|
|
166
|
+
],
|
|
163
167
|
] as const;
|
|
164
168
|
|
|
165
169
|
const reverse = [
|
|
@@ -197,7 +201,8 @@ function controlDisposition(id: string): Record<Adapter, AdapterDisposition> {
|
|
|
197
201
|
|
|
198
202
|
function controlErrors(id: string): string[] {
|
|
199
203
|
const errors: Record<string, string[]> = {
|
|
200
|
-
C01: ["client_ref_conflict", "reconciliation_capacity"],
|
|
204
|
+
C01: ["client_ref_conflict", "reconciliation_capacity", "reconciliation_persist_failed"],
|
|
205
|
+
C09: ["client_ref_conflict", "reconciliation_capacity", "reconciliation_persist_failed"],
|
|
201
206
|
C06: ["action_claimed"],
|
|
202
207
|
C07: ["action_claimed", "terminal_uncertain"],
|
|
203
208
|
C08: ["action_claimed", "terminal_uncertain"],
|
|
@@ -238,7 +243,7 @@ function queryContinuityClass(id: string): QueryContinuityClass {
|
|
|
238
243
|
}
|
|
239
244
|
|
|
240
245
|
function queryDisposition(id: string): Record<Adapter, AdapterDisposition> {
|
|
241
|
-
if (["Q23", "Q24", "Q25", "Q26", "Q27"].includes(id))
|
|
246
|
+
if (["Q23", "Q24", "Q25", "Q26", "Q27", "Q28"].includes(id))
|
|
242
247
|
return dispositions({ telegram: "prohibited", discord: "prohibited", slack: "prohibited" });
|
|
243
248
|
return dispositions();
|
|
244
249
|
}
|
package/src/sdk/session.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
type ToolResultMessage,
|
|
22
22
|
} from "@gajae-code/ai";
|
|
23
23
|
import {
|
|
24
|
+
codexToolWireName,
|
|
24
25
|
getOpenAICodexTransportDetails,
|
|
25
26
|
prewarmOpenAICodexResponses,
|
|
26
27
|
} from "@gajae-code/ai/providers/openai-codex-responses";
|
|
@@ -2188,7 +2189,18 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2188
2189
|
const previousPromptMetadataModel = promptMetadataModel;
|
|
2189
2190
|
promptMetadataModel = candidateModel;
|
|
2190
2191
|
try {
|
|
2191
|
-
|
|
2192
|
+
const activeModel = candidateModel ?? agent?.state.model ?? model;
|
|
2193
|
+
// Codex renames reserved tool names on the wire; the prompt must
|
|
2194
|
+
// refer to the tools by the names the model actually receives.
|
|
2195
|
+
const overrides =
|
|
2196
|
+
activeModel?.api === "openai-codex-responses"
|
|
2197
|
+
? Object.fromEntries(
|
|
2198
|
+
Array.from(tools.keys())
|
|
2199
|
+
.filter(name => codexToolWireName(name) !== name)
|
|
2200
|
+
.map(name => [name, { wireName: codexToolWireName(name) }]),
|
|
2201
|
+
)
|
|
2202
|
+
: {};
|
|
2203
|
+
return buildSystemPromptToolMetadata(tools, overrides);
|
|
2192
2204
|
} finally {
|
|
2193
2205
|
promptMetadataModel = previousPromptMetadataModel;
|
|
2194
2206
|
}
|