@gajae-code/coding-agent 0.18.1 → 0.18.5
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 +60 -0
- package/dist/types/cli/stats-cli.d.ts +0 -5
- package/dist/types/config/autorouting-tier-map.d.ts +29 -2
- package/dist/types/config/model-registry.d.ts +16 -1
- package/dist/types/exa/mcp-client.d.ts +1 -5
- package/dist/types/exec/bash-shell-guardian.d.ts +26 -0
- package/dist/types/hashline/parser.d.ts +28 -5
- package/dist/types/modes/acp/acp-agent.d.ts +6 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -1
- package/dist/types/sdk/broker/recovery-backoff.d.ts +62 -0
- package/dist/types/sdk/broker/runtime.d.ts +20 -0
- package/dist/types/sdk/broker/startup-budget.d.ts +5 -1
- package/dist/types/sdk/bus/index.d.ts +1 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
- package/dist/types/sdk/host/session-runtime.d.ts +7 -0
- package/dist/types/sdk/prompt-watchdog.d.ts +1 -1
- package/dist/types/tools/bash.d.ts +1 -0
- package/package.json +7 -7
- package/src/cli/stats-cli.ts +4 -36
- package/src/cli-main.ts +4 -8
- package/src/cli.ts +4 -8
- package/src/commands/commit.ts +2 -2
- package/src/commands/sdk.ts +1 -2
- package/src/config/autorouting-tier-map.ts +20 -2
- package/src/config/model-preset-registry.ts +17 -2
- package/src/config/model-profile-activation.ts +3 -1
- package/src/config/model-profiles.ts +11 -3
- package/src/config/model-registry.ts +45 -17
- package/src/exa/mcp-client.ts +41 -8
- package/src/exec/bash-shell-guardian.ts +184 -34
- package/src/hashline/execute.ts +51 -3
- package/src/hashline/parser.ts +63 -16
- package/src/internal-urls/docs-index.generated.ts +22 -22
- package/src/modes/acp/acp-agent.ts +39 -4
- package/src/modes/controllers/ssh-command-controller.ts +3 -1
- package/src/sdk/broker/lifecycle.ts +408 -218
- package/src/sdk/broker/recovery-backoff.ts +135 -0
- package/src/sdk/broker/runtime.ts +83 -0
- package/src/sdk/broker/startup-budget.ts +6 -1
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +305 -19
- package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
- package/src/sdk/host/session-runtime.ts +99 -3
- package/src/sdk/prompt-watchdog.ts +17 -4
- package/src/session/agent-session.ts +14 -2
- package/src/session/internal/managed-session-storage.ts +23 -0
- package/src/tools/bash.ts +39 -0
- package/dist/types/cli/grep-cli.d.ts +0 -17
- package/dist/types/cli/shell-cli.d.ts +0 -8
- package/dist/types/commands/grep.d.ts +0 -42
- package/dist/types/commands/shell.d.ts +0 -21
- package/src/cli/grep-cli.ts +0 -160
- package/src/cli/shell-cli.ts +0 -176
- package/src/commands/grep.ts +0 -48
- package/src/commands/shell.ts +0 -29
|
@@ -667,7 +667,9 @@ function logDroppedPromptTerminal(
|
|
|
667
667
|
});
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
type SdkPromptFailedOutcome = Extract<SdkPromptTerminalOutcome, { kind: "failed" }
|
|
670
|
+
type SdkPromptFailedOutcome = Extract<SdkPromptTerminalOutcome, { kind: "failed" }> & {
|
|
671
|
+
deliveryFailure?: { cause: string; frameBytes: number };
|
|
672
|
+
};
|
|
671
673
|
|
|
672
674
|
/**
|
|
673
675
|
* A prompt rejection that still carries the terminal's structured failure classification.
|
|
@@ -803,6 +805,13 @@ function promptFailureWireData(failure: SdkPromptFailedOutcome): Record<string,
|
|
|
803
805
|
category: failure.category,
|
|
804
806
|
retryability: promptFailureRetryability(failure.category),
|
|
805
807
|
...(isSafePromptFailureCode(failure.providerCode) ? { providerCode: failure.providerCode } : {}),
|
|
808
|
+
...(failure.deliveryFailure
|
|
809
|
+
? {
|
|
810
|
+
reason: "delivery_failed",
|
|
811
|
+
cause: failure.deliveryFailure.cause,
|
|
812
|
+
frameBytes: String(failure.deliveryFailure.frameBytes),
|
|
813
|
+
}
|
|
814
|
+
: {}),
|
|
806
815
|
...(operatorMessage === undefined ? {} : { operatorMessage }),
|
|
807
816
|
};
|
|
808
817
|
}
|
|
@@ -921,13 +930,28 @@ function terminalOutcome(event: JsonObject): SdkPromptTerminalOutcome | undefine
|
|
|
921
930
|
typeof outcome.message === "string" &&
|
|
922
931
|
(outcome.provenance === "agent_failed" || outcome.provenance === "deadline")
|
|
923
932
|
) {
|
|
924
|
-
|
|
933
|
+
const failure = failedPromptOutcome({
|
|
925
934
|
code: outcome.code,
|
|
926
935
|
provenance: outcome.provenance,
|
|
927
936
|
...(typeof outcome.providerCode === "string" ? { providerCode: outcome.providerCode } : {}),
|
|
928
937
|
...(isSdkPromptFailurePhase(outcome.phase) ? { phase: outcome.phase } : {}),
|
|
929
938
|
evidence: {},
|
|
930
939
|
});
|
|
940
|
+
const delivery = object(event.error);
|
|
941
|
+
if (
|
|
942
|
+
delivery?.code === "delivery_failed" &&
|
|
943
|
+
isSafePromptFailureCode(delivery.cause) &&
|
|
944
|
+
typeof delivery.frameBytes === "number" &&
|
|
945
|
+
Number.isSafeInteger(delivery.frameBytes) &&
|
|
946
|
+
delivery.frameBytes >= 0
|
|
947
|
+
) {
|
|
948
|
+
const classified: SdkPromptFailedOutcome = {
|
|
949
|
+
...failure,
|
|
950
|
+
deliveryFailure: { cause: delivery.cause, frameBytes: delivery.frameBytes },
|
|
951
|
+
};
|
|
952
|
+
return classified;
|
|
953
|
+
}
|
|
954
|
+
return failure;
|
|
931
955
|
}
|
|
932
956
|
return undefined;
|
|
933
957
|
}
|
|
@@ -1115,6 +1139,15 @@ function frameMessageRole(event: JsonObject | undefined): string | undefined {
|
|
|
1115
1139
|
return typeof role === "string" ? role : undefined;
|
|
1116
1140
|
}
|
|
1117
1141
|
|
|
1142
|
+
function frameMessageHasToolCall(event: JsonObject | undefined): boolean {
|
|
1143
|
+
const content = object(event?.message)?.content;
|
|
1144
|
+
if (!Array.isArray(content)) return false;
|
|
1145
|
+
return content.some(block => {
|
|
1146
|
+
const value = object(block);
|
|
1147
|
+
return value?.type === "toolCall" || value?.type === "tool_use";
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1118
1151
|
const ACP_CONFIG_OPTIONS = [
|
|
1119
1152
|
{ id: MODEL_CONFIG_ID, name: "Model", category: "model", options: [] },
|
|
1120
1153
|
{ id: THINKING_CONFIG_ID, name: "Thinking", category: "thought_level", options: [] },
|
|
@@ -4205,6 +4238,7 @@ export class AcpAgent implements Agent {
|
|
|
4205
4238
|
typeof event?.type === "string" ? event.type : undefined,
|
|
4206
4239
|
typeof event?.toolCallId === "string" ? event.toolCallId : undefined,
|
|
4207
4240
|
frameMessageRole(event),
|
|
4241
|
+
frameMessageHasToolCall(event),
|
|
4208
4242
|
);
|
|
4209
4243
|
}
|
|
4210
4244
|
|
|
@@ -4966,10 +5000,11 @@ export class AcpAgent implements Agent {
|
|
|
4966
5000
|
// connection watched start. Upgrade it from the frames this prompt actually owned, never
|
|
4967
5001
|
// downgrade a terminal that already reported `post_start`, and carry the whole
|
|
4968
5002
|
// classification on the rejection so the first-turn retry gate can read it (review P1).
|
|
4969
|
-
const failure =
|
|
5003
|
+
const failure = (
|
|
4970
5004
|
outcome.phase === "post_start"
|
|
4971
5005
|
? outcome
|
|
4972
|
-
:
|
|
5006
|
+
: rephaseFailedOutcome(outcome, { hasActivity: waiter.observedTurnActivity })
|
|
5007
|
+
) as SdkPromptFailedOutcome;
|
|
4973
5008
|
waiter.reject(new AcpPromptFailureError(failure));
|
|
4974
5009
|
}
|
|
4975
5010
|
|
|
@@ -134,7 +134,9 @@ export class SSHCommandController {
|
|
|
134
134
|
this.ctx.showError("Missing value for --port.");
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
// Same rule as the ACP `/ssh add` parser: `Number.parseInt` accepts
|
|
138
|
+
// trailing garbage ("22oops" -> 22), which would save a typo as a port.
|
|
139
|
+
const parsed = /^\d+$/.test(value) ? Number.parseInt(value, 10) : Number.NaN;
|
|
138
140
|
if (Number.isNaN(parsed) || parsed < 1 || parsed > 65535) {
|
|
139
141
|
this.ctx.showError("Invalid --port value. Must be an integer between 1 and 65535.");
|
|
140
142
|
return;
|