@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
|
@@ -12,6 +12,7 @@ export interface NotificationsEditorPreferences {
|
|
|
12
12
|
richDraftEnabled: boolean;
|
|
13
13
|
toolActivityEnabled: boolean;
|
|
14
14
|
streamingEnabled: boolean;
|
|
15
|
+
sound: "all" | "important" | "none";
|
|
15
16
|
}
|
|
16
17
|
/** Secret-safe snapshot used to render the Notifications tab. */
|
|
17
18
|
export interface NotificationsEditorState {
|
|
@@ -8,12 +8,11 @@ type ReadRenderArgs = {
|
|
|
8
8
|
file_path?: string;
|
|
9
9
|
sel?: string;
|
|
10
10
|
};
|
|
11
|
-
type ReadToolGroupOptions = {
|
|
12
|
-
showContentPreview?: boolean;
|
|
13
|
-
};
|
|
14
11
|
export declare class ReadToolGroupComponent extends Container implements ToolExecutionHandle {
|
|
15
12
|
#private;
|
|
16
|
-
constructor(options?:
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
showContentPreview?: boolean;
|
|
15
|
+
});
|
|
17
16
|
updateArgs(args: ReadRenderArgs, toolCallId?: string): void;
|
|
18
17
|
updateResult(result: {
|
|
19
18
|
content: Array<{
|
|
@@ -32,5 +31,6 @@ export declare class ReadToolGroupComponent extends Container implements ToolExe
|
|
|
32
31
|
*/
|
|
33
32
|
setManuallyExpanded(expanded: boolean): void;
|
|
34
33
|
getComponent(): Component;
|
|
34
|
+
consumeVisibleTranscriptChange(): boolean;
|
|
35
35
|
}
|
|
36
36
|
export {};
|
|
@@ -2,6 +2,24 @@ import type { KeyId } from "../../config/keybindings";
|
|
|
2
2
|
import type { SessionMessageEntry } from "../../session/session-manager";
|
|
3
3
|
import type { SessionObserverRegistry } from "../session-observer-registry";
|
|
4
4
|
import { type TranscriptViewerEntry, TranscriptViewerOverlay } from "./transcript-viewer-overlay";
|
|
5
|
+
export declare const __sessionObserverProjectionCounters: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
projectionFullRuns: number;
|
|
8
|
+
projectionIncrementalRuns: number;
|
|
9
|
+
sourceMessagesProjected: number;
|
|
10
|
+
projectedEntriesAppended: number;
|
|
11
|
+
resultPatchCount: number;
|
|
12
|
+
snapshot(): {
|
|
13
|
+
projectionFullRuns: number;
|
|
14
|
+
projectionIncrementalRuns: number;
|
|
15
|
+
sourceMessagesProjected: number;
|
|
16
|
+
projectedEntriesAppended: number;
|
|
17
|
+
resultPatchCount: number;
|
|
18
|
+
};
|
|
19
|
+
enable(): void;
|
|
20
|
+
disable(): void;
|
|
21
|
+
reset(): void;
|
|
22
|
+
};
|
|
5
23
|
/** Session-observer adapter. The shared viewer owns navigation and fold state. */
|
|
6
24
|
export declare class SessionObserverOverlayComponent extends TranscriptViewerOverlay {
|
|
7
25
|
#private;
|
|
@@ -9,4 +27,8 @@ export declare class SessionObserverOverlayComponent extends TranscriptViewerOve
|
|
|
9
27
|
refreshFromRegistry(): void;
|
|
10
28
|
handleInput(keyData: string): void;
|
|
11
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* This deliberately remains the eager full-history projection. PR2 owns projection
|
|
32
|
+
* virtualization/incrementalization; source acquisition above only controls snapshot safety.
|
|
33
|
+
*/
|
|
12
34
|
export declare function entriesFromMessages(entries: readonly SessionMessageEntry[]): TranscriptViewerEntry[];
|
|
@@ -3,6 +3,7 @@ import type { Effort } from "@gajae-code/ai";
|
|
|
3
3
|
import { type Component, Container } from "@gajae-code/tui";
|
|
4
4
|
import { type SettingPath } from "../../config/settings";
|
|
5
5
|
import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../config/settings-schema";
|
|
6
|
+
import type { GjcRuntimeSnapshotProvider } from "../../extensibility/gjc-plugins/runtime-quarantine";
|
|
6
7
|
import { type NotificationsEditorOperations } from "./notifications-settings-editor";
|
|
7
8
|
import type { StatusLineSegmentOptions } from "./tool-status-header";
|
|
8
9
|
/**
|
|
@@ -24,6 +25,14 @@ export interface SettingsRuntimeContext {
|
|
|
24
25
|
petAvailable?: boolean;
|
|
25
26
|
/** Terminal environment used to select unavailable-pet guidance. Omitted in production to use Bun.env. */
|
|
26
27
|
terminalEnv?: NodeJS.ProcessEnv;
|
|
28
|
+
/**
|
|
29
|
+
* Runtime evidence published by the session for the current activation
|
|
30
|
+
* generation. Omitted when no session published one, in which case the GJC
|
|
31
|
+
* Bundles tab honestly reports runtime status as unavailable.
|
|
32
|
+
*/
|
|
33
|
+
gjcRuntimeSnapshot?: GjcRuntimeSnapshotProvider;
|
|
34
|
+
/** Activation generation the published snapshot must match to be merged. */
|
|
35
|
+
gjcActivationGeneration?: number;
|
|
27
36
|
}
|
|
28
37
|
/** Status line settings subset for preview */
|
|
29
38
|
export interface StatusLinePreviewSettings {
|
|
@@ -58,6 +67,8 @@ export interface SettingsCallbacks {
|
|
|
58
67
|
getStatusLinePreview?: (width?: number) => string;
|
|
59
68
|
/** Called when plugins change */
|
|
60
69
|
onPluginsChanged?: () => void;
|
|
70
|
+
/** Called when an interactive setting cannot be committed. */
|
|
71
|
+
onError?: (message: string) => void;
|
|
61
72
|
/** Called when settings panel is closed */
|
|
62
73
|
onCancel: () => void;
|
|
63
74
|
}
|
|
@@ -5,6 +5,8 @@ export interface ToolExecutionOptions {
|
|
|
5
5
|
editFuzzyThreshold?: number;
|
|
6
6
|
editAllowFuzzy?: boolean;
|
|
7
7
|
hashlineAutoDropPureInsertDuplicates?: boolean;
|
|
8
|
+
/** Internal observer for visible asynchronous renderer mutations. */
|
|
9
|
+
onVisibleTranscriptMutation?: () => void;
|
|
8
10
|
}
|
|
9
11
|
export interface ToolExecutionHandle {
|
|
10
12
|
updateArgs(args: any, toolCallId?: string): void;
|
|
@@ -29,6 +31,11 @@ export interface ToolExecutionHandle {
|
|
|
29
31
|
* back to {@link setExpanded}.
|
|
30
32
|
*/
|
|
31
33
|
setManuallyExpanded?(expanded: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Internal capability for dispatchers that need exact synchronous visible-output
|
|
36
|
+
* detection. Optional so existing structural handles remain source compatible.
|
|
37
|
+
*/
|
|
38
|
+
consumeVisibleTranscriptChange?(): boolean;
|
|
32
39
|
}
|
|
33
40
|
/**
|
|
34
41
|
* Component that renders a tool call with its result (updateable)
|
|
@@ -52,6 +59,7 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
52
59
|
details?: any;
|
|
53
60
|
isError?: boolean;
|
|
54
61
|
}, isPartial?: boolean, _toolCallId?: string): void;
|
|
62
|
+
consumeVisibleTranscriptChange(): boolean;
|
|
55
63
|
/**
|
|
56
64
|
* Stop spinner animation and cleanup resources.
|
|
57
65
|
*/
|
|
@@ -29,13 +29,30 @@ export type TranscriptViewerOverlayOptions = {
|
|
|
29
29
|
footerControls?: string;
|
|
30
30
|
getEntryText?: (entry: TranscriptViewerEntry, expanded: boolean) => string;
|
|
31
31
|
};
|
|
32
|
+
export declare const __transcriptViewerPerfCounters: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
layoutCacheHits: number;
|
|
35
|
+
layoutCacheMisses: number;
|
|
36
|
+
refreshRuns: number;
|
|
37
|
+
rebuildRuns: number;
|
|
38
|
+
snapshot(): {
|
|
39
|
+
layoutCacheHits: number;
|
|
40
|
+
layoutCacheMisses: number;
|
|
41
|
+
refreshRuns: number;
|
|
42
|
+
rebuildRuns: number;
|
|
43
|
+
};
|
|
44
|
+
enable(): void;
|
|
45
|
+
disable(): void;
|
|
46
|
+
reset(): void;
|
|
47
|
+
};
|
|
32
48
|
/** Message-agnostic, modal transcript browser over resolved projection entries. */
|
|
33
49
|
export declare class TranscriptViewerOverlay extends Container {
|
|
34
50
|
#private;
|
|
35
51
|
constructor(options: TranscriptViewerOverlayOptions);
|
|
36
52
|
get selectedEntryId(): string | undefined;
|
|
37
53
|
get isFullscreen(): boolean;
|
|
38
|
-
refresh(identityMap?: ReadonlyMap<string, string
|
|
54
|
+
refresh(identityMap?: ReadonlyMap<string, string>, preserveLayoutCache?: boolean): void;
|
|
55
|
+
invalidateLayoutEntries(entryIds: readonly string[]): void;
|
|
39
56
|
render(width: number): string[];
|
|
40
57
|
handleMouse(event: MouseEvent): void;
|
|
41
58
|
handleInput(keyData: string): void;
|
|
@@ -3,7 +3,10 @@ import type { InteractiveModeContext } from "../../modes/types";
|
|
|
3
3
|
import type { AgentSessionEvent } from "../../session/agent-session";
|
|
4
4
|
/** Test-only performance counters for advisory baseline tests. */
|
|
5
5
|
export declare const __eventControllerPerfCounters: {
|
|
6
|
+
enabled: boolean;
|
|
6
7
|
messageUpdateContentVisits: number;
|
|
8
|
+
enable(): void;
|
|
9
|
+
disable(): void;
|
|
7
10
|
reset(): void;
|
|
8
11
|
};
|
|
9
12
|
export declare class EventController {
|
|
@@ -181,6 +181,8 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
181
181
|
}): Promise<void>;
|
|
182
182
|
flushPendingBashComponents(): void;
|
|
183
183
|
isKnownSlashCommand(text: string): boolean;
|
|
184
|
+
/** Advances the sticky-viewport source only for semantic transcript output. */
|
|
185
|
+
recordVisibleTranscriptMutation(): void;
|
|
184
186
|
addMessageToChat(message: AgentMessage, options?: {
|
|
185
187
|
populateHistory?: boolean;
|
|
186
188
|
}): Component[];
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { ParsedIrcMessage } from "./utils/irc-message";
|
|
2
2
|
type InlineMode = "persistent" | "ephemeral";
|
|
3
|
+
export declare const IRC_OBSERVATION_LEDGER_MAX_RECORDS = 10000;
|
|
4
|
+
export declare const IRC_OBSERVATION_LEDGER_MAX_RETAINED_UTF8_BYTES: number;
|
|
5
|
+
export declare const IRC_OBSERVATION_LEDGER_MAX_SEEN_IDENTITIES = 100000;
|
|
6
|
+
export declare const __ircLedgerPerfCounters: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
epochAdvances: number;
|
|
9
|
+
snapshot(): {
|
|
10
|
+
epochAdvances: number;
|
|
11
|
+
};
|
|
12
|
+
enable(): void;
|
|
13
|
+
disable(): void;
|
|
14
|
+
reset(): void;
|
|
15
|
+
};
|
|
3
16
|
export type IrcObservationRecord = Readonly<ParsedIrcMessage & {
|
|
4
17
|
mode: InlineMode;
|
|
5
18
|
observedAt: number;
|
|
@@ -10,6 +23,7 @@ export type IrcObservationRecord = Readonly<ParsedIrcMessage & {
|
|
|
10
23
|
/** Runtime-only IRC observations. This intentionally has no persistence layer. */
|
|
11
24
|
export declare class IrcObservationLedger {
|
|
12
25
|
#private;
|
|
26
|
+
get mutationEpoch(): number;
|
|
13
27
|
/** Inline observations expire after 10 seconds; closed-panel observations persist inline. */
|
|
14
28
|
observe(message: ParsedIrcMessage, panelVisibleAtObservation: boolean): IrcObservationRecord | undefined;
|
|
15
29
|
getRecord(observationId: string): IrcObservationRecord | undefined;
|
|
@@ -17,6 +31,8 @@ export declare class IrcObservationLedger {
|
|
|
17
31
|
getInlineProjection(now: number): readonly IrcObservationRecord[];
|
|
18
32
|
/** Returns and clears IDs whose retained payload was released. */
|
|
19
33
|
drainEvictedObservationIds(): readonly string[];
|
|
20
|
-
reset(
|
|
34
|
+
reset(options?: {
|
|
35
|
+
retireCurrentSessionIdentities?: boolean;
|
|
36
|
+
}): void;
|
|
21
37
|
}
|
|
22
38
|
export {};
|
|
@@ -218,6 +218,8 @@ export interface InteractiveModeContext {
|
|
|
218
218
|
getAssistantViewportAnchorId?(message: AssistantMessage): string;
|
|
219
219
|
findLastAssistantMessage(): AssistantMessage | undefined;
|
|
220
220
|
extractAssistantText(message: AssistantMessage): string;
|
|
221
|
+
/** Records one semantic visible-transcript mutation for the sticky viewport. */
|
|
222
|
+
recordVisibleTranscriptMutation?(): void;
|
|
221
223
|
updateEditorTopBorder(): void;
|
|
222
224
|
updateEditorBorderColor(): void;
|
|
223
225
|
rebuildChatFromMessages(policy: TranscriptRebuildPolicy): void;
|
|
@@ -6,6 +6,22 @@ import { type SessionContext } from "../../session/session-manager";
|
|
|
6
6
|
import { type ParsedIrcMessage } from "./irc-message";
|
|
7
7
|
export type { TranscriptRebuildPolicy } from "../../modes/types";
|
|
8
8
|
export declare function prepareTranscriptRebuild(ui: TUI, policy: TranscriptRebuildPolicy): void;
|
|
9
|
+
export declare const RESUME_PROGRESS_COMMIT_TIMEOUT_MS = 250;
|
|
10
|
+
export interface ResumeProgressLease {
|
|
11
|
+
readonly committed: Promise<boolean>;
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Mount a resume loader on the live status rail and wait for its render generation
|
|
16
|
+
* to commit before session I/O begins. The commit is advisory: a stopped or
|
|
17
|
+
* unavailable terminal resolves false and callers continue without blocking.
|
|
18
|
+
*
|
|
19
|
+
* Fail open (no-op lease, committed=false) when the status rail or UI lacks the
|
|
20
|
+
* child-mutation/render-commit surface required to mount progress. Headless and
|
|
21
|
+
* minimal controller contexts keep resume/migration semantics; full interactive
|
|
22
|
+
* TUI containers retain progress-before-switch.
|
|
23
|
+
*/
|
|
24
|
+
export declare function acquireResumeProgressLease(ctx: Pick<InteractiveModeContext, "ui" | "statusContainer">): ResumeProgressLease;
|
|
9
25
|
interface RenderInitialMessagesOptions {
|
|
10
26
|
preserveExistingChat?: boolean;
|
|
11
27
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ImageContent } from "@gajae-code/ai";
|
|
2
2
|
import type { CustomMessage } from "../session/messages";
|
|
3
|
+
import { type GhResult, type RunGh, runGhDefault } from "../utils/gh";
|
|
4
|
+
export type { GhResult, RunGh };
|
|
5
|
+
export { runGhDefault };
|
|
3
6
|
export declare const STAR_REMINDER_REPO = "Yeachan-Heo/gajae-code";
|
|
4
7
|
export declare const STAR_REMINDER_CUSTOM_TYPE = "star-reminder";
|
|
5
8
|
export declare const STARRED_CACHE_TTL_MS: number;
|
|
@@ -10,15 +13,6 @@ export interface StarReminderState {
|
|
|
10
13
|
starredCheckedAt: string;
|
|
11
14
|
}
|
|
12
15
|
export type StarCheckStatus = "starred" | "unstarred" | "unavailable";
|
|
13
|
-
export interface GhResult {
|
|
14
|
-
exitCode: number;
|
|
15
|
-
stdout: string;
|
|
16
|
-
stderr: string;
|
|
17
|
-
timedOut?: boolean;
|
|
18
|
-
}
|
|
19
|
-
export type RunGh = (args: string[], options?: {
|
|
20
|
-
timeoutMs?: number;
|
|
21
|
-
}) => Promise<GhResult>;
|
|
22
16
|
export interface StarReminderDeps {
|
|
23
17
|
statePath?: string;
|
|
24
18
|
now?: () => Date;
|
|
@@ -49,10 +43,6 @@ export declare function recordStarredFromPut(deps?: StarReminderDeps): Promise<S
|
|
|
49
43
|
export declare function recordFreshStarCheck(status: "starred" | "unstarred", deps?: StarReminderDeps): Promise<StarReminderState>;
|
|
50
44
|
/** Record a launch-nudge decline. Never downgrades a confirmed star. */
|
|
51
45
|
export declare function recordDeclinedAfterNo(deps?: StarReminderDeps): Promise<StarReminderState>;
|
|
52
|
-
/** Default `gh` runner. Returns an unavailable-style result instead of throwing. */
|
|
53
|
-
export declare function runGhDefault(args: string[], options?: {
|
|
54
|
-
timeoutMs?: number;
|
|
55
|
-
}): Promise<GhResult>;
|
|
56
46
|
/** Classify the star state of the repo via `gh api`. */
|
|
57
47
|
export declare function checkGhStarred(deps?: StarReminderDeps): Promise<StarCheckStatus>;
|
|
58
48
|
/** Star the repo via `gh api -X PUT`. Returns whether the PUT succeeded. */
|
|
@@ -6,6 +6,7 @@ import type { MCPToolDetails } from "./tool-bridge";
|
|
|
6
6
|
import type { MCPToolCache } from "./tool-cache";
|
|
7
7
|
import type { MCPGetPromptResult, MCPPrompt, MCPRequestOptions, MCPResource, MCPResourceReadResult, MCPResourceTemplate, MCPServerConfig, MCPServerConnection } from "./types";
|
|
8
8
|
export declare function resolveStartupTimeoutMs(configs: MCPServerConfig[], maxStartupTimeoutMs?: number): number;
|
|
9
|
+
export declare function resolveExactConfigStartupTimeoutMs(configs: MCPServerConfig[]): number;
|
|
9
10
|
/**
|
|
10
11
|
* Stable, total ordering on MCP tools by name.
|
|
11
12
|
*
|
|
@@ -7,6 +7,11 @@ type SmitheryCliPollResponse = {
|
|
|
7
7
|
apiKey?: string;
|
|
8
8
|
message?: string;
|
|
9
9
|
};
|
|
10
|
+
/** Test seam: the Smithery origin and env API key as resolved from trusted env. */
|
|
11
|
+
export declare function resolveSmitheryEnvForTest(): {
|
|
12
|
+
url: string;
|
|
13
|
+
apiKey: string | undefined;
|
|
14
|
+
};
|
|
10
15
|
export declare function getSmitheryLoginUrl(): string;
|
|
11
16
|
export declare function createSmitheryCliAuthSession(): Promise<SmitheryCliAuthSession>;
|
|
12
17
|
export declare function pollSmitheryCliAuthSession(sessionId: string, signal?: AbortSignal): Promise<SmitheryCliPollResponse>;
|
|
@@ -2,7 +2,9 @@ import { SdkClient, SdkClientError, type SdkFrame } from "../client";
|
|
|
2
2
|
type JsonObject = Record<string, unknown>;
|
|
3
3
|
/** The small agent-side ACP surface used for reverse requests. */
|
|
4
4
|
export interface AcpReverseConnection {
|
|
5
|
-
request?(method: string, params: JsonObject
|
|
5
|
+
request?(method: string, params: JsonObject, options?: {
|
|
6
|
+
cancellationSignal?: AbortSignal;
|
|
7
|
+
}): Promise<unknown>;
|
|
6
8
|
[key: string]: unknown;
|
|
7
9
|
}
|
|
8
10
|
export interface AcpProviderRegistration {
|
|
@@ -73,6 +73,11 @@ export interface SessionLifecycleLaunchRequest {
|
|
|
73
73
|
export declare function readSessionLifecycleLaunchRequest(value: string | undefined, now?: number): SessionLifecycleLaunchRequest;
|
|
74
74
|
type CleanupEvidence = BrokerCleanupEvidence;
|
|
75
75
|
export declare function validateBrokerModelPresetForTest(agentDir: string, requestedProfile: string): string | BrokerResponse;
|
|
76
|
+
/** Test seam: the session-host command override as resolved from trusted env. */
|
|
77
|
+
export declare function sdkSessionCommandOverrideForTest(): {
|
|
78
|
+
file: string;
|
|
79
|
+
args: string[];
|
|
80
|
+
} | undefined;
|
|
76
81
|
export declare function setProcessIncarnationForTest(broker: Broker, value: ((pid: number) => string | undefined) | undefined): void;
|
|
77
82
|
/** The child writes this only after its endpoint and semantic ready event are both live. */
|
|
78
83
|
export declare function writeSessionLifecycleReady(root: string, id: string, effectMarker: string): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Broker } from "./broker";
|
|
2
|
+
export type BrokerShutdownSendAction = "dropped" | "wait_for_drain" | "close";
|
|
3
|
+
export declare function brokerShutdownSendAction(status: number): BrokerShutdownSendAction;
|
|
2
4
|
/** Loopback-only WebSocket transport for the agent-global SDK broker. */
|
|
3
5
|
export declare class BrokerTransport {
|
|
4
6
|
#private;
|
|
@@ -16,7 +16,10 @@ export type ChatDaemonAction = "stop" | "reload";
|
|
|
16
16
|
* when deleting an observed owner-lock lease. Generation 12 refreshes retained
|
|
17
17
|
* native path and process authority semantics. Generation 13 rejects special
|
|
18
18
|
* files before retained native authority opens. Generation 14 reloads shared
|
|
19
|
-
* chat daemons after notification configuration parsing changes.
|
|
19
|
+
* chat daemons after notification configuration parsing changes. Generation 15
|
|
20
|
+
* applies the current notification configuration directly when starting chat
|
|
21
|
+
* daemon transports. Generation 16 applies Telegram sound-policy configuration
|
|
22
|
+
* through shared notification parsing.
|
|
20
23
|
*/
|
|
21
24
|
export declare const CHAT_DAEMON_GENERATIONS: Readonly<Record<ChatDaemonKind, number>>;
|
|
22
25
|
export declare function chatDaemonGeneration(kind: ChatDaemonKind): number;
|
|
@@ -28,6 +28,7 @@ export interface NotificationSettingsSnapshot {
|
|
|
28
28
|
botToken?: string;
|
|
29
29
|
chatId?: string;
|
|
30
30
|
activation?: Record<string, unknown>;
|
|
31
|
+
sound: "all" | "important" | "none";
|
|
31
32
|
btw: {
|
|
32
33
|
enabled: boolean;
|
|
33
34
|
};
|
|
@@ -105,6 +106,7 @@ export interface NotificationConfig {
|
|
|
105
106
|
* (those carrying {@link SPAWN_PROVENANCE_ENV}) unless they explicitly opt in.
|
|
106
107
|
*/
|
|
107
108
|
sessionScope: "all" | "primary";
|
|
109
|
+
sound: "all" | "important" | "none";
|
|
108
110
|
idleTimeoutMs: number;
|
|
109
111
|
btw: {
|
|
110
112
|
enabled: boolean;
|
|
@@ -177,7 +179,7 @@ export declare function isTelegramConfigured(cfg: NotificationConfig): cfg is No
|
|
|
177
179
|
chatId: string;
|
|
178
180
|
};
|
|
179
181
|
/** Is Discord configured with all credentials and routing identifiers required by its daemon. */
|
|
180
|
-
export declare function isDiscordConfigured(cfg: NotificationConfig): cfg is NotificationConfig & {
|
|
182
|
+
export declare function isDiscordConfigured(cfg: Pick<NotificationConfig, "enabled" | "discord">): cfg is Pick<NotificationConfig, "enabled"> & {
|
|
181
183
|
discord: {
|
|
182
184
|
botToken: string;
|
|
183
185
|
applicationId: string;
|
|
@@ -186,7 +188,7 @@ export declare function isDiscordConfigured(cfg: NotificationConfig): cfg is Not
|
|
|
186
188
|
};
|
|
187
189
|
};
|
|
188
190
|
/** Is Slack configured with both SDK tokens and its workspace/channel routing identifiers. */
|
|
189
|
-
export declare function isSlackConfigured(cfg: NotificationConfig): cfg is NotificationConfig & {
|
|
191
|
+
export declare function isSlackConfigured(cfg: Pick<NotificationConfig, "enabled" | "slack">): cfg is Pick<NotificationConfig, "enabled"> & {
|
|
190
192
|
slack: {
|
|
191
193
|
botToken: string;
|
|
192
194
|
appToken: string;
|
|
@@ -286,6 +288,8 @@ export interface RedactableAction {
|
|
|
286
288
|
workflowGateId?: string;
|
|
287
289
|
question?: string;
|
|
288
290
|
options?: string[];
|
|
291
|
+
/** Selected zero-based option positions for transport-specific multi-select rendering. */
|
|
292
|
+
selectedOptionIndices?: number[];
|
|
289
293
|
summary?: string;
|
|
290
294
|
/** Optional zero-based recommendation into the authoritative raw options. */
|
|
291
295
|
recommendedIndex?: number;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordering seam for an in-band SDK identity transition.
|
|
3
|
+
*
|
|
4
|
+
* A request arrives through predecessor A, so a successful terminal response cannot
|
|
5
|
+
* be published until successor B is ready. Native builds may provide a true
|
|
6
|
+
* send-only connection lease; source/dev builds use the conservative fallback in
|
|
7
|
+
* which the predecessor server remains alive until the terminal write completes.
|
|
8
|
+
*/
|
|
9
|
+
export type TerminalSendOutcome = "written" | "disconnected" | "write_failed";
|
|
10
|
+
/** Fence/capability hooks may return false to reject; undefined means ok. */
|
|
11
|
+
export type IdentityControlGateResult = boolean | undefined;
|
|
12
|
+
export type IdentityControlGate = () => IdentityControlGateResult | Promise<IdentityControlGateResult>;
|
|
13
|
+
export interface IdentityControlSuccessPathInput {
|
|
14
|
+
/** Fence predecessor inbound work. The fence must not close its response writer. */
|
|
15
|
+
fence: IdentityControlGate;
|
|
16
|
+
/** Optional explicit proof that the predecessor writer is still usable. */
|
|
17
|
+
ensurePredecessorSendCapable?: IdentityControlGate;
|
|
18
|
+
/** Start successor B and resolve only after its public endpoint is ready. */
|
|
19
|
+
startSuccessor: () => Promise<void>;
|
|
20
|
+
/** Write and flush either the success or non-success terminal response. */
|
|
21
|
+
sendTerminal: () => Promise<TerminalSendOutcome>;
|
|
22
|
+
/** Release predecessor A after the terminal response has settled. */
|
|
23
|
+
stopPredecessor: () => Promise<void>;
|
|
24
|
+
/** Set only when a caller cannot use the retained-writer fallback. */
|
|
25
|
+
requireNativeControlDrain?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface IdentityControlTerminalPathInput {
|
|
28
|
+
fenceInbound: IdentityControlGate;
|
|
29
|
+
ensurePredecessorSendCapable?: IdentityControlGate;
|
|
30
|
+
startSuccessorReady: () => Promise<void>;
|
|
31
|
+
sendTerminal: () => Promise<TerminalSendOutcome>;
|
|
32
|
+
stopPredecessor: () => Promise<void>;
|
|
33
|
+
requireNativeControlDrain?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Probe the loaded native addon, never an environment flag or a TypeScript shim.
|
|
37
|
+
* Older/source installs intentionally report false so callers can select the
|
|
38
|
+
* retained-writer fallback or fail closed when detach is mandatory.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isNativeControlDrainAvailable(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Run the only safe ordering for a successful identity-control response.
|
|
43
|
+
*
|
|
44
|
+
* The `finally` is deliberately around both successor startup and terminal
|
|
45
|
+
* delivery: a failed startup must not leave the fenced predecessor alive, and a
|
|
46
|
+
* failed/disconnected terminal write must still release it. When native detach
|
|
47
|
+
* is unavailable the caller is expected to keep A's server up (not call
|
|
48
|
+
* `stopAndWait`) until `sendTerminal` settles.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runIdentityControlSuccessPath(input: IdentityControlSuccessPathInput): Promise<TerminalSendOutcome>;
|
|
51
|
+
/** Compatibility spelling used by the host wiring design notes. */
|
|
52
|
+
export declare function runIdentityControlTerminalPath(input: IdentityControlTerminalPathInput): Promise<TerminalSendOutcome>;
|
|
@@ -26,10 +26,13 @@ import type { AgentSessionEvent } from "../../session/agent-session";
|
|
|
26
26
|
import type { AskAnswerSourceResult, AskRemoteControl } from "../../tools";
|
|
27
27
|
import { SessionSdkHost } from "../host";
|
|
28
28
|
import { CursorRegistry, RevisionStore } from "../host/query";
|
|
29
|
+
import { type SdkPromptTerminalOutcome } from "../prompt-status";
|
|
29
30
|
import { type SdkStartupFailure } from "../startup-capability";
|
|
30
31
|
import { type NotificationConfig } from "./config";
|
|
31
32
|
import { NotificationSessionController } from "./session-control";
|
|
32
33
|
import { type EnsureDaemonResult, type RegisterNotificationRootResult } from "./telegram-daemon";
|
|
34
|
+
export type { IdentityControlSuccessPathInput, IdentityControlTerminalPathInput, TerminalSendOutcome, } from "./control-drain-lease";
|
|
35
|
+
export { isNativeControlDrainAvailable, runIdentityControlSuccessPath, runIdentityControlTerminalPath, } from "./control-drain-lease";
|
|
33
36
|
/** Where a `session_create` should run. Discriminated by `kind`. */
|
|
34
37
|
export type SessionCreateTarget = {
|
|
35
38
|
kind: "existing_path";
|
|
@@ -297,6 +300,8 @@ interface SessionRuntime {
|
|
|
297
300
|
disposeGateListener: () => void;
|
|
298
301
|
/** Whether notification-only delivery and answer resources are active. */
|
|
299
302
|
notificationsActive: boolean;
|
|
303
|
+
/** Rejects new SDK frames while a leased terminal response drains. */
|
|
304
|
+
inboundFenced: boolean;
|
|
300
305
|
/** Set as soon as terminal teardown is requested, before startup settles. */
|
|
301
306
|
stopping: boolean;
|
|
302
307
|
/** Recreates notification-only resources after `/notify on`. */
|
|
@@ -344,6 +349,23 @@ interface SessionRuntime {
|
|
|
344
349
|
commandId: string;
|
|
345
350
|
turnId: string;
|
|
346
351
|
};
|
|
352
|
+
/** Binds the executing Agent run to a correlated prompt so cleanup targets only it. */
|
|
353
|
+
bindPromptExecutionHandle: (correlation: {
|
|
354
|
+
commandId: string;
|
|
355
|
+
turnId: string;
|
|
356
|
+
}, handle: string | undefined) => void;
|
|
357
|
+
/** Reads the durable non-terminal claim for a correlated prompt, if any. */
|
|
358
|
+
peekPromptPendingOutcome: (correlation: {
|
|
359
|
+
commandId: string;
|
|
360
|
+
turnId: string;
|
|
361
|
+
}) => SdkPromptTerminalOutcome | undefined;
|
|
362
|
+
/** Claims, fences, finalizes, and publishes exactly one normalized prompt terminal. */
|
|
363
|
+
terminalizePrompt: (correlation: {
|
|
364
|
+
commandId: string;
|
|
365
|
+
turnId: string;
|
|
366
|
+
}, outcome: SdkPromptTerminalOutcome, extra?: {
|
|
367
|
+
finalText?: string;
|
|
368
|
+
}) => Promise<void>;
|
|
347
369
|
/** Records a correlated prompt terminal boundary after agent unwind. */
|
|
348
370
|
/** Atomically claims a correlated prompt terminal boundary after agent unwind. */
|
|
349
371
|
recordPromptTerminal: (correlation: {
|
|
@@ -375,6 +397,7 @@ interface SessionRuntime {
|
|
|
375
397
|
commandId?: string;
|
|
376
398
|
turnId?: string;
|
|
377
399
|
finalText?: string;
|
|
400
|
+
outcome?: SdkPromptTerminalOutcome;
|
|
378
401
|
} | {
|
|
379
402
|
type: "agent_failed";
|
|
380
403
|
sessionId: string;
|
|
@@ -384,6 +407,7 @@ interface SessionRuntime {
|
|
|
384
407
|
code: string;
|
|
385
408
|
message: string;
|
|
386
409
|
};
|
|
410
|
+
outcome?: SdkPromptTerminalOutcome;
|
|
387
411
|
}) => void;
|
|
388
412
|
/** Publishes one canonical agent-wire event to the client that owns the active prompt. */
|
|
389
413
|
emitPromptEvent: (event: AgentSessionEvent) => void;
|
|
@@ -442,6 +466,15 @@ type SessionStartResult = {
|
|
|
442
466
|
failure?: SdkStartupFailure;
|
|
443
467
|
suppressExtensionError?: boolean;
|
|
444
468
|
};
|
|
469
|
+
/**
|
|
470
|
+
* Whether the notifications control channel is enabled.
|
|
471
|
+
*
|
|
472
|
+
* Trusted sources only: enabling it opens the session control/answer channel, so
|
|
473
|
+
* a repository must not be able to turn it on. `$env` merges the caller's
|
|
474
|
+
* `cwd/.env` into `process.env`; the sibling resolvers in `config.ts` and
|
|
475
|
+
* `session-control.ts` already read an injected env record rather than the merged
|
|
476
|
+
* view, and this direct read was the outlier.
|
|
477
|
+
*/
|
|
445
478
|
export declare function notificationsEnabled(): boolean;
|
|
446
479
|
/** Workflow-gate answer shape. */
|
|
447
480
|
interface GateAnswer {
|
|
@@ -513,6 +546,17 @@ export declare class EphemeralTurnHost {
|
|
|
513
546
|
* an identity for a transport that never became available is false success.
|
|
514
547
|
*/
|
|
515
548
|
export declare function ensureConfiguredProviderDaemons(settings: Settings, cfg: NotificationConfig, ensureProviderDaemon?: (provider: "discord" | "slack", settings: Settings) => Promise<unknown>): Promise<void>;
|
|
549
|
+
/**
|
|
550
|
+
* Classify whether a session identity event must await notification endpoint startup.
|
|
551
|
+
* Only an interactive selector resume may defer this ancillary startup; all other
|
|
552
|
+
* events, including branches and unknown origins, fail closed to awaiting it.
|
|
553
|
+
*/
|
|
554
|
+
export declare function shouldAwaitNotificationStartup(event: {
|
|
555
|
+
type: "session_switch" | "session_branch";
|
|
556
|
+
transition?: {
|
|
557
|
+
origin: string;
|
|
558
|
+
};
|
|
559
|
+
}): boolean;
|
|
516
560
|
export declare function createNotificationsExtension(api: ExtensionAPI, options?: {
|
|
517
561
|
settings?: Settings;
|
|
518
562
|
ensureTelegramDaemon?: (input: {
|
|
@@ -539,4 +583,3 @@ export declare function createNotificationsExtension(api: ExtensionAPI, options?
|
|
|
539
583
|
readNotificationFile?: (path: string) => Promise<Buffer>;
|
|
540
584
|
readNotificationDiffStat?: (cwd: string) => Promise<string | undefined>;
|
|
541
585
|
}): void;
|
|
542
|
-
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kind-aware invocation reconciliation (prompt | skill) with optional durable store.
|
|
3
|
+
* Preserves Q26 admit/first-terminal/capacity/TTL semantics; indexes and caps are per-kind.
|
|
4
|
+
*/
|
|
5
|
+
import type { PromptReconciliationStatus, SdkPromptTerminalOutcome, TurnPromptReconciliation } from "../prompt-status";
|
|
6
|
+
import { type PromptCorrelation } from "./prompt-reconciliation";
|
|
7
|
+
import type { ReconciliationKind, ReconciliationStore } from "./reconciliation-store";
|
|
8
|
+
export type { ReconciliationKind };
|
|
9
|
+
export interface KindCorrelation extends PromptCorrelation {
|
|
10
|
+
kind: ReconciliationKind;
|
|
11
|
+
}
|
|
12
|
+
export interface KindAwareReconciliation {
|
|
13
|
+
admit(kind: ReconciliationKind, clientRef?: string): void;
|
|
14
|
+
releaseAdmission(kind: ReconciliationKind, clientRef?: string): void;
|
|
15
|
+
noteAccepted(kind: ReconciliationKind, correlation: PromptCorrelation, clientRef?: string, extra?: {
|
|
16
|
+
skillName?: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
noteTransition(kind: ReconciliationKind, correlation: PromptCorrelation | undefined, frame: {
|
|
19
|
+
type: "agent_start" | "agent_end";
|
|
20
|
+
} | {
|
|
21
|
+
type: "agent_failed";
|
|
22
|
+
error: unknown;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
claimPendingOutcome(correlation: PromptCorrelation, outcome: SdkPromptTerminalOutcome): Promise<SdkPromptTerminalOutcome>;
|
|
25
|
+
finalizePromptOutcome(correlation: PromptCorrelation, outcome?: SdkPromptTerminalOutcome, recordError?: {
|
|
26
|
+
code: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
peekPendingOutcome(correlation: PromptCorrelation): SdkPromptTerminalOutcome | undefined;
|
|
30
|
+
lookup(kind: ReconciliationKind, selector: {
|
|
31
|
+
commandId?: string;
|
|
32
|
+
turnId?: string;
|
|
33
|
+
clientRef?: string;
|
|
34
|
+
}): TurnPromptReconciliation;
|
|
35
|
+
cleanup(): void;
|
|
36
|
+
activeCount(kind: ReconciliationKind): number;
|
|
37
|
+
/** Hydrate from durable store (call once at session host start). */
|
|
38
|
+
hydrateFromStore(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
export declare function createKindAwareReconciliation(options?: {
|
|
41
|
+
now?: () => number;
|
|
42
|
+
store?: ReconciliationStore | null;
|
|
43
|
+
}): KindAwareReconciliation;
|
|
44
|
+
export type { PromptReconciliationStatus };
|
|
@@ -48,6 +48,8 @@ export declare function buildCreateArgv(frame: SessionCreateFrame, _ids: {
|
|
|
48
48
|
/** Real daemon-safe tmux launcher: canonical owner-isolation plan + GJC tags. */
|
|
49
49
|
export declare function daemonSpawnCreate(env?: NodeJS.ProcessEnv, opts?: {
|
|
50
50
|
ownerIsolationProbe?: OwnerIsolationProbe;
|
|
51
|
+
platform?: NodeJS.Platform;
|
|
52
|
+
processIncarnation?: (pid: number) => string | undefined;
|
|
51
53
|
}): (frame: SessionCreateFrame, ids: {
|
|
52
54
|
lifecycleRequestId: string;
|
|
53
55
|
intendedSessionId: string;
|
|
@@ -73,6 +75,8 @@ export declare function daemonResumeSession(env?: NodeJS.ProcessEnv, opts?: {
|
|
|
73
75
|
sessionsRoot?: string;
|
|
74
76
|
listSessions?: (env: NodeJS.ProcessEnv) => GjcTmuxSessionStatus[];
|
|
75
77
|
ownerIsolationProbe?: OwnerIsolationProbe;
|
|
78
|
+
platform?: NodeJS.Platform;
|
|
79
|
+
processIncarnation?: (pid: number) => string | undefined;
|
|
76
80
|
}): (target: {
|
|
77
81
|
sessionIdOrPrefix: string;
|
|
78
82
|
path?: string;
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* - Terminal records are retained for TERMINAL_TTL_MS and bounded to
|
|
13
13
|
* TERMINAL_CAPACITY, evicted oldest-terminal-first by terminalAt; only then
|
|
14
14
|
* does a lookup honestly report `unknown`.
|
|
15
|
-
* -
|
|
15
|
+
* - Process-local durability floor is the live session process: restart means `unknown`.
|
|
16
|
+
* Session-scoped durable retention (kind-aware store) is provided by reconciliation-store.ts (#3032).
|
|
16
17
|
* - The clientRef index is session-runtime scoped; a ref conflicts only while
|
|
17
18
|
* retained and must never be reused as a retry mechanism.
|
|
18
19
|
* - Terminal transitions settle once: the first terminal outcome wins.
|