@gajae-code/coding-agent 0.17.2 → 0.17.5
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 +267 -0
- package/dist/types/cli/daemon-cli.d.ts +3 -1
- package/dist/types/cli/github-release.d.ts +17 -0
- package/dist/types/cli/public-command-entry.d.ts +56 -0
- package/dist/types/cli/public-command-errors.d.ts +126 -0
- package/dist/types/cli/public-command-evidence.d.ts +99 -0
- package/dist/types/cli/public-command-help.d.ts +65 -0
- package/dist/types/cli/public-command-registry.d.ts +69 -0
- package/dist/types/cli/session-picker.d.ts +1 -1
- package/dist/types/cli/setup-cli.d.ts +1 -0
- package/dist/types/cli/skills-cli.d.ts +5 -0
- package/dist/types/cli.d.ts +3 -0
- package/dist/types/commands/daemon.d.ts +4 -50
- package/dist/types/commands/sdk.d.ts +20 -37
- package/dist/types/commands/setup.d.ts +3 -0
- package/dist/types/commands/skills.d.ts +9 -0
- package/dist/types/config/autorouting-tier-map.d.ts +1049 -3
- package/dist/types/config/file-lock.d.ts +13 -3
- package/dist/types/config/model-profile-activation.d.ts +45 -1
- package/dist/types/config/model-registry.d.ts +14 -3
- package/dist/types/config/model-resolver.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +11 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +6 -1
- package/dist/types/daemon/operator-contract.d.ts +5 -1
- package/dist/types/eval/js/worker-protocol.d.ts +2 -0
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/extensibility/extensions/types.d.ts +12 -0
- package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +11 -2
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +18 -0
- package/dist/types/extensibility/shared-events.d.ts +3 -1
- package/dist/types/gjc-runtime/session-state-lock.d.ts +61 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/harness-control-plane/control-endpoint.d.ts +4 -1
- package/dist/types/harness-control-plane/finalize.d.ts +14 -3
- package/dist/types/internal-urls/embedded-protocol.d.ts +9 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/parse.d.ts +9 -1
- package/dist/types/main.d.ts +23 -1
- package/dist/types/modes/acp/acp-agent.d.ts +55 -1
- package/dist/types/modes/acp/startup-provenance.d.ts +16 -0
- package/dist/types/modes/components/custom-provider-wizard.d.ts +19 -1
- package/dist/types/modes/components/session-selector.d.ts +5 -2
- package/dist/types/modes/components/user-message-selector.d.ts +5 -2
- package/dist/types/modes/controllers/command-controller.d.ts +1 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/interactive-mode.d.ts +1 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +11 -1
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +14 -1
- package/dist/types/modes/types.d.ts +2 -2
- package/dist/types/runtime/process-lifecycle.d.ts +2 -0
- package/dist/types/runtime-mcp/loader.d.ts +2 -0
- package/dist/types/runtime-mcp/manager.d.ts +69 -6
- package/dist/types/runtime-mcp/pool.d.ts +17 -0
- package/dist/types/runtime-mcp/redaction.d.ts +20 -0
- package/dist/types/runtime-mcp/startup-policy.d.ts +6 -0
- package/dist/types/runtime-mcp/tool-bridge.d.ts +9 -0
- package/dist/types/runtime-mcp/transports/http.d.ts +11 -0
- package/dist/types/sdk/broker/broker.d.ts +17 -4
- package/dist/types/sdk/broker/ensure.d.ts +3 -0
- package/dist/types/sdk/broker/identity.d.ts +5 -1
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +23 -3
- package/dist/types/sdk/broker/lifecycle.d.ts +15 -8
- package/dist/types/sdk/broker/managed-task-dag.d.ts +1335 -0
- package/dist/types/sdk/broker/managed-task-verification.d.ts +37 -0
- package/dist/types/sdk/broker/runtime.d.ts +1 -1
- package/dist/types/sdk/broker/session-index.d.ts +22 -3
- package/dist/types/sdk/broker/spawn-authority.d.ts +12 -0
- package/dist/types/sdk/broker/startup-failure.d.ts +4 -0
- package/dist/types/sdk/broker/stderr-drainer.d.ts +13 -0
- package/dist/types/sdk/bus/index.d.ts +19 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +7 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +5 -0
- package/dist/types/sdk/cli/master-cli.d.ts +6 -10
- package/dist/types/sdk/cli/rows.d.ts +19 -1
- package/dist/types/sdk/cli/session-cli.d.ts +22 -5
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/guides/cli.d.ts +3 -4
- package/dist/types/sdk/guides/verify.d.ts +2 -0
- package/dist/types/sdk/host/host.d.ts +9 -0
- package/dist/types/sdk/host/session-runtime.d.ts +31 -0
- package/dist/types/sdk/host/types.d.ts +10 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/prompt-deadline-flush.d.ts +85 -0
- package/dist/types/sdk/prompt-deadline-manager.d.ts +37 -0
- package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +3 -3
- package/dist/types/sdk/startup-capability.d.ts +2 -0
- package/dist/types/sdk/transport/relay.d.ts +1 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +48 -4
- package/dist/types/sdk/transport/stdio.d.ts +5 -1
- package/dist/types/session/agent-session.d.ts +175 -23
- package/dist/types/session/fallback-chain-controller.d.ts +6 -6
- package/dist/types/session/fold-coordinator.d.ts +17 -3
- package/dist/types/session/internal/managed-session-storage.d.ts +7 -1
- package/dist/types/session/session-manager.d.ts +64 -1
- package/dist/types/session/session-work-lease.d.ts +14 -0
- package/dist/types/setup/model-onboarding-guidance.d.ts +1 -1
- package/dist/types/setup/provider-onboarding.d.ts +81 -1
- package/dist/types/task/types.d.ts +2 -0
- package/dist/types/tools/bash-interactive.d.ts +1 -0
- package/dist/types/tools/bash.d.ts +37 -11
- package/dist/types/tools/fetch.d.ts +10 -1
- package/dist/types/tools/job.d.ts +1 -1
- package/dist/types/tools/steer-fold.d.ts +31 -0
- package/dist/types/tools/subagent.d.ts +8 -1
- package/dist/types/utils/git.d.ts +28 -2
- package/dist/types/utils/mupdf-embedded.d.ts +2 -0
- package/dist/types/utils/mupdf.d.ts +4 -0
- package/dist/types/utils/session-title-generation.d.ts +6 -0
- package/dist/types/utils/title-generator.d.ts +11 -2
- package/dist/types/web/scrapers/types.d.ts +3 -0
- package/package.json +18 -10
- package/scripts/build-binary.ts +9 -3
- package/scripts/compile-args.ts +0 -9
- package/scripts/embed-mupdf.ts +52 -0
- package/scripts/generate-sdk-operation-inventory.ts +31 -1
- package/scripts/vendor-markit.ts +196 -0
- package/src/async/job-manager.ts +22 -1
- package/src/cli/daemon-cli.ts +53 -18
- package/src/cli/github-release.ts +87 -5
- package/src/cli/mcp-cli.ts +38 -4
- package/src/cli/public-command-entry.ts +450 -0
- package/src/cli/public-command-errors.ts +581 -0
- package/src/cli/public-command-evidence.ts +717 -0
- package/src/cli/public-command-help.ts +360 -0
- package/src/cli/public-command-registry.ts +541 -0
- package/src/cli/session-picker.ts +2 -1
- package/src/cli/setup-cli.ts +10 -1
- package/src/cli/skills-cli.ts +46 -2
- package/src/cli/stats-cli.ts +11 -1
- package/src/cli.ts +61 -1
- package/src/commands/daemon.ts +65 -69
- package/src/commands/sdk.ts +175 -117
- package/src/commands/setup.ts +2 -0
- package/src/commands/skills.ts +11 -0
- package/src/config/autorouting-tier-map.ts +543 -3
- package/src/config/file-lock.ts +206 -65
- package/src/config/model-discovery-manager.ts +4 -4
- package/src/config/model-profile-activation.ts +417 -66
- package/src/config/model-registry.ts +254 -36
- package/src/config/model-resolver.ts +6 -1
- package/src/config/settings-schema.ts +26 -2
- package/src/coordinator-mcp/policy.ts +10 -5
- package/src/coordinator-mcp/question-gate-codec.ts +17 -0
- package/src/coordinator-mcp/question-state.ts +179 -9
- package/src/coordinator-mcp/server.ts +521 -87
- package/src/coordinator-mcp/session-reaper.ts +6 -4
- package/src/crash/record-loader.ts +6 -2
- package/src/daemon/operator-contract.ts +26 -12
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
- package/src/eval/js/context-manager.ts +8 -8
- package/src/eval/js/worker-core.ts +9 -4
- package/src/eval/js/worker-protocol.ts +2 -0
- package/src/exec/bash-executor.ts +3 -0
- package/src/extensibility/extensions/runner.ts +52 -4
- package/src/extensibility/extensions/types.ts +10 -0
- package/src/extensibility/gjc-plugins/registry.ts +196 -37
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +46 -8
- package/src/extensibility/runtime-skill-discovery.ts +61 -3
- package/src/extensibility/shared-events.ts +3 -1
- package/src/gjc-runtime/session-state-lock.ts +165 -24
- package/src/gjc-runtime/state-writer.ts +317 -6
- package/src/gjc-runtime/ultragoal-succession.ts +31 -3
- package/src/harness-control-plane/control-endpoint.ts +24 -6
- package/src/harness-control-plane/finalize.ts +312 -25
- package/src/harness-control-plane/owner.ts +323 -89
- package/src/internal-urls/docs-index.generated.ts +23 -20
- package/src/internal-urls/embedded-protocol.ts +83 -0
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/parse.ts +21 -1
- package/src/internal-urls/router.ts +4 -2
- package/src/main.ts +192 -74
- package/src/modes/acp/acp-agent.ts +973 -56
- package/src/modes/acp/startup-provenance.ts +59 -0
- package/src/modes/components/custom-provider-wizard.ts +308 -7
- package/src/modes/components/gjc-bundle-settings.ts +21 -1
- package/src/modes/components/oauth-selector.ts +9 -0
- package/src/modes/components/session-selector.ts +47 -4
- package/src/modes/components/tool-status-header.ts +72 -6
- package/src/modes/components/user-message-selector.ts +57 -15
- package/src/modes/controllers/command-controller.ts +58 -32
- package/src/modes/controllers/extension-ui-controller.ts +33 -7
- package/src/modes/controllers/input-controller.ts +4 -0
- package/src/modes/controllers/runtime-mcp-command-controller.ts +1 -1
- package/src/modes/controllers/selector-controller.ts +161 -15
- package/src/modes/interactive-mode.ts +21 -7
- package/src/modes/runtime-init.ts +1 -0
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +124 -7
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +16 -2
- package/src/modes/types.ts +2 -2
- package/src/prompts/agent-fragments/browser-aside.md +1 -0
- package/src/prompts/system/title-system.md +1 -1
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/job.md +1 -1
- package/src/prompts/tools/read.md +2 -0
- package/src/runtime/network-prewarm-service.test.ts +36 -1
- package/src/runtime/network-prewarm-service.ts +28 -3
- package/src/runtime/process-lifecycle.ts +22 -11
- package/src/runtime-mcp/config.ts +16 -1
- package/src/runtime-mcp/loader.ts +6 -3
- package/src/runtime-mcp/manager.ts +845 -109
- package/src/runtime-mcp/pool.test.ts +31 -0
- package/src/runtime-mcp/pool.ts +304 -28
- package/src/runtime-mcp/redaction.ts +42 -0
- package/src/runtime-mcp/startup-policy.ts +7 -0
- package/src/runtime-mcp/tool-bridge.ts +71 -0
- package/src/runtime-mcp/transports/http.ts +108 -25
- package/src/sdk/acp/adapter.ts +27 -8
- package/src/sdk/broker/broker.ts +1431 -198
- package/src/sdk/broker/ensure.ts +21 -3
- package/src/sdk/broker/identity.ts +22 -1
- package/src/sdk/broker/lifecycle-ledger.ts +95 -31
- package/src/sdk/broker/lifecycle.ts +690 -141
- package/src/sdk/broker/managed-task-dag.ts +1927 -0
- package/src/sdk/broker/managed-task-verification.ts +642 -0
- package/src/sdk/broker/runtime.ts +1 -1
- package/src/sdk/broker/session-index.ts +97 -4
- package/src/sdk/broker/spawn-authority.ts +175 -14
- package/src/sdk/broker/startup-failure.ts +80 -1
- package/src/sdk/broker/stderr-drainer.ts +59 -0
- package/src/sdk/broker/transport.ts +1 -0
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
- package/src/sdk/bus/index.ts +707 -81
- package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
- package/src/sdk/bus/telegram-daemon-contract.ts +7 -1
- package/src/sdk/bus/telegram-daemon.ts +10 -3
- package/src/sdk/cli/master-cli.ts +47 -36
- package/src/sdk/cli/rows.ts +30 -7
- package/src/sdk/cli/session-cli.ts +705 -184
- package/src/sdk/client/client.ts +18 -0
- package/src/sdk/guides/catalog.ts +2 -2
- package/src/sdk/guides/cli.ts +20 -62
- package/src/sdk/guides/verify.ts +14 -0
- package/src/sdk/host/host.ts +49 -5
- package/src/sdk/host/session-runtime.test.ts +184 -2
- package/src/sdk/host/session-runtime.ts +322 -101
- package/src/sdk/host/types.ts +12 -1
- package/src/sdk/host/websocket-transport.lifecycle.test.ts +84 -0
- package/src/sdk/host/websocket-transport.ts +40 -6
- package/src/sdk/index.ts +11 -0
- package/src/sdk/lifecycle/service.ts +2 -0
- package/src/sdk/prompt-deadline-flush.ts +356 -0
- package/src/sdk/prompt-deadline-manager.ts +133 -1
- package/src/sdk/prompt-tool-boundary.ts +121 -0
- package/src/sdk/protocol/operation-inventory.generated.json +106 -0
- package/src/sdk/router/session-router.ts +9 -1
- package/src/sdk/session.ts +763 -116
- package/src/sdk/startup-capability.ts +1 -1
- package/src/sdk/transport/relay.ts +71 -6
- package/src/sdk/transport/serve-cli.ts +397 -42
- package/src/sdk/transport/socket.ts +12 -11
- package/src/sdk/transport/stdio.ts +7 -3
- package/src/session/agent-session.ts +2472 -407
- package/src/session/fallback-chain-controller.ts +6 -7
- package/src/session/fold-coordinator.ts +24 -5
- package/src/session/internal/managed-session-scope.ts +68 -18
- package/src/session/internal/managed-session-storage.ts +334 -12
- package/src/session/session-manager.ts +382 -44
- package/src/session/session-work-lease.ts +34 -0
- package/src/setup/model-onboarding-guidance.ts +1 -1
- package/src/setup/provider-onboarding.ts +397 -24
- package/src/setup/provider-presets.json +2 -1
- package/src/slash-commands/builtin-registry.ts +259 -15
- package/src/task/executor.ts +46 -17
- package/src/task/index.ts +14 -2
- package/src/task/types.ts +2 -0
- package/src/tools/bash-interactive.ts +2 -0
- package/src/tools/bash.ts +118 -78
- package/src/tools/fetch.ts +140 -25
- package/src/tools/job.ts +151 -25
- package/src/tools/output-meta.ts +15 -2
- package/src/tools/path-utils.ts +27 -3
- package/src/tools/read.ts +3 -3
- package/src/tools/steer-fold.ts +107 -0
- package/src/tools/subagent-render.ts +24 -1
- package/src/tools/subagent.ts +27 -1
- package/src/tools/tool-catalog.generated.ts +29 -2
- package/src/tools/tool-errors.ts +4 -0
- package/src/utils/git.ts +53 -3
- package/src/utils/markit.ts +55 -41
- package/src/utils/mupdf-assets.d.ts +4 -0
- package/src/utils/mupdf-embedded.ts +4 -0
- package/src/utils/mupdf.ts +136 -0
- package/src/utils/session-title-generation.ts +29 -0
- package/src/utils/title-generator.ts +46 -2
- package/src/web/scrapers/types.ts +24 -3
- package/vendor/markit-ai/LICENSE +21 -0
- package/vendor/markit-ai/MANIFEST.json +412 -0
- package/vendor/markit-ai/dist/commands/config.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/config.js +139 -0
- package/vendor/markit-ai/dist/commands/convert.d.ts +6 -0
- package/vendor/markit-ai/dist/commands/convert.js +113 -0
- package/vendor/markit-ai/dist/commands/formats.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/formats.js +92 -0
- package/vendor/markit-ai/dist/commands/init.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/init.js +29 -0
- package/vendor/markit-ai/dist/commands/onboard.d.ts +2 -0
- package/vendor/markit-ai/dist/commands/onboard.js +61 -0
- package/vendor/markit-ai/dist/commands/plugin.d.ts +4 -0
- package/vendor/markit-ai/dist/commands/plugin.js +58 -0
- package/vendor/markit-ai/dist/config.d.ts +26 -0
- package/vendor/markit-ai/dist/config.js +42 -0
- package/vendor/markit-ai/dist/converters/audio.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/audio.js +104 -0
- package/vendor/markit-ai/dist/converters/csv.d.ts +7 -0
- package/vendor/markit-ai/dist/converters/csv.js +83 -0
- package/vendor/markit-ai/dist/converters/docx.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/docx.js +57 -0
- package/vendor/markit-ai/dist/converters/epub.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/epub.js +128 -0
- package/vendor/markit-ai/dist/converters/github.d.ts +18 -0
- package/vendor/markit-ai/dist/converters/github.js +148 -0
- package/vendor/markit-ai/dist/converters/html.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/html.js +30 -0
- package/vendor/markit-ai/dist/converters/image.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/image.js +124 -0
- package/vendor/markit-ai/dist/converters/ipynb.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/ipynb.js +75 -0
- package/vendor/markit-ai/dist/converters/iwork.d.ts +20 -0
- package/vendor/markit-ai/dist/converters/iwork.js +391 -0
- package/vendor/markit-ai/dist/converters/json.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/json.js +21 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.d.ts +35 -0
- package/vendor/markit-ai/dist/converters/pdf/columns.js +93 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/extract.js +514 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.d.ts +25 -0
- package/vendor/markit-ai/dist/converters/pdf/grid.js +795 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/headers.js +108 -0
- package/vendor/markit-ai/dist/converters/pdf/index.d.ts +19 -0
- package/vendor/markit-ai/dist/converters/pdf/index.js +136 -0
- package/vendor/markit-ai/dist/converters/pdf/mupdf-loader.js +9 -0
- package/vendor/markit-ai/dist/converters/pdf/render.d.ts +24 -0
- package/vendor/markit-ai/dist/converters/pdf/render.js +513 -0
- package/vendor/markit-ai/dist/converters/pdf/types.d.ts +75 -0
- package/vendor/markit-ai/dist/converters/pdf/types.js +1 -0
- package/vendor/markit-ai/dist/converters/plain-text.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/plain-text.js +87 -0
- package/vendor/markit-ai/dist/converters/pptx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/pptx.js +289 -0
- package/vendor/markit-ai/dist/converters/rss.d.ts +11 -0
- package/vendor/markit-ai/dist/converters/rss.js +138 -0
- package/vendor/markit-ai/dist/converters/wikipedia.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/wikipedia.js +33 -0
- package/vendor/markit-ai/dist/converters/xlsx.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/xlsx.js +147 -0
- package/vendor/markit-ai/dist/converters/xml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/xml.js +18 -0
- package/vendor/markit-ai/dist/converters/yaml.d.ts +6 -0
- package/vendor/markit-ai/dist/converters/yaml.js +17 -0
- package/vendor/markit-ai/dist/converters/zip.d.ts +8 -0
- package/vendor/markit-ai/dist/converters/zip.js +57 -0
- package/vendor/markit-ai/dist/index.d.ts +30 -0
- package/vendor/markit-ai/dist/index.js +26 -0
- package/vendor/markit-ai/dist/main.d.ts +2 -0
- package/vendor/markit-ai/dist/main.js +191 -0
- package/vendor/markit-ai/dist/markit.d.ts +45 -0
- package/vendor/markit-ai/dist/markit.js +267 -0
- package/vendor/markit-ai/dist/plugins/api.d.ts +7 -0
- package/vendor/markit-ai/dist/plugins/api.js +42 -0
- package/vendor/markit-ai/dist/plugins/index.d.ts +4 -0
- package/vendor/markit-ai/dist/plugins/index.js +3 -0
- package/vendor/markit-ai/dist/plugins/installer.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/installer.js +176 -0
- package/vendor/markit-ai/dist/plugins/loader.d.ts +6 -0
- package/vendor/markit-ai/dist/plugins/loader.js +61 -0
- package/vendor/markit-ai/dist/plugins/types.d.ts +25 -0
- package/vendor/markit-ai/dist/plugins/types.js +1 -0
- package/vendor/markit-ai/dist/providers/anthropic.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/anthropic.js +47 -0
- package/vendor/markit-ai/dist/providers/index.d.ts +21 -0
- package/vendor/markit-ai/dist/providers/index.js +56 -0
- package/vendor/markit-ai/dist/providers/openai.d.ts +2 -0
- package/vendor/markit-ai/dist/providers/openai.js +76 -0
- package/vendor/markit-ai/dist/providers/types.d.ts +26 -0
- package/vendor/markit-ai/dist/providers/types.js +1 -0
- package/vendor/markit-ai/dist/types.d.ts +36 -0
- package/vendor/markit-ai/dist/types.js +1 -0
- package/vendor/markit-ai/dist/utils/exit-codes.d.ts +4 -0
- package/vendor/markit-ai/dist/utils/exit-codes.js +4 -0
- package/vendor/markit-ai/dist/utils/output.d.ts +22 -0
- package/vendor/markit-ai/dist/utils/output.js +31 -0
- package/vendor/markit-ai/dist/utils/turndown.d.ts +8 -0
- package/vendor/markit-ai/dist/utils/turndown.js +70 -0
- package/vendor/markit-ai/package.json +74 -0
- package/vendor/markit-ai.patch +49 -0
|
@@ -21,12 +21,14 @@ export type FileLockAcquireReason = "acquire_timeout" | "orphan_transition";
|
|
|
21
21
|
* generation); this records the cause that exhaustion must report.
|
|
22
22
|
*/
|
|
23
23
|
export interface FileLockStaleRemovalFailure {
|
|
24
|
-
/** Guarded-removal outcome
|
|
25
|
-
outcome: "cleanup_failed" | "error";
|
|
24
|
+
/** Guarded-removal outcome; refusals are surfaced only after exhaustion revalidates the dead generation. */
|
|
25
|
+
outcome: "cleanup_failed" | "owner_changed" | "missing" | "error";
|
|
26
26
|
/** Native/errno code carried by the refusal, when one was present. */
|
|
27
27
|
code?: string;
|
|
28
28
|
/** Human-readable cause surfaced to the operator at exhaustion. */
|
|
29
29
|
message: string;
|
|
30
|
+
/** Platform-specific manual cleanup command, set only when the same dead owner persists at exhaustion. */
|
|
31
|
+
manualCleanupCommand?: string;
|
|
30
32
|
}
|
|
31
33
|
export declare class FileLockAcquireError extends Error {
|
|
32
34
|
readonly filePath: string;
|
|
@@ -89,7 +91,14 @@ export interface FileLockOwnerToken {
|
|
|
89
91
|
}
|
|
90
92
|
/** Outcome of a guarded lock-dir removal attempt (`removeFileLockDirForGc`). */
|
|
91
93
|
export type FileLockGcRemoval = "removed" | "owner_changed" | "missing" | "cleanup_failed";
|
|
92
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Identity evidence carried by the generic stale verdict into a later removal.
|
|
96
|
+
*
|
|
97
|
+
* `ctimeNs` is a mutable metadata-change time on every supported filesystem, so
|
|
98
|
+
* it is retained for diagnostics/legacy consumers but is not part of the lock
|
|
99
|
+
* identity predicate. `infoBirthtimeNs` is the creation time that stays bound
|
|
100
|
+
* to the file object.
|
|
101
|
+
*/
|
|
93
102
|
export interface GenericFileLockDirIdentity {
|
|
94
103
|
rootDev: string;
|
|
95
104
|
rootIno: string;
|
|
@@ -99,6 +108,7 @@ export interface GenericFileLockDirIdentity {
|
|
|
99
108
|
infoSize: string;
|
|
100
109
|
infoMtimeNs: string;
|
|
101
110
|
infoCtimeNs: string;
|
|
111
|
+
infoBirthtimeNs: string;
|
|
102
112
|
infoSha256: string;
|
|
103
113
|
}
|
|
104
114
|
export type GenericFileLockDirStaleVerdict = {
|
|
@@ -31,7 +31,7 @@ type ModelProfileActivationSession = Pick<AgentSession, "model" | "thinkingLevel
|
|
|
31
31
|
getDefaultFallbackRuntimeState?: () => DefaultFallbackRuntimeState;
|
|
32
32
|
restoreDefaultFallbackRuntimeState?: (state: DefaultFallbackRuntimeState) => void;
|
|
33
33
|
restoreModelSelectionForRollback?: AgentSession["restoreModelSelectionForRollback"];
|
|
34
|
-
modelRegistry?: Pick<ModelRegistry, "getSessionCanonicalVariant" | "restoreSessionCanonicalVariant" | "clearCanonicalVariant" | "getAvailable" | "lookupAliasExists" | "resolveModelByLookupAlias" | "authStorage" | "isCredentiallessProvider"
|
|
34
|
+
modelRegistry?: Pick<ModelRegistry, "getSessionCanonicalVariant" | "restoreSessionCanonicalVariant" | "clearCanonicalVariant" | "getAvailable" | "lookupAliasExists" | "resolveModelByLookupAlias" | "authStorage" | "isCredentiallessProvider"> & Partial<Pick<ModelRegistry, "getAvailableForProfileActivation">>;
|
|
35
35
|
getConfiguredModelChainState?: (role: string) => ConfiguredModelChainState | undefined;
|
|
36
36
|
};
|
|
37
37
|
type ConfiguredModelChainState = {
|
|
@@ -182,6 +182,48 @@ export declare function getProxyRoutableProviders(profile: ModelProfileDefinitio
|
|
|
182
182
|
* retain their legacy tolerance for stale qualified role tails.
|
|
183
183
|
*/
|
|
184
184
|
export declare function requiresQualifiedModelProfileRoleResolution(profile: Pick<ModelProfileDefinition, "source">): boolean;
|
|
185
|
+
/** Resolve a removed saved-session default through the durable profile without mutating persistent state. */
|
|
186
|
+
export declare function resolveMissingSessionModelRecovery(options: {
|
|
187
|
+
modelRegistry: PrepareModelProfileActivationOptions["modelRegistry"];
|
|
188
|
+
settings: Pick<Settings, "get" | "getModelRole">;
|
|
189
|
+
defaultEntries: readonly string[];
|
|
190
|
+
skips: Array<{
|
|
191
|
+
selector: string;
|
|
192
|
+
reason: string;
|
|
193
|
+
}>;
|
|
194
|
+
savedDefault: string | undefined;
|
|
195
|
+
credentialSessionId: string;
|
|
196
|
+
aliasIntent?: "preset-equivalent";
|
|
197
|
+
}): Promise<{
|
|
198
|
+
profileName: string;
|
|
199
|
+
entries: string[];
|
|
200
|
+
model?: Model<Api>;
|
|
201
|
+
thinkingLevel?: ThinkingLevel;
|
|
202
|
+
explicitThinkingLevel: boolean;
|
|
203
|
+
activeIndex: number;
|
|
204
|
+
skips: Array<{
|
|
205
|
+
selector: string;
|
|
206
|
+
reason: string;
|
|
207
|
+
}>;
|
|
208
|
+
} | undefined>;
|
|
209
|
+
/** Resolve a durable profile's effective default chain without mutating session or settings state. */
|
|
210
|
+
export declare function resolveModelProfileDefaultChain(options: {
|
|
211
|
+
modelRegistry: PrepareModelProfileActivationOptions["modelRegistry"];
|
|
212
|
+
settings: Pick<Settings, "get">;
|
|
213
|
+
profileName: string;
|
|
214
|
+
credentialSessionId: string;
|
|
215
|
+
}): Promise<{
|
|
216
|
+
profileName: string;
|
|
217
|
+
entries: string[];
|
|
218
|
+
model?: Model<Api>;
|
|
219
|
+
thinkingLevel?: ThinkingLevel;
|
|
220
|
+
explicitThinkingLevel: boolean;
|
|
221
|
+
activeIndex: number;
|
|
222
|
+
skips: Array<{
|
|
223
|
+
selector: string;
|
|
224
|
+
reason: string;
|
|
225
|
+
}>;
|
|
226
|
+
}>;
|
|
185
227
|
export declare function rewriteSelectorForProxy(selector: string, proxyProvider: string, proxyMode: ModelProfileProxyMode, allModels: Model<Api>[], directlyAuthenticated: ReadonlySet<string>, routableProviders: ReadonlySet<string>): string;
|
|
186
228
|
export declare function prepareModelProfileActivation(options: PrepareModelProfileActivationOptions): Promise<PreparedModelProfileActivation>;
|
|
187
229
|
export declare function applyPreparedModelProfileActivation(prepared: PreparedModelProfileActivation, options?: ApplyModelProfileActivationOptions): Promise<void>;
|
|
@@ -218,3 +260,5 @@ export declare function restoreMaterializedModelProfileForDeletion(options: {
|
|
|
218
260
|
snapshot: MaterializeModelProfileForDeletionResult;
|
|
219
261
|
}): Promise<void>;
|
|
220
262
|
export declare function activateModelProfile(options: PrepareModelProfileActivationOptions, applyOptions?: ApplyModelProfileActivationOptions): Promise<void>;
|
|
263
|
+
/** Install only a profile's runtime role layer, preserving session model and configured-chain intent. */
|
|
264
|
+
export declare function applyModelProfileRuntimeBindings(options: PrepareModelProfileActivationOptions): Promise<void>;
|
|
@@ -9,7 +9,7 @@ import { ConfigError, ConfigFile } from "./config-file";
|
|
|
9
9
|
import { isAuthenticated, kNoAuth } from "./model-auth";
|
|
10
10
|
import { type ConfiguredModelBindings } from "./model-bindings-applier";
|
|
11
11
|
import { type ProviderDiscoveryState } from "./model-discovery-manager";
|
|
12
|
-
import { type ModelPresetRegistryDependencies } from "./model-preset-registry";
|
|
12
|
+
import { type ModelPresetRegistryDependencies, type ModelPresetRegistryRefreshResult } from "./model-preset-registry";
|
|
13
13
|
export type { ProviderDiscoveryState, ProviderDiscoveryStatus } from "./model-discovery-manager";
|
|
14
14
|
import { type CanonicalModelIndex, type CanonicalModelRecord, type CanonicalModelVariant, type ModelEquivalenceConfig } from "./model-equivalence";
|
|
15
15
|
import { type ModelProfileDefinition } from "./model-profiles";
|
|
@@ -20,6 +20,12 @@ export type { BillingPath, BillingPathKind } from "./billing-path";
|
|
|
20
20
|
export type { EffectiveProviderAuth, ProviderSelectionPolicy } from "./provider-selection-policy";
|
|
21
21
|
export type { CanonicalModelIndex, CanonicalModelRecord, CanonicalModelVariant, ModelEquivalenceConfig };
|
|
22
22
|
export { isAuthenticated, kNoAuth };
|
|
23
|
+
/**
|
|
24
|
+
* Scrub resolved credential material from a discovery failure before it is
|
|
25
|
+
* published to discovery state, cache provenance, or the logger. Mutates
|
|
26
|
+
* Error messages and stacks in place to preserve class/identity; wraps non-Errors.
|
|
27
|
+
*/
|
|
28
|
+
export declare function scrubDiscoveryError(error: unknown, secrets: ReadonlyArray<string | undefined>): unknown;
|
|
23
29
|
/**
|
|
24
30
|
* A loopback discovery endpoint that is proven to have no listener is the normal state of
|
|
25
31
|
* a machine without a local model server. Structured transport evidence is required when
|
|
@@ -321,6 +327,7 @@ interface ProviderOverride {
|
|
|
321
327
|
cacheRetention?: CacheRetention;
|
|
322
328
|
isOAuth?: boolean;
|
|
323
329
|
}
|
|
330
|
+
export declare function registrySelectorResolvesToModel(selector: string, models: readonly Model<Api>[]): boolean;
|
|
324
331
|
/**
|
|
325
332
|
* Merge a freshly discovered model with the matching bundled/configured entry
|
|
326
333
|
* (or a runtime provider override when no bundled entry exists).
|
|
@@ -369,6 +376,8 @@ export declare class ModelRegistry {
|
|
|
369
376
|
* Reload models from disk (embedded + accepted registry + custom from models.yml).
|
|
370
377
|
*/
|
|
371
378
|
refreshStatic(): Promise<void>;
|
|
379
|
+
/** Refresh the signed profile catalog online, then publish its accepted snapshot. */
|
|
380
|
+
refreshModelPresetProfilesFromRegistry(): Promise<ModelPresetRegistryRefreshResult>;
|
|
372
381
|
/**
|
|
373
382
|
* Reload models from disk and refresh runtime provider discovery state.
|
|
374
383
|
*/
|
|
@@ -523,8 +532,10 @@ export declare class ModelRegistry {
|
|
|
523
532
|
*/
|
|
524
533
|
seedCanonicalVariant(sessionId: string, model: Model<Api>): boolean;
|
|
525
534
|
/**
|
|
526
|
-
* Get
|
|
527
|
-
* This is a fast check that doesn't refresh OAuth tokens.
|
|
535
|
+
* Get selectable models with auth configured.
|
|
536
|
+
* This is a fast check that doesn't refresh OAuth tokens. A current,
|
|
537
|
+
* authoritative live catalog also limits each provider to its enrolled ids;
|
|
538
|
+
* bundled entries remain the fallback until that evidence exists.
|
|
528
539
|
*/
|
|
529
540
|
getAvailable(): Model<Api>[];
|
|
530
541
|
/**
|
|
@@ -41,7 +41,7 @@ export declare function resolveStartupModelRefreshSelectors(options: {
|
|
|
41
41
|
resume?: string | boolean;
|
|
42
42
|
hasStartupProfile: boolean;
|
|
43
43
|
}, settings: ModelRoleSettings): ModelSelectorValue | undefined;
|
|
44
|
-
export declare function refreshMissingQualifiedModelProviders(selectors: ModelSelectorValue | undefined, modelRegistry: Pick<ModelRegistry, "getAvailable" | "getRefreshableProviders" | "refreshProvider"
|
|
44
|
+
export declare function refreshMissingQualifiedModelProviders(selectors: ModelSelectorValue | undefined, modelRegistry: Pick<ModelRegistry, "getAvailable" | "getRefreshableProviders" | "refreshProvider">, credentialSessionId?: string): Promise<boolean>;
|
|
45
45
|
/**
|
|
46
46
|
* Format a model as "provider/modelId" string.
|
|
47
47
|
*/
|
|
@@ -157,6 +157,12 @@ export interface ModelTagsSettings {
|
|
|
157
157
|
[key: string]: ModelTagDef;
|
|
158
158
|
}
|
|
159
159
|
export declare const DEFAULT_BASH_INTERCEPTOR_RULES: BashInterceptorRule[];
|
|
160
|
+
export declare const DEFAULT_SDK_PROMPT_DEADLINE_MS = 3600000;
|
|
161
|
+
export declare const DEFAULT_SDK_PROMPT_MAX_RUNTIME_MS = 21600000;
|
|
162
|
+
/** Resolve a `sdk.promptDeadlineMs` lookup, falling back on any non-finite value. */
|
|
163
|
+
export declare function resolveSdkPromptDeadlineMs(value: unknown): number;
|
|
164
|
+
/** Resolve a `sdk.promptMaxRuntimeMs` lookup, falling back on any non-finite value. */
|
|
165
|
+
export declare function resolveSdkPromptMaxRuntimeMs(value: unknown): number;
|
|
160
166
|
export declare const SETTINGS_SCHEMA: {
|
|
161
167
|
readonly lastChangelogVersion: {
|
|
162
168
|
readonly type: "string";
|
|
@@ -219,6 +225,11 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
219
225
|
readonly description: "Hard maximum runtime for an SDK prompt from acceptance, bounding progress-aware renewals.";
|
|
220
226
|
readonly validate: (value: number) => boolean;
|
|
221
227
|
};
|
|
228
|
+
readonly "sdk.flushWorktreeOnDeadline": {
|
|
229
|
+
readonly type: "boolean";
|
|
230
|
+
readonly default: true;
|
|
231
|
+
readonly description: "Autosave uncommitted changes in the session's linked worktree by default as a WIP commit when a prompt deadline retires a prompt; primary checkouts require an explicit true opt-in.";
|
|
232
|
+
};
|
|
222
233
|
readonly "sdk.masterOrphanGraceMs": {
|
|
223
234
|
readonly type: "number";
|
|
224
235
|
readonly default: 120000;
|
|
@@ -454,7 +454,12 @@ export declare function readSchedulerRoster(paths: CoordinatorStatePaths, option
|
|
|
454
454
|
export declare function advanceSchedulerCursor(paths: CoordinatorStatePaths, cursor: string, options?: {
|
|
455
455
|
signal?: AbortSignal;
|
|
456
456
|
}): Promise<void>;
|
|
457
|
-
export declare function readSessionTransaction(paths: CoordinatorStatePaths, sessionId: string
|
|
457
|
+
export declare function readSessionTransaction(paths: CoordinatorStatePaths, sessionId: string, options?: {
|
|
458
|
+
signal?: AbortSignal;
|
|
459
|
+
}): Promise<CoordinatorSessionTransactionV1 | null>;
|
|
460
|
+
export declare function repairLegacyReportIds(paths: CoordinatorStatePaths, sessionId: string, options?: {
|
|
461
|
+
signal?: AbortSignal;
|
|
462
|
+
}): Promise<CoordinatorSessionTransactionV1 | null>;
|
|
458
463
|
export declare function withSessionTransaction<T>(paths: CoordinatorStatePaths, sessionId: string, operation: (transaction: CoordinatorSessionTransactionV1) => Promise<T>, options?: {
|
|
459
464
|
signal?: AbortSignal;
|
|
460
465
|
}): Promise<T>;
|
|
@@ -24,11 +24,15 @@ export declare const DAEMON_ACTION_ALIASES: Readonly<Record<string, DaemonAction
|
|
|
24
24
|
export declare const DAEMON_ACTION_TOKENS: readonly string[];
|
|
25
25
|
/** Resolve a leading verb (canonical or alias) to its canonical action. */
|
|
26
26
|
export declare function resolveDaemonAction(token: string | undefined): DaemonAction | undefined;
|
|
27
|
-
/**
|
|
27
|
+
/** Public input failures exit 2; operational failures retain exit 1. */
|
|
28
28
|
export declare const DAEMON_EXIT: {
|
|
29
29
|
readonly ok: 0;
|
|
30
30
|
readonly failure: 1;
|
|
31
|
+
readonly usage: 2;
|
|
31
32
|
};
|
|
33
|
+
/** A refused result may follow a successful stop or spawn; snapshots and prose
|
|
34
|
+
* do not prove that no effect occurred. Only completed results prove applied. */
|
|
35
|
+
export declare function daemonOperationOutcome(result: DaemonOperationResult): "applied" | "unknown";
|
|
32
36
|
/** Human-facing headline when a spawn/reload is refused by a live foreign identity. */
|
|
33
37
|
export declare const OWNERSHIP_MISMATCH_MESSAGE = "refused: a live Telegram daemon with a different bot token or chat already owns this workspace";
|
|
34
38
|
/** Structured, actionable recovery for a token/chat ownership mismatch. */
|
|
@@ -68,6 +68,8 @@ export interface BashExecutorOptions {
|
|
|
68
68
|
sessionKey?: string;
|
|
69
69
|
/** Additional environment variables to inject */
|
|
70
70
|
env?: Record<string, string>;
|
|
71
|
+
/** Environment names to hide from this command's inherited environment. */
|
|
72
|
+
unsetEnv?: string[];
|
|
71
73
|
/** Artifact path/id for full output storage */
|
|
72
74
|
artifactPath?: string;
|
|
73
75
|
artifactId?: string;
|
|
@@ -31,6 +31,7 @@ import type { AgentSessionEventListener } from "../../session/agent-session";
|
|
|
31
31
|
import type { ClientBridge, ClientBridgePermissionOption, ClientBridgePermissionOutcome, ClientBridgePermissionToolCall } from "../../session/client-bridge";
|
|
32
32
|
import type { CustomMessage } from "../../session/messages";
|
|
33
33
|
import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager";
|
|
34
|
+
import type { SessionWorkLease } from "../../session/session-work-lease";
|
|
34
35
|
import type { BashToolDetails, BashToolInput, FindToolDetails, FindToolInput, ReadToolDetails, ReadToolInput, SearchToolDetails, SearchToolInput, WriteToolInput } from "../../tools";
|
|
35
36
|
import type { EventBus } from "../../utils/event-bus";
|
|
36
37
|
import type { AgentEndEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, AgentStartEvent as SharedAgentStartEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
|
|
@@ -279,6 +280,8 @@ export interface ExtensionContext {
|
|
|
279
280
|
isIdle(): boolean;
|
|
280
281
|
/** Stable resource ownership identifier for the active prompt run. */
|
|
281
282
|
getActivePromptHandle(): string | undefined;
|
|
283
|
+
/** The session's authoritative host-liveness lease. */
|
|
284
|
+
getSessionWorkLease?(): SessionWorkLease | undefined;
|
|
282
285
|
/** Abort the current agent operation */
|
|
283
286
|
abort(): void | Promise<void>;
|
|
284
287
|
/** Abort and prove whether resources for a specific prompt settled. */
|
|
@@ -1044,6 +1047,13 @@ export type SendUserMessageHandler = (content: string | (TextContent | ImageCont
|
|
|
1044
1047
|
startsOwnRun?: boolean;
|
|
1045
1048
|
removed?: boolean;
|
|
1046
1049
|
}) => void;
|
|
1050
|
+
/**
|
|
1051
|
+
* Fired synchronously when a plain prompt's dispatch resolves at queue
|
|
1052
|
+
* time instead of run end (diverted into an in-flight run's steering).
|
|
1053
|
+
*/
|
|
1054
|
+
onDispatchDisposition?: (promotion: {
|
|
1055
|
+
startsOwnRun: boolean;
|
|
1056
|
+
}) => void;
|
|
1047
1057
|
preflightSignal?: AbortSignal;
|
|
1048
1058
|
}) => void | Promise<void>;
|
|
1049
1059
|
export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
|
|
@@ -1111,6 +1121,8 @@ export interface ExtensionContextActions {
|
|
|
1111
1121
|
isIdle: () => boolean;
|
|
1112
1122
|
/** Stable resource ownership identifier for the active prompt run. */
|
|
1113
1123
|
getActivePromptHandle?: () => string | undefined;
|
|
1124
|
+
/** The session's authoritative host-liveness lease. */
|
|
1125
|
+
getSessionWorkLease?: () => SessionWorkLease | undefined;
|
|
1114
1126
|
abort: () => void | Promise<void>;
|
|
1115
1127
|
abortPromptAndWait?: (handle: string, options: {
|
|
1116
1128
|
graceMs: number;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type GjcPluginRegistry, type GjcPluginRegistryEntry, type GjcPluginScope } from "./types";
|
|
2
|
+
export declare const RegistryLockTestHooks: {
|
|
3
|
+
beforeEviction?: (lockPath: string, raw: string) => void | Promise<void>;
|
|
4
|
+
beforePublish?: (stagingPath: string, lockPath: string) => void | Promise<void>;
|
|
5
|
+
};
|
|
2
6
|
export declare function registryRootForScope(scope: GjcPluginScope, cwd: string): string;
|
|
3
7
|
export declare function registryPathForScope(scope: GjcPluginScope, cwd: string): string;
|
|
4
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CustomTool } from "../custom-tools/types";
|
|
2
2
|
import { type SessionQuarantine } from "./session-validation";
|
|
3
|
-
import type { GjcPluginScope, JsonSchema202012, NormalizedToolSurfaceV2 } from "./types";
|
|
3
|
+
import type { GjcBundleIdentity, GjcPluginScope, JsonSchema202012, NormalizedToolSurfaceV2 } from "./types";
|
|
4
4
|
export interface AlwaysOnPluginTools {
|
|
5
5
|
tools: CustomTool[];
|
|
6
6
|
quarantine: SessionQuarantine[];
|
|
@@ -9,6 +9,12 @@ export interface GjcPluginToolDeclaration extends NormalizedToolSurfaceV2 {
|
|
|
9
9
|
plugin: string;
|
|
10
10
|
scope: GjcPluginScope;
|
|
11
11
|
}
|
|
12
|
+
export interface GjcPluginMcpServerProvenance {
|
|
13
|
+
identity: GjcBundleIdentity;
|
|
14
|
+
surfaceId: string;
|
|
15
|
+
}
|
|
16
|
+
/** Bound and scrub plugin-controlled MCP causes before they enter logs or runtime findings. */
|
|
17
|
+
export declare function safePluginMcpDiagnostic(value: unknown): string;
|
|
12
18
|
/**
|
|
13
19
|
* Return v2 tool declarations without reading or importing implementation
|
|
14
20
|
* modules. This is the schema-serving path used by discovery and diagnostics.
|
|
@@ -69,11 +75,14 @@ export declare function renderSkillAdvertisement(input: {
|
|
|
69
75
|
* Convert active plugin-bundle MCP surfaces into runtime MCPServerConfig entries,
|
|
70
76
|
* applying install + runtime MCP policy (URL scheme/private-range deny, DNS
|
|
71
77
|
* re-resolution for http/sse, stdio root-confinement) before connection. Servers
|
|
72
|
-
* failing policy are quarantined and excluded.
|
|
78
|
+
* failing policy are quarantined and excluded. The provenance map contains
|
|
79
|
+
* only servers present in `configs`, so connection errors can be attributed to
|
|
80
|
+
* the authenticated bundle and stable surface that supplied each server.
|
|
73
81
|
*/
|
|
74
82
|
export declare function buildPluginMcpConfigs(input: {
|
|
75
83
|
cwd: string;
|
|
76
84
|
}): Promise<{
|
|
77
85
|
configs: Record<string, any>;
|
|
78
86
|
quarantine: SessionQuarantine[];
|
|
87
|
+
serverProvenance: ReadonlyMap<string, GjcPluginMcpServerProvenance>;
|
|
79
88
|
}>;
|
|
@@ -23,6 +23,16 @@ export interface RuntimeSkillDiscoveryResult {
|
|
|
23
23
|
candidates: RuntimeSkillDiscoveryCandidate[];
|
|
24
24
|
/** Deduped skill metadata the query filter ran against, including bundled entries; candidates.length <= scanned. */
|
|
25
25
|
scanned: number;
|
|
26
|
+
/**
|
|
27
|
+
* Skills left after the query filter, before the page slice: the denominator
|
|
28
|
+
* a page is a page *of*. `scanned` counts everything the filter ran against,
|
|
29
|
+
* so it cannot serve this role.
|
|
30
|
+
*/
|
|
31
|
+
matching: number;
|
|
32
|
+
/** Normalized zero-based offset the returned page starts at. */
|
|
33
|
+
offset: number;
|
|
34
|
+
/** Offset of the next page, present only while one exists; omitted on the final page. */
|
|
35
|
+
nextOffset?: number;
|
|
26
36
|
diagnostics: RuntimeSkillDiscoveryDiagnostics;
|
|
27
37
|
}
|
|
28
38
|
export interface DiscoverRuntimeSkillsOptions {
|
|
@@ -33,9 +43,17 @@ export interface DiscoverRuntimeSkillsOptions {
|
|
|
33
43
|
profileAuthority?: "default" | "custom";
|
|
34
44
|
query?: string;
|
|
35
45
|
limit?: number;
|
|
46
|
+
/** Zero-based index into the matching set the returned page starts at; defaults to 0. */
|
|
47
|
+
offset?: number;
|
|
36
48
|
source?: RuntimeSkillDiscoveryScope | "all";
|
|
37
49
|
policy?: SkillsSettings;
|
|
38
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Upper bound every caller's `limit` clamps to. Exported so `gjc skills discover`
|
|
53
|
+
* can default a human to the widest page the library will serve instead of the
|
|
54
|
+
* model-context-sized `DEFAULT_LIMIT`.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SKILL_DISCOVERY_MAX_LIMIT = 50;
|
|
39
57
|
/**
|
|
40
58
|
* Explain an empty result that is caused by disabled discovery config rather
|
|
41
59
|
* than by an actually empty skill catalog. Uses the user-facing trust
|
|
@@ -81,9 +81,11 @@ export interface SessionCompactEvent {
|
|
|
81
81
|
/** Whether the compaction entry was provided by an extension/hook */
|
|
82
82
|
fromExtension: boolean;
|
|
83
83
|
}
|
|
84
|
-
/** Fired
|
|
84
|
+
/** Fired during session teardown, including process exit and SDK host self-reap. */
|
|
85
85
|
export interface SessionShutdownEvent {
|
|
86
86
|
type: "session_shutdown";
|
|
87
|
+
/** Set only when the SDK host reaped itself after detached-idle grace. */
|
|
88
|
+
reason?: "detached_idle";
|
|
87
89
|
}
|
|
88
90
|
/** Preparation data for tree navigation (used by session_before_tree event) */
|
|
89
91
|
export interface TreePreparation {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LinuxProcPidProbeResult } from "./linux-proc";
|
|
1
2
|
/**
|
|
2
3
|
* How a `<file>.lock` owner record can be opened safely on this platform.
|
|
3
4
|
*
|
|
@@ -43,6 +44,13 @@ export declare const SessionStateLockTestHooks: {
|
|
|
43
44
|
* configuration.
|
|
44
45
|
*/
|
|
45
46
|
probeProcessSignal?: (pid: number) => void;
|
|
47
|
+
/**
|
|
48
|
+
* @internal How an owner pid's `/proc` entry is read. Whether a killed pid is still an
|
|
49
|
+
* unreaped zombie depends on when its parent happens to reap it, so it cannot be
|
|
50
|
+
* arranged deterministically from a test. Production code never sets it, and it is
|
|
51
|
+
* never serialized or exposed as runtime configuration.
|
|
52
|
+
*/
|
|
53
|
+
probeLinuxProcPid?: (pid: number) => LinuxProcPidProbeResult;
|
|
46
54
|
/**
|
|
47
55
|
* @internal Runs inside a NEW owner record's write, after the exclusive create has
|
|
48
56
|
* taken the pathname and before the record's bytes land. Throwing from it fails that
|
|
@@ -90,6 +98,32 @@ export declare const SessionStateLockTestHooks: {
|
|
|
90
98
|
};
|
|
91
99
|
/** Raised when the lock could not be acquired; callers map it to their own refusal. */
|
|
92
100
|
export type SessionStateLockUnavailableReason = "acquire_timeout" | "legacy_directory_owner_unprovenanced" | "lock_initialization_failed" | "lock_inspection_failed" | "lock_owner_live_or_unverifiable" | "lock_owner_record_fresh" | "lock_owner_record_unprovenanced" | "lock_release_failed" | "transition_claim_timeout" | "unsafe_lock_path_type";
|
|
101
|
+
/**
|
|
102
|
+
* Why a stale-transition reclaim refused, as a bounded classifier.
|
|
103
|
+
*
|
|
104
|
+
* `transition_claim_timeout` collapsed several structurally different refusals into
|
|
105
|
+
* one message, so an operator could not tell a foreign-host tombstone from a
|
|
106
|
+
* live owner from a directory an external process was stamping — the gap #5606
|
|
107
|
+
* asked for. Every member is a fixed enum: never a path, token, host id, pid or
|
|
108
|
+
* raw errno, because this rides on an error message users paste into reports.
|
|
109
|
+
*/
|
|
110
|
+
export type TransitionReclaimRefusal =
|
|
111
|
+
/** The claim vanished, or its owner sidecar was absent/unparseable/invalid. */
|
|
112
|
+
"claim_or_owner_unreadable"
|
|
113
|
+
/** A released tombstone carrying no `owner_host_id` at all. */
|
|
114
|
+
| "released_owner_unprovenanced"
|
|
115
|
+
/** A released tombstone belonging to a different installation. */
|
|
116
|
+
| "released_owner_foreign_host"
|
|
117
|
+
/** A released tombstone still inside `RELEASED_TRANSITION_GRACE_MS`. */
|
|
118
|
+
| "released_owner_within_grace"
|
|
119
|
+
/** The owner is alive, or its liveness could not be disproven. */
|
|
120
|
+
| "owner_live_or_unverifiable"
|
|
121
|
+
/** The claim changed between inspection and capture — an external writer. */
|
|
122
|
+
| "claim_generation_changed"
|
|
123
|
+
/** The claim was not empty when captured, so it is not ours to remove. */
|
|
124
|
+
| "claim_not_empty"
|
|
125
|
+
/** The claim's canonical path or directory snapshot could not be taken. */
|
|
126
|
+
| "claim_capture_failed";
|
|
93
127
|
interface SessionStateLockUnavailableDetails {
|
|
94
128
|
lockPath: string;
|
|
95
129
|
reason: SessionStateLockUnavailableReason;
|
|
@@ -170,6 +204,33 @@ export declare function setSessionStateLockNativeBindings(load: SessionStateLock
|
|
|
170
204
|
* and deletion has a different inode identity and is refused by construction.
|
|
171
205
|
*/
|
|
172
206
|
export declare function removeVerifiedEmptyQuarantine(directory: string, name: string): Promise<void>;
|
|
207
|
+
/**
|
|
208
|
+
* Outcome of one stale-transition reclaim attempt. `reclaimed` drives the
|
|
209
|
+
* caller's retry accounting exactly as the previous boolean did; `refusal`
|
|
210
|
+
* exists only so the eventual `transition_claim_timeout` can name which
|
|
211
|
+
* precondition said no (#5606).
|
|
212
|
+
*/
|
|
213
|
+
interface TransitionReclaimOutcome {
|
|
214
|
+
reclaimed: boolean;
|
|
215
|
+
reclaimReason?: "released_handoff" | "dead_owner";
|
|
216
|
+
refusal?: TransitionReclaimRefusal;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Classify one stale-transition reclaim attempt.
|
|
220
|
+
*
|
|
221
|
+
* @internal exported as the seam the refusal classifier is tested through. Driving
|
|
222
|
+
* a real `transition_claim_timeout` would mean waiting out `LOCK_ACQUIRE_MAX_WAIT_MS`
|
|
223
|
+
* (60s) per case, and `tryWithSessionStateFileLock` throws BUSY before the timeout
|
|
224
|
+
* is ever built, so the per-branch reasons have no other reachable surface (#5606).
|
|
225
|
+
*/
|
|
226
|
+
export declare function classifyTransitionReclaimForTests(transitionDir: string, quarantineName: string): Promise<TransitionReclaimOutcome>;
|
|
227
|
+
/**
|
|
228
|
+
* Build the timeout error exactly as the transition loop does.
|
|
229
|
+
*
|
|
230
|
+
* @internal exported so the message contract — a bounded enum suffix and nothing
|
|
231
|
+
* else — is pinned without a 60s wait (#5606).
|
|
232
|
+
*/
|
|
233
|
+
export declare function transitionClaimTimeoutForTests(transitionDir: string, refusal: TransitionReclaimRefusal | undefined): SessionStateLockUnavailableError;
|
|
173
234
|
export declare function reclaimStaleSessionStateLock(lockFile: string, quarantineName?: string): Promise<void>;
|
|
174
235
|
/**
|
|
175
236
|
* Serialize one read-modify-write of `stateFile` against every other holder of
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Stats } from "node:fs";
|
|
2
2
|
import { type FileLockOptions } from "../config/file-lock";
|
|
3
3
|
import type { SkillActiveEntry } from "../skill-state/active-state";
|
|
4
4
|
import { type AuditEntry, type CanonicalGjcWorkflowSkill, type WorkflowStateMutationOwner } from "../skill-state/workflow-state-contract";
|
|
@@ -82,6 +82,14 @@ export interface GuardedStateWriteReceipt {
|
|
|
82
82
|
export declare function guardedStateWriteReceipt(result: GuardedWriteResult): GuardedStateWriteReceipt | undefined;
|
|
83
83
|
export interface StateWriterOptions {
|
|
84
84
|
cwd?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Linux-only private durable source publication. The supplied directory is
|
|
87
|
+
* the exact private subtree containing the target; existing paths are never
|
|
88
|
+
* chmodded or repaired.
|
|
89
|
+
*/
|
|
90
|
+
privateDurable?: {
|
|
91
|
+
directory: string;
|
|
92
|
+
};
|
|
85
93
|
receipt?: StateWriterReceiptContext;
|
|
86
94
|
audit?: StateWriterAuditContext;
|
|
87
95
|
sourceRevision?: number;
|
|
@@ -108,6 +116,11 @@ export declare class StateWriteConflictError extends Error {
|
|
|
108
116
|
export interface DeleteIfOwnedOptions extends StateWriterOptions {
|
|
109
117
|
predicate?: (current: unknown) => boolean | Promise<boolean>;
|
|
110
118
|
}
|
|
119
|
+
export declare class StatePublicationUncertainError extends Error {
|
|
120
|
+
readonly path: string;
|
|
121
|
+
readonly cause: unknown;
|
|
122
|
+
constructor(path: string, cause: unknown);
|
|
123
|
+
}
|
|
111
124
|
export interface DeleteResult {
|
|
112
125
|
path: string;
|
|
113
126
|
deleted: boolean;
|
|
@@ -13,7 +13,10 @@ export interface EndpointRequest {
|
|
|
13
13
|
verb: string;
|
|
14
14
|
input: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export interface EndpointHandlerRequest extends EndpointRequest {
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
export type EndpointHandler = (req: EndpointHandlerRequest) => Promise<unknown>;
|
|
17
20
|
export declare class ControlServer {
|
|
18
21
|
#private;
|
|
19
22
|
readonly socketPath: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type LinuxProcPidProbeResult } from "../gjc-runtime/linux-proc";
|
|
2
|
+
import { type ReceiptEnvelope } from "./receipts";
|
|
3
|
+
import { type ReceiptIndexEntry } from "./storage";
|
|
1
4
|
import { type ReviewVerdict } from "./types";
|
|
2
5
|
export interface ValidationCommandSpec {
|
|
3
6
|
name: string;
|
|
@@ -9,14 +12,21 @@ export interface ValidationRun {
|
|
|
9
12
|
exitStatus: number;
|
|
10
13
|
pass: boolean;
|
|
11
14
|
}
|
|
15
|
+
export declare class ValidationObservationUncertainError extends Error {
|
|
16
|
+
readonly exactCommand: string;
|
|
17
|
+
readonly cwd: string;
|
|
18
|
+
constructor(exactCommand: string, cwd: string, cause?: unknown);
|
|
19
|
+
}
|
|
12
20
|
export interface FinalizeChecks {
|
|
13
|
-
runValidation(spec: ValidationCommandSpec): Promise<ValidationRun>;
|
|
21
|
+
runValidation(spec: ValidationCommandSpec, signal?: AbortSignal): Promise<ValidationRun>;
|
|
14
22
|
resolveCommit(): Promise<string | null>;
|
|
15
23
|
commitOnBranch(commit: string, branch: string): Promise<boolean>;
|
|
16
24
|
prOrIssue(): Promise<{
|
|
17
25
|
prUrl: string | null;
|
|
18
26
|
issueArtifact: string | null;
|
|
19
27
|
}>;
|
|
28
|
+
/** Owner-scoped receipt commit hook; null means lifecycle authority was withdrawn. */
|
|
29
|
+
writeReceipt?(family: "validation" | "completion" | "review-failure" | "review-verdict", receipt: ReceiptEnvelope<unknown>): Promise<ReceiptIndexEntry | null>;
|
|
20
30
|
}
|
|
21
31
|
export interface FinalizeOptions {
|
|
22
32
|
root: string;
|
|
@@ -39,6 +49,8 @@ export interface FinalizeOptions {
|
|
|
39
49
|
prTarget?: string | null;
|
|
40
50
|
validationCommands?: ValidationCommandSpec[];
|
|
41
51
|
checks: FinalizeChecks;
|
|
52
|
+
/** Cancels an in-flight validation subprocess when its owning request is withdrawn. */
|
|
53
|
+
signal?: AbortSignal;
|
|
42
54
|
clock?: () => number;
|
|
43
55
|
}
|
|
44
56
|
export interface FinalizeResult {
|
|
@@ -56,5 +68,4 @@ export interface FinalizeResult {
|
|
|
56
68
|
blockers: string[];
|
|
57
69
|
}
|
|
58
70
|
export declare function runFinalize(opts: FinalizeOptions): Promise<FinalizeResult>;
|
|
59
|
-
|
|
60
|
-
export declare function defaultFinalizeChecks(workspace: string): FinalizeChecks;
|
|
71
|
+
export declare function defaultFinalizeChecks(workspace: string, probeProcess?: (pid: number) => LinuxProcPidProbeResult): FinalizeChecks;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InternalResource, InternalUrl, ProtocolHandler } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Handler for `embedded:` URLs.
|
|
4
|
+
*/
|
|
5
|
+
export declare class EmbeddedProtocolHandler implements ProtocolHandler {
|
|
6
|
+
readonly scheme = "embedded";
|
|
7
|
+
readonly immutable = true;
|
|
8
|
+
resolve(url: InternalUrl): Promise<InternalResource>;
|
|
9
|
+
}
|
|
@@ -10,10 +10,18 @@
|
|
|
10
10
|
* MUST use this function instead of calling `new URL()` directly.
|
|
11
11
|
*/
|
|
12
12
|
import type { InternalUrl } from "./types";
|
|
13
|
+
/**
|
|
14
|
+
* Canonicalize an internal URL so slashless schemes carry an authority.
|
|
15
|
+
*
|
|
16
|
+
* Every entry point that inspects or routes an internal URL (router,
|
|
17
|
+
* read/write tools, selector splitting) MUST normalize first, so handlers only
|
|
18
|
+
* ever see the `scheme://authority/path` form.
|
|
19
|
+
*/
|
|
20
|
+
export declare function normalizeInternalUrlInput(input: string): string;
|
|
13
21
|
/**
|
|
14
22
|
* Parse an internal URL into an InternalUrl.
|
|
15
23
|
*
|
|
16
24
|
* Handles URLs where `new URL()` would fail (e.g., `skill://plugin:name`
|
|
17
25
|
* where the colon is not a port separator).
|
|
18
26
|
*/
|
|
19
|
-
export declare function parseInternalUrl(
|
|
27
|
+
export declare function parseInternalUrl(rawInput: string): InternalUrl;
|