@gajae-code/coding-agent 0.11.11 → 0.12.1
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 +131 -4
- package/dist/types/async/job-manager.d.ts +17 -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 +83 -1
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/exa/mcp-client.d.ts +10 -1
- package/dist/types/exec/bash-executor.d.ts +45 -12
- package/dist/types/extensibility/extensions/types.d.ts +38 -4
- package/dist/types/extensibility/gjc-plugins/index.d.ts +12 -2
- package/dist/types/extensibility/gjc-plugins/installer.d.ts +63 -7
- package/dist/types/extensibility/gjc-plugins/lifecycle-reconciliation.d.ts +55 -0
- package/dist/types/extensibility/gjc-plugins/lifecycle.d.ts +64 -0
- package/dist/types/extensibility/gjc-plugins/runtime-quarantine.d.ts +67 -0
- package/dist/types/extensibility/gjc-plugins/session-validation.d.ts +3 -1
- package/dist/types/extensibility/gjc-plugins/types.d.ts +124 -0
- 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/launch-tmux.d.ts +1 -0
- package/dist/types/gjc-runtime/memory-guard-owner-claims.d.ts +47 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +70 -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 +27 -1
- package/dist/types/gjc-runtime/team-store.d.ts +12 -0
- package/dist/types/gjc-runtime/team-worker-heartbeat.d.ts +43 -0
- package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +92 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +17 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +8 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +31 -80
- 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 +10 -19
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/gjc-bundle-settings.d.ts +34 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
- package/dist/types/modes/components/notifications-settings-editor.d.ts +1 -0
- package/dist/types/modes/components/read-tool-group.d.ts +4 -4
- package/dist/types/modes/components/session-observer-overlay.d.ts +22 -0
- package/dist/types/modes/components/settings-selector.d.ts +11 -0
- package/dist/types/modes/components/status-line/gh.d.ts +5 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +18 -1
- 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/reminders/star-reminder.d.ts +3 -13
- package/dist/types/runtime-mcp/manager.d.ts +1 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
- package/dist/types/sdk/acp/adapter.d.ts +3 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +5 -0
- package/dist/types/sdk/broker/transport.d.ts +2 -0
- package/dist/types/sdk/bus/attachment-registry.d.ts +1 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +4 -1
- package/dist/types/sdk/bus/config.d.ts +6 -2
- package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
- package/dist/types/sdk/bus/index.d.ts +44 -1
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +44 -0
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +2 -1
- package/dist/types/sdk/bus/reconciliation-store.d.ts +69 -0
- package/dist/types/sdk/bus/rich-draft.d.ts +1 -0
- package/dist/types/sdk/bus/rich-render.d.ts +2 -0
- package/dist/types/sdk/bus/telegram-adoption-intent.d.ts +165 -0
- package/dist/types/sdk/bus/telegram-cli.d.ts +12 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +11 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -1
- package/dist/types/sdk/bus/telegram-reference.d.ts +11 -1
- package/dist/types/sdk/bus/threaded-render.d.ts +3 -2
- package/dist/types/sdk/bus/topic-registry.d.ts +11 -1
- 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/sdk/host/query/revision-store.d.ts +2 -0
- package/dist/types/sdk/host/reverse-leases.d.ts +1 -1
- package/dist/types/sdk/prompt-status.d.ts +23 -3
- package/dist/types/sdk/session.d.ts +6 -0
- package/dist/types/session/agent-session.d.ts +82 -12
- package/dist/types/session/artifacts.d.ts +8 -0
- package/dist/types/session/blob-store.d.ts +57 -4
- package/dist/types/session/internal/managed-session-storage.d.ts +8 -1
- package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
- package/dist/types/session/session-manager.d.ts +48 -19
- package/dist/types/session/session-storage.d.ts +4 -0
- package/dist/types/session/streaming-output.d.ts +96 -12
- package/dist/types/setup/credential-import.d.ts +12 -0
- package/dist/types/skill-state/active-state.d.ts +12 -4
- package/dist/types/skill-state/workflow-hud.d.ts +9 -0
- package/dist/types/task/executor.d.ts +3 -2
- package/dist/types/task/index.d.ts +3 -1
- package/dist/types/task/provider-retry-status.d.ts +8 -0
- package/dist/types/task/receipt.d.ts +7 -1
- package/dist/types/task/types.d.ts +23 -0
- package/dist/types/tools/ask-answer-registry.d.ts +2 -2
- package/dist/types/tools/bash-interactive.d.ts +4 -1
- package/dist/types/tools/bash.d.ts +3 -1
- package/dist/types/tools/browser/launch.d.ts +7 -0
- package/dist/types/tools/fetch.d.ts +17 -1
- package/dist/types/tools/image-gen.d.ts +4 -0
- package/dist/types/tools/index.d.ts +4 -0
- package/dist/types/tools/output-meta.d.ts +44 -3
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/read-internals.d.ts +12 -0
- package/dist/types/tools/read.d.ts +45 -7
- package/dist/types/tools/resource-gc.d.ts +4 -0
- package/dist/types/tools/review.d.ts +5 -7
- package/dist/types/tools/subagent.d.ts +2 -0
- package/dist/types/tools/tool-result.d.ts +7 -1
- package/dist/types/utils/gh.d.ts +13 -0
- package/dist/types/utils/image-resize.d.ts +1 -0
- package/dist/types/web/search/providers/kimi.d.ts +2 -0
- package/dist/types/web/search/providers/searxng.d.ts +7 -0
- package/dist/types/web/search/providers/xai.d.ts +2 -0
- package/package.json +11 -13
- package/scripts/acp-conformance-agent.ts +218 -0
- package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
- package/scripts/capture-gjc-bundle-settings.ts +306 -0
- package/scripts/capture-sticky-viewport-showcase.ts +292 -0
- package/scripts/generate-sdk-operation-inventory.ts +5 -0
- package/scripts/resident-memory-bench.ts +1341 -0
- package/scripts/run-acp-conformance.ts +285 -0
- package/scripts/verify-gjc-sdk-canonicalization.ts +122 -18
- package/scripts/verify-sticky-viewport-showcase.ts +611 -0
- package/src/async/job-manager.ts +78 -20
- package/src/capability/index.ts +8 -0
- package/src/cli/fast-help.ts +1 -1
- package/src/cli/plugin-cli.ts +176 -18
- 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 +20 -2
- package/src/config/file-lock.ts +11 -2
- 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 +74 -1
- package/src/config/settings.ts +246 -108
- package/src/coordinator-mcp/question-gate-codec.ts +1 -1
- package/src/coordinator-mcp/server.ts +5 -12
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +230 -82
- package/src/defaults/gjc/skills/ralplan/SKILL.md +77 -41
- package/src/defaults/gjc/skills/team/SKILL.md +3 -1
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +62 -39
- package/src/defaults/gjc/skills/ultragoal/validation-batch-contracts.md +12 -0
- package/src/defaults/gjc-defaults.ts +4 -4
- package/src/eval/py/executor.ts +7 -2
- package/src/exa/mcp-client.ts +12 -3
- package/src/exec/bash-executor.ts +144 -27
- package/src/extensibility/extensions/runner.ts +15 -0
- package/src/extensibility/extensions/types.ts +46 -5
- package/src/extensibility/gjc-plugins/constrained-hooks.ts +8 -2
- package/src/extensibility/gjc-plugins/index.ts +19 -2
- package/src/extensibility/gjc-plugins/installer.ts +189 -50
- package/src/extensibility/gjc-plugins/lifecycle-reconciliation.ts +199 -0
- package/src/extensibility/gjc-plugins/lifecycle.ts +626 -0
- package/src/extensibility/gjc-plugins/observability.ts +3 -3
- package/src/extensibility/gjc-plugins/prompt-appendix.ts +5 -1
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +12 -2
- package/src/extensibility/gjc-plugins/runtime-quarantine.ts +121 -0
- package/src/extensibility/gjc-plugins/schema.ts +84 -12
- package/src/extensibility/gjc-plugins/session-validation.ts +9 -3
- package/src/extensibility/gjc-plugins/types.ts +141 -0
- package/src/extensibility/gjc-plugins/validation.ts +9 -0
- 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/launch-tmux.ts +25 -6
- package/src/gjc-runtime/managed-owner-admission.ts +1 -1
- package/src/gjc-runtime/memory-guard-owner-claims.ts +389 -0
- package/src/gjc-runtime/ralplan-runtime.ts +1149 -98
- 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 +42 -5
- package/src/gjc-runtime/team-runtime.ts +1085 -40
- package/src/gjc-runtime/team-store.ts +32 -0
- package/src/gjc-runtime/team-worker-heartbeat.ts +149 -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 +28 -0
- package/src/gjc-runtime/tmux-sessions.ts +58 -13
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +20 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +414 -618
- package/src/gjc-runtime/workflow-manifest.generated.json +105 -449
- package/src/gjc-runtime/workflow-manifest.ts +38 -247
- 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 +21 -22
- 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 +98 -0
- package/src/modes/acp/acp-agent.ts +339 -191
- 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/gjc-bundle-settings.ts +508 -0
- package/src/modes/components/irc-sidebar.ts +176 -62
- package/src/modes/components/model-selector.ts +61 -4
- package/src/modes/components/notifications-settings-editor.ts +12 -1
- package/src/modes/components/oauth-selector.ts +96 -28
- package/src/modes/components/read-tool-group.ts +82 -14
- package/src/modes/components/session-observer-overlay.ts +457 -83
- package/src/modes/components/settings-selector.ts +116 -23
- package/src/modes/components/status-line/gh.ts +16 -0
- package/src/modes/components/tool-execution.ts +138 -27
- package/src/modes/components/tool-status-header.ts +3 -14
- package/src/modes/components/transcript-viewer-overlay.ts +99 -24
- package/src/modes/controllers/command-controller.ts +4 -0
- package/src/modes/controllers/event-controller.ts +109 -27
- package/src/modes/controllers/extension-ui-controller.ts +26 -2
- package/src/modes/controllers/input-controller.ts +18 -3
- package/src/modes/controllers/selector-controller.ts +127 -36
- package/src/modes/interactive-mode.ts +62 -3
- package/src/modes/irc-observation-ledger.ts +71 -15
- package/src/modes/runtime-init.ts +22 -2
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/ui-helpers.ts +94 -1
- package/src/prompts/agent-fragments/ralplan-persistence.md +4 -3
- package/src/prompts/agents/architect.md +9 -1
- package/src/prompts/agents/critic.md +9 -0
- package/src/prompts/system/eager-todo.md +8 -4
- package/src/prompts/system/system-prompt.md +11 -5
- package/src/prompts/tools/bash.md +5 -5
- package/src/prompts/tools/read.md +4 -2
- package/src/prompts/tools/search-tool-bm25.md +5 -0
- package/src/prompts/tools/task.md +1 -1
- package/src/reminders/star-reminder.ts +4 -42
- package/src/runtime-mcp/manager.ts +19 -4
- package/src/runtime-mcp/smithery-auth.ts +17 -2
- package/src/runtime-mcp/smithery-connect.ts +11 -1
- package/src/sdk/acp/adapter.ts +22 -6
- package/src/sdk/broker/lifecycle.ts +25 -6
- package/src/sdk/broker/transport.ts +35 -3
- package/src/sdk/bus/attachment-registry.ts +5 -1
- package/src/sdk/bus/chat-daemon-cli.ts +4 -39
- package/src/sdk/bus/chat-daemon-control.ts +6 -3
- package/src/sdk/bus/config.ts +18 -2
- package/src/sdk/bus/control-drain-lease.ts +104 -0
- package/src/sdk/bus/index.ts +984 -146
- package/src/sdk/bus/kind-aware-reconciliation.ts +317 -0
- package/src/sdk/bus/lifecycle-commands.ts +4 -1
- package/src/sdk/bus/lifecycle-control-runtime.ts +403 -88
- package/src/sdk/bus/prompt-reconciliation.ts +2 -1
- package/src/sdk/bus/reconciliation-store.ts +303 -0
- package/src/sdk/bus/rich-draft.ts +1 -1
- package/src/sdk/bus/rich-render.ts +2 -2
- package/src/sdk/bus/telegram-adoption-intent.ts +574 -0
- package/src/sdk/bus/telegram-cli.ts +33 -8
- package/src/sdk/bus/telegram-daemon-cli.ts +1 -0
- package/src/sdk/bus/telegram-daemon-contract.ts +11 -4
- package/src/sdk/bus/telegram-daemon.ts +916 -23
- package/src/sdk/bus/telegram-reference.ts +40 -3
- package/src/sdk/bus/threaded-render.ts +48 -3
- package/src/sdk/bus/topic-registry.ts +20 -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/host/query/revision-store.ts +36 -2
- package/src/sdk/host/reverse-leases.ts +44 -7
- package/src/sdk/mcp/server.ts +46 -18
- package/src/sdk/prompt-status.ts +16 -3
- package/src/sdk/protocol/operation-inventory.generated.json +51 -0
- package/src/sdk/protocol/operation-registry.ts +7 -2
- package/src/sdk/session.ts +101 -10
- package/src/session/agent-session.ts +1286 -220
- package/src/session/artifacts.ts +22 -0
- package/src/session/auth-broker-config.ts +10 -3
- package/src/session/blob-store.ts +915 -24
- package/src/session/internal/managed-session-scope.ts +44 -6
- package/src/session/internal/managed-session-storage.ts +48 -6
- package/src/session/memory-guard-checkpoint-participant.ts +131 -0
- package/src/session/session-manager.ts +2364 -438
- package/src/session/session-storage.ts +9 -1
- package/src/session/streaming-output.ts +500 -111
- package/src/setup/credential-import.ts +75 -13
- package/src/setup/provider-onboarding.ts +19 -4
- package/src/skill-state/active-state.ts +32 -10
- package/src/skill-state/workflow-hud.ts +42 -2
- package/src/skill-state/workflow-mutation-guard.ts +560 -8
- package/src/task/executor.ts +122 -39
- package/src/task/index.ts +23 -14
- package/src/task/provider-retry-status.ts +16 -0
- package/src/task/receipt.ts +23 -7
- package/src/task/render.ts +6 -2
- package/src/task/types.ts +108 -0
- package/src/tools/ask-answer-registry.ts +12 -6
- package/src/tools/ask.ts +169 -118
- package/src/tools/ast-edit.ts +1 -0
- package/src/tools/ast-grep.ts +1 -0
- package/src/tools/bash-interactive.ts +8 -3
- package/src/tools/bash.ts +503 -60
- package/src/tools/browser/launch.ts +41 -6
- package/src/tools/fetch.ts +114 -23
- package/src/tools/find.ts +1 -0
- package/src/tools/image-gen.ts +29 -5
- package/src/tools/index.ts +4 -0
- package/src/tools/output-meta.ts +281 -20
- package/src/tools/path-utils.ts +8 -3
- package/src/tools/read-internals.ts +44 -0
- package/src/tools/read.ts +1560 -310
- package/src/tools/resource-gc.ts +182 -18
- package/src/tools/review.ts +5 -7
- package/src/tools/search.ts +1 -0
- package/src/tools/subagent-render.ts +6 -2
- package/src/tools/subagent.ts +6 -0
- package/src/tools/telegram-send.ts +6 -3
- package/src/tools/tool-result.ts +14 -1
- package/src/utils/gh.ts +39 -0
- package/src/utils/image-resize.ts +3 -0
- package/src/web/search/providers/anthropic.ts +4 -4
- package/src/web/search/providers/codex.ts +1 -1
- package/src/web/search/providers/kimi.ts +15 -5
- package/src/web/search/providers/searxng.ts +47 -4
- package/src/web/search/providers/xai.ts +7 -2
- 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/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +0 -23
- package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +0 -30
- 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/gjc-runtime/ultragoal-pipeline.ts +0 -306
|
@@ -3,6 +3,29 @@ export declare const DEFAULT_MAX_LINES = 3000;
|
|
|
3
3
|
export declare const DEFAULT_MAX_BYTES: number;
|
|
4
4
|
export declare const DEFAULT_MAX_COLUMN = 1024;
|
|
5
5
|
export declare const DEFAULT_ARTIFACT_MAX_BYTES: number;
|
|
6
|
+
/**
|
|
7
|
+
* Terminal publisher used when managed artifact storage exposes an ID but no
|
|
8
|
+
* writable pathname. The sink supplies raw content retained up to its artifact
|
|
9
|
+
* hard cap; `omittedBytes` is the source-byte count already omitted by that cap.
|
|
10
|
+
* A successful publisher may report additional omitted bytes (for example, a
|
|
11
|
+
* downstream storage cap); those counts are added to the sink summary. Failed
|
|
12
|
+
* and unavailable results are surfaced through the bounded artifact diagnostic
|
|
13
|
+
* without exposing an unresolvable artifact URL.
|
|
14
|
+
*/
|
|
15
|
+
export type TerminalArtifactPublishResult = {
|
|
16
|
+
status: "published";
|
|
17
|
+
artifactId: string;
|
|
18
|
+
omittedBytes?: number;
|
|
19
|
+
} | {
|
|
20
|
+
status: "unavailable";
|
|
21
|
+
} | {
|
|
22
|
+
status: "failed";
|
|
23
|
+
diagnostic: string;
|
|
24
|
+
};
|
|
25
|
+
export type TerminalArtifactPublisher = (content: string, info: {
|
|
26
|
+
totalBytes: number;
|
|
27
|
+
omittedBytes: number;
|
|
28
|
+
}) => Promise<TerminalArtifactPublishResult>;
|
|
6
29
|
export interface OutputSummary {
|
|
7
30
|
output: string;
|
|
8
31
|
truncated: boolean;
|
|
@@ -18,10 +41,12 @@ export interface OutputSummary {
|
|
|
18
41
|
columnDroppedBytes?: number;
|
|
19
42
|
/** Number of distinct lines that hit the per-line column cap. */
|
|
20
43
|
columnTruncatedLines?: number;
|
|
21
|
-
/** Artifact ID for internal URL access (artifact://<id>) when
|
|
44
|
+
/** Artifact ID for internal URL access (artifact://<id>) when output was persisted. */
|
|
22
45
|
artifactId?: string;
|
|
23
46
|
/** Bytes omitted from artifact storage after the artifact hard cap was reached. */
|
|
24
47
|
artifactTruncatedBytes?: number;
|
|
48
|
+
/** Bounded diagnostic when artifact writer or terminal publisher creation, write, finalization, or publication failed. */
|
|
49
|
+
artifactFailureDiagnostic?: string;
|
|
25
50
|
}
|
|
26
51
|
export interface OutputSinkOptions {
|
|
27
52
|
/**
|
|
@@ -30,6 +55,12 @@ export interface OutputSinkOptions {
|
|
|
30
55
|
*/
|
|
31
56
|
artifactPath?: string;
|
|
32
57
|
artifactId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional terminal publisher for managed artifact stores that do not expose a
|
|
60
|
+
* writable path. It is invoked only when visible spill/truncation requires an
|
|
61
|
+
* artifact, and receives raw content bounded by `artifactMaxBytes`.
|
|
62
|
+
*/
|
|
63
|
+
artifactPublisher?: TerminalArtifactPublisher;
|
|
33
64
|
/** Tail buffer budget (bytes). Default DEFAULT_MAX_BYTES. */
|
|
34
65
|
spillThreshold?: number;
|
|
35
66
|
/**
|
|
@@ -83,7 +114,10 @@ export interface TruncationResult {
|
|
|
83
114
|
elidedLines?: number;
|
|
84
115
|
lastLinePartial?: boolean;
|
|
85
116
|
firstLineExceedsLimit?: boolean;
|
|
117
|
+
lastLineExceedsLimit?: boolean;
|
|
86
118
|
}
|
|
119
|
+
/** Direction vocabulary used by callers that select which end of content to retain. */
|
|
120
|
+
export type TruncationDirection = "head" | "last" | "both";
|
|
87
121
|
export interface TruncationOptions {
|
|
88
122
|
/** Maximum number of lines (default: 3000) */
|
|
89
123
|
maxLines?: number;
|
|
@@ -99,6 +133,8 @@ export interface TruncationOptions {
|
|
|
99
133
|
* window receives `maxLines - maxHeadLines`. Default `floor(maxLines/2)`.
|
|
100
134
|
*/
|
|
101
135
|
maxHeadLines?: number;
|
|
136
|
+
/** Direction to dispatch through truncateContent (head, last, or both). */
|
|
137
|
+
direction?: TruncationDirection;
|
|
102
138
|
}
|
|
103
139
|
/** Result from byte-level truncation helpers. */
|
|
104
140
|
export interface ByteTruncationResult {
|
|
@@ -155,14 +191,64 @@ export declare function truncateTail(content: string, options?: TruncationOption
|
|
|
155
191
|
*/
|
|
156
192
|
export declare function formatMiddleElisionMarker(elidedLines: number, elidedBytes: number): string;
|
|
157
193
|
/**
|
|
158
|
-
*
|
|
194
|
+
* A retained source segment returned by {@link truncateMiddleWindows}.
|
|
195
|
+
* Line coordinates are 1-indexed and inclusive.
|
|
196
|
+
*/
|
|
197
|
+
export type ReadSegment = {
|
|
198
|
+
kind: "lines";
|
|
199
|
+
content: string;
|
|
200
|
+
lines: number;
|
|
201
|
+
bytes: number;
|
|
202
|
+
origin: {
|
|
203
|
+
startLine: number;
|
|
204
|
+
endLine: number;
|
|
205
|
+
};
|
|
206
|
+
lastLinePartial: false;
|
|
207
|
+
} | {
|
|
208
|
+
kind: "partial-line";
|
|
209
|
+
content: string;
|
|
210
|
+
lines: 1;
|
|
211
|
+
bytes: number;
|
|
212
|
+
origin: {
|
|
213
|
+
startLine: number;
|
|
214
|
+
endLine: number;
|
|
215
|
+
};
|
|
216
|
+
sourceLineBytes: number;
|
|
217
|
+
lastLinePartial: true;
|
|
218
|
+
};
|
|
219
|
+
/** The actual windows retained by middle truncation. */
|
|
220
|
+
export interface ReadWindow {
|
|
221
|
+
kind: "full" | "head-only" | "tail-only" | "middle";
|
|
222
|
+
head?: ReadSegment;
|
|
223
|
+
tail?: ReadSegment;
|
|
224
|
+
overlap: "disjoint" | "adjacent" | "overlapping";
|
|
225
|
+
elidedLines: number;
|
|
226
|
+
elidedBytes: number;
|
|
227
|
+
totalLines: number;
|
|
228
|
+
totalBytes: number;
|
|
229
|
+
/** @deprecated Non-enumerable compatibility reason for older consumers. */
|
|
230
|
+
truncatedBy?: "lines" | "bytes" | "middle";
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Truncate content while exposing the exact retained head/tail windows.
|
|
159
234
|
*
|
|
160
|
-
* The
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
235
|
+
* The budget split and fallback ordering intentionally mirror truncateMiddle.
|
|
236
|
+
* The overlap classification is performed before resolving an overlap to a
|
|
237
|
+
* full window, so callers can distinguish disjoint, adjacent and overlapping
|
|
238
|
+
* candidate windows even when no marker is needed.
|
|
239
|
+
*/
|
|
240
|
+
export declare function truncateMiddleWindows(content: string, options?: TruncationOptions): ReadWindow;
|
|
241
|
+
/**
|
|
242
|
+
* Truncate content keeping a head window and a tail window, eliding the middle.
|
|
243
|
+
* The composed return shape remains field-for-field compatible with the
|
|
244
|
+
* historical implementation; callers that need coordinates use
|
|
245
|
+
* truncateMiddleWindows directly.
|
|
164
246
|
*/
|
|
165
247
|
export declare function truncateMiddle(content: string, options?: TruncationOptions): TruncationResult;
|
|
248
|
+
/**
|
|
249
|
+
* Dispatch truncation using the caller-facing direction vocabulary.
|
|
250
|
+
*/
|
|
251
|
+
export declare function truncateContent(content: string, options?: TruncationOptions): TruncationResult;
|
|
166
252
|
export declare class TailBuffer {
|
|
167
253
|
#private;
|
|
168
254
|
readonly maxBytes: number;
|
|
@@ -186,12 +272,10 @@ export declare class OutputSink {
|
|
|
186
272
|
* minimizer rewrites the captured output after the raw bytes have already
|
|
187
273
|
* been streamed.
|
|
188
274
|
*
|
|
189
|
-
* After this call the
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* — which would otherwise reorder content and trip the middle-elision
|
|
194
|
-
* branch in `dump()` against stale totals.
|
|
275
|
+
* After this call the replacement is authoritative: counters reflect its full
|
|
276
|
+
* size, the configured head+tail byte windows are retained with UTF-8-safe
|
|
277
|
+
* boundaries, and future head accumulation is disabled so later `push()` calls
|
|
278
|
+
* append directly to the tail without reordering the replacement.
|
|
195
279
|
*/
|
|
196
280
|
replace(text: string): void;
|
|
197
281
|
dump(notice?: string): Promise<OutputSummary>;
|
|
@@ -48,6 +48,18 @@ export interface DiscoveryOptions {
|
|
|
48
48
|
env?: Record<string, string | undefined>;
|
|
49
49
|
/** Override the platform (defaults to `process.platform`). */
|
|
50
50
|
platform?: NodeJS.Platform;
|
|
51
|
+
/**
|
|
52
|
+
* Claude Code config directory holding `.credentials.json`.
|
|
53
|
+
*
|
|
54
|
+
* Defaults to the trusted `CLAUDE_CONFIG_DIR` value, else `<homeDir>/.claude`.
|
|
55
|
+
*/
|
|
56
|
+
claudeConfigDir?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Codex CLI home directory holding `auth.json`.
|
|
59
|
+
*
|
|
60
|
+
* Defaults to the trusted `CODEX_HOME` value, else `<homeDir>/.codex`.
|
|
61
|
+
*/
|
|
62
|
+
codexHome?: string;
|
|
51
63
|
/**
|
|
52
64
|
* Reader for the macOS Keychain `Claude Code-credentials` entry. Defaults to
|
|
53
65
|
* shelling out to `security`; injected in tests. Returns the raw JSON string,
|
|
@@ -45,8 +45,6 @@ export interface SkillActiveEntry {
|
|
|
45
45
|
handoff_at?: string;
|
|
46
46
|
active_subskills?: ActiveSubskillEntry[];
|
|
47
47
|
source_state_revision?: number;
|
|
48
|
-
/** Durable ordering token from the source workflow mode-state, not this cache file's revision. */
|
|
49
|
-
committed_mode_state_revision?: number;
|
|
50
48
|
}
|
|
51
49
|
export interface SkillActiveState {
|
|
52
50
|
version?: number;
|
|
@@ -87,11 +85,19 @@ export interface SyncSkillActiveStateOptions {
|
|
|
87
85
|
handoff_at?: string;
|
|
88
86
|
active_subskills?: ActiveSubskillEntry[];
|
|
89
87
|
sourceRevision?: number;
|
|
90
|
-
/** Durable ordering token from the source workflow mode-state, not this cache file's revision. */
|
|
91
|
-
committedModeRevision?: number;
|
|
92
88
|
}
|
|
93
89
|
export declare function normalizeWorkflowHudSummary(raw: unknown): WorkflowHudSummary | undefined;
|
|
94
90
|
export declare function isCanonicalGjcWorkflowSkill(skill: string): skill is CanonicalGjcWorkflowSkill;
|
|
91
|
+
/**
|
|
92
|
+
* Continuation inertness for compaction auto-continue, derived from each
|
|
93
|
+
* workflow's manifest contract: manifest-terminal and explicitly inert phases
|
|
94
|
+
* are inert; unknown skills or phases unknown to the skill's manifest are
|
|
95
|
+
* conservatively inert so a synthetic continuation never wakes an unrecognized
|
|
96
|
+
* workflow. Generic Ultragoal `blocked` remains continuation-active because its
|
|
97
|
+
* blocker may be autonomously resolvable; verified human pauses are represented
|
|
98
|
+
* by the inline goal's `paused` status instead.
|
|
99
|
+
*/
|
|
100
|
+
export declare function isWorkflowContinuationInert(skill: string, phase: string): boolean;
|
|
95
101
|
export declare function listActiveSkills(raw: unknown): SkillActiveEntry[];
|
|
96
102
|
export declare function normalizeSkillActiveState(raw: unknown): SkillActiveState | null;
|
|
97
103
|
export declare function getSkillActiveStatePaths(cwd: string, sessionId?: string): SkillActiveStatePaths;
|
|
@@ -99,6 +105,8 @@ export declare function collapsePlanningPipeline(entries: readonly SkillActiveEn
|
|
|
99
105
|
export type VisibleSkillActiveStateCacheTier = "security" | "hud";
|
|
100
106
|
export interface ReadVisibleSkillActiveStateOptions {
|
|
101
107
|
tier?: VisibleSkillActiveStateCacheTier;
|
|
108
|
+
/** Bypass all signature/TTL caches for authorization decisions. */
|
|
109
|
+
bypassCache?: boolean;
|
|
102
110
|
}
|
|
103
111
|
interface ActiveStateStatSignature {
|
|
104
112
|
path: string;
|
|
@@ -20,9 +20,18 @@ interface RalplanHudState extends WorkflowGateHudState {
|
|
|
20
20
|
iteration?: number;
|
|
21
21
|
iterationFromIndex?: number;
|
|
22
22
|
stages?: string;
|
|
23
|
+
architectPasses?: number;
|
|
24
|
+
criticPasses?: number;
|
|
25
|
+
reviewPassBudget?: number;
|
|
23
26
|
verdict?: string;
|
|
24
27
|
latestSummary?: string;
|
|
25
28
|
pendingApproval?: boolean;
|
|
29
|
+
autoHandoff?: {
|
|
30
|
+
configuredTarget: string;
|
|
31
|
+
effectiveTarget: string;
|
|
32
|
+
degradationReason: string | null;
|
|
33
|
+
};
|
|
34
|
+
planningStuck?: boolean;
|
|
26
35
|
updatedAt?: string;
|
|
27
36
|
}
|
|
28
37
|
interface UltragoalLikeGoal {
|
|
@@ -19,7 +19,7 @@ import { SessionManager } from "../session/session-manager";
|
|
|
19
19
|
import type { ContextFileEntry } from "../tools";
|
|
20
20
|
import type { EventBus } from "../utils/event-bus";
|
|
21
21
|
import type { WorkspaceTree } from "../workspace-tree";
|
|
22
|
-
import { type AgentDefinition, type AgentProgress, type
|
|
22
|
+
import { type AgentDefinition, type AgentProgress, type SingleResult } from "./types";
|
|
23
23
|
import { type ExecutorExecutionMode } from "./ultragoal-redteam-activation";
|
|
24
24
|
export declare function trimForkContextSeedForModel(seed: ForkContextSeed, model: Model | undefined): ForkContextSeed;
|
|
25
25
|
/** Options for subagent execution */
|
|
@@ -79,6 +79,8 @@ export interface ExecutorOptions {
|
|
|
79
79
|
* subagents, and a main-model fast-mode auto-disable does not clobber it.
|
|
80
80
|
*/
|
|
81
81
|
inheritedServiceTier?: ServiceTier;
|
|
82
|
+
/** Resolve whether the effective subagent tier grants fast mode for the selected provider. */
|
|
83
|
+
isFastForSubagentProvider?: (provider?: string) => boolean;
|
|
82
84
|
/** Override local:// protocol options so subagent shares parent's local:// root */
|
|
83
85
|
localProtocolOptions?: LocalProtocolOptions;
|
|
84
86
|
/**
|
|
@@ -122,7 +124,6 @@ interface FinalizeSubprocessOutputArgs {
|
|
|
122
124
|
doneAborted: boolean;
|
|
123
125
|
signalAborted: boolean;
|
|
124
126
|
yieldItems?: YieldItem[];
|
|
125
|
-
reportFindings?: ReviewFinding[];
|
|
126
127
|
outputSchema: unknown;
|
|
127
128
|
}
|
|
128
129
|
interface FinalizeSubprocessOutputResult {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core";
|
|
2
2
|
import type { Model } from "@gajae-code/ai";
|
|
3
3
|
import type { ToolSession } from "..";
|
|
4
|
+
import { type SubagentRunOutcome } from "../async";
|
|
4
5
|
import type { Theme } from "../modes/theme/theme";
|
|
5
|
-
import { type TaskToolDetails, type TaskToolSchemaInstance } from "./types";
|
|
6
|
+
import { type SingleResult, type TaskToolDetails, type TaskToolSchemaInstance } from "./types";
|
|
6
7
|
import "../tools/review";
|
|
7
8
|
import { renderResult, renderCall as renderTaskCall } from "./render";
|
|
9
|
+
export declare function subagentRunOutcomeFromSingleResult(finalText: string, singleResult: Pick<SingleResult, "aborted" | "exitCode" | "paused" | "setupFailure"> | undefined): string | SubagentRunOutcome;
|
|
8
10
|
export { loadBundledAgents as BUNDLED_AGENTS } from "./agents";
|
|
9
11
|
export { discoverCommands, expandCommand, getCommand } from "./commands";
|
|
10
12
|
export { discoverAgents, getAgent } from "./discovery";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { AgentProgress, TaskToolDetails } from "./types";
|
|
2
2
|
export type ProviderRetryKind = NonNullable<AgentProgress["retryState"]>["kind"];
|
|
3
3
|
export declare function classifyProviderRetry(errorMessage: string): ProviderRetryKind;
|
|
4
|
+
/**
|
|
5
|
+
* Prefer typed transport facts when present; fall back to message regex for
|
|
6
|
+
* message-only callers that never received `transportFailure.providerCode`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function classifyProviderRetryFromTransport(facts: {
|
|
9
|
+
providerCode?: string;
|
|
10
|
+
errorMessage?: string;
|
|
11
|
+
}): ProviderRetryKind;
|
|
4
12
|
export declare function providerNameFromModel(model: string | undefined): string | undefined;
|
|
5
13
|
export declare function providerRetryPhaseLabel(kind: ProviderRetryKind): string;
|
|
6
14
|
export declare function providerProgressAgeLabel(retryState: NonNullable<AgentProgress["retryState"]>, nowMs: number): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SingleResult, type TaskToolDetails } from "./types";
|
|
1
|
+
import { type ReviewFindingsArtifactRef, type SingleResult, type TaskToolDetails } from "./types";
|
|
2
2
|
export interface TaskRoi {
|
|
3
3
|
tokens: number;
|
|
4
4
|
contextTokens?: number;
|
|
@@ -29,6 +29,7 @@ export interface TaskResultReceipt {
|
|
|
29
29
|
contextWindow?: number;
|
|
30
30
|
modelOverride?: string | string[];
|
|
31
31
|
modelSubstitutionWarning?: SingleResult["modelSubstitutionWarning"];
|
|
32
|
+
fastMode?: boolean;
|
|
32
33
|
usage?: SingleResult["usage"];
|
|
33
34
|
cost?: number;
|
|
34
35
|
usageCostBreakdownComplete?: true;
|
|
@@ -37,6 +38,9 @@ export interface TaskResultReceipt {
|
|
|
37
38
|
attempt: number;
|
|
38
39
|
errorSummary: string;
|
|
39
40
|
};
|
|
41
|
+
setupFailure?: {
|
|
42
|
+
summary: string;
|
|
43
|
+
};
|
|
40
44
|
errorSummary?: string;
|
|
41
45
|
abortSummary?: string;
|
|
42
46
|
preview: string;
|
|
@@ -55,6 +59,8 @@ export interface TaskResultReceipt {
|
|
|
55
59
|
severity?: string;
|
|
56
60
|
summary: string;
|
|
57
61
|
}>;
|
|
62
|
+
/** Canonical full-fidelity findings; inline summaries are display-only. */
|
|
63
|
+
findingsRef?: ReviewFindingsArtifactRef;
|
|
58
64
|
};
|
|
59
65
|
extractedToolCounts?: Record<string, number>;
|
|
60
66
|
forkContext?: SingleResult["forkContext"];
|
|
@@ -368,6 +368,13 @@ export interface ReviewFinding {
|
|
|
368
368
|
line_start: number;
|
|
369
369
|
line_end: number;
|
|
370
370
|
}
|
|
371
|
+
/** Durable full-fidelity review findings artifact associated with a task result. */
|
|
372
|
+
export interface ReviewFindingsArtifactRef {
|
|
373
|
+
uri: `artifact://${string}`;
|
|
374
|
+
sizeBytes: number;
|
|
375
|
+
sha256: string;
|
|
376
|
+
findingCount: number;
|
|
377
|
+
}
|
|
371
378
|
/** Review summary submitted by the reviewer agent */
|
|
372
379
|
export interface ReviewSummary {
|
|
373
380
|
overall_correctness: "correct" | "incorrect";
|
|
@@ -439,6 +446,8 @@ export interface AgentProgress {
|
|
|
439
446
|
durationMs: number;
|
|
440
447
|
modelOverride?: string | string[];
|
|
441
448
|
modelSubstitutionWarning?: ModelSubstitutionWarning;
|
|
449
|
+
/** Whether the resolved subagent model runs under the effective fast service tier. */
|
|
450
|
+
fastMode?: boolean;
|
|
442
451
|
/** Data extracted by registered subprocess tool handlers (keyed by tool name) */
|
|
443
452
|
extractedToolData?: Record<string, unknown[]>;
|
|
444
453
|
/**
|
|
@@ -469,6 +478,8 @@ export interface AgentProgress {
|
|
|
469
478
|
attempt: number;
|
|
470
479
|
errorMessage: string;
|
|
471
480
|
};
|
|
481
|
+
/** Safe diagnostic retained in terminal progress when setup fails before the first LLM request. */
|
|
482
|
+
setupFailure?: SetupFailureSummary;
|
|
472
483
|
/**
|
|
473
484
|
* Snapshot of the most recent `task` tool call's in-flight `TaskToolDetails`,
|
|
474
485
|
* captured from `tool_execution_update`. Lets the parent UI surface live
|
|
@@ -478,6 +489,12 @@ export interface AgentProgress {
|
|
|
478
489
|
*/
|
|
479
490
|
inflightTaskDetails?: TaskToolDetails;
|
|
480
491
|
}
|
|
492
|
+
/** Bounded diagnostic retained when subagent setup fails before an LLM request starts. */
|
|
493
|
+
export interface SetupFailureSummary {
|
|
494
|
+
summary: string;
|
|
495
|
+
}
|
|
496
|
+
/** Create a bounded diagnostic that preserves a setup failure's cause without exposing credentials or local paths. */
|
|
497
|
+
export declare function createSetupFailureSummary(error: unknown): SetupFailureSummary;
|
|
481
498
|
/** Result from a single agent execution */
|
|
482
499
|
export interface SingleResult {
|
|
483
500
|
index: number;
|
|
@@ -501,7 +518,11 @@ export interface SingleResult {
|
|
|
501
518
|
contextWindow?: number;
|
|
502
519
|
modelOverride?: string | string[];
|
|
503
520
|
modelSubstitutionWarning?: ModelSubstitutionWarning;
|
|
521
|
+
/** Whether the resolved subagent model ran under the effective fast service tier. */
|
|
522
|
+
fastMode?: boolean;
|
|
504
523
|
error?: string;
|
|
524
|
+
/** Safe diagnostic for a failure before the subagent sent its first LLM request. */
|
|
525
|
+
setupFailure?: SetupFailureSummary;
|
|
505
526
|
aborted?: boolean;
|
|
506
527
|
abortReason?: string;
|
|
507
528
|
paused?: boolean;
|
|
@@ -521,6 +542,8 @@ export interface SingleResult {
|
|
|
521
542
|
producedChanges?: boolean;
|
|
522
543
|
/** Data extracted by registered subprocess tool handlers (keyed by tool name) */
|
|
523
544
|
extractedToolData?: Record<string, unknown[]>;
|
|
545
|
+
/** Full wrapper-owned review evidence, kept separate from caller completion data. */
|
|
546
|
+
reviewFindingsRef?: ReviewFindingsArtifactRef;
|
|
524
547
|
/**
|
|
525
548
|
* Terminal retry failure, when the subagent exited because the auto-retry
|
|
526
549
|
* loop gave up (retry-after exceeded the cap, or all attempts exhausted).
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { WorkflowGateEmitter } from "../modes/shared/agent-wire/workflow-gate-broker";
|
|
10
10
|
import type { AskAnswerSource } from "./index";
|
|
11
|
-
/** Register `source` for `sessionId`. Returns a disposer that
|
|
11
|
+
/** Register `source` for `sessionId`. Returns a disposer that restores the prior source. */
|
|
12
12
|
export declare function registerAskAnswerSource(sessionId: string, source: AskAnswerSource): () => void;
|
|
13
|
-
/** The answer source for `sessionId`, if one is registered. */
|
|
13
|
+
/** The highest-priority answer source for `sessionId`, if one is registered. */
|
|
14
14
|
export declare function getAskAnswerSource(sessionId: string): AskAnswerSource | undefined;
|
|
15
15
|
/** Publish a session's current workflow-gate emitter after mode initialization. */
|
|
16
16
|
export declare function notifyWorkflowGateEmitterChanged(sessionId: string, emitter: WorkflowGateEmitter | undefined): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentToolContext } from "@gajae-code/agent-core";
|
|
2
|
-
import { type OutputSummary } from "../session/streaming-output";
|
|
2
|
+
import { type OutputSummary, type TerminalArtifactPublisher } from "../session/streaming-output";
|
|
3
3
|
export interface BashInteractiveResult extends OutputSummary {
|
|
4
4
|
exitCode: number | undefined;
|
|
5
5
|
cancelled: boolean;
|
|
@@ -13,4 +13,7 @@ export declare function runInteractiveBashPty(ui: NonNullable<AgentToolContext["
|
|
|
13
13
|
env?: Record<string, string>;
|
|
14
14
|
artifactPath?: string;
|
|
15
15
|
artifactId?: string;
|
|
16
|
+
artifactPublisher?: TerminalArtifactPublisher;
|
|
17
|
+
spillThreshold?: number;
|
|
18
|
+
headBytes?: number;
|
|
16
19
|
}): Promise<BashInteractiveResult>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core";
|
|
2
2
|
import type { Component } from "@gajae-code/tui";
|
|
3
3
|
import * as z from "zod/v4";
|
|
4
|
+
import { type BashArtifactSaveResult } from "../exec/bash-executor";
|
|
4
5
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
6
|
import { type Theme } from "../modes/theme/theme";
|
|
6
7
|
import type { ToolSession } from ".";
|
|
7
8
|
import { type OutputMeta } from "./output-meta";
|
|
8
9
|
export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
|
|
9
|
-
export
|
|
10
|
+
export type BashOriginalArtifactSaveResult = BashArtifactSaveResult;
|
|
11
|
+
export declare function saveBashOriginalArtifactForTests(session: ToolSession, originalText: string, onResult?: (result: BashOriginalArtifactSaveResult) => void): Promise<string | undefined>;
|
|
10
12
|
declare const bashSchemaBase: z.ZodObject<{
|
|
11
13
|
command: z.ZodString;
|
|
12
14
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -13,6 +13,13 @@ export declare const DEFAULT_VIEWPORT: {
|
|
|
13
13
|
export declare const BROWSER_PROTOCOL_TIMEOUT_MS = 60000;
|
|
14
14
|
export declare function loadPuppeteer(): Promise<typeof Puppeteer>;
|
|
15
15
|
export declare function loadPuppeteerInWorker(safeDir: string): Promise<typeof Puppeteer>;
|
|
16
|
+
/** Test seam: the browser launch overrides as resolved from trusted env. */
|
|
17
|
+
export declare function resolveBrowserEnvOverridesForTest(): {
|
|
18
|
+
executablePath: string | undefined;
|
|
19
|
+
proxy: string | undefined;
|
|
20
|
+
proxyBypassLoopback: boolean;
|
|
21
|
+
ignoreCertErrors: boolean;
|
|
22
|
+
};
|
|
16
23
|
export interface LaunchHeadlessOptions {
|
|
17
24
|
headless: boolean;
|
|
18
25
|
viewport?: {
|
|
@@ -4,6 +4,7 @@ import type { Settings } from "../config/settings";
|
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
7
|
+
import { type TruncationDirection } from "../session/streaming-output";
|
|
7
8
|
import type { RenderResult } from "../web/scrapers/types";
|
|
8
9
|
import { type OutputMeta } from "./output-meta";
|
|
9
10
|
export declare function isReadableUrlPath(value: string): boolean;
|
|
@@ -50,7 +51,12 @@ interface ReadUrlCacheEntry {
|
|
|
50
51
|
artifactId?: string;
|
|
51
52
|
details: ReadUrlToolDetails;
|
|
52
53
|
image?: FetchImagePayload;
|
|
54
|
+
/** Complete URL output, including its preamble and body. */
|
|
53
55
|
output: string;
|
|
56
|
+
/** UTF-16 code-unit offset of the preamble in `output`. */
|
|
57
|
+
preambleChars: number;
|
|
58
|
+
/** Offset of the preamble after `wrapUntrustedContent(output)` is persisted. */
|
|
59
|
+
wrappedPreambleChars?: number;
|
|
54
60
|
}
|
|
55
61
|
export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
|
|
56
62
|
path: string;
|
|
@@ -59,11 +65,21 @@ export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
|
|
|
59
65
|
ensureArtifact?: boolean;
|
|
60
66
|
preferCached?: boolean;
|
|
61
67
|
}): Promise<ReadUrlCacheEntry>;
|
|
68
|
+
export declare const WRAP_PREFIX_CHARS: number;
|
|
69
|
+
export declare function escapeUntrustedContent(content: string): string;
|
|
62
70
|
export declare function wrapUntrustedContent(content: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Remove only the outer URL-output wrapper before line pagination. The content
|
|
73
|
+
* remains escaped exactly as persisted; it is deliberately never unescaped.
|
|
74
|
+
*/
|
|
75
|
+
export declare function prepareReadUrlSelectorInput(output: string, preambleChars: number, wrappedPreambleChars?: number): {
|
|
76
|
+
text: string;
|
|
77
|
+
preambleChars: number;
|
|
78
|
+
};
|
|
63
79
|
export declare function executeReadUrl(session: ToolSession, params: {
|
|
64
80
|
path: string;
|
|
65
81
|
raw?: boolean;
|
|
66
|
-
}, signal?: AbortSignal): Promise<AgentToolResult<ReadUrlToolDetails>>;
|
|
82
|
+
}, signal?: AbortSignal, direction?: TruncationDirection): Promise<AgentToolResult<ReadUrlToolDetails>>;
|
|
67
83
|
/** Render URL read call (URL preview) */
|
|
68
84
|
export declare function renderReadUrlCall(args: {
|
|
69
85
|
path?: string;
|
|
@@ -134,7 +134,11 @@ export declare function setConfiguredImageModel(config: ImageProviderConfig | nu
|
|
|
134
134
|
export declare function getConfiguredImageModel(): ImageProviderConfig | null;
|
|
135
135
|
/** Resolve the effective image model for a configured provider */
|
|
136
136
|
export declare function resolveImageModel(provider: string, modelOverride: string | null): string;
|
|
137
|
+
/** Test seam: the Google image key fallback as resolved from trusted env. */
|
|
138
|
+
export declare function googleImageApiKeyFromEnvForTest(): string | undefined;
|
|
137
139
|
export declare function isOpenAIHostedImageModel(model: Model | undefined): model is Model;
|
|
140
|
+
/** Test seam: the image-request base URL as resolved from trusted env. */
|
|
141
|
+
export declare function getOpenAIImageBaseUrlForTest(model: Model, authCredentialType?: "api_key" | "oauth"): string;
|
|
138
142
|
export declare const imageGenTool: CustomTool<typeof imageGenSchema, ImageGenToolDetails>;
|
|
139
143
|
export declare function getImageGenTools(modelRegistry?: ModelRegistry, activeModel?: Model): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>>;
|
|
140
144
|
export declare function getImageGenToolsWithRegistry(modelRegistry: ModelRegistry, activeModel?: Model): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>>;
|
|
@@ -215,6 +215,8 @@ export interface ToolSession {
|
|
|
215
215
|
strictToolNames?: boolean;
|
|
216
216
|
/** Get artifacts directory for artifact:// URLs */
|
|
217
217
|
getArtifactsDir?: () => string | null;
|
|
218
|
+
/** Additional artifacts directories explicitly authorized for this session's tree (parent/child/sibling reads). Derived only from the explicitly adopted/shared `ArtifactManager`; never enumerates unrelated live sessions. */
|
|
219
|
+
getAuthorizedArtifactsDirs?: () => readonly string[];
|
|
218
220
|
/** Get the ArtifactManager backing this session (shared across parent + subagents). */
|
|
219
221
|
getArtifactManager?: () => ArtifactManager | null;
|
|
220
222
|
/** Allocate a new artifact path and ID for session-scoped truncated output. */
|
|
@@ -240,6 +242,8 @@ export interface ToolSession {
|
|
|
240
242
|
settings: Settings;
|
|
241
243
|
/** Live service-tier intent of the parent session, inherited by `inherit` subagents. */
|
|
242
244
|
serviceTier?: ServiceTier;
|
|
245
|
+
/** Whether the effective subagent tier grants fast mode for a resolved provider. */
|
|
246
|
+
isFastForSubagentProvider?: (provider?: string) => boolean;
|
|
243
247
|
/** Plan mode state (if active) */
|
|
244
248
|
getPlanModeState?: () => PlanModeState | undefined;
|
|
245
249
|
/** Goal mode state (if active or paused) */
|
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
import type { AgentTool } from "@gajae-code/agent-core";
|
|
8
8
|
import { type Settings } from "../config/settings";
|
|
9
9
|
import type { Theme } from "../modes/theme/theme";
|
|
10
|
-
import { type OutputSummary, type TruncationResult } from "../session/streaming-output";
|
|
10
|
+
import { type OutputSummary, type ReadWindow, type TruncationResult } from "../session/streaming-output";
|
|
11
11
|
/**
|
|
12
12
|
* Truncation metadata for the output notice.
|
|
13
13
|
*/
|
|
14
14
|
export interface TruncationMeta {
|
|
15
15
|
direction: "head" | "tail" | "middle";
|
|
16
|
+
/** Coordinate basis for shown/head/tail ranges. Omitted means file coordinates; "window" is the selected-range coordinate system. */
|
|
17
|
+
rangeBase?: "file" | "window";
|
|
18
|
+
noticeOwner?: "body";
|
|
16
19
|
truncatedBy: "lines" | "bytes" | "middle";
|
|
17
20
|
totalLines: number;
|
|
18
21
|
totalBytes: number;
|
|
@@ -33,12 +36,22 @@ export interface TruncationMeta {
|
|
|
33
36
|
start: number;
|
|
34
37
|
end: number;
|
|
35
38
|
};
|
|
39
|
+
/** Partial source-line preview retained by a directional window. */
|
|
40
|
+
partialLine?: {
|
|
41
|
+
line: number;
|
|
42
|
+
bytes: number;
|
|
43
|
+
sourceBytes: number;
|
|
44
|
+
};
|
|
36
45
|
/** Bytes elided from the middle. */
|
|
37
46
|
elidedBytes?: number;
|
|
38
47
|
/** Lines elided from the middle. */
|
|
39
48
|
elidedLines?: number;
|
|
40
|
-
/** Artifact ID
|
|
49
|
+
/** Artifact ID when output was persisted; completeness is tracked separately below. */
|
|
41
50
|
artifactId?: string;
|
|
51
|
+
/** Bytes omitted from an artifact after its hard storage cap was reached. */
|
|
52
|
+
artifactTruncatedBytes?: number;
|
|
53
|
+
/** Bounded diagnostic when artifact writer creation, write, or finalization failed. */
|
|
54
|
+
artifactFailureDiagnostic?: string;
|
|
42
55
|
/** Next offset for pagination (head truncation only) */
|
|
43
56
|
nextOffset?: number;
|
|
44
57
|
}
|
|
@@ -96,11 +109,14 @@ export interface TruncationOptions {
|
|
|
96
109
|
startLine?: number;
|
|
97
110
|
totalFileLines?: number;
|
|
98
111
|
artifactId?: string;
|
|
112
|
+
maxBytes?: number;
|
|
113
|
+
noticeOwner?: "body";
|
|
99
114
|
}
|
|
100
115
|
export interface TruncationSummaryOptions {
|
|
101
116
|
direction: "head" | "tail" | "middle";
|
|
102
117
|
startLine?: number;
|
|
103
118
|
totalFileLines?: number;
|
|
119
|
+
noticeOwner?: "body";
|
|
104
120
|
}
|
|
105
121
|
export interface TruncationTextOptions {
|
|
106
122
|
direction: "head" | "tail" | "middle";
|
|
@@ -108,6 +124,7 @@ export interface TruncationTextOptions {
|
|
|
108
124
|
totalBytes?: number;
|
|
109
125
|
maxBytes?: number;
|
|
110
126
|
artifactId?: string;
|
|
127
|
+
noticeOwner?: "body";
|
|
111
128
|
}
|
|
112
129
|
/**
|
|
113
130
|
* Fluent builder for OutputMeta.
|
|
@@ -125,7 +142,14 @@ export declare class OutputMetaBuilder {
|
|
|
125
142
|
#private;
|
|
126
143
|
/** Add truncation info from TruncationResult. No-op if not truncated. */
|
|
127
144
|
truncation(result: TruncationResult, options: TruncationOptions): this;
|
|
128
|
-
/** Add
|
|
145
|
+
/** Add metadata from the actual head/tail windows retained by middle truncation. */
|
|
146
|
+
truncationWindows(windows: ReadWindow, options?: {
|
|
147
|
+
artifactId?: string;
|
|
148
|
+
noticeOwner?: "body";
|
|
149
|
+
maxBytes?: number;
|
|
150
|
+
rangeBase?: "file" | "window";
|
|
151
|
+
}): this;
|
|
152
|
+
/** Add truncation info from OutputSummary. No-op if not truncated or artifact evidence is absent. */
|
|
129
153
|
truncationFromSummary(summary: OutputSummary, options: TruncationSummaryOptions): this;
|
|
130
154
|
/** Add truncation info from truncated output text. No-op if truncation not detected. */
|
|
131
155
|
truncationFromText(text: string, options: TruncationTextOptions): this;
|
|
@@ -158,6 +182,10 @@ export declare class OutputMetaBuilder {
|
|
|
158
182
|
/** Create a new OutputMetaBuilder. */
|
|
159
183
|
export declare function outputMeta(): OutputMetaBuilder;
|
|
160
184
|
export declare function formatFullOutputReference(artifactId: string): string;
|
|
185
|
+
/**
|
|
186
|
+
* Format an artifact reference without claiming completeness when storage was hard-capped.
|
|
187
|
+
*/
|
|
188
|
+
export declare function formatArtifactReference(artifactId: string, artifactTruncatedBytes?: number): string;
|
|
161
189
|
export declare function formatTruncationMetaNotice(truncation: TruncationMeta): string;
|
|
162
190
|
/**
|
|
163
191
|
* Format styled artifact reference with warning color and brackets.
|
|
@@ -191,6 +219,19 @@ export declare function stripOutputNotice(text: string, meta: OutputMeta | undef
|
|
|
191
219
|
* middle elision with the same per-user configuration.
|
|
192
220
|
*/
|
|
193
221
|
export declare function resolveOutputSinkHeadBytes(s: Settings | undefined): number;
|
|
222
|
+
export declare const BASH_DEFAULT_OUTPUT_TAIL_BYTES = 1024;
|
|
223
|
+
/**
|
|
224
|
+
* Bash uses a deliberately small tail window to nudge callers toward focused
|
|
225
|
+
* commands and dedicated search tools. An explicitly configured shared tail
|
|
226
|
+
* budget still wins.
|
|
227
|
+
*/
|
|
228
|
+
export declare function resolveBashOutputSinkTailBytes(s: Settings): number;
|
|
229
|
+
/**
|
|
230
|
+
* Bash keeps only the tail unless the user explicitly opts into the shared
|
|
231
|
+
* head-retention setting. Schema defaults still apply to other streaming
|
|
232
|
+
* tools without silently turning Bash back into middle-elision mode.
|
|
233
|
+
*/
|
|
234
|
+
export declare function resolveBashOutputSinkHeadBytes(s: Settings): number;
|
|
194
235
|
/**
|
|
195
236
|
* Resolve the per-line column cap from session settings. Shared by streaming
|
|
196
237
|
* executors (bash/python/ssh/eval via OutputSink) and the `read` tool's
|
|
@@ -112,6 +112,7 @@ export interface ToolScopeOptions {
|
|
|
112
112
|
rawPaths: string[];
|
|
113
113
|
cwd: string;
|
|
114
114
|
getArtifactsDir?: () => string | null;
|
|
115
|
+
getAuthorizedArtifactsDirs?: () => readonly string[];
|
|
115
116
|
/** Verb used in the "Cannot {action} internal URL without a backing file: …" message. */
|
|
116
117
|
internalUrlAction: string;
|
|
117
118
|
/** Collect absolute paths flagged immutable by their internal-URL handler. */
|