@gajae-code/coding-agent 0.13.0 → 0.13.2
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 +34 -0
- package/dist/types/config/file-lock.d.ts +2 -0
- package/dist/types/config/keybindings.d.ts +2 -2
- package/dist/types/config/model-registry.d.ts +4 -0
- package/dist/types/config/models-config-schema.d.ts +6 -0
- package/dist/types/config/settings-schema.d.ts +17 -5
- package/dist/types/config/settings.d.ts +10 -1
- package/dist/types/edit/streaming.d.ts +5 -5
- package/dist/types/eval/py/kernel.d.ts +2 -2
- package/dist/types/eval/py/runtime.d.ts +5 -1
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +3 -0
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +3 -1
- package/dist/types/modes/components/model-selector.d.ts +3 -2
- package/dist/types/runtime/process-lifecycle.d.ts +12 -31
- package/dist/types/sdk/broker/identity.d.ts +2 -1
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +17 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +11 -6
- package/dist/types/sdk/broker/startup-failure.d.ts +32 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
- package/dist/types/sdk/bus/conversation-store.d.ts +1 -0
- package/dist/types/sdk/bus/index.d.ts +4 -0
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +10 -1
- package/dist/types/sdk/bus/reconciliation-store.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +13 -2
- package/dist/types/sdk/bus/telegram-daemon.d.ts +17 -1
- package/dist/types/sdk/host/query/cursor.d.ts +4 -0
- package/dist/types/sdk/host/query/handlers.d.ts +6 -0
- package/dist/types/sdk/host/session-runtime.d.ts +7 -6
- package/dist/types/sdk/host/websocket-transport.d.ts +1 -1
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/turn-result.d.ts +37 -0
- package/dist/types/session/agent-session.d.ts +8 -11
- package/dist/types/session/blob-store.d.ts +6 -3
- package/dist/types/session/internal/managed-session-storage.d.ts +13 -0
- package/dist/types/slash-commands/helpers/fast-status-report.d.ts +12 -3
- package/dist/types/task/executor.d.ts +4 -7
- package/dist/types/tools/index.d.ts +1 -1
- package/dist/types/tools/read.d.ts +1 -1
- package/dist/types/tools/search.d.ts +1 -1
- package/dist/types/utils/edit-mode.d.ts +69 -0
- package/package.json +8 -8
- package/scripts/generate-hotkeys-docs.ts +8 -6
- package/src/commands/sdk.ts +23 -2
- package/src/config/file-lock.ts +25 -5
- package/src/config/keybindings.ts +4 -2
- package/src/config/model-registry.ts +20 -0
- package/src/config/models-config-schema.ts +1 -0
- package/src/config/settings-schema.ts +29 -22
- package/src/config/settings.ts +42 -10
- package/src/coordinator-mcp/server.ts +87 -106
- package/src/edit/index.ts +5 -19
- package/src/edit/renderer.ts +3 -2
- package/src/edit/streaming.ts +28 -15
- package/src/eval/py/executor.ts +108 -10
- package/src/eval/py/kernel.ts +86 -12
- package/src/eval/py/runtime.ts +200 -16
- package/src/exec/bash-executor.ts +36 -37
- package/src/gjc-runtime/gc-runtime.ts +25 -3
- package/src/gjc-runtime/managed-owner-supervisor.ts +27 -1
- package/src/gjc-runtime/session-state-sidecar.ts +110 -4
- package/src/gjc-runtime/tmux-sessions.ts +34 -5
- package/src/internal-urls/docs-index.generated.ts +9 -9
- package/src/modes/acp/acp-agent.ts +10 -2
- package/src/modes/components/model-selector.ts +28 -8
- package/src/modes/controllers/plan-mode-controller.ts +3 -3
- package/src/modes/controllers/selector-controller.ts +4 -2
- package/src/modes/interactive-mode.ts +4 -0
- package/src/runtime/process-lifecycle.ts +126 -27
- package/src/runtime-mcp/transports/stdio.ts +11 -6
- package/src/sdk/acp/adapter.ts +18 -10
- package/src/sdk/broker/broker.ts +55 -4
- package/src/sdk/broker/ensure.ts +10 -7
- package/src/sdk/broker/identity.ts +10 -0
- package/src/sdk/broker/lifecycle-ledger.ts +56 -6
- package/src/sdk/broker/lifecycle.ts +53 -10
- package/src/sdk/broker/process-incarnation.ts +6 -1
- package/src/sdk/broker/session-index.ts +28 -11
- package/src/sdk/broker/startup-failure.ts +101 -0
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +4 -3
- package/src/sdk/bus/chat-daemon-runtime.ts +8 -1
- package/src/sdk/bus/conversation-store.ts +171 -50
- package/src/sdk/bus/index.ts +101 -47
- package/src/sdk/bus/kind-aware-reconciliation.ts +52 -2
- package/src/sdk/bus/notification-service.ts +3 -3
- package/src/sdk/bus/reconciliation-store.ts +16 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +13 -2
- package/src/sdk/bus/telegram-daemon.ts +151 -41
- package/src/sdk/bus/topic-registry.ts +38 -9
- package/src/sdk/cli/session-cli.ts +20 -7
- package/src/sdk/client/discovery.ts +23 -2
- package/src/sdk/host/query/cursor.ts +4 -0
- package/src/sdk/host/query/handlers.ts +99 -100
- package/src/sdk/host/sdk-surface-parity.test.ts +1 -1
- package/src/sdk/host/session-runtime.test.ts +98 -1
- package/src/sdk/host/session-runtime.ts +57 -15
- package/src/sdk/host/websocket-transport.lifecycle.test.ts +192 -2
- package/src/sdk/host/websocket-transport.ts +54 -30
- package/src/sdk/index.ts +1 -0
- package/src/sdk/mcp/server.ts +19 -6
- package/src/sdk/protocol/operation-inventory.generated.json +1 -1
- package/src/sdk/protocol/operation-registry.ts +8 -12
- package/src/sdk/session.ts +5 -14
- package/src/sdk/turn-result.ts +53 -0
- package/src/session/agent-session.ts +112 -69
- package/src/session/blob-store.ts +91 -21
- package/src/session/internal/managed-session-storage.ts +136 -21
- package/src/session/session-manager.ts +408 -81
- package/src/session/session-storage.ts +68 -10
- package/src/slash-commands/builtin-registry.ts +43 -5
- package/src/slash-commands/helpers/fast-status-report.ts +24 -8
- package/src/task/executor.ts +25 -8
- package/src/task/index.ts +5 -4
- package/src/tools/bash.ts +11 -9
- package/src/tools/index.ts +1 -1
- package/src/tools/read.ts +12 -11
- package/src/tools/search.ts +7 -7
- package/src/utils/edit-mode.ts +180 -9
- package/src/web/search/providers/insane.ts +55 -1
|
@@ -149,10 +149,12 @@ export interface ForceCloseOwnerDependencies {
|
|
|
149
149
|
now(): Date;
|
|
150
150
|
sleep(ms: number): Promise<void>;
|
|
151
151
|
listPanePids(sessionName: string, env: NodeJS.ProcessEnv): number[];
|
|
152
|
+
/** Test/runtime seam for an exact owner-exit observer; durable validation remains authoritative. */
|
|
153
|
+
waitForOwnerExitVerdict?(): Promise<OwnerVerdict>;
|
|
152
154
|
}
|
|
153
155
|
const GJC_TMUX_PSMUX_INCARNATION_OPTION = "@gjc-psmux-incarnation";
|
|
154
156
|
|
|
155
|
-
const FORCE_CLOSE_VERDICT_TIMEOUT_MS =
|
|
157
|
+
const FORCE_CLOSE_VERDICT_TIMEOUT_MS = 15_000;
|
|
156
158
|
const FORCE_CLOSE_VERDICT_POLL_MS = 50;
|
|
157
159
|
|
|
158
160
|
export interface CreateGjcTmuxSessionOptions {
|
|
@@ -1363,12 +1365,28 @@ async function requireUnchangedOwnerForCompatibilityCleanup(
|
|
|
1363
1365
|
}
|
|
1364
1366
|
}
|
|
1365
1367
|
|
|
1368
|
+
async function waitForOwnerVerdictUntil(
|
|
1369
|
+
verdict: Promise<OwnerVerdict>,
|
|
1370
|
+
now: () => Date,
|
|
1371
|
+
deadline: number,
|
|
1372
|
+
): Promise<OwnerVerdict> {
|
|
1373
|
+
const remainingMs = deadline - now().getTime();
|
|
1374
|
+
if (remainingMs <= 0) throw new Error("owner_term_verdict_timeout");
|
|
1375
|
+
const timeout = Promise.withResolvers<never>();
|
|
1376
|
+
const timer = setTimeout(() => timeout.reject(new Error("owner_term_verdict_timeout")), remainingMs);
|
|
1377
|
+
try {
|
|
1378
|
+
return await Promise.race([verdict, timeout.promise]);
|
|
1379
|
+
} finally {
|
|
1380
|
+
clearTimeout(timer);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1366
1384
|
async function waitForExpectedVerdict(
|
|
1367
1385
|
identity: ExactOwnerIdentity,
|
|
1368
1386
|
sleep: (ms: number) => Promise<void>,
|
|
1369
1387
|
now: () => Date,
|
|
1388
|
+
deadline: number,
|
|
1370
1389
|
): Promise<OwnerVerdict | null> {
|
|
1371
|
-
const deadline = now().getTime() + FORCE_CLOSE_VERDICT_TIMEOUT_MS;
|
|
1372
1390
|
const paths = lifecyclePaths(identity.stateDir, identity.sessionId, identity.generation);
|
|
1373
1391
|
const verdictFile = paths.verdictFile;
|
|
1374
1392
|
const verdictAliasFile = paths.verdictAliasFile;
|
|
@@ -1459,7 +1477,8 @@ export async function forceCloseGjcTmuxSession(
|
|
|
1459
1477
|
const now = deps.now ?? (() => new Date());
|
|
1460
1478
|
const sleep = deps.sleep ?? (ms => Bun.sleep(ms));
|
|
1461
1479
|
const dispatchId = crypto.randomUUID();
|
|
1462
|
-
|
|
1480
|
+
const verdictDeadline = now().getTime() + FORCE_CLOSE_VERDICT_TIMEOUT_MS;
|
|
1481
|
+
let operatorVerdict: Promise<OwnerVerdict> | null = deps.waitForOwnerExitVerdict?.() ?? null;
|
|
1463
1482
|
await closeExactTmuxOwner(
|
|
1464
1483
|
{
|
|
1465
1484
|
stateDir: identity.stateDir,
|
|
@@ -1470,7 +1489,7 @@ export async function forceCloseGjcTmuxSession(
|
|
|
1470
1489
|
startTime: identity.startTime,
|
|
1471
1490
|
dispatchId,
|
|
1472
1491
|
createdAt: now().toISOString(),
|
|
1473
|
-
expiresAt: new Date(
|
|
1492
|
+
expiresAt: new Date(verdictDeadline).toISOString(),
|
|
1474
1493
|
},
|
|
1475
1494
|
{
|
|
1476
1495
|
readStartTime: deps.readProcessStartTime ?? readProcessStartTime,
|
|
@@ -1505,7 +1524,17 @@ export async function forceCloseGjcTmuxSession(
|
|
|
1505
1524
|
}
|
|
1506
1525
|
},
|
|
1507
1526
|
|
|
1508
|
-
waitForVerdict: () =>
|
|
1527
|
+
waitForVerdict: async () => {
|
|
1528
|
+
if (!operatorVerdict) return await waitForExpectedVerdict(identity, sleep, now, verdictDeadline);
|
|
1529
|
+
try {
|
|
1530
|
+
return await waitForOwnerVerdictUntil(operatorVerdict, now, verdictDeadline);
|
|
1531
|
+
} catch {
|
|
1532
|
+
// The sidecar and raw monitor intentionally race to publish the first valid
|
|
1533
|
+
// verdict. If the exact supervisor-exit path loses that race or times out
|
|
1534
|
+
// under load, recover only from the same fully validated durable evidence.
|
|
1535
|
+
return await waitForExpectedVerdict(identity, sleep, now, verdictDeadline);
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1509
1538
|
cleanupSession: async () => {
|
|
1510
1539
|
const cleanupRequired = await requireUnchangedOwnerForCompatibilityCleanup(
|
|
1511
1540
|
session.name,
|