@sayknow-cli/coding-agent 0.7.11 → 0.7.13
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 +16 -0
- package/dist/types/async/result-formatting.d.ts +2 -0
- package/dist/types/capability/fs.d.ts +22 -3
- package/dist/types/capability/mcp.d.ts +2 -0
- package/dist/types/cli/append-system-prompt.d.ts +6 -0
- package/dist/types/cli/update-cli.d.ts +3 -0
- package/dist/types/commands/contribution-prep.d.ts +0 -3
- package/dist/types/commands/migrate.d.ts +1 -1
- package/dist/types/commands/sdk.d.ts +9 -0
- package/dist/types/commit/changelog/index.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +14 -0
- package/dist/types/config/settings.d.ts +7 -1
- package/dist/types/coordinator-mcp/session-reaper.d.ts +5 -0
- package/dist/types/cursor-delete-path.d.ts +1 -0
- package/dist/types/cursor-mcp-name.d.ts +8 -0
- package/dist/types/dap/config.d.ts +8 -4
- package/dist/types/dap/session.d.ts +11 -2
- package/dist/types/debug/report-bundle-parent.d.ts +2 -0
- package/dist/types/debug/system-info.d.ts +6 -1
- package/dist/types/discovery/helpers.d.ts +11 -3
- package/dist/types/discovery/mcp-json.d.ts +1 -0
- package/dist/types/edit/file-read-cache.d.ts +4 -0
- package/dist/types/edit/modes/patch.d.ts +14 -0
- package/dist/types/edit/modes/replace.d.ts +8 -0
- package/dist/types/eval/py/runtime.d.ts +9 -0
- package/dist/types/exa/mcp-client.d.ts +11 -6
- package/dist/types/exec/bash-executor.d.ts +18 -1
- package/dist/types/export/html/css-color.d.ts +2 -0
- package/dist/types/export/html/html-export-destination.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/custom-tools/loader.d.ts +3 -2
- package/dist/types/extensibility/custom-tools/types.d.ts +3 -1
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +2 -0
- package/dist/types/extensibility/plugins/plugin-link-path.d.ts +2 -0
- package/dist/types/goals/runtime.d.ts +6 -0
- package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
- package/dist/types/hindsight/content.d.ts +5 -6
- package/dist/types/internal-urls/skill-path.d.ts +1 -0
- package/dist/types/internal-urls/types.d.ts +2 -0
- package/dist/types/lsp/clients/swiftlint-client.d.ts +0 -4
- package/dist/types/lsp/config.d.ts +8 -5
- package/dist/types/lsp/workspace-path.d.ts +1 -0
- package/dist/types/migrate/adapters/codex.d.ts +2 -1
- package/dist/types/migrate/adapters/index.d.ts +10 -1
- package/dist/types/migrate/executor.d.ts +3 -1
- package/dist/types/migrate/types.d.ts +15 -3
- package/dist/types/modes/components/custom-editor.d.ts +6 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +4 -3
- package/dist/types/modes/components/model-selector.d.ts +46 -0
- package/dist/types/modes/controllers/input-controller.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/utils/macos-option-forwarding.d.ts +17 -0
- package/dist/types/runtime-mcp/content-limits.d.ts +4 -0
- package/dist/types/runtime-mcp/manager.d.ts +9 -1
- package/dist/types/runtime-mcp/mcp-redirect.d.ts +9 -0
- package/dist/types/runtime-mcp/oauth-public-url.d.ts +1 -0
- package/dist/types/runtime-mcp/plugin-mcp-name-filter.d.ts +22 -0
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +1 -0
- package/dist/types/runtime-mcp/project-host-values.d.ts +33 -0
- package/dist/types/runtime-mcp/smithery-registry.d.ts +24 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +4 -0
- package/dist/types/runtime-mcp/types.d.ts +6 -0
- package/dist/types/sdk/broker/ensure.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +5 -1
- package/dist/types/sdk/broker/runtime.d.ts +1 -1
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +3 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +1 -0
- package/dist/types/sdk/host/events.d.ts +4 -0
- package/dist/types/session/agent-session.d.ts +22 -2
- package/dist/types/session/auto-resume.d.ts +5 -0
- package/dist/types/session/messages.d.ts +5 -1
- package/dist/types/session/session-manager.d.ts +13 -0
- package/dist/types/session/session-storage.d.ts +8 -0
- package/dist/types/session/streaming-output.d.ts +11 -0
- package/dist/types/session-import/redact.d.ts +1 -1
- package/dist/types/skc-runtime/managed-owner-admission.d.ts +3 -0
- package/dist/types/skc-runtime/psmux-detect.d.ts +5 -4
- package/dist/types/skc-runtime/ralplan-runtime.d.ts +5 -0
- package/dist/types/skc-runtime/sidecar-bootstrap-env.d.ts +6 -0
- package/dist/types/skc-runtime/state-writer.d.ts +4 -1
- package/dist/types/skc-runtime/tmux-sessions.d.ts +24 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +4 -0
- package/dist/types/skill-state/workflow-mutation-guard.d.ts +20 -1
- package/dist/types/slash-commands/helpers/mcp.d.ts +5 -0
- package/dist/types/ssh/ssh-executor.d.ts +3 -1
- package/dist/types/system-prompt.d.ts +5 -2
- package/dist/types/task/executor.d.ts +17 -3
- package/dist/types/task/isolation-dir.d.ts +26 -0
- package/dist/types/task/role-body.d.ts +11 -0
- package/dist/types/task/token-log-mode.test.d.ts +1 -0
- package/dist/types/tools/ask.d.ts +77 -254
- package/dist/types/tools/ast-edit-write-path.d.ts +23 -0
- package/dist/types/tools/atomic-file-write.d.ts +74 -0
- package/dist/types/tools/auto-generated-guard.d.ts +5 -2
- package/dist/types/tools/bash-allowed-prefixes.d.ts +16 -0
- package/dist/types/tools/bash-interactive.d.ts +2 -0
- package/dist/types/tools/bash-skill-urls.d.ts +5 -1
- package/dist/types/tools/bash.d.ts +1 -0
- package/dist/types/tools/browser/cdp-url.d.ts +2 -0
- package/dist/types/tools/browser/tab-worker.d.ts +2 -0
- package/dist/types/tools/debug.d.ts +2 -2
- package/dist/types/tools/explicit-artifact.d.ts +8 -0
- package/dist/types/tools/fetch.d.ts +7 -4
- package/dist/types/tools/github-side-effect.d.ts +22 -0
- package/dist/types/tools/index.d.ts +3 -0
- package/dist/types/tools/monitor-mutation.d.ts +9 -0
- package/dist/types/tools/recipe/index.d.ts +2 -0
- package/dist/types/tools/recipe/recipe-guard.d.ts +7 -0
- package/dist/types/tools/restricted-cwd.d.ts +1 -0
- package/dist/types/tools/reverse-engineer.d.ts +81 -0
- package/dist/types/tools/search-tool-bm25.d.ts +2 -0
- package/dist/types/tools/tmux-self-injection-guard.d.ts +17 -0
- package/dist/types/tools/untrusted-content.d.ts +12 -0
- package/dist/types/utils/file-mentions.d.ts +5 -0
- package/dist/types/utils/open.d.ts +0 -1
- package/dist/types/utils/shell-snapshot.d.ts +2 -0
- package/dist/types/utils/title-generator.d.ts +12 -2
- package/dist/types/utils/tools-checksum.d.ts +7 -0
- package/dist/types/utils/xml-escape.d.ts +2 -0
- package/dist/types/web/scrapers/types.d.ts +8 -1
- package/dist/types/web/search/providers/codex.d.ts +6 -7
- package/dist/types/web/search/providers/insane.d.ts +7 -1
- package/dist/types/web/search/providers/kimi.d.ts +2 -0
- package/dist/types/web/search/providers/searxng.d.ts +7 -0
- package/dist/types/web/search/providers/xai.d.ts +2 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +4 -0
- package/src/async/job-manager.ts +23 -9
- package/src/async/result-formatting.ts +40 -0
- package/src/capability/fs.ts +78 -11
- package/src/capability/mcp.ts +2 -0
- package/src/cli/append-system-prompt.ts +12 -0
- package/src/cli/auth-broker-cli.ts +22 -12
- package/src/cli/config-cli.ts +8 -18
- package/src/cli/migrate-cli.ts +7 -5
- package/src/cli/ssh-cli.ts +6 -3
- package/src/cli/stats-cli.ts +9 -4
- package/src/cli/update-cli.ts +42 -0
- package/src/cli/web-search-cli.ts +9 -3
- package/src/cli.ts +5 -9
- package/src/commands/commit.ts +2 -2
- package/src/commands/contribution-prep.ts +1 -3
- package/src/commands/harness.ts +25 -15
- package/src/commands/launch.ts +1 -1
- package/src/commands/migrate.ts +3 -3
- package/src/commands/sdk.ts +115 -14
- package/src/commands/ultragoal.ts +14 -8
- package/src/commit/agentic/agent.ts +6 -6
- package/src/commit/analysis/conventional.ts +14 -5
- package/src/commit/changelog/index.ts +39 -1
- package/src/commit/message.ts +10 -3
- package/src/config/config-file.ts +106 -3
- package/src/config/keybindings.ts +154 -7
- package/src/config/mcp-schema.json +4 -0
- package/src/config/model-registry.ts +10 -2
- package/src/config/settings-schema.ts +18 -0
- package/src/config/settings.ts +32 -4
- package/src/coordinator-mcp/policy.ts +14 -4
- package/src/coordinator-mcp/server.ts +44 -4
- package/src/coordinator-mcp/session-reaper.ts +9 -1
- package/src/cursor-delete-path.ts +10 -0
- package/src/cursor-mcp-name.ts +15 -0
- package/src/cursor.ts +13 -2
- package/src/dap/client.ts +9 -2
- package/src/dap/config.ts +33 -13
- package/src/dap/defaults.json +1 -1
- package/src/dap/session.ts +161 -36
- package/src/debug/crash-diagnostics.ts +89 -6
- package/src/debug/report-bundle-parent.ts +22 -0
- package/src/debug/report-bundle.ts +100 -3
- package/src/debug/system-info.ts +21 -4
- package/src/defaults/skc/extensions/grok-cli-vendor/src/shared/base-url.ts +21 -7
- package/src/defaults/skc/skills/deep-interview/SKILL.md +1 -1
- package/src/discovery/agents-md.ts +3 -2
- package/src/discovery/agents.ts +3 -2
- package/src/discovery/builtin.ts +21 -11
- package/src/discovery/claude.ts +5 -4
- package/src/discovery/cline.ts +2 -2
- package/src/discovery/codex.ts +6 -5
- package/src/discovery/cursor.ts +11 -2
- package/src/discovery/gemini.ts +4 -3
- package/src/discovery/github.ts +2 -2
- package/src/discovery/helpers.ts +51 -11
- package/src/discovery/mcp-json.ts +28 -12
- package/src/discovery/opencode.ts +2 -1
- package/src/discovery/ssh.ts +11 -6
- package/src/discovery/substitute-plugin-root.ts +3 -1
- package/src/discovery/vscode.ts +3 -3
- package/src/edit/apply-patch/index.ts +12 -1
- package/src/edit/file-read-cache.ts +24 -6
- package/src/edit/index.ts +90 -20
- package/src/edit/modes/patch.ts +215 -9
- package/src/edit/modes/replace.ts +141 -0
- package/src/eval/js/context-manager.ts +29 -3
- package/src/eval/js/worker-entry.ts +51 -18
- package/src/eval/py/runner.py +144 -5
- package/src/eval/py/runtime.ts +44 -4
- package/src/eval/py/tool-bridge.ts +4 -0
- package/src/exa/mcp-client.ts +53 -11
- package/src/exec/bash-executor.ts +87 -4
- package/src/exec/non-interactive-env.ts +0 -1
- package/src/export/html/css-color.ts +9 -0
- package/src/export/html/html-export-destination.ts +16 -0
- package/src/export/html/index.ts +102 -8
- package/src/export/html/template.generated.ts +1 -1
- package/src/extensibility/custom-tools/loader.ts +13 -3
- package/src/extensibility/custom-tools/types.ts +3 -1
- package/src/extensibility/custom-tools/wrapper.ts +3 -1
- package/src/extensibility/plugins/manager.ts +3 -2
- package/src/extensibility/plugins/marketplace/cache.ts +15 -0
- package/src/extensibility/plugins/marketplace/fetcher.ts +2 -2
- package/src/extensibility/plugins/marketplace/manager.ts +5 -3
- package/src/extensibility/plugins/plugin-link-path.ts +12 -0
- package/src/extensibility/skc-plugins/mcp-policy.ts +2 -1
- package/src/goals/runtime.ts +30 -8
- package/src/harness-control-plane/finalize.ts +10 -0
- package/src/harness-control-plane/operate.ts +12 -4
- package/src/harness-control-plane/owner.ts +8 -1
- package/src/harness-control-plane/receipt-spool.ts +105 -28
- package/src/harness-control-plane/storage.ts +124 -6
- package/src/hashline/execute.ts +3 -3
- package/src/hashline/recovery.ts +85 -2
- package/src/hindsight/config.ts +9 -3
- package/src/hindsight/content.ts +116 -16
- package/src/hindsight/mental-models.ts +22 -10
- package/src/hindsight/state.ts +7 -4
- package/src/hooks/native-skill-hook.ts +17 -12
- package/src/i18n/messages/de.settings.ts +3 -0
- package/src/i18n/messages/es.settings.ts +3 -0
- package/src/i18n/messages/fr.settings.ts +3 -0
- package/src/i18n/messages/ja.settings.ts +3 -0
- package/src/i18n/messages/ko.settings.ts +3 -0
- package/src/i18n/messages/zh.settings.ts +3 -0
- package/src/internal-urls/artifact-protocol.ts +3 -1
- package/src/internal-urls/docs-index.generated.ts +10 -10
- package/src/internal-urls/local-protocol.ts +167 -8
- package/src/internal-urls/skill-path.ts +18 -0
- package/src/internal-urls/skill-protocol.ts +2 -0
- package/src/internal-urls/types.ts +2 -0
- package/src/lsp/client.ts +2 -1
- package/src/lsp/clients/biome-client.ts +2 -0
- package/src/lsp/clients/swiftlint-client.ts +2 -0
- package/src/lsp/config.ts +18 -62
- package/src/lsp/edits.ts +6 -0
- package/src/lsp/index.ts +29 -0
- package/src/lsp/workspace-path.ts +75 -0
- package/src/main.ts +33 -11
- package/src/memories/index.ts +141 -9
- package/src/migrate/action-planner.ts +57 -0
- package/src/migrate/adapters/claude-code.ts +23 -4
- package/src/migrate/adapters/codex.ts +22 -4
- package/src/migrate/adapters/index.ts +22 -4
- package/src/migrate/adapters/opencode.ts +6 -1
- package/src/migrate/executor.ts +84 -7
- package/src/migrate/report.ts +19 -2
- package/src/migrate/types.ts +14 -4
- package/src/modes/DESIGN.md +5 -0
- package/src/modes/acp/acp-agent.ts +35 -2
- package/src/modes/acp/permission-mode.ts +18 -1
- package/src/modes/components/custom-editor.ts +14 -0
- package/src/modes/components/extensions/extension-dashboard.ts +2 -2
- package/src/modes/components/extensions/inspector-panel.ts +9 -5
- package/src/modes/components/extensions/state-manager.ts +15 -5
- package/src/modes/components/model-selector.ts +144 -94
- package/src/modes/components/welcome.ts +3 -2
- package/src/modes/controllers/command-controller.ts +300 -9
- package/src/modes/controllers/event-controller.ts +1 -1
- package/src/modes/controllers/extension-ui-controller.ts +32 -19
- package/src/modes/controllers/input-controller.ts +62 -26
- package/src/modes/controllers/plan-mode-controller.ts +17 -7
- package/src/modes/controllers/runtime-mcp-command-controller.ts +25 -20
- package/src/modes/controllers/ssh-command-controller.ts +3 -1
- package/src/modes/interactive-mode.ts +10 -0
- package/src/modes/utils/macos-option-forwarding.ts +80 -0
- package/src/prompts/system/irc-incoming.md +3 -1
- package/src/prompts/system/project-prompt.md +19 -0
- package/src/prompts/system/system-prompt.md +3 -0
- package/src/prompts/tools/ask.md +2 -0
- package/src/prompts/tools/debug.md +1 -1
- package/src/prompts/tools/monitor.md +7 -5
- package/src/prompts/tools/reverse-engineer.md +29 -0
- package/src/runtime-credential-selector.ts +2 -2
- package/src/runtime-mcp/config-writer.ts +10 -6
- package/src/runtime-mcp/config.ts +1 -0
- package/src/runtime-mcp/content-limits.ts +7 -0
- package/src/runtime-mcp/json-rpc.ts +2 -1
- package/src/runtime-mcp/manager.ts +57 -9
- package/src/runtime-mcp/mcp-redirect.ts +73 -0
- package/src/runtime-mcp/oauth-flow.ts +43 -5
- package/src/runtime-mcp/oauth-public-url.ts +8 -0
- package/src/runtime-mcp/plugin-mcp-name-filter.ts +62 -0
- package/src/runtime-mcp/plugin-network-boundary.ts +4 -0
- package/src/runtime-mcp/project-host-values.ts +50 -0
- package/src/runtime-mcp/render.ts +16 -1
- package/src/runtime-mcp/smithery-registry.ts +22 -3
- package/src/runtime-mcp/tool-bridge.ts +194 -21
- package/src/runtime-mcp/transports/http.ts +4 -3
- package/src/runtime-mcp/transports/stdio.ts +2 -1
- package/src/runtime-mcp/types.ts +6 -0
- package/src/sdk/broker/broker.ts +11 -2
- package/src/sdk/broker/ensure.ts +131 -10
- package/src/sdk/broker/lifecycle-ledger.ts +18 -3
- package/src/sdk/broker/lifecycle.ts +21 -19
- package/src/sdk/broker/runtime.ts +1 -1
- package/src/sdk/bus/chat-daemon-cli.ts +38 -1
- package/src/sdk/bus/chat-daemon-control.ts +5 -3
- package/src/sdk/bus/index.ts +5 -3
- package/src/sdk/bus/lifecycle-control-runtime.ts +9 -2
- package/src/sdk/bus/session-control.ts +2 -0
- package/src/sdk/bus/slack-daemon.ts +8 -1
- package/src/sdk/bus/slack-live-provider.ts +3 -1
- package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
- package/src/sdk/bus/telegram-daemon-control.ts +17 -12
- package/src/sdk/bus/telegram-daemon.ts +41 -1
- package/src/sdk/host/events.ts +67 -4
- package/src/sdk/mcp/server.ts +16 -3
- package/src/sdk/protocol/operation-inventory.generated.json +22 -0
- package/src/sdk/session.ts +18 -25
- package/src/secrets/obfuscator.ts +92 -12
- package/src/session/agent-session.ts +466 -100
- package/src/session/artifacts.ts +3 -1
- package/src/session/auto-resume.ts +45 -8
- package/src/session/history-storage.ts +172 -8
- package/src/session/internal/managed-session-scope.ts +130 -52
- package/src/session/messages.ts +47 -6
- package/src/session/session-manager.ts +116 -8
- package/src/session/session-storage.ts +31 -1
- package/src/session/streaming-output.ts +263 -4
- package/src/session-import/redact.ts +76 -3
- package/src/setup/hermes-setup.ts +4 -1
- package/src/skc-runtime/gc-runtime.ts +26 -4
- package/src/skc-runtime/launch-tmux.ts +21 -11
- package/src/skc-runtime/launch-worktree.ts +42 -3
- package/src/skc-runtime/managed-owner-admission.ts +46 -2
- package/src/skc-runtime/psmux-detect.ts +29 -5
- package/src/skc-runtime/ralplan-runtime.ts +14 -1
- package/src/skc-runtime/session-resolution.ts +38 -6
- package/src/skc-runtime/sidecar-bootstrap-env.ts +19 -0
- package/src/skc-runtime/state-writer.ts +134 -16
- package/src/skc-runtime/tmux-sessions.ts +85 -4
- package/src/skc-runtime/ultragoal-change-set.ts +18 -2
- package/src/skc-runtime/ultragoal-guard.ts +9 -1
- package/src/skc-runtime/ultragoal-runtime.ts +26 -9
- package/src/skill-state/active-state.ts +13 -0
- package/src/skill-state/workflow-mutation-guard.ts +3297 -180
- package/src/slash-commands/builtin-registry.ts +14 -8
- package/src/slash-commands/helpers/mcp.ts +20 -7
- package/src/ssh/ssh-executor.ts +3 -1
- package/src/stt/recorder.ts +26 -9
- package/src/system-prompt.ts +65 -16
- package/src/task/commands.ts +3 -1
- package/src/task/executor.ts +52 -7
- package/src/task/index.ts +28 -0
- package/src/task/isolation-dir.ts +143 -0
- package/src/task/role-body.ts +84 -0
- package/src/task/token-log-mode.test.ts +162 -0
- package/src/task/token-log.ts +91 -2
- package/src/task/worktree.ts +16 -7
- package/src/tools/archive-reader.ts +653 -31
- package/src/tools/ask.ts +86 -14
- package/src/tools/ast-edit-write-path.ts +133 -0
- package/src/tools/ast-edit.ts +27 -1
- package/src/tools/ast-grep.ts +7 -2
- package/src/tools/atomic-file-write.ts +625 -0
- package/src/tools/auto-generated-guard.ts +28 -8
- package/src/tools/bash-allowed-prefixes.ts +225 -6
- package/src/tools/bash-interactive.ts +12 -0
- package/src/tools/bash-skill-urls.ts +113 -7
- package/src/tools/bash.ts +152 -20
- package/src/tools/browser/cdp-url.ts +18 -0
- package/src/tools/browser/tab-worker.ts +49 -14
- package/src/tools/browser.ts +25 -8
- package/src/tools/cron.ts +10 -1
- package/src/tools/debug.ts +16 -8
- package/src/tools/eval.ts +71 -34
- package/src/tools/explicit-artifact.ts +89 -0
- package/src/tools/fetch.ts +26 -17
- package/src/tools/gh.ts +40 -12
- package/src/tools/github-side-effect.ts +112 -0
- package/src/tools/image-gen.ts +24 -10
- package/src/tools/index.ts +6 -0
- package/src/tools/monitor-mutation.ts +27 -0
- package/src/tools/monitor.ts +28 -1
- package/src/tools/output-meta.ts +74 -5
- package/src/tools/read.ts +24 -36
- package/src/tools/recipe/index.ts +12 -0
- package/src/tools/recipe/recipe-guard.ts +19 -0
- package/src/tools/recipe/runner.ts +23 -12
- package/src/tools/render-utils.ts +2 -2
- package/src/tools/restricted-cwd.ts +10 -0
- package/src/tools/reverse-engineer.ts +497 -0
- package/src/tools/search-tool-bm25.ts +14 -3
- package/src/tools/search.ts +3 -2
- package/src/tools/ssh.ts +235 -8
- package/src/tools/subagent-render.ts +43 -7
- package/src/tools/subagent.ts +7 -3
- package/src/tools/tmux-self-injection-guard.ts +3538 -0
- package/src/tools/todo-write.ts +41 -3
- package/src/tools/untrusted-content.ts +23 -0
- package/src/tools/vim.ts +2 -2
- package/src/tools/write.ts +37 -4
- package/src/tui/tree-list.ts +15 -1
- package/src/utils/commit-message-generator.ts +9 -2
- package/src/utils/external-editor.ts +21 -7
- package/src/utils/file-mentions.ts +75 -7
- package/src/utils/git.ts +38 -7
- package/src/utils/open.ts +73 -4
- package/src/utils/shell-snapshot.ts +9 -1
- package/src/utils/title-generator.ts +61 -16
- package/src/utils/tools-checksum.ts +34 -0
- package/src/utils/tools-manager.ts +24 -6
- package/src/utils/xml-escape.ts +14 -0
- package/src/web/insane/url-guard.ts +2 -1
- package/src/web/scrapers/types.ts +8 -0
- package/src/web/scrapers/youtube.ts +3 -2
- package/src/web/search/index.ts +4 -3
- package/src/web/search/providers/anthropic.ts +4 -4
- package/src/web/search/providers/codex.ts +31 -34
- package/src/web/search/providers/insane.ts +145 -28
- package/src/web/search/providers/kimi.ts +15 -5
- package/src/web/search/providers/searxng.ts +47 -4
- package/src/web/search/providers/xai.ts +7 -2
- package/dist/types/cli/shell-cli.d.ts +0 -8
- package/dist/types/commands/shell.d.ts +0 -21
- package/src/cli/shell-cli.ts +0 -176
- package/src/commands/shell.ts +0 -29
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classify `github` tool operations for the approval gate and the planning
|
|
3
|
+
* mutation guard. Read-only ops stay available. Every other op, including a
|
|
4
|
+
* missing or unrecognized one, is a side effect and fails closed.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentTool } from "@sayknow-cli/agent-core";
|
|
7
|
+
/** Name-only tool the planning guard uses when `GithubTool.execute` checks itself. */
|
|
8
|
+
export declare const githubMutationTool: AgentTool;
|
|
9
|
+
export declare function githubOp(args: unknown): string | undefined;
|
|
10
|
+
/** True only for a known read-only github op. Missing and unknown ops are not read-only. */
|
|
11
|
+
export declare function isGithubReadOnlyArgs(args: unknown): boolean;
|
|
12
|
+
export declare function isGithubReadOnlyOp(op: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Approval summary for a side-effect github call. The PR body is omitted so a
|
|
15
|
+
* token pasted into `body` is not copied into the permission title.
|
|
16
|
+
*/
|
|
17
|
+
export declare function describeGithubSideEffect(args: unknown): string;
|
|
18
|
+
export declare function githubPermissionIntent(args: unknown): {
|
|
19
|
+
toolName: string;
|
|
20
|
+
title: string;
|
|
21
|
+
cacheKey: string;
|
|
22
|
+
} | undefined;
|
|
@@ -52,6 +52,7 @@ export * from "./read";
|
|
|
52
52
|
export * from "./recipe";
|
|
53
53
|
export * from "./render-mermaid";
|
|
54
54
|
export * from "./resolve";
|
|
55
|
+
export * from "./reverse-engineer";
|
|
55
56
|
export * from "./review";
|
|
56
57
|
export * from "./search";
|
|
57
58
|
export * from "./search-tool-bm25";
|
|
@@ -262,6 +263,8 @@ export interface ToolSession {
|
|
|
262
263
|
/** Goal runtime for the active agent session. */
|
|
263
264
|
getGoalRuntime?: () => GoalRuntime | undefined;
|
|
264
265
|
/** Bridge to the connected client (e.g. ACP editor host). Tools should route fs/terminal/permission requests through this when available. */
|
|
266
|
+
/** Live ACP/SDK approval mode. Task children copy this at spawn; absent means `allow`. */
|
|
267
|
+
getSdkPermissionMode?: () => "prompt" | "allow" | "deny";
|
|
265
268
|
getClientBridge?: () => ClientBridge | undefined;
|
|
266
269
|
/** Get compact conversation context for subagents (excludes tool results, system prompts) */
|
|
267
270
|
getCompactContext?: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judge a monitor command with the same mutation rules as bash. Monitor is a
|
|
3
|
+
* background shell, so a planning-phase mutation must fail before the job starts.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertMonitorMutationAllowed(input: {
|
|
6
|
+
cwd: string;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
command: string;
|
|
9
|
+
}): Promise<void>;
|
|
@@ -10,6 +10,8 @@ import { type DetectedRunner } from "./runner";
|
|
|
10
10
|
declare const recipeSchema: z.ZodObject<{
|
|
11
11
|
op: z.ZodString;
|
|
12
12
|
}, z.core.$strict>;
|
|
13
|
+
export { recipeSchema };
|
|
14
|
+
export declare const RECIPE_DESCRIPTION: string;
|
|
13
15
|
type RecipeParams = z.infer<typeof recipeSchema>;
|
|
14
16
|
type RecipeRenderResult = {
|
|
15
17
|
content: Array<{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertCwdInsideWorkspace(workspace: string, commandCwd: string): Promise<void>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult } from "@sayknow-cli/agent-core";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
import type { ToolSession } from ".";
|
|
4
|
+
import type { OutputMeta } from "./output-meta";
|
|
5
|
+
export declare const REA_PACKAGE = "rea-agents";
|
|
6
|
+
/** Pinned so the command list below always matches the CLI that runs. */
|
|
7
|
+
export declare const REA_VERSION = "6.7.0";
|
|
8
|
+
/**
|
|
9
|
+
* Commands of rea-agents@6.7.0 the tool may run. Left out on purpose: commands that change the
|
|
10
|
+
* host, a device, or an analysis database (`setup`, `uninstall`, `update`, `annotate-native-function`,
|
|
11
|
+
* adb install/uninstall/push/start/stop), unrestricted debugger or Rizin/Cutter consoles, and
|
|
12
|
+
* commands that drive or instrument the user's own running apps (`capture-native-ui-scenario`,
|
|
13
|
+
* `capture-process`, `observe-native-calls`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const REA_COMMANDS: readonly ["address-to-file-offset", "analyze", "analyze-javascript-application", "analyze-web-bundle", "build-reconstruction-obligation-ledger", "capabilities", "capture-adb-screen", "capture-browser-scenario", "capture-electron-scenario", "capture-web-screenshot", "collect-adb-bugreport", "compare", "compare-application-versions", "compare-javascript-export-shapes", "compare-managed-members", "compare-process-captures", "compare-source-to-bundle", "compare-wasm-interfaces", "compare-web-captures", "compare-web-screenshots", "decode-android-resources", "decode-interface-builder", "decode-signal-recording", "decompile", "decompile-jeb-item", "demangle-swift", "discover-webmcp-tools", "doctor", "evaluate-reconstruction-coverage", "evidence-export", "evidence-import", "export-web-scripts", "extract-artifact", "extract-firmware", "function", "identify-flutter-build", "import-managed-reconstruction", "import-reference-source", "inspect", "inspect-adb-client", "inspect-adb-device", "inspect-adb-display", "inspect-adb-package", "inspect-adb-window", "inspect-analysis-view", "inspect-android-class", "inspect-android-method", "inspect-android-package", "inspect-apktool-client", "inspect-artifact", "inspect-asset-catalog", "inspect-binary-layout", "inspect-dart-aot", "inspect-electron-fuses", "inspect-electron-page", "inspect-evidence-bundle", "inspect-evm-interface", "inspect-firmware-regions", "inspect-go-binary", "inspect-jeb-client", "inspect-keyed-archive", "inspect-macho", "inspect-managed-artifact", "inspect-managed-members", "inspect-managed-native-boundaries", "inspect-native-api", "inspect-native-data-type", "inspect-native-dispatch-metadata", "inspect-native-instruction", "inspect-native-load-image", "inspect-packet-capture", "inspect-packet-fields", "inspect-pcap-capture", "inspect-pcap-client", "inspect-pe-resources", "inspect-plist", "inspect-recorded-crash", "inspect-rust-binary", "inspect-signal-decoders", "inspect-signature", "inspect-sqlite-database", "inspect-wasm-artifact", "inspect-web-event-listeners", "inspect-web-network-capture", "inspect-web-page", "inspect-with-objdump", "instructions", "instrument-with-frida", "list-adb-devices", "list-adb-directory", "list-adb-features", "list-adb-packages", "list-adb-processes", "list-adb-services", "list-architectures", "list-browser-targets", "list-cutter-sessions", "list-electron-targets", "list-frida-devices", "list-frida-processes", "list-javascript-runtime-targets", "list-jeb-units", "list-objdump-architectures", "observe-javascript-runtime", "observe-native-ui", "observe-web-execution", "observe-web-session", "open-jeb-project", "project-android-application-graph", "project-apple-application-graph", "project-harmony-application-graph", "project-managed-application-graph", "providers", "pull-adb-file", "pull-adb-package", "read-adb-logcat", "read-adb-setting", "read-bytes", "reconcile-javascript-runtime", "recover-javascript-sources", "resolve-adb-packages", "resolve-native-call-targets", "search", "search-android-classes", "search-bytes", "trace", "trace-android-references", "trace-application-feature", "trace-dylib-resolution", "trace-javascript-semantics", "trace-native-ui-action", "trace-native-values", "trace-web-module-imports", "trace-web-source-location", "verify-managed-native-boundaries", "xrefs"];
|
|
16
|
+
declare const reverseEngineerSchema: z.ZodObject<{
|
|
17
|
+
op: z.ZodEnum<{
|
|
18
|
+
run: "run";
|
|
19
|
+
help: "help";
|
|
20
|
+
browsers: "browsers";
|
|
21
|
+
}>;
|
|
22
|
+
command: z.ZodOptional<z.ZodString>;
|
|
23
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
type ReverseEngineerInput = z.infer<typeof reverseEngineerSchema>;
|
|
27
|
+
export interface ReverseEngineerToolDetails {
|
|
28
|
+
meta?: OutputMeta;
|
|
29
|
+
op: ReverseEngineerInput["op"];
|
|
30
|
+
command?: string;
|
|
31
|
+
exitCode?: number;
|
|
32
|
+
savedPath?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ReaRunResult {
|
|
35
|
+
exitCode: number;
|
|
36
|
+
stdout: string;
|
|
37
|
+
stderr: string;
|
|
38
|
+
timedOut: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type ReaRunner = (argv: string[], options: {
|
|
41
|
+
cwd: string;
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
timeoutMs: number;
|
|
44
|
+
}) => Promise<ReaRunResult>;
|
|
45
|
+
export interface ReverseEngineerDeps {
|
|
46
|
+
which?: (command: string) => string | null | undefined;
|
|
47
|
+
run?: ReaRunner;
|
|
48
|
+
fileExists?: (filePath: string) => Promise<boolean>;
|
|
49
|
+
listDir?: (dir: string) => Promise<string[]>;
|
|
50
|
+
homeDir?: string;
|
|
51
|
+
platform?: NodeJS.Platform;
|
|
52
|
+
}
|
|
53
|
+
/** Package-runner argv prefix that starts the pinned REA release, or null when none is installed. */
|
|
54
|
+
export declare function reaRunnerArgv(which: (command: string) => string | null | undefined): string[] | null;
|
|
55
|
+
/** Replace long strings so a screenshot or script body cannot flood the context. */
|
|
56
|
+
export declare function elideLargeStrings(value: unknown): unknown;
|
|
57
|
+
export declare function summarizeReaOutput(stdout: string): string;
|
|
58
|
+
export declare class ReverseEngineerTool implements AgentTool<typeof reverseEngineerSchema, ReverseEngineerToolDetails> {
|
|
59
|
+
#private;
|
|
60
|
+
private readonly session;
|
|
61
|
+
readonly name = "reverse_engineer";
|
|
62
|
+
readonly summary = "Reverse engineer a referenced website, app, or binary (REA) to build one like it: clone, copy, make this, \uCC38\uACE0\uD574\uC11C \uB9CC\uB4E4\uC5B4\uC918, \uB611\uAC19\uC774 \uB9CC\uB4E4\uC5B4\uC918";
|
|
63
|
+
readonly loadMode = "discoverable";
|
|
64
|
+
readonly label = "Reverse Engineer";
|
|
65
|
+
readonly description: string;
|
|
66
|
+
readonly parameters: z.ZodObject<{
|
|
67
|
+
op: z.ZodEnum<{
|
|
68
|
+
run: "run";
|
|
69
|
+
help: "help";
|
|
70
|
+
browsers: "browsers";
|
|
71
|
+
}>;
|
|
72
|
+
command: z.ZodOptional<z.ZodString>;
|
|
73
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
readonly strict = true;
|
|
77
|
+
constructor(session: ToolSession, deps?: ReverseEngineerDeps);
|
|
78
|
+
static createIf(session: ToolSession): ReverseEngineerTool | null;
|
|
79
|
+
execute(_toolCallId: string, params: ReverseEngineerInput, signal?: AbortSignal, _onUpdate?: unknown, _context?: AgentToolContext): Promise<AgentToolResult<ReverseEngineerToolDetails>>;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -23,6 +23,8 @@ export interface SearchToolBm25Details {
|
|
|
23
23
|
limit: number;
|
|
24
24
|
total_tools: number;
|
|
25
25
|
activated_tools: string[];
|
|
26
|
+
/** Matching (or, when nothing new matched, all) already-active discovered tools. */
|
|
27
|
+
already_active_tools: string[];
|
|
26
28
|
active_selected_tools: string[];
|
|
27
29
|
tools: SearchToolBm25Match[];
|
|
28
30
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface TmuxSelfInjectionResult {
|
|
2
|
+
block: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
}
|
|
5
|
+
export type TmuxPaneResolver = (options: {
|
|
6
|
+
socketArgs: string[];
|
|
7
|
+
target: string;
|
|
8
|
+
env: Record<string, string>;
|
|
9
|
+
}) => Promise<string | undefined>;
|
|
10
|
+
export interface TmuxSelfInjectionOptions {
|
|
11
|
+
env?: Record<string, string | undefined>;
|
|
12
|
+
cwd?: string;
|
|
13
|
+
/** Effective Bash environment for locating shell-runner scripts; never used for tmux identity. */
|
|
14
|
+
executionEnv?: Record<string, string | undefined>;
|
|
15
|
+
resolvePaneId?: TmuxPaneResolver;
|
|
16
|
+
}
|
|
17
|
+
export declare function checkTmuxSelfInjection(command: string, options?: TmuxSelfInjectionOptions, depth?: number): Promise<TmuxSelfInjectionResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<untrusted-content>` envelope for tool output the model must treat as data.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of imports so low-level tools (for example `gh`, which is reachable
|
|
5
|
+
* from `config/settings` through internal URLs) can wrap output without pulling
|
|
6
|
+
* `tools/fetch` and the web scrapers into the settings import cycle.
|
|
7
|
+
*/
|
|
8
|
+
export declare const UNTRUSTED_CONTENT_OPEN = "<untrusted-content>";
|
|
9
|
+
export declare const WRAP_PREFIX_CHARS: number;
|
|
10
|
+
export declare const WRAP_SUFFIX = "\n</untrusted-content>";
|
|
11
|
+
export declare function escapeUntrustedContent(content: string): string;
|
|
12
|
+
export declare function wrapUntrustedContent(content: string): string;
|
|
@@ -7,6 +7,11 @@ import type { AgentMessage } from "@sayknow-cli/agent-core";
|
|
|
7
7
|
export declare const DEFAULT_FILE_MENTION_INLINE_BYTES: number;
|
|
8
8
|
/** Extract all @filepath mentions from text */
|
|
9
9
|
export declare function extractFileMentions(text: string): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Compare canonical Windows paths without folding directory names: individual
|
|
12
|
+
* directories can opt into case-sensitive names.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isCanonicalWindowsPathWithin(root: string, candidate: string): boolean;
|
|
10
15
|
/**
|
|
11
16
|
* Generate a FileMentionMessage containing the contents of mentioned files.
|
|
12
17
|
* Returns empty array if no files could be read.
|
|
@@ -6,8 +6,17 @@ import type { Settings } from "../config/settings";
|
|
|
6
6
|
* Build a bounded conversation digest for title regeneration. Regeneration
|
|
7
7
|
* reads several messages so a throwaway first prompt can be corrected, while
|
|
8
8
|
* the automatic first-message path intentionally uses only its initial input.
|
|
9
|
+
* `obfuscateText`, when set, runs on each kept message's full text before the
|
|
10
|
+
* per-message character cut so a secret cannot be split by that cut.
|
|
9
11
|
*/
|
|
10
|
-
export declare function buildConversationTitleInput(messages: readonly AgentMessage[]): string | undefined;
|
|
12
|
+
export declare function buildConversationTitleInput(messages: readonly AgentMessage[], obfuscateText?: (text: string) => string): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Obfuscate the full title input, then truncate, then wrap.
|
|
15
|
+
* A secret that crosses the character cap is replaced before the cut, and the
|
|
16
|
+
* `<user-message>` fence stays outside the truncated body.
|
|
17
|
+
*/
|
|
18
|
+
export declare function prepareTitleOutboundText(firstMessage: string, obfuscateText?: (text: string) => string): string;
|
|
19
|
+
export declare function titleInputObfuscator(settings: Settings, activeCwd?: string): Promise<((text: string) => string) | undefined>;
|
|
11
20
|
/**
|
|
12
21
|
* Generate a title for a session based on the provided user-message input.
|
|
13
22
|
* Automatic titles pass the first user message; regeneration passes a bounded
|
|
@@ -22,8 +31,9 @@ export declare function buildConversationTitleInput(messages: readonly AgentMess
|
|
|
22
31
|
* to produce request metadata (e.g. user_id for session attribution). Using a
|
|
23
32
|
* resolver instead of a pre-evaluated value ensures the metadata's account_uuid
|
|
24
33
|
* reflects the credential actually selected for this request.
|
|
34
|
+
* @param activeCwd Active session cwd for project-scoped secret lookup.
|
|
25
35
|
*/
|
|
26
|
-
export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined): Promise<string | null>;
|
|
36
|
+
export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined, activeCwd?: string): Promise<string | null>;
|
|
27
37
|
export declare function formatSessionTerminalTitle(sessionName: string | undefined, cwd?: string): string;
|
|
28
38
|
/**
|
|
29
39
|
* Set the terminal title using OSC 0 (sets both tab and window title). Unsupported terminals ignore it.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ReleaseAssetDigest {
|
|
2
|
+
name?: string;
|
|
3
|
+
digest?: string | null;
|
|
4
|
+
}
|
|
5
|
+
export declare function sha256FromReleaseDigest(digest: string | null | undefined): string | null;
|
|
6
|
+
export declare function requireAssetSha256(assets: readonly ReleaseAssetDigest[], assetName: string): string;
|
|
7
|
+
export declare function assertFileMatchesSha256(filePath: string, expectedSha256: string): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Settings } from "../../config/settings";
|
|
1
2
|
import type { AgentStorage } from "../../session/agent-storage";
|
|
2
3
|
import type { AddressResolver } from "../insane/url-guard";
|
|
3
4
|
export { formatNumber } from "@sayknow-cli/utils";
|
|
@@ -11,7 +12,13 @@ export interface RenderResult {
|
|
|
11
12
|
truncated: boolean;
|
|
12
13
|
notes: string[];
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* `settings` is the caller's session settings. Handlers must read through it
|
|
17
|
+
* rather than the process-global singleton: the SDK/ACP host path runs tools
|
|
18
|
+
* without ever calling `Settings.init()`, where a global read throws
|
|
19
|
+
* "Settings not initialized" instead of scraping the page.
|
|
20
|
+
*/
|
|
21
|
+
export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null, settings?: Settings) => Promise<RenderResult | null>;
|
|
15
22
|
export declare const MAX_OUTPUT_CHARS = 500000;
|
|
16
23
|
export declare const MAX_BYTES: number;
|
|
17
24
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AuthStorage } from "@sayknow-cli/ai";
|
|
2
2
|
import type { SearchResponse } from "../../../web/search/types";
|
|
3
3
|
import type { SearchParams } from "./base";
|
|
4
4
|
import { SearchProvider } from "./base";
|
|
@@ -14,12 +14,11 @@ export interface CodexSearchParams {
|
|
|
14
14
|
* Executes a web search using OpenAI code provider's built-in web search tool.
|
|
15
15
|
*
|
|
16
16
|
* Default-model behavior:
|
|
17
|
-
* -
|
|
18
|
-
* upstream
|
|
19
|
-
* - Otherwise
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI rejects.
|
|
17
|
+
* - Use `SKC_OPENAI_CODE_WEB_SEARCH_MODEL` (then `PI_CODEX_WEB_SEARCH_MODEL`)
|
|
18
|
+
* exactly once when configured and surface upstream errors without model retries.
|
|
19
|
+
* - Otherwise intersect current account discovery with GPT-6.1 Sol, then GPT-6 Luna.
|
|
20
|
+
* Fail closed when discovery is unavailable or neither candidate is advertised.
|
|
21
|
+
* Retry the next advertised candidate only for the known unsupported-model 400 family.
|
|
23
22
|
*/
|
|
24
23
|
export declare function searchCodex(params: SearchParams): Promise<SearchResponse>;
|
|
25
24
|
/**
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { AuthStorage } from "@sayknow-cli/ai";
|
|
14
14
|
import type { SearchResponse, SearchSource } from "../../../web/search/types";
|
|
15
|
+
import type { AddressResolver } from "../../insane/url-guard";
|
|
15
16
|
import type { SearchParams } from "./base";
|
|
16
17
|
import { SearchProvider } from "./base";
|
|
17
18
|
export interface InsaneRouteAttempt {
|
|
@@ -35,13 +36,18 @@ interface RouteFailure {
|
|
|
35
36
|
attempts: InsaneRouteAttempt[];
|
|
36
37
|
}
|
|
37
38
|
type RouteResult = RouteSuccess | RouteFailure | null;
|
|
38
|
-
export declare function routeInsanePublicUrl(rawUrl: string, signal?: AbortSignal
|
|
39
|
+
export declare function routeInsanePublicUrl(rawUrl: string, signal?: AbortSignal, resolverOption?: {
|
|
40
|
+
resolver?: AddressResolver;
|
|
41
|
+
}): Promise<RouteResult>;
|
|
39
42
|
/** Execute safe Insane Search public-route discovery. */
|
|
40
43
|
export declare function searchInsane(params: {
|
|
41
44
|
query: string;
|
|
42
45
|
num_results?: number;
|
|
43
46
|
recency?: "day" | "week" | "month" | "year";
|
|
44
47
|
signal?: AbortSignal;
|
|
48
|
+
resolverOption?: {
|
|
49
|
+
resolver?: AddressResolver;
|
|
50
|
+
};
|
|
45
51
|
}): Promise<SearchResponse>;
|
|
46
52
|
/** Keyless provider that ports safe upstream public-route fallbacks only. */
|
|
47
53
|
export declare class InsaneProvider extends SearchProvider {
|
|
@@ -16,6 +16,8 @@ export interface KimiSearchParams {
|
|
|
16
16
|
authStorage: AuthStorage;
|
|
17
17
|
sessionId?: string;
|
|
18
18
|
}
|
|
19
|
+
/** Test seam: the Kimi search base URL as resolved from trusted env. */
|
|
20
|
+
export declare function resolveKimiSearchBaseUrlForTest(): string;
|
|
19
21
|
/** Execute Kimi web search. */
|
|
20
22
|
export declare function searchKimi(params: KimiSearchParams): Promise<SearchResponse>;
|
|
21
23
|
/** Search provider for Kimi web search. */
|
|
@@ -28,6 +28,13 @@ import type { AuthStorage } from "@sayknow-cli/ai";
|
|
|
28
28
|
import type { SearchResponse } from "../../../web/search/types";
|
|
29
29
|
import type { SearchParams } from "./base";
|
|
30
30
|
import { SearchProvider } from "./base";
|
|
31
|
+
/** Test seam: the SearXNG endpoint and auth material as resolved from trusted env. */
|
|
32
|
+
export declare function resolveSearxngConfigForTest(): {
|
|
33
|
+
endpoint: string | null;
|
|
34
|
+
token: string | null;
|
|
35
|
+
basicUsername: string | null;
|
|
36
|
+
basicPassword: string | null;
|
|
37
|
+
};
|
|
31
38
|
/** Execute SearXNG web search. */
|
|
32
39
|
export declare function searchSearXNG(params: {
|
|
33
40
|
query: string;
|
|
@@ -32,6 +32,8 @@ export interface XaiSearchParams {
|
|
|
32
32
|
authStorage: AuthStorage;
|
|
33
33
|
sessionId?: string;
|
|
34
34
|
}
|
|
35
|
+
/** Test seam: the xAI search base URL as resolved from trusted env. */
|
|
36
|
+
export declare function resolveXaiSearchBaseUrlForTest(): string;
|
|
35
37
|
export declare function buildXaiRequestBody(params: {
|
|
36
38
|
query: string;
|
|
37
39
|
systemPrompt: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@sayknow-cli/coding-agent",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.13",
|
|
5
5
|
"description": "Sayknow-CLI CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://sayknow-cli.com",
|
|
7
7
|
"author": "jaybeyond",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
55
55
|
"@babel/parser": "^7.29.3",
|
|
56
56
|
"@mozilla/readability": "^0.6.0",
|
|
57
|
-
"@sayknow-cli/stats": "0.7.
|
|
58
|
-
"@sayknow-cli/agent-core": "0.7.
|
|
59
|
-
"@sayknow-cli/ai": "0.7.
|
|
60
|
-
"@sayknow-cli/natives": "0.7.
|
|
61
|
-
"@sayknow-cli/tui": "0.7.
|
|
62
|
-
"@sayknow-cli/utils": "0.7.
|
|
57
|
+
"@sayknow-cli/stats": "0.7.13",
|
|
58
|
+
"@sayknow-cli/agent-core": "0.7.13",
|
|
59
|
+
"@sayknow-cli/ai": "0.7.13",
|
|
60
|
+
"@sayknow-cli/natives": "0.7.13",
|
|
61
|
+
"@sayknow-cli/tui": "0.7.13",
|
|
62
|
+
"@sayknow-cli/utils": "0.7.13",
|
|
63
63
|
"@puppeteer/browsers": "^2.13.0",
|
|
64
64
|
"@types/turndown": "5.0.6",
|
|
65
65
|
"@xterm/headless": "^6.0.0",
|
|
@@ -13,6 +13,10 @@ const inventoryPath = process.env.SKC_SDK_OPERATION_INVENTORY
|
|
|
13
13
|
const LOCKED_EXCLUSIONS: Readonly<Record<string, string>> = {
|
|
14
14
|
"agent_session:getAutoCompactionThresholdTokens":
|
|
15
15
|
"internal compaction-threshold accessor feeding the /context breakdown; exposed through context.get, not an independent SDK operation",
|
|
16
|
+
"agent_session:resolvePromptSkillInvocation":
|
|
17
|
+
"internal prompt-dispatch classifier shared with interactive title seeding, not a user-facing control seam",
|
|
18
|
+
"agent_session:isLocallyHandledSlashCommand":
|
|
19
|
+
"internal slash-command classifier that keeps command text out of title seeding, not a user-facing control seam",
|
|
16
20
|
"slash_command:settings": "visual/local-only command, not a user-facing SDK control seam",
|
|
17
21
|
"slash_command:theme": "visual/local-only command, not a user-facing SDK control seam",
|
|
18
22
|
"slash_command:copy": "visual/local-only command, not a user-facing SDK control seam",
|
package/src/async/job-manager.ts
CHANGED
|
@@ -1784,16 +1784,24 @@ export class AsyncJobManager {
|
|
|
1784
1784
|
return;
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
|
-
|
|
1787
|
+
// Publish the loop future before the loop body runs: a delivery callback can
|
|
1788
|
+
// reenter (drain, dispose) synchronously, and it must see this loop, not none.
|
|
1789
|
+
const completion = Promise.withResolvers<void>();
|
|
1790
|
+
const promise = completion.promise;
|
|
1791
|
+
this.#deliveryLoop = promise;
|
|
1792
|
+
const operation = this.#runDeliveryLoop()
|
|
1788
1793
|
.catch(error => {
|
|
1789
1794
|
logger.error("Async job delivery loop crashed", { error: String(error) });
|
|
1790
1795
|
})
|
|
1791
1796
|
.finally(() => {
|
|
1792
|
-
this.#deliveryLoop
|
|
1793
|
-
|
|
1794
|
-
this.#
|
|
1797
|
+
if (this.#deliveryLoop === promise) {
|
|
1798
|
+
this.#deliveryLoop = undefined;
|
|
1799
|
+
if (!this.#disposed && this.#hasDeliverable()) {
|
|
1800
|
+
this.#ensureDeliveryLoop();
|
|
1801
|
+
}
|
|
1795
1802
|
}
|
|
1796
1803
|
});
|
|
1804
|
+
void operation.then(completion.resolve, completion.reject);
|
|
1797
1805
|
}
|
|
1798
1806
|
|
|
1799
1807
|
async #runDeliveryLoop(): Promise<void> {
|
|
@@ -1816,8 +1824,12 @@ export class AsyncJobManager {
|
|
|
1816
1824
|
}
|
|
1817
1825
|
|
|
1818
1826
|
#deliverDelivery(delivery: AsyncJobDelivery): Promise<void> {
|
|
1819
|
-
|
|
1820
|
-
|
|
1827
|
+
// Enroll the in-flight future before the callback starts, so a reentrant
|
|
1828
|
+
// drain from inside `onJobComplete` waits on it instead of finding none.
|
|
1829
|
+
const completion = Promise.withResolvers<void>();
|
|
1830
|
+
delivery.promise = completion.promise;
|
|
1831
|
+
this.#inFlightDeliveries.push(delivery);
|
|
1832
|
+
const operation = (async () => {
|
|
1821
1833
|
try {
|
|
1822
1834
|
await this.#onJobComplete(delivery.jobId, delivery.text, this.#jobs.get(delivery.jobId));
|
|
1823
1835
|
} catch (error) {
|
|
@@ -1848,12 +1860,14 @@ export class AsyncJobManager {
|
|
|
1848
1860
|
if (!this.#disposed && this.#hasDeliverable()) this.#ensureDeliveryLoop();
|
|
1849
1861
|
}
|
|
1850
1862
|
})();
|
|
1851
|
-
|
|
1852
|
-
return promise;
|
|
1863
|
+
void operation.then(completion.resolve, completion.reject);
|
|
1864
|
+
return completion.promise;
|
|
1853
1865
|
}
|
|
1854
1866
|
|
|
1855
1867
|
async #waitForDeliveryPromise(promise: Promise<void> | undefined, deadline: number): Promise<boolean> {
|
|
1856
|
-
|
|
1868
|
+
// Missing an enrolled in-flight future is uncertainty, never evidence of
|
|
1869
|
+
// successful settlement.
|
|
1870
|
+
if (!promise) return false;
|
|
1857
1871
|
if (deadline === Number.POSITIVE_INFINITY) {
|
|
1858
1872
|
await promise;
|
|
1859
1873
|
return true;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { logger } from "@sayknow-cli/utils";
|
|
2
|
+
import type { SessionManager } from "../session/session-manager";
|
|
3
|
+
import { DEFAULT_ARTIFACT_MAX_BYTES, truncateHeadBytes } from "../session/streaming-output";
|
|
4
|
+
|
|
5
|
+
const ASYNC_INLINE_RESULT_MAX_CHARS = 12_000;
|
|
6
|
+
const ASYNC_PREVIEW_MAX_CHARS = 4_000;
|
|
7
|
+
|
|
8
|
+
export async function formatAsyncResultForFollowUp(
|
|
9
|
+
sessionManager: SessionManager,
|
|
10
|
+
result: string,
|
|
11
|
+
allowArtifact = true,
|
|
12
|
+
): Promise<string> {
|
|
13
|
+
if (result.length <= ASYNC_INLINE_RESULT_MAX_CHARS) return result;
|
|
14
|
+
const preview = `${result.slice(0, ASYNC_PREVIEW_MAX_CHARS)}\n\n[Output truncated. Showing first ${ASYNC_PREVIEW_MAX_CHARS.toLocaleString()} characters.]`;
|
|
15
|
+
// Denied owned deliveries must not leave unreferenced output artifacts.
|
|
16
|
+
if (!allowArtifact) return preview;
|
|
17
|
+
try {
|
|
18
|
+
const artifactId = await sessionManager.saveArtifact(result, "async");
|
|
19
|
+
if (artifactId) {
|
|
20
|
+
const bytes = Buffer.byteLength(result, "utf8");
|
|
21
|
+
const omittedBytes =
|
|
22
|
+
bytes > DEFAULT_ARTIFACT_MAX_BYTES
|
|
23
|
+
? bytes - truncateHeadBytes(result, DEFAULT_ARTIFACT_MAX_BYTES).bytes
|
|
24
|
+
: 0;
|
|
25
|
+
const notice = omittedBytes
|
|
26
|
+
? `Saved completion output is incomplete; omitted ${omittedBytes} UTF-8 bytes`
|
|
27
|
+
: "Saved completion output";
|
|
28
|
+
return `${preview}\n${notice}: artifact://${artifactId}`;
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
try {
|
|
32
|
+
logger.warn("Failed to persist async follow-up artifact", {
|
|
33
|
+
error: error instanceof Error ? error.message : String(error),
|
|
34
|
+
});
|
|
35
|
+
} catch {
|
|
36
|
+
// Diagnostics must not discard a completed job's preview.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return `${preview}\n[Completion output storage unavailable; only the preview is available here.]`;
|
|
40
|
+
}
|