@sayknow-cli/coding-agent 0.4.7 → 0.5.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 +122 -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
|
@@ -59,6 +59,8 @@ export interface TaskResultReceipt {
|
|
|
59
59
|
extractedToolCounts?: Record<string, number>;
|
|
60
60
|
forkContext?: SingleResult["forkContext"];
|
|
61
61
|
forkContextAdvisory?: SingleResult["forkContextAdvisory"];
|
|
62
|
+
/** Resolved repository identity for this delegated lane (#2901). */
|
|
63
|
+
repositoryBinding?: SingleResult["repositoryBinding"];
|
|
62
64
|
roi?: TaskRoi;
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
@@ -45,6 +45,10 @@ export declare const taskItemSchema: z.ZodObject<{
|
|
|
45
45
|
id: z.ZodString;
|
|
46
46
|
description: z.ZodString;
|
|
47
47
|
assignment: z.ZodString;
|
|
48
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
default: "default";
|
|
50
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
51
|
+
}>>;
|
|
48
52
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
49
53
|
none: "none";
|
|
50
54
|
receipt: "receipt";
|
|
@@ -52,6 +56,15 @@ export declare const taskItemSchema: z.ZodObject<{
|
|
|
52
56
|
bounded: "bounded";
|
|
53
57
|
full: "full";
|
|
54
58
|
}>>;
|
|
59
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
61
|
+
worktreeRoot: z.ZodString;
|
|
62
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
63
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
64
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
65
|
+
head: z.ZodOptional<z.ZodString>;
|
|
66
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>>;
|
|
55
68
|
}, z.core.$strip>;
|
|
56
69
|
export type TaskItem = z.infer<typeof taskItemSchema>;
|
|
57
70
|
export declare const taskSchema: z.ZodObject<{
|
|
@@ -60,6 +73,10 @@ export declare const taskSchema: z.ZodObject<{
|
|
|
60
73
|
id: z.ZodString;
|
|
61
74
|
description: z.ZodString;
|
|
62
75
|
assignment: z.ZodString;
|
|
76
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
default: "default";
|
|
78
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
79
|
+
}>>;
|
|
63
80
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
64
81
|
none: "none";
|
|
65
82
|
receipt: "receipt";
|
|
@@ -67,6 +84,15 @@ export declare const taskSchema: z.ZodObject<{
|
|
|
67
84
|
bounded: "bounded";
|
|
68
85
|
full: "full";
|
|
69
86
|
}>>;
|
|
87
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
89
|
+
worktreeRoot: z.ZodString;
|
|
90
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
91
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
92
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
93
|
+
head: z.ZodOptional<z.ZodString>;
|
|
94
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>>;
|
|
70
96
|
}, z.core.$strip>>;
|
|
71
97
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
72
98
|
whyParallel: z.ZodString;
|
|
@@ -82,6 +108,10 @@ export declare const taskSchemaNoIsolation: z.ZodObject<{
|
|
|
82
108
|
id: z.ZodString;
|
|
83
109
|
description: z.ZodString;
|
|
84
110
|
assignment: z.ZodString;
|
|
111
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
112
|
+
default: "default";
|
|
113
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
114
|
+
}>>;
|
|
85
115
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
86
116
|
none: "none";
|
|
87
117
|
receipt: "receipt";
|
|
@@ -89,6 +119,15 @@ export declare const taskSchemaNoIsolation: z.ZodObject<{
|
|
|
89
119
|
bounded: "bounded";
|
|
90
120
|
full: "full";
|
|
91
121
|
}>>;
|
|
122
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
124
|
+
worktreeRoot: z.ZodString;
|
|
125
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
126
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
127
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
128
|
+
head: z.ZodOptional<z.ZodString>;
|
|
129
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
92
131
|
}, z.core.$strip>>;
|
|
93
132
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
94
133
|
whyParallel: z.ZodString;
|
|
@@ -104,6 +143,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
104
143
|
id: z.ZodString;
|
|
105
144
|
description: z.ZodString;
|
|
106
145
|
assignment: z.ZodString;
|
|
146
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
147
|
+
default: "default";
|
|
148
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
149
|
+
}>>;
|
|
107
150
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
108
151
|
none: "none";
|
|
109
152
|
receipt: "receipt";
|
|
@@ -111,6 +154,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
111
154
|
bounded: "bounded";
|
|
112
155
|
full: "full";
|
|
113
156
|
}>>;
|
|
157
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
159
|
+
worktreeRoot: z.ZodString;
|
|
160
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
161
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
162
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
163
|
+
head: z.ZodOptional<z.ZodString>;
|
|
164
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
114
166
|
}, z.core.$strip>>;
|
|
115
167
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
116
168
|
whyParallel: z.ZodString;
|
|
@@ -125,6 +177,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
125
177
|
id: z.ZodString;
|
|
126
178
|
description: z.ZodString;
|
|
127
179
|
assignment: z.ZodString;
|
|
180
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
default: "default";
|
|
182
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
183
|
+
}>>;
|
|
128
184
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
129
185
|
none: "none";
|
|
130
186
|
receipt: "receipt";
|
|
@@ -132,6 +188,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
132
188
|
bounded: "bounded";
|
|
133
189
|
full: "full";
|
|
134
190
|
}>>;
|
|
191
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
193
|
+
worktreeRoot: z.ZodString;
|
|
194
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
195
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
196
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
197
|
+
head: z.ZodOptional<z.ZodString>;
|
|
198
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
135
200
|
}, z.core.$strip>>;
|
|
136
201
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
137
202
|
whyParallel: z.ZodString;
|
|
@@ -146,6 +211,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
146
211
|
id: z.ZodString;
|
|
147
212
|
description: z.ZodString;
|
|
148
213
|
assignment: z.ZodString;
|
|
214
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
215
|
+
default: "default";
|
|
216
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
217
|
+
}>>;
|
|
149
218
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
150
219
|
none: "none";
|
|
151
220
|
receipt: "receipt";
|
|
@@ -153,6 +222,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
153
222
|
bounded: "bounded";
|
|
154
223
|
full: "full";
|
|
155
224
|
}>>;
|
|
225
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
227
|
+
worktreeRoot: z.ZodString;
|
|
228
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
229
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
230
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
231
|
+
head: z.ZodOptional<z.ZodString>;
|
|
232
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
233
|
+
}, z.core.$strict>>;
|
|
156
234
|
}, z.core.$strip>>;
|
|
157
235
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
158
236
|
whyParallel: z.ZodString;
|
|
@@ -167,6 +245,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
167
245
|
id: z.ZodString;
|
|
168
246
|
description: z.ZodString;
|
|
169
247
|
assignment: z.ZodString;
|
|
248
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
249
|
+
default: "default";
|
|
250
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
251
|
+
}>>;
|
|
170
252
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
171
253
|
none: "none";
|
|
172
254
|
receipt: "receipt";
|
|
@@ -174,6 +256,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
174
256
|
bounded: "bounded";
|
|
175
257
|
full: "full";
|
|
176
258
|
}>>;
|
|
259
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
261
|
+
worktreeRoot: z.ZodString;
|
|
262
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
263
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
264
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
265
|
+
head: z.ZodOptional<z.ZodString>;
|
|
266
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, z.core.$strict>>;
|
|
177
268
|
}, z.core.$strip>>;
|
|
178
269
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
179
270
|
whyParallel: z.ZodString;
|
|
@@ -188,6 +279,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
188
279
|
id: z.ZodString;
|
|
189
280
|
description: z.ZodString;
|
|
190
281
|
assignment: z.ZodString;
|
|
282
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
283
|
+
default: "default";
|
|
284
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
285
|
+
}>>;
|
|
191
286
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
192
287
|
none: "none";
|
|
193
288
|
receipt: "receipt";
|
|
@@ -195,6 +290,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
195
290
|
bounded: "bounded";
|
|
196
291
|
full: "full";
|
|
197
292
|
}>>;
|
|
293
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
295
|
+
worktreeRoot: z.ZodString;
|
|
296
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
297
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
298
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
299
|
+
head: z.ZodOptional<z.ZodString>;
|
|
300
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
301
|
+
}, z.core.$strict>>;
|
|
198
302
|
}, z.core.$strip>>;
|
|
199
303
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
200
304
|
whyParallel: z.ZodString;
|
|
@@ -209,6 +313,10 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
209
313
|
id: z.ZodString;
|
|
210
314
|
description: z.ZodString;
|
|
211
315
|
assignment: z.ZodString;
|
|
316
|
+
executionMode: z.ZodOptional<z.ZodEnum<{
|
|
317
|
+
default: "default";
|
|
318
|
+
"ultragoal-red-team": "ultragoal-red-team";
|
|
319
|
+
}>>;
|
|
212
320
|
inheritContext: z.ZodOptional<z.ZodEnum<{
|
|
213
321
|
none: "none";
|
|
214
322
|
receipt: "receipt";
|
|
@@ -216,6 +324,15 @@ declare const ALL_TASK_SCHEMAS: readonly [z.ZodObject<{
|
|
|
216
324
|
bounded: "bounded";
|
|
217
325
|
full: "full";
|
|
218
326
|
}>>;
|
|
327
|
+
repositoryBinding: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
schema: z.ZodLiteral<"skc.repository_binding.v1">;
|
|
329
|
+
worktreeRoot: z.ZodString;
|
|
330
|
+
commonDir: z.ZodNullable<z.ZodString>;
|
|
331
|
+
relativeSubdir: z.ZodOptional<z.ZodString>;
|
|
332
|
+
displayPath: z.ZodOptional<z.ZodString>;
|
|
333
|
+
head: z.ZodOptional<z.ZodString>;
|
|
334
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strict>>;
|
|
219
336
|
}, z.core.$strip>>;
|
|
220
337
|
spawnPlan: z.ZodOptional<z.ZodObject<{
|
|
221
338
|
whyParallel: z.ZodString;
|
|
@@ -335,6 +452,9 @@ export interface AgentProgress {
|
|
|
335
452
|
attempt: number;
|
|
336
453
|
maxAttempts: number;
|
|
337
454
|
unbounded?: boolean;
|
|
455
|
+
kind: "first_event_timeout" | "idle_stream_stall" | "provider_error";
|
|
456
|
+
provider?: string;
|
|
457
|
+
lastProviderProgressAtMs?: number;
|
|
338
458
|
delayMs: number;
|
|
339
459
|
errorMessage: string;
|
|
340
460
|
startedAtMs: number;
|
|
@@ -431,6 +551,19 @@ export interface SingleResult {
|
|
|
431
551
|
recommendedMode: ForkContextMode;
|
|
432
552
|
reasons: string[];
|
|
433
553
|
};
|
|
554
|
+
/**
|
|
555
|
+
* Resolved repository identity used for this task after pre-discovery stamping
|
|
556
|
+
* and fail-closed validation (#2901).
|
|
557
|
+
*/
|
|
558
|
+
repositoryBinding?: {
|
|
559
|
+
schema: "skc.repository_binding.v1";
|
|
560
|
+
worktreeRoot: string;
|
|
561
|
+
commonDir: string | null;
|
|
562
|
+
relativeSubdir?: string;
|
|
563
|
+
displayPath?: string;
|
|
564
|
+
head?: string;
|
|
565
|
+
branch?: string;
|
|
566
|
+
};
|
|
434
567
|
}
|
|
435
568
|
/** True only for complete, factual five-bucket cost accounting. */
|
|
436
569
|
export declare function hasCompleteUsageCostBreakdown(usage: unknown): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decide whether an executor assignment should inject the ultragoal red-team
|
|
3
|
+
* prompt fragment.
|
|
4
|
+
*
|
|
5
|
+
* Preference order (parse, don't re-validate later):
|
|
6
|
+
* 1. Explicit typed `executionMode` on the task / ExecutorOptions — authoritative.
|
|
7
|
+
* 2. Assignment text heuristics — only explicit Ultragoal QA/red-team phrasing.
|
|
8
|
+
*
|
|
9
|
+
* Bare mentions of `executorQa` (docs, quality-gate field names, negative
|
|
10
|
+
* instructions) must not flip the mode (#2698 / #2456).
|
|
11
|
+
*
|
|
12
|
+
* Mirrors `executor.md`:
|
|
13
|
+
* "activates only when the assignment explicitly labels Executor as Ultragoal
|
|
14
|
+
* completion QA/red-team or asks for `executorQa` red-team evidence."
|
|
15
|
+
*/
|
|
16
|
+
export declare const EXECUTOR_EXECUTION_MODES: readonly ["default", "ultragoal-red-team"];
|
|
17
|
+
export type ExecutorExecutionMode = (typeof EXECUTOR_EXECUTION_MODES)[number];
|
|
18
|
+
export declare function isExecutorExecutionMode(value: unknown): value is ExecutorExecutionMode;
|
|
19
|
+
/**
|
|
20
|
+
* Parse a caller-supplied mode. Unknown values fail closed to `undefined`
|
|
21
|
+
* so the assignment heuristic (or default off) still applies — never invent on.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseExecutorExecutionMode(value: unknown): ExecutorExecutionMode | undefined;
|
|
24
|
+
export declare function assignmentRequestsUltragoalRedTeam(assignment: string | undefined): boolean;
|
|
25
|
+
export interface ResolveUltragoalRedTeamArgs {
|
|
26
|
+
readonly executionMode?: unknown;
|
|
27
|
+
readonly assignment?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Final activation decision for the executor prompt fragment.
|
|
31
|
+
* Typed mode wins; assignment text is a compatibility fallback only.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveUltragoalRedTeamActivation(args: ResolveUltragoalRedTeamArgs): boolean;
|
|
@@ -13,6 +13,13 @@ export declare const DEFAULT_VIEWPORT: {
|
|
|
13
13
|
export declare const BROWSER_PROTOCOL_TIMEOUT_MS = 60000;
|
|
14
14
|
export declare function loadPuppeteer(): Promise<typeof Puppeteer>;
|
|
15
15
|
export declare function loadPuppeteerInWorker(safeDir: string): Promise<typeof Puppeteer>;
|
|
16
|
+
/** Test seam: the browser launch overrides as resolved from trusted env. */
|
|
17
|
+
export declare function resolveBrowserEnvOverridesForTest(): {
|
|
18
|
+
executablePath: string | undefined;
|
|
19
|
+
proxy: string | undefined;
|
|
20
|
+
proxyBypassLoopback: boolean;
|
|
21
|
+
ignoreCertErrors: boolean;
|
|
22
|
+
};
|
|
16
23
|
export interface LaunchHeadlessOptions {
|
|
17
24
|
headless: boolean;
|
|
18
25
|
viewport?: {
|
|
@@ -4,6 +4,7 @@ import type { Settings } from "../config/settings";
|
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
7
|
+
import { type TruncationDirection } from "../session/streaming-output";
|
|
7
8
|
import type { RenderResult } from "../web/scrapers/types";
|
|
8
9
|
import { type OutputMeta } from "./output-meta";
|
|
9
10
|
export declare function isReadableUrlPath(value: string): boolean;
|
|
@@ -14,6 +15,11 @@ export interface ParsedReadUrlTarget {
|
|
|
14
15
|
limit?: number;
|
|
15
16
|
}
|
|
16
17
|
export declare function parseReadUrlTarget(readPath: string): ParsedReadUrlTarget | null;
|
|
18
|
+
export declare function renderHtmlToText(html: string, signal?: AbortSignal): Promise<{
|
|
19
|
+
content: string;
|
|
20
|
+
ok: boolean;
|
|
21
|
+
method: string;
|
|
22
|
+
}>;
|
|
17
23
|
interface FetchImagePayload {
|
|
18
24
|
data: string;
|
|
19
25
|
mimeType: string;
|
|
@@ -21,14 +27,6 @@ interface FetchImagePayload {
|
|
|
21
27
|
type FetchRenderResult = RenderResult & {
|
|
22
28
|
image?: FetchImagePayload;
|
|
23
29
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Opt-in insane-search fallback for blocked / degraded public URL reads.
|
|
26
|
-
*
|
|
27
|
-
* Returns a finalized `method: "insane"` result on success, or null (so the
|
|
28
|
-
* caller continues with its normal degraded behavior). Fail-closed: no note,
|
|
29
|
-
* guard DNS, dependency probe, or subprocess when raw mode or the opt-in
|
|
30
|
-
* setting is off. The public-URL guard runs BEFORE any probe/spawn.
|
|
31
|
-
*/
|
|
32
30
|
export declare function tryInsaneFallback(args: {
|
|
33
31
|
url: string;
|
|
34
32
|
finalUrl: string;
|
|
@@ -53,7 +51,12 @@ interface ReadUrlCacheEntry {
|
|
|
53
51
|
artifactId?: string;
|
|
54
52
|
details: ReadUrlToolDetails;
|
|
55
53
|
image?: FetchImagePayload;
|
|
54
|
+
/** Complete URL output, including its preamble and body. */
|
|
56
55
|
output: string;
|
|
56
|
+
/** UTF-16 code-unit offset of the preamble in `output`. */
|
|
57
|
+
preambleChars: number;
|
|
58
|
+
/** Offset of the preamble after `wrapUntrustedContent(output)` is persisted. */
|
|
59
|
+
wrappedPreambleChars?: number;
|
|
57
60
|
}
|
|
58
61
|
export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
|
|
59
62
|
path: string;
|
|
@@ -62,11 +65,21 @@ export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
|
|
|
62
65
|
ensureArtifact?: boolean;
|
|
63
66
|
preferCached?: boolean;
|
|
64
67
|
}): Promise<ReadUrlCacheEntry>;
|
|
68
|
+
export declare const WRAP_PREFIX_CHARS: number;
|
|
69
|
+
export declare function escapeUntrustedContent(content: string): string;
|
|
65
70
|
export declare function wrapUntrustedContent(content: string): string;
|
|
71
|
+
/**
|
|
72
|
+
* Remove only the outer URL-output wrapper before line pagination. The content
|
|
73
|
+
* remains escaped exactly as persisted; it is deliberately never unescaped.
|
|
74
|
+
*/
|
|
75
|
+
export declare function prepareReadUrlSelectorInput(output: string, preambleChars: number, wrappedPreambleChars?: number): {
|
|
76
|
+
text: string;
|
|
77
|
+
preambleChars: number;
|
|
78
|
+
};
|
|
66
79
|
export declare function executeReadUrl(session: ToolSession, params: {
|
|
67
80
|
path: string;
|
|
68
81
|
raw?: boolean;
|
|
69
|
-
}, signal?: AbortSignal): Promise<AgentToolResult<ReadUrlToolDetails>>;
|
|
82
|
+
}, signal?: AbortSignal, direction?: TruncationDirection): Promise<AgentToolResult<ReadUrlToolDetails>>;
|
|
70
83
|
/** Render URL read call (URL preview) */
|
|
71
84
|
export declare function renderReadUrlCall(args: {
|
|
72
85
|
path?: string;
|
|
@@ -2,7 +2,7 @@ import { type Model } from "@sayknow-cli/ai";
|
|
|
2
2
|
import * as z from "zod/v4";
|
|
3
3
|
import { type ModelRegistry } from "../config/model-registry";
|
|
4
4
|
import type { CustomTool } from "../extensibility/custom-tools/types";
|
|
5
|
-
type ImageProvider = "antigravity" | "gemini" | "openai" | "openai-codex" | "openrouter";
|
|
5
|
+
type ImageProvider = "alibaba" | "antigravity" | "gemini" | "openai" | "openai-codex" | "openrouter";
|
|
6
6
|
declare const responseModalitySchema: z.ZodEnum<{
|
|
7
7
|
IMAGE: "IMAGE";
|
|
8
8
|
TEXT: "TEXT";
|
|
@@ -55,6 +55,52 @@ interface OpenAIResponsesUsage {
|
|
|
55
55
|
total_tokens?: number;
|
|
56
56
|
}
|
|
57
57
|
type ImageUsageMetadata = GeminiUsageMetadata | OpenAIResponsesUsage;
|
|
58
|
+
interface AlibabaImageContentPart {
|
|
59
|
+
type?: string;
|
|
60
|
+
text?: string;
|
|
61
|
+
image?: string;
|
|
62
|
+
}
|
|
63
|
+
interface AlibabaImageResponse {
|
|
64
|
+
code?: string;
|
|
65
|
+
message?: string;
|
|
66
|
+
output?: {
|
|
67
|
+
choices?: Array<{
|
|
68
|
+
message?: {
|
|
69
|
+
content?: AlibabaImageContentPart[];
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Map the tool's image_size values onto wan2.7's 1K/2K size classes. */
|
|
75
|
+
export declare function resolveAlibabaImageSize(imageSize: string | undefined): string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Build the Bailian multimodal-generation request body for wan2.7 image
|
|
78
|
+
* generation/editing. Input images ride along as data URLs; generation-only
|
|
79
|
+
* calls send just the prompt text. The sync endpoint returns OSS URLs inline.
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildAlibabaImageRequest(model: string, promptText: string, inputImages: InlineImageData[], imageSize: string | undefined): {
|
|
82
|
+
model: string;
|
|
83
|
+
input: {
|
|
84
|
+
messages: Array<{
|
|
85
|
+
role: "user";
|
|
86
|
+
content: Array<{
|
|
87
|
+
text: string;
|
|
88
|
+
} | {
|
|
89
|
+
image: string;
|
|
90
|
+
}>;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
parameters: {
|
|
94
|
+
n: number;
|
|
95
|
+
watermark: boolean;
|
|
96
|
+
size?: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/** Collect OSS image URLs and any text parts from a Bailian image response. */
|
|
100
|
+
export declare function collectAlibabaImageResult(response: AlibabaImageResponse): {
|
|
101
|
+
imageUrls: string[];
|
|
102
|
+
responseText?: string;
|
|
103
|
+
};
|
|
58
104
|
interface ImageGenToolDetails {
|
|
59
105
|
provider: ImageProvider;
|
|
60
106
|
model: string;
|
|
@@ -72,6 +118,22 @@ interface InlineImageData {
|
|
|
72
118
|
}
|
|
73
119
|
/** Set the preferred image provider from settings */
|
|
74
120
|
export declare function setPreferredImageProvider(provider: ImageProvider | "auto"): void;
|
|
121
|
+
/** Provider → default image model mapping for auto-binding */
|
|
122
|
+
export declare const IMAGE_PROVIDER_DEFAULTS: Record<string, string>;
|
|
123
|
+
/** Resolved image generation configuration from settings */
|
|
124
|
+
export interface ImageProviderConfig {
|
|
125
|
+
provider: ImageProvider | "auto" | "custom";
|
|
126
|
+
model: string | null;
|
|
127
|
+
customUrl?: string;
|
|
128
|
+
customKey?: string;
|
|
129
|
+
customKeyEnv?: string;
|
|
130
|
+
}
|
|
131
|
+
/** Set the configured image provider + model from settings */
|
|
132
|
+
export declare function setConfiguredImageModel(config: ImageProviderConfig | null): void;
|
|
133
|
+
/** Get the current configured image model (for UI display) */
|
|
134
|
+
export declare function getConfiguredImageModel(): ImageProviderConfig | null;
|
|
135
|
+
/** Resolve the effective image model for a configured provider */
|
|
136
|
+
export declare function resolveImageModel(provider: string, modelOverride: string | null): string;
|
|
75
137
|
export declare function isOpenAIHostedImageModel(model: Model | undefined): model is Model;
|
|
76
138
|
export declare const imageGenTool: CustomTool<typeof imageGenSchema, ImageGenToolDetails>;
|
|
77
139
|
export declare function getImageGenTools(modelRegistry?: ModelRegistry, activeModel?: Model): Promise<Array<CustomTool<typeof imageGenSchema, ImageGenToolDetails>>>;
|
|
@@ -82,6 +82,8 @@ export interface AskAnswerRequest {
|
|
|
82
82
|
options: string[];
|
|
83
83
|
interaction: "selector" | "custom_editor" | "clarification_editor";
|
|
84
84
|
controls: readonly AskRemoteControl[];
|
|
85
|
+
/** Optional zero-based recommendation into the authoritative raw options. */
|
|
86
|
+
recommendedIndex?: number;
|
|
85
87
|
}
|
|
86
88
|
export type AskRemoteInteraction = {
|
|
87
89
|
kind: "value";
|
|
@@ -155,6 +157,8 @@ export interface ToolSession {
|
|
|
155
157
|
* its terminal-phase chain guard. Returns the raw phase string or undefined
|
|
156
158
|
* when no active skill (or accessor) is available. */
|
|
157
159
|
getActiveSkillPhase?: () => string | undefined;
|
|
160
|
+
/** Restrict provider-facing deep-interview ask metadata to the active workflow stage. */
|
|
161
|
+
getDeepInterviewAskStage?: () => "topology" | "post-topology" | undefined;
|
|
158
162
|
/** Pre-loaded prompt templates */
|
|
159
163
|
promptTemplates?: PromptTemplate[];
|
|
160
164
|
/** Whether LSP integrations are enabled */
|
|
@@ -194,9 +198,11 @@ export interface ToolSession {
|
|
|
194
198
|
/** Agent identity used for IRC routing. Returns the registry id (e.g. "0-Main", "0-AuthLoader"). */
|
|
195
199
|
getAgentId?: () => string | null;
|
|
196
200
|
/** Look up a registered tool by name (used by the eval js backend's tool bridge). */
|
|
201
|
+
getToolByName?: (name: string) => AgentTool | undefined;
|
|
202
|
+
/** Look up a registered tool with the session's execution guards applied. */
|
|
203
|
+
getToolForExecution?: (name: string) => AgentTool | undefined;
|
|
197
204
|
/** Purge undelivered queued custom messages matching the predicate. Returns counts. */
|
|
198
205
|
purgeQueuedCustomMessages?: (predicate: (message: CustomMessage) => boolean) => PurgeQueuedCustomMessagesResult;
|
|
199
|
-
getToolByName?: (name: string) => AgentTool | undefined;
|
|
200
206
|
/** Agent registry for IRC routing across live sessions. */
|
|
201
207
|
agentRegistry?: AgentRegistry;
|
|
202
208
|
/** Optional restricted bash command prefixes for read-only role agents and constrained modes. */
|
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
import type { AgentTool } from "@sayknow-cli/agent-core";
|
|
8
8
|
import { type Settings } from "../config/settings";
|
|
9
9
|
import type { Theme } from "../modes/theme/theme";
|
|
10
|
-
import { type OutputSummary, type TruncationResult } from "../session/streaming-output";
|
|
10
|
+
import { type OutputSummary, type ReadWindow, type TruncationResult } from "../session/streaming-output";
|
|
11
11
|
/**
|
|
12
12
|
* Truncation metadata for the output notice.
|
|
13
13
|
*/
|
|
14
14
|
export interface TruncationMeta {
|
|
15
15
|
direction: "head" | "tail" | "middle";
|
|
16
|
+
/** Coordinate basis for shown/head/tail ranges. Omitted means file coordinates; "window" is the selected-range coordinate system. */
|
|
17
|
+
rangeBase?: "file" | "window";
|
|
18
|
+
noticeOwner?: "body";
|
|
16
19
|
truncatedBy: "lines" | "bytes" | "middle";
|
|
17
20
|
totalLines: number;
|
|
18
21
|
totalBytes: number;
|
|
@@ -33,6 +36,12 @@ export interface TruncationMeta {
|
|
|
33
36
|
start: number;
|
|
34
37
|
end: number;
|
|
35
38
|
};
|
|
39
|
+
/** Partial source-line preview retained by a directional window. */
|
|
40
|
+
partialLine?: {
|
|
41
|
+
line: number;
|
|
42
|
+
bytes: number;
|
|
43
|
+
sourceBytes: number;
|
|
44
|
+
};
|
|
36
45
|
/** Bytes elided from the middle. */
|
|
37
46
|
elidedBytes?: number;
|
|
38
47
|
/** Lines elided from the middle. */
|
|
@@ -96,11 +105,14 @@ export interface TruncationOptions {
|
|
|
96
105
|
startLine?: number;
|
|
97
106
|
totalFileLines?: number;
|
|
98
107
|
artifactId?: string;
|
|
108
|
+
maxBytes?: number;
|
|
109
|
+
noticeOwner?: "body";
|
|
99
110
|
}
|
|
100
111
|
export interface TruncationSummaryOptions {
|
|
101
112
|
direction: "head" | "tail" | "middle";
|
|
102
113
|
startLine?: number;
|
|
103
114
|
totalFileLines?: number;
|
|
115
|
+
noticeOwner?: "body";
|
|
104
116
|
}
|
|
105
117
|
export interface TruncationTextOptions {
|
|
106
118
|
direction: "head" | "tail" | "middle";
|
|
@@ -108,6 +120,7 @@ export interface TruncationTextOptions {
|
|
|
108
120
|
totalBytes?: number;
|
|
109
121
|
maxBytes?: number;
|
|
110
122
|
artifactId?: string;
|
|
123
|
+
noticeOwner?: "body";
|
|
111
124
|
}
|
|
112
125
|
/**
|
|
113
126
|
* Fluent builder for OutputMeta.
|
|
@@ -125,6 +138,13 @@ export declare class OutputMetaBuilder {
|
|
|
125
138
|
#private;
|
|
126
139
|
/** Add truncation info from TruncationResult. No-op if not truncated. */
|
|
127
140
|
truncation(result: TruncationResult, options: TruncationOptions): this;
|
|
141
|
+
/** Add metadata from the actual head/tail windows retained by middle truncation. */
|
|
142
|
+
truncationWindows(windows: ReadWindow, options?: {
|
|
143
|
+
artifactId?: string;
|
|
144
|
+
noticeOwner?: "body";
|
|
145
|
+
maxBytes?: number;
|
|
146
|
+
rangeBase?: "file" | "window";
|
|
147
|
+
}): this;
|
|
128
148
|
/** Add truncation info from OutputSummary. No-op if not truncated. */
|
|
129
149
|
truncationFromSummary(summary: OutputSummary, options: TruncationSummaryOptions): this;
|
|
130
150
|
/** Add truncation info from truncated output text. No-op if truncation not detected. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Settings } from "../config/settings";
|
|
2
|
+
import type { TruncationDirection } from "../session/streaming-output";
|
|
3
|
+
/**
|
|
4
|
+
* Read execution routes that have distinct truncation-default contracts.
|
|
5
|
+
* Routes that share the same default are grouped only when their truncation
|
|
6
|
+
* policy is identical; selection and rendering remain owned by read.ts.
|
|
7
|
+
*/
|
|
8
|
+
export type ReadRoute = "local-bare-stream" | "local-bare-acp" | "archive-member-bare" | "local-range" | "local-multi-range" | "local-raw" | "local-summary" | "url-reader" | "url-cache-page" | "dir-local" | "dir-archive" | "sqlite-list" | "sqlite-rows" | "converted";
|
|
9
|
+
/** Resolve the configured default for a route; explicit parameters bypass it. */
|
|
10
|
+
export declare function pathDefault(route: ReadRoute, settings: Settings): TruncationDirection;
|
|
11
|
+
/** Resolve the effective caller-facing direction with explicit precedence. */
|
|
12
|
+
export declare function resolveEffectiveDirection(explicitParam: TruncationDirection | undefined, route: ReadRoute, settings: Settings): TruncationDirection;
|
|
@@ -4,10 +4,49 @@ import * as z from "zod/v4";
|
|
|
4
4
|
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
5
5
|
import { type Theme } from "../modes/theme/theme";
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
7
|
-
import {
|
|
7
|
+
import type { ReadWindow, TruncationResult } from "../session/streaming-output";
|
|
8
8
|
import { type OutputMeta } from "./output-meta";
|
|
9
|
+
export declare function streamLinesFromFile(filePath: string, startLine: number, maxLinesToCollect: number, maxBytes: number, selectedLineLimit: number | null, signal?: AbortSignal, collect?: "head" | "tail" | "both", collectEndExclusive?: number | null): Promise<{
|
|
10
|
+
lines: string[];
|
|
11
|
+
totalFileLines: number;
|
|
12
|
+
collectedBytes: number;
|
|
13
|
+
stoppedByByteLimit: boolean;
|
|
14
|
+
firstLinePreview?: {
|
|
15
|
+
text: string;
|
|
16
|
+
bytes: number;
|
|
17
|
+
};
|
|
18
|
+
firstLineByteLength?: number;
|
|
19
|
+
selectedBytesTotal: number;
|
|
20
|
+
windowBytesTotal: number;
|
|
21
|
+
windowLinesTotal: number;
|
|
22
|
+
windowStartIndex: number;
|
|
23
|
+
tailPartial?: {
|
|
24
|
+
text: string;
|
|
25
|
+
bytes: number;
|
|
26
|
+
sourceIndex: number;
|
|
27
|
+
sourceLineBytes: number;
|
|
28
|
+
};
|
|
29
|
+
maxBytes: number;
|
|
30
|
+
headLines?: string[];
|
|
31
|
+
headBytes?: number;
|
|
32
|
+
headStartIndex?: number;
|
|
33
|
+
degenerateTailBudget: boolean;
|
|
34
|
+
degenerateHeadBudget: boolean;
|
|
35
|
+
headStoppedByBytes: boolean;
|
|
36
|
+
headStoppedByLines: boolean;
|
|
37
|
+
ringBudgetLines: number;
|
|
38
|
+
ringEvictedForBytes: boolean;
|
|
39
|
+
ringEvictedForLines: boolean;
|
|
40
|
+
tailDroppedForBytes: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export declare function streamResultWindow(result: Awaited<ReturnType<typeof streamLinesFromFile>>, collect: "tail" | "both", startLine: number, collectEndExclusive: number | null): ReadWindow;
|
|
9
43
|
declare const readSchema: z.ZodObject<{
|
|
10
44
|
path: z.ZodString;
|
|
45
|
+
truncation: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
head: "head";
|
|
47
|
+
last: "last";
|
|
48
|
+
both: "both";
|
|
49
|
+
}>>;
|
|
11
50
|
}, z.core.$strict>;
|
|
12
51
|
export type ReadToolInput = z.infer<typeof readSchema>;
|
|
13
52
|
/** Project paths and output sizes without exposing read content or remote URLs. */
|
|
@@ -60,6 +99,11 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
|
|
|
60
99
|
readonly description: string;
|
|
61
100
|
readonly parameters: z.ZodObject<{
|
|
62
101
|
path: z.ZodString;
|
|
102
|
+
truncation: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
head: "head";
|
|
104
|
+
last: "last";
|
|
105
|
+
both: "both";
|
|
106
|
+
}>>;
|
|
63
107
|
}, z.core.$strict>;
|
|
64
108
|
readonly nonAbortable = true;
|
|
65
109
|
readonly strict = true;
|