@gajae-code/coding-agent 0.16.0 → 0.16.3
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 +52 -1
- package/dist/types/async/job-manager.d.ts +32 -1
- package/dist/types/browser-backend.d.ts +12 -0
- package/dist/types/cli/update-cli.d.ts +1 -0
- package/dist/types/commands/sdk.d.ts +2 -0
- package/dist/types/config/billing-path.d.ts +25 -0
- package/dist/types/config/config-schema-version.d.ts +13 -1
- package/dist/types/config/model-registry.d.ts +16 -0
- package/dist/types/config/settings-schema.d.ts +17 -7
- package/dist/types/extensibility/extensions/types.d.ts +8 -3
- package/dist/types/gjc-runtime/launch-worktree.d.ts +25 -1
- package/dist/types/gjc-runtime/session-state-lock.d.ts +22 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/modes/acp/acp-agent.d.ts +21 -21
- package/dist/types/modes/components/model-selector.d.ts +4 -0
- package/dist/types/modes/components/session-selector.d.ts +1 -1
- package/dist/types/modes/components/sessions-dashboard.d.ts +2 -1
- package/dist/types/modes/interactive-mode.d.ts +16 -2
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/sdk/broker/broker.d.ts +2 -1
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +6 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +14 -0
- package/dist/types/sdk/broker/startup-budget.d.ts +52 -0
- package/dist/types/sdk/broker/state-version.d.ts +17 -0
- package/dist/types/sdk/bus/discord-daemon.d.ts +1 -1
- package/dist/types/sdk/bus/index.d.ts +3 -1
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +1 -1
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +1 -1
- package/dist/types/sdk/bus/slack-conversation.d.ts +1 -1
- package/dist/types/sdk/bus/slack-daemon.d.ts +1 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
- package/dist/types/sdk/cli/rows.d.ts +15 -2
- package/dist/types/sdk/cli/session-cli.d.ts +2 -1
- package/dist/types/sdk/host/events.d.ts +2 -0
- package/dist/types/sdk/host/host.d.ts +2 -0
- package/dist/types/sdk/host/query/cursor.d.ts +4 -2
- package/dist/types/sdk/host/query/handlers.d.ts +1 -0
- package/dist/types/sdk/host/query/revision-store.d.ts +1 -0
- package/dist/types/sdk/host/session-runtime.d.ts +18 -17
- package/dist/types/sdk/lifecycle-session.d.ts +1 -1
- package/dist/types/sdk/prompt-deadline-manager.d.ts +2 -5
- package/dist/types/sdk/receipt-state.d.ts +2 -0
- package/dist/types/sdk/router/session-router.d.ts +4 -0
- package/dist/types/sdk/turn-result.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +47 -7
- package/dist/types/session/fold-coordinator.d.ts +29 -2
- package/dist/types/session/session-manager.d.ts +14 -2
- package/dist/types/tools/ask.d.ts +1 -0
- package/dist/types/tools/bash.d.ts +12 -0
- package/dist/types/tools/browser/launch.d.ts +10 -0
- package/dist/types/tools/browser/registry.d.ts +8 -0
- package/dist/types/tools/index.d.ts +4 -10
- package/dist/types/tools/job.d.ts +3 -1
- package/dist/types/utils/external-editor.d.ts +12 -0
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/pirate.ts +7 -4
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +7 -1
- package/src/async/job-manager.ts +107 -9
- package/src/browser-backend.ts +29 -0
- package/src/cli/plugin-cli.ts +29 -0
- package/src/cli/update-cli.ts +63 -12
- package/src/commands/sdk.ts +22 -7
- package/src/config/billing-path.ts +42 -0
- package/src/config/config-schema-version.ts +18 -1
- package/src/config/model-preset-registry.ts +177 -18
- package/src/config/model-registry.ts +268 -42
- package/src/config/settings-schema.ts +19 -7
- package/src/config/settings.ts +46 -15
- package/src/coordinator-mcp/projection-scan.ts +6 -6
- package/src/coordinator-mcp/server.ts +21 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
- package/src/extensibility/extensions/runner.ts +27 -0
- package/src/extensibility/extensions/types.ts +8 -3
- package/src/extensibility/gjc-plugins/installer.ts +51 -11
- package/src/extensibility/runtime-skill-discovery.ts +110 -3
- package/src/extensibility/skills.ts +22 -12
- package/src/gjc-runtime/launch-worktree.ts +285 -4
- package/src/gjc-runtime/session-state-lock.ts +156 -32
- package/src/gjc-runtime/session-state-sidecar.ts +10 -17
- package/src/gjc-runtime/tmux-owner-isolation.ts +16 -1
- package/src/internal-urls/docs-index.generated.ts +11 -11
- package/src/main.ts +4 -1
- package/src/modes/acp/acp-agent.ts +34 -19
- package/src/modes/components/model-selector.ts +76 -8
- package/src/modes/components/session-selector.ts +23 -15
- package/src/modes/components/sessions-dashboard.ts +8 -5
- package/src/modes/controllers/command-controller.ts +1 -1
- package/src/modes/controllers/event-controller.ts +30 -4
- package/src/modes/controllers/extension-ui-controller.ts +13 -13
- package/src/modes/controllers/input-controller.ts +2 -2
- package/src/modes/controllers/selector-controller.ts +10 -3
- package/src/modes/interactive-mode.ts +36 -12
- package/src/modes/prompt-action-autocomplete.ts +30 -4
- package/src/modes/runtime-init.ts +12 -9
- package/src/modes/theme/theme.ts +5 -0
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/ui-helpers.ts +22 -3
- package/src/prompts/agent-fragments/browser-aside.md +22 -0
- package/src/prompts/tools/ask.md +1 -1
- package/src/prompts/tools/bash.md +1 -0
- package/src/prompts/tools/job.md +1 -1
- package/src/sdk/acp/adapter.ts +6 -1
- package/src/sdk/broker/broker.ts +10 -1
- package/src/sdk/broker/ensure.ts +76 -3
- package/src/sdk/broker/lifecycle-ledger.ts +6 -0
- package/src/sdk/broker/lifecycle.ts +254 -34
- package/src/sdk/broker/spawn-substrate.ts +45 -2
- package/src/sdk/broker/startup-budget.ts +144 -2
- package/src/sdk/broker/state-version.ts +17 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +118 -24
- package/src/sdk/bus/discord-daemon.ts +50 -10
- package/src/sdk/bus/index.ts +33 -3
- package/src/sdk/bus/kind-aware-reconciliation.ts +296 -48
- package/src/sdk/bus/lifecycle-commands.ts +4 -0
- package/src/sdk/bus/notification-service.ts +22 -5
- package/src/sdk/bus/prompt-reconciliation.ts +7 -2
- package/src/sdk/bus/reconciliation-store.ts +55 -31
- package/src/sdk/bus/slack-conversation.ts +1 -1
- package/src/sdk/bus/slack-daemon.ts +72 -38
- package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
- package/src/sdk/cli/rows.ts +75 -7
- package/src/sdk/cli/session-cli.ts +68 -35
- package/src/sdk/host/control/dispatch.ts +2 -2
- package/src/sdk/host/events.ts +26 -2
- package/src/sdk/host/host.ts +6 -1
- package/src/sdk/host/query/cursor.ts +52 -7
- package/src/sdk/host/query/handlers.ts +33 -12
- package/src/sdk/host/query/revision-store.ts +12 -0
- package/src/sdk/host/session-runtime.test.ts +497 -31
- package/src/sdk/host/session-runtime.ts +387 -54
- package/src/sdk/host/surface-policy.ts +3 -3
- package/src/sdk/lifecycle-session.ts +7 -2
- package/src/sdk/prompt-deadline-manager.ts +2 -1
- package/src/sdk/protocol/operation-inventory.generated.json +54 -3
- package/src/sdk/protocol/operation-registry.ts +1 -1
- package/src/sdk/receipt-state.ts +10 -0
- package/src/sdk/router/session-router.ts +210 -94
- package/src/sdk/session.ts +59 -41
- package/src/sdk/turn-result.ts +22 -0
- package/src/session/agent-session.ts +1033 -260
- package/src/session/fold-coordinator.ts +40 -3
- package/src/session/session-manager.ts +517 -77
- package/src/slash-commands/builtin-registry.ts +41 -0
- package/src/task/executor.ts +9 -4
- package/src/tools/ask-contract.test.ts +64 -0
- package/src/tools/ask-contract.ts +36 -1
- package/src/tools/ask.ts +10 -8
- package/src/tools/bash-interactive.ts +11 -2
- package/src/tools/bash.ts +158 -33
- package/src/tools/browser/launch.ts +37 -0
- package/src/tools/browser/registry.ts +99 -9
- package/src/tools/cron.ts +6 -4
- package/src/tools/descriptors.test.ts +15 -0
- package/src/tools/descriptors.ts +5 -1
- package/src/tools/index.ts +4 -6
- package/src/tools/job.ts +4 -1
- package/src/tools/monitor.ts +12 -9
- package/src/tools/resolve.ts +30 -10
- package/src/tools/tool-catalog.generated.ts +2 -2
- package/src/utils/external-editor.ts +86 -1
|
@@ -34,7 +34,7 @@ const CONTROL_BINDINGS: Readonly<Record<string, string | undefined>> = {
|
|
|
34
34
|
"thinking.cycle": "cycleThinkingLevel",
|
|
35
35
|
"queue.steering_mode.set": "setQueueMode",
|
|
36
36
|
"queue.follow_up_mode.set": "setQueueMode",
|
|
37
|
-
"queue.
|
|
37
|
+
"queue.tool_interrupt_policy.set": "setQueueMode",
|
|
38
38
|
"todo.replace": "sdkControl",
|
|
39
39
|
"permission_mode.set": "sdkControl",
|
|
40
40
|
"skill.invoke": "invokeSkill",
|
|
@@ -62,8 +62,8 @@ const CONTROL_BINDINGS: Readonly<Record<string, string | undefined>> = {
|
|
|
62
62
|
// Resource queries (`artifact.read`, `runtime.jobs.list`) remain dispatchable when their
|
|
63
63
|
// backing session resource is absent so their handlers can return `resource_gone`.
|
|
64
64
|
// `session.checkpoint` (Q30) is likewise unconditionally installed: it is an SDK-native
|
|
65
|
-
// replay authority
|
|
66
|
-
//
|
|
65
|
+
// replay authority whose handler returns explicit `unavailable` when the host cannot
|
|
66
|
+
// provide one atomic transcript/ring/idle capture, so it must never be hidden behind a binding gate.
|
|
67
67
|
const QUERY_BINDINGS: Readonly<Record<string, string | undefined>> = {
|
|
68
68
|
"skill.list/state": "getSkillState",
|
|
69
69
|
"config.list/get": "getConfigItems",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseModelString } from "../config/model-resolver";
|
|
2
|
-
import type
|
|
2
|
+
import { type AgentSession, isSessionDisposalIncompleteError } from "../session/agent-session";
|
|
3
3
|
import { type CreateAgentSessionOptions, createAgentSession } from "./session";
|
|
4
4
|
import {
|
|
5
5
|
lifecycleMcpStartupTimeoutOption,
|
|
@@ -106,7 +106,12 @@ export async function createLifecycleAgentSession(
|
|
|
106
106
|
const expected = parseModelString(modelId);
|
|
107
107
|
const expectedSelector = expected ? `${expected.provider}/${expected.id}` : modelId;
|
|
108
108
|
if (!activeSelector || activeSelector.toLowerCase() !== expectedSelector.toLowerCase()) {
|
|
109
|
-
|
|
109
|
+
try {
|
|
110
|
+
await result.session.dispose();
|
|
111
|
+
} catch (error) {
|
|
112
|
+
if (!isSessionDisposalIncompleteError(error)) throw error;
|
|
113
|
+
await result.session.awaitDisposeCompletion();
|
|
114
|
+
}
|
|
110
115
|
throw new Error(
|
|
111
116
|
`Model "${modelId}" not found. Use --list-models to see available models.${
|
|
112
117
|
activeSelector ? ` Session resolved ${activeSelector} instead.` : ""
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
promptDeadlineAt,
|
|
8
8
|
recordAttributableProgress,
|
|
9
9
|
} from "./prompt-deadline-lease";
|
|
10
|
+
import type { SdkPromptTerminalOutcome } from "./prompt-status";
|
|
10
11
|
import type { TurnResultContent } from "./turn-result";
|
|
11
12
|
|
|
12
13
|
const MAX_EXPIRY_RETRIES = 5;
|
|
@@ -26,7 +27,7 @@ export type PromptDeadlineOutcome = {
|
|
|
26
27
|
export interface PromptTerminalTransitionEvidence {
|
|
27
28
|
content?: TurnResultContent;
|
|
28
29
|
hasActivity?: boolean;
|
|
29
|
-
outcome?:
|
|
30
|
+
outcome?: SdkPromptTerminalOutcome;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
function leaseKey(correlation: InvocationCorrelation): string {
|
|
@@ -346,7 +346,7 @@
|
|
|
346
346
|
"sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
|
|
347
347
|
"sourceKind": "registry",
|
|
348
348
|
"decision": "include",
|
|
349
|
-
"sdkId": "queue.
|
|
349
|
+
"sdkId": "queue.tool_interrupt_policy.set",
|
|
350
350
|
"adapterMappings": {
|
|
351
351
|
"telegram": "generic_safe",
|
|
352
352
|
"discord": "generic_safe",
|
|
@@ -2315,6 +2315,28 @@
|
|
|
2315
2315
|
"testIds": "not_applicable"
|
|
2316
2316
|
}
|
|
2317
2317
|
},
|
|
2318
|
+
{
|
|
2319
|
+
"sourceId": "slash_command:star",
|
|
2320
|
+
"sourceFile": "packages/coding-agent/src/slash-commands/builtin-registry.ts",
|
|
2321
|
+
"sourceKind": "slash_command",
|
|
2322
|
+
"decision": "exclude",
|
|
2323
|
+
"rationale": "local transcript-discovery metadata command; no SDK operation counterpart or runtime/retention authority",
|
|
2324
|
+
"exclusionMetadata": {
|
|
2325
|
+
"adapterMappings": "not_applicable",
|
|
2326
|
+
"testIds": "not_applicable"
|
|
2327
|
+
}
|
|
2328
|
+
},
|
|
2329
|
+
{
|
|
2330
|
+
"sourceId": "slash_command:unstar",
|
|
2331
|
+
"sourceFile": "packages/coding-agent/src/slash-commands/builtin-registry.ts",
|
|
2332
|
+
"sourceKind": "slash_command",
|
|
2333
|
+
"decision": "exclude",
|
|
2334
|
+
"rationale": "local transcript-discovery metadata command; no SDK operation counterpart or runtime/retention authority",
|
|
2335
|
+
"exclusionMetadata": {
|
|
2336
|
+
"adapterMappings": "not_applicable",
|
|
2337
|
+
"testIds": "not_applicable"
|
|
2338
|
+
}
|
|
2339
|
+
},
|
|
2318
2340
|
{
|
|
2319
2341
|
"sourceId": "slash_command:resume",
|
|
2320
2342
|
"sourceFile": "packages/coding-agent/src/slash-commands/builtin-registry.ts",
|
|
@@ -3038,6 +3060,17 @@
|
|
|
3038
3060
|
"testIds": "not_applicable"
|
|
3039
3061
|
}
|
|
3040
3062
|
},
|
|
3063
|
+
{
|
|
3064
|
+
"sourceId": "agent_session:onJobFold",
|
|
3065
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
3066
|
+
"sourceKind": "agent_session",
|
|
3067
|
+
"decision": "exclude",
|
|
3068
|
+
"rationale": "internal fold-event plumbing feeding the bash_folded event frame, not a control seam",
|
|
3069
|
+
"exclusionMetadata": {
|
|
3070
|
+
"adapterMappings": "not_applicable",
|
|
3071
|
+
"testIds": "not_applicable"
|
|
3072
|
+
}
|
|
3073
|
+
},
|
|
3041
3074
|
{
|
|
3042
3075
|
"sourceId": "agent_session:requestForegroundBashBackground",
|
|
3043
3076
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -3049,6 +3082,24 @@
|
|
|
3049
3082
|
"testIds": "not_applicable"
|
|
3050
3083
|
}
|
|
3051
3084
|
},
|
|
3085
|
+
{
|
|
3086
|
+
"sourceId": "agent_session:requestForegroundBashBackgroundOutcome",
|
|
3087
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
3088
|
+
"sourceKind": "agent_session",
|
|
3089
|
+
"decision": "include",
|
|
3090
|
+
"sdkId": "bash.background",
|
|
3091
|
+
"adapterMappings": {
|
|
3092
|
+
"telegram": "prohibited",
|
|
3093
|
+
"discord": "prohibited",
|
|
3094
|
+
"slack": "prohibited",
|
|
3095
|
+
"mcp": "generic_safe",
|
|
3096
|
+
"acp": "generic_safe",
|
|
3097
|
+
"daemonCli": "generic_safe"
|
|
3098
|
+
},
|
|
3099
|
+
"testIds": [
|
|
3100
|
+
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
3101
|
+
]
|
|
3102
|
+
},
|
|
3052
3103
|
{
|
|
3053
3104
|
"sourceId": "agent_session:getAllToolNames",
|
|
3054
3105
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -4732,11 +4783,11 @@
|
|
|
4732
4783
|
]
|
|
4733
4784
|
},
|
|
4734
4785
|
{
|
|
4735
|
-
"sourceId": "agent_session:
|
|
4786
|
+
"sourceId": "agent_session:setToolInterruptPolicy",
|
|
4736
4787
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4737
4788
|
"sourceKind": "agent_session",
|
|
4738
4789
|
"decision": "include",
|
|
4739
|
-
"sdkId": "queue.
|
|
4790
|
+
"sdkId": "queue.tool_interrupt_policy.set",
|
|
4740
4791
|
"adapterMappings": {
|
|
4741
4792
|
"telegram": "generic_safe",
|
|
4742
4793
|
"discord": "generic_safe",
|
|
@@ -91,7 +91,7 @@ const controls = [
|
|
|
91
91
|
["permission_mode.set", "Set permission mode."],
|
|
92
92
|
["queue.steering_mode.set", "Set steering queue mode."],
|
|
93
93
|
["queue.follow_up_mode.set", "Set follow-up queue mode."],
|
|
94
|
-
["queue.
|
|
94
|
+
["queue.tool_interrupt_policy.set", "Set whether a steer aborts or finishes in-flight tools."],
|
|
95
95
|
["compaction.run", "Run context compaction."],
|
|
96
96
|
["compaction.auto.set", "Set automatic compaction."],
|
|
97
97
|
["retry.auto.set", "Set automatic retry."],
|
package/src/sdk/receipt-state.ts
CHANGED
|
@@ -25,6 +25,16 @@ export function receiptStateForTerminal(source: ReceiptSource): Extract<ReceiptS
|
|
|
25
25
|
return reportableReceipt(source) ? "present" : "missing";
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/** Terminal receipt evidence is monotonic: present > missing > unknown. */
|
|
29
|
+
export function reduceReceiptState(
|
|
30
|
+
existing: Exclude<ReceiptState, "absent"> | undefined,
|
|
31
|
+
incoming: Exclude<ReceiptState, "absent"> | undefined,
|
|
32
|
+
): Exclude<ReceiptState, "absent"> | undefined {
|
|
33
|
+
if (existing === "present" || incoming === "present") return "present";
|
|
34
|
+
if (existing === "missing" || incoming === "missing") return "missing";
|
|
35
|
+
return existing ?? incoming;
|
|
36
|
+
}
|
|
37
|
+
|
|
28
38
|
export function reduceTerminalReceiptState(input: TerminalReceiptInput): TerminalReceiptState {
|
|
29
39
|
switch (input.execution) {
|
|
30
40
|
case "accepted":
|