@sayknow-cli/coding-agent 0.4.7 → 0.5.0
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 +97 -0
- package/dist/types/capability/index.d.ts +10 -20
- package/dist/types/capability/types.d.ts +3 -0
- package/dist/types/cli/args.d.ts +0 -2
- package/dist/types/cli/read-cli.d.ts +1 -0
- package/dist/types/cli.d.ts +9 -1
- package/dist/types/commands/daemon.d.ts +2 -2
- 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/commands/sdk.d.ts +20 -2
- package/dist/types/config/keybindings.d.ts +34 -4
- package/dist/types/config/model-profile-contract.d.ts +40 -0
- package/dist/types/config/model-profiles.d.ts +2 -3
- package/dist/types/config/model-registry.d.ts +5 -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 +156 -10
- package/dist/types/config/settings.d.ts +3 -0
- package/dist/types/edit/modes/patch.d.ts +13 -0
- package/dist/types/edit/path-mutation-lock.d.ts +15 -0
- package/dist/types/eval/py/executor.d.ts +1 -1
- package/dist/types/eval/py/runner-artifact.d.ts +8 -0
- package/dist/types/eval/py/tool-bridge.d.ts +1 -2
- package/dist/types/extensibility/extensions/types.d.ts +43 -2
- package/dist/types/extensibility/shared-events.d.ts +6 -0
- package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
- package/dist/types/main.d.ts +33 -2
- package/dist/types/memories/index.d.ts +2 -0
- package/dist/types/modes/acp/acp-agent.d.ts +22 -9
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
- package/dist/types/modes/components/queue-pane.d.ts +8 -0
- package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
- package/dist/types/modes/components/read-tool-group.d.ts +4 -4
- package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +2 -1
- package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/components/tool-status-header.d.ts +4 -2
- package/dist/types/modes/components/welcome.d.ts +5 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +5 -0
- package/dist/types/modes/controllers/command-controller.d.ts +2 -0
- package/dist/types/modes/controllers/event-controller.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +13 -2
- package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +6 -1
- package/dist/types/modes/prompt-suggestion-controller.d.ts +35 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +2 -2
- package/dist/types/modes/types.d.ts +6 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +2 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
- package/dist/types/runtime/memory-domain.d.ts +9 -0
- package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
- package/dist/types/runtime/memory-guard.d.ts +39 -0
- package/dist/types/runtime/memory-limit.d.ts +11 -0
- package/dist/types/runtime-mcp/content-limits.d.ts +7 -0
- package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +1 -1
- package/dist/types/runtime-mcp/manager.d.ts +9 -1
- package/dist/types/runtime-mcp/oauth-flow.d.ts +0 -5
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +14 -0
- package/dist/types/runtime-mcp/redaction.d.ts +2 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
- package/dist/types/sdk/acp/final-text.d.ts +19 -0
- package/dist/types/sdk/acp/mcp.d.ts +23 -0
- package/dist/types/sdk/broker/broker.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +13 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +9 -1
- package/dist/types/sdk/bus/config-commands.d.ts +2 -2
- package/dist/types/sdk/bus/config.d.ts +2 -0
- package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +1 -0
- package/dist/types/sdk/bus/daemon-paths.d.ts +1 -0
- package/dist/types/sdk/bus/index.d.ts +52 -4
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
- package/dist/types/sdk/bus/lifecycle-commands.d.ts +5 -4
- package/dist/types/sdk/bus/notification-orchestration.d.ts +1 -0
- package/dist/types/sdk/bus/notification-service.d.ts +34 -0
- package/dist/types/sdk/bus/operator-runtime.d.ts +1 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +106 -0
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
- package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +33 -9
- package/dist/types/sdk/bus/telegram-daemon-control.d.ts +5 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +286 -12
- package/dist/types/sdk/bus/telegram-reference.d.ts +2 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +88 -2
- package/dist/types/sdk/client/discovery.d.ts +2 -0
- package/dist/types/sdk/client/liveness.d.ts +7 -0
- package/dist/types/sdk/host/control/operations.d.ts +3 -2
- package/dist/types/sdk/host/host.d.ts +3 -1
- package/dist/types/sdk/host/query/handlers.d.ts +14 -0
- package/dist/types/sdk/index.d.ts +2 -0
- package/dist/types/sdk/lifecycle-session.d.ts +10 -1
- package/dist/types/sdk/prompt-status.d.ts +88 -0
- package/dist/types/sdk/session-directory.d.ts +1 -1
- package/dist/types/sdk/session.d.ts +7 -0
- package/dist/types/sdk/startup-capability.d.ts +9 -0
- package/dist/types/sdk/transport/auth-preface.d.ts +9 -0
- package/dist/types/sdk/transport/index.d.ts +12 -0
- package/dist/types/sdk/transport/relay.d.ts +43 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +4 -0
- package/dist/types/sdk/transport/socket.d.ts +7 -0
- package/dist/types/sdk/transport/stdio.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +83 -24
- package/dist/types/session/btw-contract.d.ts +16 -0
- package/dist/types/session/fallback-chain-controller.d.ts +18 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +70 -10
- package/dist/types/session/internal/managed-session-storage.d.ts +34 -12
- package/dist/types/session/internal/native-publish-outcome.d.ts +48 -0
- package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
- package/dist/types/session/session-manager.d.ts +89 -18
- package/dist/types/session/session-storage.d.ts +31 -0
- package/dist/types/session/streaming-output.d.ts +60 -5
- package/dist/types/setup/credential-import.d.ts +5 -1
- package/dist/types/setup/provider-onboarding.d.ts +2 -0
- package/dist/types/skc-runtime/deep-interview-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/deep-interview-stage.d.ts +37 -0
- package/dist/types/skc-runtime/gc-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/linux-proc.d.ts +22 -14
- package/dist/types/skc-runtime/memory-guard-owner-claims.d.ts +47 -0
- package/dist/types/skc-runtime/ralplan-runtime.d.ts +112 -1
- package/dist/types/skc-runtime/repository-binding.d.ts +63 -0
- package/dist/types/skc-runtime/state-runtime.d.ts +3 -1
- package/dist/types/skc-runtime/state-writer.d.ts +5 -1
- package/dist/types/skc-runtime/team-launch.d.ts +1 -1
- package/dist/types/skc-runtime/team-runtime.d.ts +9 -2
- package/dist/types/skc-runtime/team-store.d.ts +12 -0
- package/dist/types/skc-runtime/team-worker-memory-guard.d.ts +92 -0
- package/dist/types/skc-runtime/tmux-owner-isolation.d.ts +7 -0
- package/dist/types/skc-runtime/ultragoal-guard.d.ts +6 -5
- package/dist/types/skc-runtime/ultragoal-receipt-freshness.d.ts +28 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +43 -5
- package/dist/types/skill-state/workflow-hud.d.ts +3 -0
- package/dist/types/ssh/utils.d.ts +1 -0
- package/dist/types/task/discovery.d.ts +3 -1
- package/dist/types/task/executor.d.ts +6 -0
- package/dist/types/task/index.d.ts +3 -1
- package/dist/types/task/provider-retry-status.d.ts +13 -0
- package/dist/types/task/receipt.d.ts +2 -0
- package/dist/types/task/types.d.ts +133 -0
- package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
- package/dist/types/tools/browser/launch.d.ts +7 -0
- package/dist/types/tools/fetch.d.ts +22 -9
- package/dist/types/tools/image-gen.d.ts +63 -1
- package/dist/types/tools/index.d.ts +7 -1
- package/dist/types/tools/output-meta.d.ts +21 -1
- package/dist/types/tools/read-internals.d.ts +12 -0
- package/dist/types/tools/read.d.ts +45 -1
- package/dist/types/tools/resource-gc.d.ts +23 -0
- package/dist/types/tools/skill-discovery.d.ts +7 -0
- package/dist/types/tools/sqlite-reader.d.ts +7 -0
- package/dist/types/tools/tool-result.d.ts +7 -1
- package/dist/types/utils/prompt-suggestion.d.ts +33 -0
- package/dist/types/utils/shell-snapshot.d.ts +12 -0
- package/dist/types/web/insane/bridge.d.ts +1 -0
- package/dist/types/web/insane/url-guard.d.ts +17 -0
- package/package.json +8 -12
- package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
- package/scripts/capture-platform-shortcut-labels-showcase.ts +342 -0
- package/scripts/capture-sticky-viewport-showcase.ts +292 -0
- package/scripts/compile-args.ts +0 -1
- package/scripts/dogfood-repository-binding.ts +209 -0
- package/scripts/generate-docs-index.ts +4 -1
- package/scripts/generate-sdk-operation-inventory.ts +9 -0
- package/scripts/run-test-manifest.ts +6 -4
- package/scripts/verify-skc-sdk-canonicalization.ts +122 -18
- package/scripts/verify-sticky-viewport-showcase.ts +611 -0
- package/src/capability/index.ts +58 -42
- package/src/capability/types.ts +3 -0
- package/src/cli/args.ts +16 -100
- package/src/cli/fast-help.ts +1 -1
- package/src/cli/mcp-cli.ts +4 -21
- package/src/cli/notify-cli.ts +6 -38
- package/src/cli/read-cli.ts +2 -1
- package/src/cli/setup-cli.ts +10 -4
- package/src/cli.ts +133 -11
- package/src/commands/daemon.ts +22 -5
- package/src/commands/deep-interview.ts +26 -1
- package/src/commands/harness.ts +35 -12
- package/src/commands/read.ts +11 -2
- package/src/commands/sdk.ts +134 -17
- package/src/commands/team.ts +1 -1
- package/src/commit/agentic/index.ts +3 -3
- package/src/commit/map-reduce/index.ts +2 -2
- package/src/config/keybindings.ts +158 -25
- package/src/config/model-profile-contract.ts +174 -0
- package/src/config/model-profiles.ts +51 -10
- package/src/config/model-registry.ts +24 -4
- package/src/config/model-resolver.ts +2 -2
- package/src/config/provider-auth-health.ts +42 -0
- package/src/config/provider-ranking.ts +119 -0
- package/src/config/settings-schema.ts +157 -10
- package/src/config/settings.ts +254 -108
- package/src/coordinator-mcp/model-preset.ts +21 -74
- package/src/defaults/skc/skills/deep-interview/SKILL.md +147 -24
- package/src/defaults/skc/skills/ralplan/SKILL.md +91 -34
- package/src/defaults/skc/skills/team/SKILL.md +1 -1
- package/src/defaults/skc/skills/ultragoal/SKILL.md +68 -17
- package/src/discovery/ssh.ts +12 -1
- package/src/edit/index.ts +3 -6
- package/src/edit/modes/patch.ts +38 -1
- package/src/edit/modes/replace.ts +42 -0
- package/src/edit/path-mutation-lock.ts +112 -0
- package/src/eval/js/tool-bridge.ts +1 -1
- package/src/eval/py/executor.ts +37 -13
- package/src/eval/py/kernel.ts +1 -21
- package/src/eval/py/prelude.py +2 -2
- package/src/eval/py/runner-artifact.ts +84 -0
- package/src/eval/py/tool-bridge.ts +34 -18
- package/src/extensibility/extensions/runner.ts +4 -0
- package/src/extensibility/extensions/types.ts +42 -4
- package/src/extensibility/plugins/marketplace/fetcher.ts +191 -7
- package/src/extensibility/shared-events.ts +5 -0
- package/src/extensibility/skc-plugins/runtime-adapters.ts +2 -1
- package/src/hooks/native-skill-hook.ts +17 -4
- package/src/internal-urls/docs-index.generated.ts +17 -16
- package/src/internal-urls/local-protocol.ts +87 -25
- package/src/internal-urls/local-root-gc.ts +127 -0
- package/src/internal-urls/mcp-protocol.ts +73 -11
- package/src/main.ts +120 -42
- package/src/memories/index.ts +10 -0
- package/src/modes/DESIGN.md +52 -0
- package/src/modes/acp/acp-agent.ts +647 -83
- package/src/modes/acp/acp-event-mapper.ts +106 -12
- package/src/modes/acp/acp-mode.ts +39 -3
- package/src/modes/action-registry.ts +1 -1
- package/src/modes/components/assistant-message.ts +123 -22
- package/src/modes/components/btw-panel.ts +82 -16
- 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 +1 -1
- package/src/modes/components/oauth-selector.ts +42 -12
- package/src/modes/components/plan-preview-overlay.ts +1 -1
- package/src/modes/components/queue-pane.ts +55 -9
- package/src/modes/components/queued-message-selector.ts +53 -10
- package/src/modes/components/read-tool-group.ts +82 -14
- package/src/modes/components/runtime-mcp-add-wizard.ts +5 -0
- package/src/modes/components/sayknow-pet-widget.ts +20 -8
- package/src/modes/components/session-observer-overlay.ts +187 -32
- package/src/modes/components/settings-selector.ts +60 -18
- package/src/modes/components/tool-execution.ts +138 -27
- package/src/modes/components/tool-status-header.ts +26 -8
- package/src/modes/components/welcome.ts +50 -23
- package/src/modes/controllers/btw-controller.ts +119 -36
- package/src/modes/controllers/command-controller.ts +101 -54
- package/src/modes/controllers/event-controller.ts +119 -27
- package/src/modes/controllers/extension-ui-controller.ts +23 -12
- package/src/modes/controllers/input-controller.ts +100 -8
- package/src/modes/controllers/runtime-mcp-command-controller.ts +29 -6
- package/src/modes/controllers/selector-controller.ts +4 -1
- package/src/modes/interactive-mode.ts +201 -60
- package/src/modes/irc-observation-ledger.ts +71 -15
- package/src/modes/prompt-action-autocomplete.ts +32 -13
- package/src/modes/prompt-suggestion-controller.ts +96 -0
- package/src/modes/runtime-init.ts +20 -2
- package/src/modes/shared/agent-wire/command-dispatch.ts +3 -3
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +2 -2
- package/src/modes/types.ts +6 -0
- package/src/modes/utils/hotkeys-markdown.ts +64 -36
- package/src/modes/utils/ui-helpers.ts +99 -4
- package/src/prompts/agent-fragments/restricted-bash.md +1 -1
- package/src/prompts/agents/architect.md +17 -3
- package/src/prompts/agents/critic.md +17 -2
- package/src/prompts/agents/executor.md +1 -1
- package/src/prompts/agents/planner.md +8 -1
- package/src/prompts/system/btw-user.md +3 -8
- package/src/prompts/system/prompt-suggestion-system.md +32 -0
- package/src/prompts/system/system-prompt.md +6 -3
- package/src/prompts/tools/cron.md +3 -1
- package/src/prompts/tools/read.md +4 -2
- package/src/prompts/tools/skill-discovery.md +1 -0
- package/src/runtime/memory-domain.ts +66 -0
- package/src/runtime/memory-guard-contract.ts +73 -0
- package/src/runtime/memory-guard.ts +292 -0
- package/src/runtime/memory-limit.ts +50 -0
- package/src/runtime-mcp/client.ts +41 -55
- package/src/runtime-mcp/content-limits.ts +71 -0
- package/src/runtime-mcp/discoverable-tool-metadata.ts +1 -1
- package/src/runtime-mcp/json-rpc.ts +28 -11
- package/src/runtime-mcp/manager.ts +77 -59
- package/src/runtime-mcp/oauth-flow.ts +0 -72
- package/src/runtime-mcp/plugin-network-boundary.ts +101 -0
- package/src/runtime-mcp/redaction.ts +30 -0
- package/src/runtime-mcp/smithery-auth.ts +17 -2
- package/src/runtime-mcp/smithery-connect.ts +11 -1
- package/src/runtime-mcp/transports/http.ts +63 -22
- package/src/sdk/acp/adapter.ts +8 -1
- package/src/sdk/acp/final-text.ts +40 -0
- package/src/sdk/acp/mcp.ts +26 -0
- package/src/sdk/broker/broker.ts +34 -20
- package/src/sdk/broker/identity.ts +22 -12
- package/src/sdk/broker/lifecycle.ts +293 -43
- package/src/sdk/broker/session-index.ts +11 -1
- package/src/sdk/bus/chat-daemon-cli.ts +2 -2
- package/src/sdk/bus/chat-daemon-control.ts +22 -5
- package/src/sdk/bus/config-commands.ts +2 -2
- package/src/sdk/bus/config.ts +10 -2
- package/src/sdk/bus/control-drain-lease.ts +104 -0
- package/src/sdk/bus/conversation-store.ts +40 -6
- package/src/sdk/bus/daemon-paths.ts +2 -0
- package/src/sdk/bus/index.ts +793 -121
- package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
- package/src/sdk/bus/lifecycle-commands.ts +63 -10
- package/src/sdk/bus/lifecycle-control-runtime.ts +11 -2
- package/src/sdk/bus/lifecycle-orchestrator.ts +32 -1
- package/src/sdk/bus/notification-orchestration.ts +12 -0
- package/src/sdk/bus/notification-service.ts +87 -25
- package/src/sdk/bus/operator-runtime.ts +31 -5
- package/src/sdk/bus/prompt-reconciliation.ts +240 -0
- package/src/sdk/bus/rate-limit-pool.ts +8 -0
- package/src/sdk/bus/recent-activity.ts +90 -26
- package/src/sdk/bus/reconciliation-store.ts +224 -0
- package/src/sdk/bus/telegram-cli.ts +6 -13
- package/src/sdk/bus/telegram-daemon-cli.ts +8 -3
- package/src/sdk/bus/telegram-daemon-contract.ts +34 -9
- package/src/sdk/bus/telegram-daemon-control.ts +161 -40
- package/src/sdk/bus/telegram-daemon.ts +3649 -593
- package/src/sdk/bus/telegram-reference.ts +20 -2
- package/src/sdk/bus/topic-registry.ts +451 -12
- package/src/sdk/cli/session-cli.ts +15 -2
- package/src/sdk/client/discovery.ts +19 -3
- package/src/sdk/client/liveness.ts +49 -0
- package/src/sdk/host/control/dispatch.ts +8 -2
- package/src/sdk/host/control/operations.ts +3 -2
- package/src/sdk/host/host.ts +27 -9
- package/src/sdk/host/query/handlers.ts +125 -5
- package/src/sdk/index.ts +12 -0
- package/src/sdk/lifecycle-session.ts +19 -3
- package/src/sdk/mcp/server.ts +46 -18
- package/src/sdk/prompt-status.ts +97 -0
- package/src/sdk/protocol/operation-inventory.generated.json +145 -0
- package/src/sdk/protocol/operation-registry.ts +24 -4
- package/src/sdk/session-directory.ts +5 -1
- package/src/sdk/session.ts +69 -8
- package/src/sdk/startup-capability.ts +15 -1
- package/src/sdk/transport/auth-preface.ts +82 -0
- package/src/sdk/transport/index.ts +18 -0
- package/src/sdk/transport/relay.ts +252 -0
- package/src/sdk/transport/serve-cli.ts +105 -0
- package/src/sdk/transport/socket.ts +197 -0
- package/src/sdk/transport/stdio.ts +17 -0
- package/src/session/agent-session.ts +1112 -314
- package/src/session/blob-store.ts +25 -7
- package/src/session/btw-contract.ts +59 -0
- package/src/session/fallback-chain-controller.ts +47 -8
- package/src/session/internal/managed-session-scope.ts +1426 -259
- package/src/session/internal/managed-session-storage.ts +414 -238
- package/src/session/internal/native-publish-outcome.ts +271 -0
- package/src/session/memory-guard-checkpoint-participant.ts +131 -0
- package/src/session/session-manager.ts +2079 -469
- package/src/session/session-storage.ts +151 -11
- package/src/session/streaming-output.ts +262 -43
- package/src/setup/credential-import.ts +28 -3
- package/src/setup/provider-onboarding.ts +49 -5
- package/src/setup/provider-presets.json +2 -1
- package/src/skc-runtime/deep-interview-runtime.ts +303 -36
- package/src/skc-runtime/deep-interview-stage.ts +1016 -0
- package/src/skc-runtime/deep-interview-state.ts +8 -5
- package/src/skc-runtime/gc-render.ts +1 -0
- package/src/skc-runtime/gc-runtime.ts +11 -1
- package/src/skc-runtime/linux-proc.ts +70 -36
- package/src/skc-runtime/managed-owner-supervisor.ts +83 -4
- package/src/skc-runtime/memory-guard-owner-claims.ts +389 -0
- package/src/skc-runtime/ralplan-runtime.ts +1057 -75
- package/src/skc-runtime/repository-binding.ts +267 -0
- package/src/skc-runtime/session-state-sidecar.ts +25 -9
- package/src/skc-runtime/state-runtime.ts +50 -12
- package/src/skc-runtime/state-writer.ts +68 -56
- package/src/skc-runtime/team-launch.ts +34 -5
- package/src/skc-runtime/team-runtime.ts +41 -1
- package/src/skc-runtime/team-store.ts +32 -0
- package/src/skc-runtime/team-worker-memory-guard.ts +363 -0
- package/src/skc-runtime/team-workers.ts +1 -0
- package/src/skc-runtime/tmux-common.ts +13 -2
- package/src/skc-runtime/tmux-owner-isolation.ts +20 -1
- package/src/skc-runtime/tmux-sessions.ts +45 -6
- package/src/skc-runtime/ultragoal-guard.ts +93 -15
- package/src/skc-runtime/ultragoal-receipt-freshness.ts +123 -0
- package/src/skc-runtime/ultragoal-runtime.ts +469 -38
- package/src/skc-runtime/workflow-manifest.generated.json +195 -5
- package/src/skc-runtime/workflow-manifest.ts +67 -3
- package/src/skill-state/workflow-hud.ts +25 -2
- package/src/skill-state/workflow-mutation-guard.ts +104 -12
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/ssh/utils.ts +14 -0
- package/src/task/discovery.ts +8 -2
- package/src/task/executor.ts +165 -47
- package/src/task/index.ts +123 -15
- package/src/task/provider-retry-status.ts +88 -0
- package/src/task/receipt.ts +3 -0
- package/src/task/render.ts +45 -26
- package/src/task/skc-command.ts +2 -2
- package/src/task/types.ts +55 -10
- package/src/task/ultragoal-redteam-activation.ts +75 -0
- package/src/tools/ask.ts +1 -1
- package/src/tools/ast-edit.ts +2 -2
- package/src/tools/bash-allowed-prefixes.ts +45 -1
- package/src/tools/bash-pty-selection.ts +2 -2
- package/src/tools/browser/launch.ts +41 -6
- package/src/tools/browser/screenshot-format.ts +6 -1
- package/src/tools/cron.ts +1 -1
- package/src/tools/fetch.ts +127 -154
- package/src/tools/image-gen.ts +476 -23
- package/src/tools/index.ts +7 -1
- package/src/tools/output-meta.ts +176 -9
- package/src/tools/path-utils.ts +5 -1
- package/src/tools/read-internals.ts +44 -0
- package/src/tools/read.ts +1544 -310
- package/src/tools/resource-gc.ts +665 -125
- package/src/tools/skill-discovery.ts +39 -3
- package/src/tools/sqlite-reader.ts +63 -5
- package/src/tools/subagent-render.ts +74 -16
- package/src/tools/subagent.ts +2 -0
- package/src/tools/tool-result.ts +14 -1
- package/src/utils/edit-mode.ts +2 -2
- package/src/utils/pasted-image-path.ts +15 -6
- package/src/utils/prompt-suggestion.ts +265 -0
- package/src/utils/shell-snapshot.ts +173 -63
- package/src/utils/sixel.ts +3 -3
- package/src/web/insane/bridge.ts +5 -1
- package/src/web/insane/url-guard.ts +140 -27
- package/src/web/scrapers/docs-rs.ts +30 -5
- package/src/web/scrapers/types.ts +19 -49
- package/src/web/scrapers/utils.ts +12 -26
- package/src/web/search/providers/codex.ts +1 -1
- package/src/workflow/workflow-intent-diff.ts +4 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Settings } from "../config/settings";
|
|
2
|
+
import type { MemoryGuardDecision, MemoryGuardDomainSnapshot, MemoryGuardPolicy, MemoryGuardSchedulerState } from "./memory-guard-contract";
|
|
3
|
+
type WorkOwner = {
|
|
4
|
+
generation: number;
|
|
5
|
+
source: "timer" | "external";
|
|
6
|
+
};
|
|
7
|
+
export interface MemoryGuardHostRegistration {
|
|
8
|
+
ownerId: string;
|
|
9
|
+
intervalMs: number;
|
|
10
|
+
}
|
|
11
|
+
export interface MemoryGuardHostOptions {
|
|
12
|
+
run: () => Promise<void>;
|
|
13
|
+
logDebug?: (message: string, meta?: Record<string, unknown>) => void;
|
|
14
|
+
schedulerNow?: () => number;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveMemoryGuardPolicy(settings: Settings): MemoryGuardPolicy;
|
|
17
|
+
export declare function chooseMemoryGuardAction(input: {
|
|
18
|
+
domain: MemoryGuardDomainSnapshot;
|
|
19
|
+
hostSupported: boolean;
|
|
20
|
+
workerSupported: (workerId: string) => boolean;
|
|
21
|
+
}): MemoryGuardDecision;
|
|
22
|
+
export declare function revalidateMemoryGuardAction(previous: Extract<MemoryGuardDecision, {
|
|
23
|
+
kind: "execute";
|
|
24
|
+
}>, revalidated: MemoryGuardDecision): MemoryGuardDecision;
|
|
25
|
+
export declare class MemoryGuardHost {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(options: MemoryGuardHostOptions);
|
|
28
|
+
register(registration: MemoryGuardHostRegistration): () => void;
|
|
29
|
+
updateInterval(ownerId: string, intervalMs: number): void;
|
|
30
|
+
runTick(generation?: number, source?: WorkOwner["source"]): Promise<void>;
|
|
31
|
+
runTimerCallbackForTest(owner: {
|
|
32
|
+
generation: number;
|
|
33
|
+
token: number;
|
|
34
|
+
}, deadline: number): Promise<void>;
|
|
35
|
+
setSchedulerNowForTest(now: () => number): void;
|
|
36
|
+
getStateForTest(): MemoryGuardSchedulerState;
|
|
37
|
+
resetForTest(): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface EffectiveMemoryLimitInput {
|
|
2
|
+
hardCapBytes?: number | null;
|
|
3
|
+
policyLimitBytes?: number | null;
|
|
4
|
+
}
|
|
5
|
+
export interface EffectiveMemoryLimit {
|
|
6
|
+
hardCapBytes: number | null;
|
|
7
|
+
policyLimitBytes: number | null;
|
|
8
|
+
effectiveBytes: number | null;
|
|
9
|
+
source: "none" | "hard_cap" | "policy_limit" | "hard_cap_and_policy_limit";
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveEffectiveMemoryLimit(input: EffectiveMemoryLimitInput): EffectiveMemoryLimit;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MCP_MAX_CONTENT_BYTES: number;
|
|
2
|
+
export declare const MCP_MAX_ERROR_BYTES: number;
|
|
3
|
+
export declare const MCP_MAX_SSE_REQUEST_MESSAGES = 1024;
|
|
4
|
+
export declare const MCP_MAX_SSE_BATCH_MESSAGES = 1024;
|
|
5
|
+
export declare const MCP_HTTP_TIMEOUT_MS = 30000;
|
|
6
|
+
export declare function cancelMCPStream(stream: ReadableStream<Uint8Array> | null): void;
|
|
7
|
+
export declare function readMCPResponseText(response: Response, limit: number, truncate?: boolean, signal?: AbortSignal): Promise<string>;
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* Upstream v0.11.x renamed `DiscoverableMCP*` → `DiscoverableTool*`; we re-export
|
|
7
7
|
* the new symbols under the legacy names so existing call sites still compile.
|
|
8
8
|
*/
|
|
9
|
-
export type { DiscoverableToolSearchDocument as DiscoverableMCPSearchDocument, DiscoverableToolSearchIndex as DiscoverableMCPSearchIndex, DiscoverableToolSearchResult as DiscoverableMCPSearchResult,
|
|
9
|
+
export type { DiscoverableTool as DiscoverableMCPTool, DiscoverableToolSearchDocument as DiscoverableMCPSearchDocument, DiscoverableToolSearchIndex as DiscoverableMCPSearchIndex, DiscoverableToolSearchResult as DiscoverableMCPSearchResult, DiscoverableToolServerSummary as DiscoverableMCPToolServerSummary, DiscoverableToolSummary as DiscoverableMCPToolSummary, } from "../tool-discovery/tool-index";
|
|
10
10
|
export { buildDiscoverableToolSearchIndex as buildDiscoverableMCPSearchIndex, collectDiscoverableTools as collectDiscoverableMCPTools, formatDiscoverableToolServerSummary as formatDiscoverableMCPToolServerSummary, getDiscoverableTool as getDiscoverableMCPTool, isMCPBridgeTool, isMCPToolName, searchDiscoverableTools as searchDiscoverableMCPTools, selectDiscoverableToolNamesByServer as selectDiscoverableMCPToolNamesByServer, summarizeDiscoverableTools as summarizeDiscoverableMCPTools, } from "../tool-discovery/tool-index";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TSchema } from "@sayknow-cli/ai";
|
|
2
2
|
import type { SourceMeta } from "../capability/types";
|
|
3
3
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
4
4
|
import type { AuthStorage } from "../session/auth-storage";
|
|
5
5
|
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
|
+
export declare function resolveStartupTimeoutMs(configs: MCPServerConfig[], maxStartupTimeoutMs?: number): number;
|
|
8
9
|
/**
|
|
9
10
|
* Stable, total ordering on MCP tools by name.
|
|
10
11
|
*
|
|
@@ -48,6 +49,13 @@ export interface MCPDiscoverOptions {
|
|
|
48
49
|
export interface MCPManagerOptions {
|
|
49
50
|
/** Restrict this instance to tools from an explicit MCP config. */
|
|
50
51
|
toolsOnly?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Ceiling for the startup wait, in milliseconds. Only ACP lifecycle launches
|
|
54
|
+
* set this, so a slow ACP MCP handshake gets the readiness budget while every
|
|
55
|
+
* other consumer keeps the short default. Non-positive or non-finite values
|
|
56
|
+
* are ignored and the default applies.
|
|
57
|
+
*/
|
|
58
|
+
maxStartupTimeoutMs?: number;
|
|
51
59
|
}
|
|
52
60
|
/**
|
|
53
61
|
* MCP Server Manager.
|
|
@@ -52,8 +52,3 @@ export declare class MCPOAuthFlow extends OAuthCallbackFlow {
|
|
|
52
52
|
}>;
|
|
53
53
|
exchangeToken(code: string, _state: string, redirectUri: string): Promise<OAuthCredentials>;
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Refresh an MCP OAuth token using the standard refresh_token grant.
|
|
57
|
-
* Returns updated credentials; preserves the old refresh token if the server doesn't rotate it.
|
|
58
|
-
*/
|
|
59
|
-
export declare function refreshMCPOAuthToken(tokenUrl: string, refreshToken: string, clientId?: string, clientSecret?: string): Promise<OAuthCredentials>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AddressResolver } from "../web/insane/url-guard";
|
|
2
|
+
import type { MCPHttpServerConfig, MCPSseServerConfig } from "./types";
|
|
3
|
+
/** Mark an in-memory plugin-bundle remote MCP config for connection-bound public-network enforcement. */
|
|
4
|
+
export declare function bindPluginMcpToPublicNetwork<T extends MCPHttpServerConfig | MCPSseServerConfig>(config: T): T;
|
|
5
|
+
/** The marker is an internal symbol, so persisted user MCP configs cannot opt into or forge this path. */
|
|
6
|
+
export declare function isPluginMcpPublicNetworkBound(config: MCPHttpServerConfig | MCPSseServerConfig): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Fetch a plugin-bundle MCP request through a DNS-pinned public address. Every
|
|
9
|
+
* redirect is handled manually and revalidated before the next connection.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchPluginMcpRequest(rawUrl: string, init: BunFetchRequestInit, options?: {
|
|
12
|
+
resolver?: AddressResolver;
|
|
13
|
+
maxRedirects?: number;
|
|
14
|
+
}): Promise<Response>;
|
|
@@ -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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const ACP_FINAL_TEXT_LIMIT = 100000;
|
|
2
|
+
export interface BoundedAcpFinalText {
|
|
3
|
+
text: string;
|
|
4
|
+
truncated: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type AcpFinalTextResolution = {
|
|
7
|
+
kind: "none";
|
|
8
|
+
final: BoundedAcpFinalText;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "emit";
|
|
11
|
+
final: BoundedAcpFinalText;
|
|
12
|
+
text: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "divergent";
|
|
15
|
+
final: BoundedAcpFinalText;
|
|
16
|
+
};
|
|
17
|
+
export declare function boundAcpFinalText(value: string): BoundedAcpFinalText;
|
|
18
|
+
export declare function acpFinalTextFromMessage(message: unknown): BoundedAcpFinalText;
|
|
19
|
+
export declare function resolveAcpFinalText(streamed: string, finalText: string): AcpFinalTextResolution;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const ACP_MCP_REQUEST_TIMEOUT_MS = 30000;
|
|
2
|
+
export declare const ACP_MCP_LIFECYCLE_TIMEOUT_MS: number;
|
|
3
|
+
/**
|
|
4
|
+
* Slice of the readiness budget reserved for the work that follows MCP startup
|
|
5
|
+
* (session wiring, marker publication). The ACP MCP startup ceiling is the
|
|
6
|
+
* remaining time to `semanticReadyDeadlineAt` minus this headroom, so a slow
|
|
7
|
+
* MCP handshake cannot consume the whole readiness window.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ACP_MCP_STARTUP_HEADROOM_MS = 250;
|
|
10
|
+
export interface SessionLifecycleMcpStdioServer {
|
|
11
|
+
type?: "stdio";
|
|
12
|
+
name: string;
|
|
13
|
+
command: string;
|
|
14
|
+
args: string[];
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface SessionLifecycleMcpRemoteServer {
|
|
18
|
+
type: "http" | "sse";
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
}
|
|
23
|
+
export type SessionLifecycleMcpServer = SessionLifecycleMcpStdioServer | SessionLifecycleMcpRemoteServer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NativeDirectoryTreeSnapshot } from "@sayknow-cli/natives";
|
|
2
|
+
import type { ModelProfileErrorDetails } from "../../config/model-profile-contract";
|
|
2
3
|
import { type DirectoryMigrationPolicy } from "../session-directory";
|
|
3
4
|
import { type BrokerDiscovery, type RedactedBrokerDiscovery } from "./discovery";
|
|
4
5
|
import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
@@ -93,6 +94,7 @@ export type BrokerResponse = {
|
|
|
93
94
|
error: {
|
|
94
95
|
code: BrokerErrorCode;
|
|
95
96
|
message: string;
|
|
97
|
+
details?: ModelProfileErrorDetails;
|
|
96
98
|
endpoint?: "unavailable";
|
|
97
99
|
cleanup?: BrokerCleanupEvidence;
|
|
98
100
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SessionLifecycleMcpServer } from "../acp/mcp";
|
|
1
2
|
import type { SdkStartupFailure, SdkStartupRollbackResult } from "../startup-capability";
|
|
2
3
|
import type { Broker, BrokerCleanupEvidence, BrokerResponse } from "./broker";
|
|
3
4
|
import type { LifecycleDurableEffectsReceipt, LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
@@ -61,6 +62,7 @@ export interface SessionLifecycleLaunchRequest {
|
|
|
61
62
|
/** Broker-issued effect marker which the child echoes only after host readiness. */
|
|
62
63
|
effectMarker?: string;
|
|
63
64
|
modelPreset?: string;
|
|
65
|
+
mcpServers?: SessionLifecycleMcpServer[];
|
|
64
66
|
worktree?: SessionLifecycleWorktreeTarget;
|
|
65
67
|
receivedAt: number;
|
|
66
68
|
requestedReadinessTimeoutMs: number;
|
|
@@ -70,6 +72,12 @@ export interface SessionLifecycleLaunchRequest {
|
|
|
70
72
|
}
|
|
71
73
|
export declare function readSessionLifecycleLaunchRequest(value: string | undefined, now?: number): SessionLifecycleLaunchRequest;
|
|
72
74
|
type CleanupEvidence = BrokerCleanupEvidence;
|
|
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;
|
|
73
81
|
export declare function setProcessIncarnationForTest(broker: Broker, value: ((pid: number) => string | undefined) | undefined): void;
|
|
74
82
|
/** The child writes this only after its endpoint and semantic ready event are both live. */
|
|
75
83
|
export declare function writeSessionLifecycleReady(root: string, id: string, effectMarker: string): Promise<void>;
|
|
@@ -79,6 +87,11 @@ export interface LifecycleTranscriptEvidence {
|
|
|
79
87
|
}
|
|
80
88
|
/** The child writes bounded startup diagnostics before exiting without readiness. */
|
|
81
89
|
export declare function writeSessionLifecycleFailure(root: string, id: string, effectMarker: string, failure: SdkStartupFailure, rollback: SdkStartupRollbackResult, transcript?: LifecycleTranscriptEvidence, ownerIncarnation?: string): Promise<void>;
|
|
90
|
+
export declare function readSessionLifecycleFailureForTest(root: string, id: string, expected: {
|
|
91
|
+
pid: number;
|
|
92
|
+
effectMarker: string;
|
|
93
|
+
incarnation: string;
|
|
94
|
+
}): Promise<SdkStartupFailure | undefined>;
|
|
82
95
|
export interface LifecycleExecutionOutcome {
|
|
83
96
|
response: BrokerResponse;
|
|
84
97
|
durableEffects?: LifecycleDurableEffectsReceipt;
|
|
@@ -8,7 +8,15 @@ export type ChatDaemonAction = "stop" | "reload";
|
|
|
8
8
|
* Generation 6 carries the retained managed filesystem authority boundary.
|
|
9
9
|
* Generation 7 restores macOS daemon signaling (kill(2) with a start-time
|
|
10
10
|
* incarnation recheck) so a live/hung owner can be replaced without an external
|
|
11
|
-
* `kill -9`.
|
|
11
|
+
* `kill -9`. Generation 8 adopts Windows expected-identity ACL verification and
|
|
12
|
+
* repair for shared native authority. Generation 9 refreshes the shared native
|
|
13
|
+
* authority declaration contract with bounded frame-delivery acknowledgement.
|
|
14
|
+
* Generation 11 accepts typed retained exact-unlink cleanup authority — a
|
|
15
|
+
* concrete detached quarantine plus a proven-absent canonical lock pathname —
|
|
16
|
+
* when deleting an observed owner-lock lease. Generation 12 refreshes retained
|
|
17
|
+
* native path and process authority semantics. Generation 13 rejects special
|
|
18
|
+
* files before retained native authority opens. Generation 14 reloads shared
|
|
19
|
+
* chat daemons after notification configuration parsing changes.
|
|
12
20
|
*/
|
|
13
21
|
export declare const CHAT_DAEMON_GENERATIONS: Readonly<Record<ChatDaemonKind, number>>;
|
|
14
22
|
export declare function chatDaemonGeneration(kind: ChatDaemonKind): number;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* removed), but the user can still adjust per-surface behaviour from inside a
|
|
6
6
|
* session thread with small slash commands:
|
|
7
7
|
*
|
|
8
|
-
* - `/verbose` switch the mirror to
|
|
9
|
-
* - `/lean`
|
|
8
|
+
* - `/verbose` switch the mirror to per-turn assistant text + tool summaries + reasoning summaries
|
|
9
|
+
* - `/lean` settled assistant answer at idle + immediate ask lead-ins (no intermediate tool-turn flood)
|
|
10
10
|
* - `/verbosity lean|verbose`
|
|
11
11
|
* - `/redact on|off` toggle redaction of streamed content
|
|
12
12
|
*
|
|
@@ -287,6 +287,8 @@ export interface RedactableAction {
|
|
|
287
287
|
question?: string;
|
|
288
288
|
options?: string[];
|
|
289
289
|
summary?: string;
|
|
290
|
+
/** Optional zero-based recommendation into the authoritative raw options. */
|
|
291
|
+
recommendedIndex?: number;
|
|
290
292
|
}
|
|
291
293
|
/**
|
|
292
294
|
* When redact is true, strip sensitive content for remote delivery:
|
|
@@ -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>;
|
|
@@ -56,6 +56,7 @@ export declare class ConversationStore<T extends ConversationRecord> {
|
|
|
56
56
|
pidAlive?: (pid: number) => boolean;
|
|
57
57
|
sleep?: (ms: number) => Promise<void>;
|
|
58
58
|
lockTimeoutMs?: number;
|
|
59
|
+
platform?: NodeJS.Platform;
|
|
59
60
|
});
|
|
60
61
|
get filePath(): string;
|
|
61
62
|
load(): Promise<ConversationStoreDocument<T>>;
|
|
@@ -29,7 +29,9 @@ import { CursorRegistry, RevisionStore } from "../host/query";
|
|
|
29
29
|
import { type SdkStartupFailure } from "../startup-capability";
|
|
30
30
|
import { type NotificationConfig } from "./config";
|
|
31
31
|
import { NotificationSessionController } from "./session-control";
|
|
32
|
-
import { type EnsureDaemonResult } from "./telegram-daemon";
|
|
32
|
+
import { type EnsureDaemonResult, type RegisterNotificationRootResult } from "./telegram-daemon";
|
|
33
|
+
export type { IdentityControlSuccessPathInput, IdentityControlTerminalPathInput, TerminalSendOutcome, } from "./control-drain-lease";
|
|
34
|
+
export { isNativeControlDrainAvailable, runIdentityControlSuccessPath, runIdentityControlTerminalPath, } from "./control-drain-lease";
|
|
33
35
|
/** Where a `session_create` should run. Discriminated by `kind`. */
|
|
34
36
|
export type SessionCreateTarget = {
|
|
35
37
|
kind: "existing_path";
|
|
@@ -204,6 +206,7 @@ interface UnattendedGatePresentation {
|
|
|
204
206
|
question: string;
|
|
205
207
|
options: string[];
|
|
206
208
|
controls: readonly AskRemoteControl[];
|
|
209
|
+
recommendedIndex?: number;
|
|
207
210
|
multi: boolean;
|
|
208
211
|
allowEmpty: boolean;
|
|
209
212
|
navigationLabel?: "Next" | "Done";
|
|
@@ -296,6 +299,8 @@ interface SessionRuntime {
|
|
|
296
299
|
disposeGateListener: () => void;
|
|
297
300
|
/** Whether notification-only delivery and answer resources are active. */
|
|
298
301
|
notificationsActive: boolean;
|
|
302
|
+
/** Rejects new SDK frames while a leased terminal response drains. */
|
|
303
|
+
inboundFenced: boolean;
|
|
299
304
|
/** Set as soon as terminal teardown is requested, before startup settles. */
|
|
300
305
|
stopping: boolean;
|
|
301
306
|
/** Recreates notification-only resources after `/notify on`. */
|
|
@@ -323,6 +328,12 @@ interface SessionRuntime {
|
|
|
323
328
|
hostStopped: boolean;
|
|
324
329
|
serverStopped: boolean;
|
|
325
330
|
brokerRegistrationReleased: boolean;
|
|
331
|
+
/** Managed Telegram root registration released during terminal teardown. */
|
|
332
|
+
notificationRootRegistration?: {
|
|
333
|
+
settings: Settings;
|
|
334
|
+
cwd: string;
|
|
335
|
+
registrationToken?: string;
|
|
336
|
+
};
|
|
326
337
|
verbosity: "lean" | "verbose";
|
|
327
338
|
sessionTag: string;
|
|
328
339
|
/** Whether the agent loop is currently running (drives the typing indicator). */
|
|
@@ -343,6 +354,21 @@ interface SessionRuntime {
|
|
|
343
354
|
commandId: string;
|
|
344
355
|
turnId: string;
|
|
345
356
|
} | undefined) => boolean;
|
|
357
|
+
/** Transitions the authoritative reconciliation record at lifecycle ingress; terminal outcomes settle once. */
|
|
358
|
+
notePromptReconciliation: (correlation: {
|
|
359
|
+
commandId: string;
|
|
360
|
+
turnId: string;
|
|
361
|
+
} | undefined, frame: {
|
|
362
|
+
type: "agent_start" | "agent_end";
|
|
363
|
+
} | {
|
|
364
|
+
type: "agent_failed";
|
|
365
|
+
error: unknown;
|
|
366
|
+
}) => void;
|
|
367
|
+
/** Settles and emits one sanitized correlated prompt failure. */
|
|
368
|
+
emitPromptFailure: (correlation: {
|
|
369
|
+
commandId: string;
|
|
370
|
+
turnId: string;
|
|
371
|
+
}, error: unknown) => void;
|
|
346
372
|
/** Records correlated lifecycle frames for replay and delivers them only to the accepted requester after acknowledgement. */
|
|
347
373
|
emitPromptLifecycle: (correlation: {
|
|
348
374
|
commandId: string;
|
|
@@ -352,6 +378,7 @@ interface SessionRuntime {
|
|
|
352
378
|
sessionId: string;
|
|
353
379
|
commandId?: string;
|
|
354
380
|
turnId?: string;
|
|
381
|
+
finalText?: string;
|
|
355
382
|
} | {
|
|
356
383
|
type: "agent_failed";
|
|
357
384
|
sessionId: string;
|
|
@@ -385,6 +412,15 @@ interface SessionRuntime {
|
|
|
385
412
|
text?: string;
|
|
386
413
|
messageRef?: string;
|
|
387
414
|
};
|
|
415
|
+
/**
|
|
416
|
+
* Lean-mode deferred final answer: latest assistant text observed at `turn_end`,
|
|
417
|
+
* emitted once at `agent_end` so intermediate tool-turn narration does not flood
|
|
418
|
+
* remote clients. Cleared after flush or when replaced by a newer turn.
|
|
419
|
+
*/
|
|
420
|
+
pendingSettled?: {
|
|
421
|
+
text: string;
|
|
422
|
+
messageRef?: string;
|
|
423
|
+
};
|
|
388
424
|
/** Durable gates emitted while ownership is provisional; presented only after stable activation. */
|
|
389
425
|
deferredGatePresentations: Array<() => void>;
|
|
390
426
|
/** SDK control frames received during provisional ownership; replayed only after stable activation. */
|
|
@@ -392,7 +428,8 @@ interface SessionRuntime {
|
|
|
392
428
|
/** Started tool calls awaiting a terminal activity frame, keyed by tool call id. */
|
|
393
429
|
inFlightTools: Map<string, {
|
|
394
430
|
toolName: string;
|
|
395
|
-
args
|
|
431
|
+
args?: unknown;
|
|
432
|
+
pendingPhase?: "completed" | "failed" | "cancelled";
|
|
396
433
|
}>;
|
|
397
434
|
/** Cancels the postmortem cleanup that emits `session_closed` on process teardown. */
|
|
398
435
|
cancelPostmortemCleanup: () => void;
|
|
@@ -480,12 +517,24 @@ export declare class EphemeralTurnHost {
|
|
|
480
517
|
* an identity for a transport that never became available is false success.
|
|
481
518
|
*/
|
|
482
519
|
export declare function ensureConfiguredProviderDaemons(settings: Settings, cfg: NotificationConfig, ensureProviderDaemon?: (provider: "discord" | "slack", settings: Settings) => Promise<unknown>): Promise<void>;
|
|
520
|
+
/**
|
|
521
|
+
* Classify whether a session identity event must await notification endpoint startup.
|
|
522
|
+
* Only an interactive selector resume may defer this ancillary startup; all other
|
|
523
|
+
* events, including branches and unknown origins, fail closed to awaiting it.
|
|
524
|
+
*/
|
|
525
|
+
export declare function shouldAwaitNotificationStartup(event: {
|
|
526
|
+
type: "session_switch" | "session_branch";
|
|
527
|
+
transition?: {
|
|
528
|
+
origin: string;
|
|
529
|
+
};
|
|
530
|
+
}): boolean;
|
|
483
531
|
export declare function createNotificationsExtension(api: ExtensionAPI, options?: {
|
|
484
532
|
settings?: Settings;
|
|
485
533
|
ensureTelegramDaemon?: (input: {
|
|
486
534
|
settings: Settings;
|
|
487
535
|
cwd: string;
|
|
488
536
|
sessionId: string;
|
|
537
|
+
onRegistered?: (registration: RegisterNotificationRootResult) => void;
|
|
489
538
|
}) => Promise<EnsureDaemonResult>;
|
|
490
539
|
ensureProviderDaemon?: (provider: "discord" | "slack", settings: Settings) => Promise<unknown>;
|
|
491
540
|
/** Suppress auto-delivery for a SKC-spawned child under `sessionScope=primary`. */
|
|
@@ -494,7 +543,7 @@ export declare function createNotificationsExtension(api: ExtensionAPI, options?
|
|
|
494
543
|
/** Whether this host mode can own the root SDK endpoint. Default: true. */
|
|
495
544
|
sdkHostModeSupported?: boolean;
|
|
496
545
|
onSdkRequest?: (kind: "control" | "query", connectionId: string, frame: Record<string, unknown>) => void;
|
|
497
|
-
|
|
546
|
+
runBtwTurn?: (question: string, signal: AbortSignal) => Promise<{
|
|
498
547
|
replyText: string;
|
|
499
548
|
}>;
|
|
500
549
|
/** Observes settlement of optional session-branch startup after reconciliation completes. */
|
|
@@ -505,4 +554,3 @@ export declare function createNotificationsExtension(api: ExtensionAPI, options?
|
|
|
505
554
|
readNotificationFile?: (path: string) => Promise<Buffer>;
|
|
506
555
|
readNotificationDiffStat?: (cwd: string) => Promise<string | undefined>;
|
|
507
556
|
}): void;
|
|
508
|
-
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
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 PromptCorrelation, type PromptReconciliationStatus, type TurnPromptReconciliation } from "./prompt-reconciliation";
|
|
6
|
+
import type { ReconciliationKind, ReconciliationStore } from "./reconciliation-store";
|
|
7
|
+
export type { ReconciliationKind };
|
|
8
|
+
export interface KindCorrelation extends PromptCorrelation {
|
|
9
|
+
kind: ReconciliationKind;
|
|
10
|
+
}
|
|
11
|
+
export interface KindAwareReconciliation {
|
|
12
|
+
admit(kind: ReconciliationKind, clientRef?: string): void;
|
|
13
|
+
releaseAdmission(kind: ReconciliationKind, clientRef?: string): void;
|
|
14
|
+
noteAccepted(kind: ReconciliationKind, correlation: PromptCorrelation, clientRef?: string, extra?: {
|
|
15
|
+
skillName?: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
noteTransition(kind: ReconciliationKind, correlation: PromptCorrelation | undefined, frame: {
|
|
18
|
+
type: "agent_start" | "agent_end";
|
|
19
|
+
} | {
|
|
20
|
+
type: "agent_failed";
|
|
21
|
+
error: unknown;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
lookup(kind: ReconciliationKind, selector: {
|
|
24
|
+
commandId?: string;
|
|
25
|
+
turnId?: string;
|
|
26
|
+
clientRef?: string;
|
|
27
|
+
}): TurnPromptReconciliation;
|
|
28
|
+
cleanup(): void;
|
|
29
|
+
activeCount(kind: ReconciliationKind): number;
|
|
30
|
+
/** Hydrate from durable store (call once at session host start). */
|
|
31
|
+
hydrateFromStore(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export declare function createKindAwareReconciliation(options?: {
|
|
34
|
+
now?: () => number;
|
|
35
|
+
store?: ReconciliationStore | null;
|
|
36
|
+
}): KindAwareReconciliation;
|
|
37
|
+
export type { PromptReconciliationStatus };
|
|
@@ -62,8 +62,9 @@ export declare function normalizeLifecyclePath(value: string): string | undefine
|
|
|
62
62
|
/**
|
|
63
63
|
* Map a lifecycle response/error to a user-facing Telegram message (G010).
|
|
64
64
|
*
|
|
65
|
-
* Only derives text from sessionId, mode, reason, a safe message,
|
|
66
|
-
* {sessionId,path} — never a token or prompt. Each
|
|
67
|
-
* actionable copy; an "in progress" pending response
|
|
65
|
+
* Only derives text from sessionId, mode, reason, a safe message, the originating
|
|
66
|
+
* lifecycle verb, and candidate {sessionId,path} — never a token or prompt. Each
|
|
67
|
+
* error reason gets tailored, actionable copy; an "in progress" pending response
|
|
68
|
+
* is surfaced distinctly.
|
|
68
69
|
*/
|
|
69
|
-
export declare function formatLifecycleOutcome(r: SessionLifecycleResponse): string;
|
|
70
|
+
export declare function formatLifecycleOutcome(r: SessionLifecycleResponse, verb?: LifecycleCommandVerb): string;
|
|
@@ -74,6 +74,40 @@ export interface NotificationStatusReport {
|
|
|
74
74
|
export declare function buildNotificationStatusReport(settings: Settings): NotificationStatusReport;
|
|
75
75
|
/** Render a status report as human-readable lines (no secrets). */
|
|
76
76
|
export declare function formatNotificationStatusReport(report: NotificationStatusReport): string;
|
|
77
|
+
export interface NotificationEndpointView {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
pid: number | undefined;
|
|
80
|
+
stale: boolean;
|
|
81
|
+
}
|
|
82
|
+
export type NotificationEndpointLiveness = "live" | "dead" | "unknown";
|
|
83
|
+
/**
|
|
84
|
+
* Classification used by recovery and startup takeover. A file is an endpoint
|
|
85
|
+
* only when it has endpoint authority fields; lifecycle/audit records are never
|
|
86
|
+
* candidates for endpoint cleanup.
|
|
87
|
+
*/
|
|
88
|
+
export type NotificationEndpointClassification = {
|
|
89
|
+
kind: "endpoint";
|
|
90
|
+
view: NotificationEndpointView;
|
|
91
|
+
liveness: NotificationEndpointLiveness;
|
|
92
|
+
identity: NotificationEndpointFileIdentity;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "non-endpoint";
|
|
95
|
+
} | {
|
|
96
|
+
kind: "unreadable";
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Classify an endpoint using owner-proof semantics. An endpoint is only `dead`
|
|
100
|
+
* with positive proof: an explicit `stale` tombstone, or a recorded pid that is
|
|
101
|
+
* confirmed not alive. A PID-less endpoint is `unknown` (not provably dead) and
|
|
102
|
+
* must never be treated as dead — removing it could delete a live session's
|
|
103
|
+
* discovery file that simply omitted a pid.
|
|
104
|
+
*/
|
|
105
|
+
export declare function notificationEndpointLiveness(view: NotificationEndpointView, pidAlive: (pid: number) => boolean): NotificationEndpointLiveness;
|
|
106
|
+
/**
|
|
107
|
+
* Read and classify one endpoint candidate. The returned identity belongs to
|
|
108
|
+
* exactly the bytes inspected and is required for any later deletion.
|
|
109
|
+
*/
|
|
110
|
+
export declare function classifyNotificationEndpoint(fs: Pick<NotificationServiceFs, "readEndpointFile">, file: string, pidAlive: (pid: number) => boolean): Promise<NotificationEndpointClassification>;
|
|
77
111
|
export type HealthLevel = "ok" | "warn" | "error";
|
|
78
112
|
export interface HealthCheck {
|
|
79
113
|
name: string;
|
|
@@ -47,6 +47,7 @@ export declare class NotificationOperatorRuntime {
|
|
|
47
47
|
stopInterval(name: string): void;
|
|
48
48
|
stopAllIntervals(): void;
|
|
49
49
|
runExclusive(name: string, fn: () => Promise<void>): Promise<void>;
|
|
50
|
+
joinExclusive(name: string, timeoutMs: number): Promise<boolean>;
|
|
50
51
|
sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
51
52
|
now(): number;
|
|
52
53
|
}
|