@ai-agent-forge/agent-forge 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5969 -0
- package/README.md +629 -0
- package/dist/artifacts/artifact-store.d.ts +51 -0
- package/dist/artifacts/artifact-store.d.ts.map +1 -0
- package/dist/artifacts/artifact-store.js +87 -0
- package/dist/artifacts/artifact-store.js.map +1 -0
- package/dist/artifacts/paged-read.d.ts +51 -0
- package/dist/artifacts/paged-read.d.ts.map +1 -0
- package/dist/artifacts/paged-read.js +55 -0
- package/dist/artifacts/paged-read.js.map +1 -0
- package/dist/bun/cli.d.ts +3 -0
- package/dist/bun/cli.d.ts.map +1 -0
- package/dist/bun/cli.js +11 -0
- package/dist/bun/cli.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +17 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +36 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/bundle/.build-manifest.json +3566 -0
- package/dist/bundle/chunks/anthropic-messages-RJYU4TCY.js +6 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-LESTCUL7.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +78 -0
- package/dist/bundle/chunks/chunk-3QKHSPQL.js +8 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-4NKZMFSZ.js +1579 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
- package/dist/bundle/chunks/chunk-7ZY7IXZD.js +4 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
- package/dist/bundle/chunks/chunk-EWXX34QG.js +2 -0
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
- package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
- package/dist/bundle/chunks/chunk-KQEGUM34.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-MDOTREMR.js +11 -0
- package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-SER2HCLE.js +38 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-V46XUTK3.js +2 -0
- package/dist/bundle/chunks/chunk-WGLBM2BP.js +2 -0
- package/dist/bundle/chunks/chunk-WW3LMV3F.js +2 -0
- package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-NZ66X6K7.js +2 -0
- package/dist/bundle/chunks/google-vertex-2ZZOFBNQ.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-UDEHOBGS.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
- package/dist/bundle/chunks/mistral-conversations-B6DZRMEK.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
- package/dist/bundle/chunks/openai-codex-responses-UFH6O5K6.js +10 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-A55GHA4O.js +7 -0
- package/dist/bundle/chunks/openai-responses-TJLXRAXR.js +2 -0
- package/dist/bundle/chunks/openrouter-images-G3GT5BVT.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-SLF355GF.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/client.js +2 -0
- package/dist/bundle/index.js +8 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/capabilities/builtin.d.ts +46 -0
- package/dist/capabilities/builtin.d.ts.map +1 -0
- package/dist/capabilities/builtin.js +68 -0
- package/dist/capabilities/builtin.js.map +1 -0
- package/dist/cli/args.d.ts +102 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +712 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/auth-check.d.ts +19 -0
- package/dist/cli/auth-check.d.ts.map +1 -0
- package/dist/cli/auth-check.js +50 -0
- package/dist/cli/auth-check.js.map +1 -0
- package/dist/cli/auth-command.d.ts +24 -0
- package/dist/cli/auth-command.d.ts.map +1 -0
- package/dist/cli/auth-command.js +102 -0
- package/dist/cli/auth-command.js.map +1 -0
- package/dist/cli/config-selector.d.ts +23 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +51 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/credential-print.d.ts +13 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +76 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/experimental/auth.d.ts +16 -0
- package/dist/cli/experimental/auth.d.ts.map +1 -0
- package/dist/cli/experimental/auth.js +13 -0
- package/dist/cli/experimental/auth.js.map +1 -0
- package/dist/cli/experimental/cli.d.ts +6 -0
- package/dist/cli/experimental/cli.d.ts.map +1 -0
- package/dist/cli/experimental/cli.js +5 -0
- package/dist/cli/experimental/cli.js.map +1 -0
- package/dist/cli/experimental/command-options.d.ts +17 -0
- package/dist/cli/experimental/command-options.d.ts.map +1 -0
- package/dist/cli/experimental/command-options.js +35 -0
- package/dist/cli/experimental/command-options.js.map +1 -0
- package/dist/cli/experimental/command.d.ts +63 -0
- package/dist/cli/experimental/command.d.ts.map +1 -0
- package/dist/cli/experimental/command.js +130 -0
- package/dist/cli/experimental/command.js.map +1 -0
- package/dist/cli/experimental/commands/client.d.ts +13 -0
- package/dist/cli/experimental/commands/client.d.ts.map +1 -0
- package/dist/cli/experimental/commands/client.js +25 -0
- package/dist/cli/experimental/commands/client.js.map +1 -0
- package/dist/cli/experimental/commands/pi.d.ts +15 -0
- package/dist/cli/experimental/commands/pi.d.ts.map +1 -0
- package/dist/cli/experimental/commands/pi.js +26 -0
- package/dist/cli/experimental/commands/pi.js.map +1 -0
- package/dist/cli/experimental/commands/server.d.ts +13 -0
- package/dist/cli/experimental/commands/server.d.ts.map +1 -0
- package/dist/cli/experimental/commands/server.js +25 -0
- package/dist/cli/experimental/commands/server.js.map +1 -0
- package/dist/cli/experimental/transport-address.d.ts +10 -0
- package/dist/cli/experimental/transport-address.d.ts.map +1 -0
- package/dist/cli/experimental/transport-address.js +38 -0
- package/dist/cli/experimental/transport-address.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +71 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/initial-message.d.ts +18 -0
- package/dist/cli/initial-message.d.ts.map +1 -0
- package/dist/cli/initial-message.js +22 -0
- package/dist/cli/initial-message.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +98 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/plugin-command.d.ts +50 -0
- package/dist/cli/plugin-command.d.ts.map +1 -0
- package/dist/cli/plugin-command.js +85 -0
- package/dist/cli/plugin-command.js.map +1 -0
- package/dist/cli/plugin-manager-controller.d.ts +59 -0
- package/dist/cli/plugin-manager-controller.d.ts.map +1 -0
- package/dist/cli/plugin-manager-controller.js +183 -0
- package/dist/cli/plugin-manager-controller.js.map +1 -0
- package/dist/cli/plugin-selection-controller.d.ts +57 -0
- package/dist/cli/plugin-selection-controller.d.ts.map +1 -0
- package/dist/cli/plugin-selection-controller.js +159 -0
- package/dist/cli/plugin-selection-controller.js.map +1 -0
- package/dist/cli/serve.d.ts +39 -0
- package/dist/cli/serve.d.ts.map +1 -0
- package/dist/cli/serve.js +124 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/session-picker.d.ts +30 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +62 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli/startup-ui.d.ts +20 -0
- package/dist/cli/startup-ui.d.ts.map +1 -0
- package/dist/cli/startup-ui.js +185 -0
- package/dist/cli/startup-ui.js.map +1 -0
- package/dist/cli/trace-view.d.ts +86 -0
- package/dist/cli/trace-view.d.ts.map +1 -0
- package/dist/cli/trace-view.js +263 -0
- package/dist/cli/trace-view.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +19 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/config.d.ts +95 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +459 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-capability-contract.d.ts +322 -0
- package/dist/core/agent-capability-contract.d.ts.map +1 -0
- package/dist/core/agent-capability-contract.js +1154 -0
- package/dist/core/agent-capability-contract.js.map +1 -0
- package/dist/core/agent-session-bash.d.ts +51 -0
- package/dist/core/agent-session-bash.d.ts.map +1 -0
- package/dist/core/agent-session-bash.js +138 -0
- package/dist/core/agent-session-bash.js.map +1 -0
- package/dist/core/agent-session-compaction.d.ts +188 -0
- package/dist/core/agent-session-compaction.d.ts.map +1 -0
- package/dist/core/agent-session-compaction.js +1071 -0
- package/dist/core/agent-session-compaction.js.map +1 -0
- package/dist/core/agent-session-context.d.ts +43 -0
- package/dist/core/agent-session-context.d.ts.map +1 -0
- package/dist/core/agent-session-context.js +170 -0
- package/dist/core/agent-session-context.js.map +1 -0
- package/dist/core/agent-session-extensions.d.ts +30 -0
- package/dist/core/agent-session-extensions.d.ts.map +1 -0
- package/dist/core/agent-session-extensions.js +74 -0
- package/dist/core/agent-session-extensions.js.map +1 -0
- package/dist/core/agent-session-internal.d.ts +290 -0
- package/dist/core/agent-session-internal.d.ts.map +1 -0
- package/dist/core/agent-session-internal.js +40 -0
- package/dist/core/agent-session-internal.js.map +1 -0
- package/dist/core/agent-session-lifecycle.d.ts +242 -0
- package/dist/core/agent-session-lifecycle.d.ts.map +1 -0
- package/dist/core/agent-session-lifecycle.js +699 -0
- package/dist/core/agent-session-lifecycle.js.map +1 -0
- package/dist/core/agent-session-loop-runner.d.ts +52 -0
- package/dist/core/agent-session-loop-runner.d.ts.map +1 -0
- package/dist/core/agent-session-loop-runner.js +168 -0
- package/dist/core/agent-session-loop-runner.js.map +1 -0
- package/dist/core/agent-session-loop.d.ts +39 -0
- package/dist/core/agent-session-loop.d.ts.map +1 -0
- package/dist/core/agent-session-loop.js +155 -0
- package/dist/core/agent-session-loop.js.map +1 -0
- package/dist/core/agent-session-model.d.ts +49 -0
- package/dist/core/agent-session-model.d.ts.map +1 -0
- package/dist/core/agent-session-model.js +155 -0
- package/dist/core/agent-session-model.js.map +1 -0
- package/dist/core/agent-session-paths.d.ts +3 -0
- package/dist/core/agent-session-paths.d.ts.map +1 -0
- package/dist/core/agent-session-paths.js +14 -0
- package/dist/core/agent-session-paths.js.map +1 -0
- package/dist/core/agent-session-projection.d.ts +53 -0
- package/dist/core/agent-session-projection.d.ts.map +1 -0
- package/dist/core/agent-session-projection.js +195 -0
- package/dist/core/agent-session-projection.js.map +1 -0
- package/dist/core/agent-session-retry.d.ts +28 -0
- package/dist/core/agent-session-retry.d.ts.map +1 -0
- package/dist/core/agent-session-retry.js +141 -0
- package/dist/core/agent-session-retry.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +181 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +297 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +281 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +680 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session-store.d.ts +47 -0
- package/dist/core/agent-session-store.d.ts.map +1 -0
- package/dist/core/agent-session-store.js +155 -0
- package/dist/core/agent-session-store.js.map +1 -0
- package/dist/core/agent-session-tools.d.ts +36 -0
- package/dist/core/agent-session-tools.d.ts.map +1 -0
- package/dist/core/agent-session-tools.js +305 -0
- package/dist/core/agent-session-tools.js.map +1 -0
- package/dist/core/agent-session.d.ts +1156 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2550 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +72 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +426 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +32 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +111 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/cache-stats.d.ts +49 -0
- package/dist/core/cache-stats.d.ts.map +1 -0
- package/dist/core/cache-stats.js +101 -0
- package/dist/core/cache-stats.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +220 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +178 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +608 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +49 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +170 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +4 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +11 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/embedded-sdk.d.ts +96 -0
- package/dist/core/embedded-sdk.d.ts.map +1 -0
- package/dist/core/embedded-sdk.js +395 -0
- package/dist/core/embedded-sdk.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +75 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/experimental.d.ts +2 -0
- package/dist/core/experimental.d.ts.map +1 -0
- package/dist/core/experimental.js +6 -0
- package/dist/core/experimental.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +37 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +226 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/tool-renderer.d.ts +34 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +108 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/core/extensions/agent-composition.d.ts +67 -0
- package/dist/core/extensions/agent-composition.d.ts.map +1 -0
- package/dist/core/extensions/agent-composition.js +785 -0
- package/dist/core/extensions/agent-composition.js.map +1 -0
- package/dist/core/extensions/bootstrap-agent-loop.d.ts +203 -0
- package/dist/core/extensions/bootstrap-agent-loop.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-agent-loop.js +565 -0
- package/dist/core/extensions/bootstrap-agent-loop.js.map +1 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.js +28 -0
- package/dist/core/extensions/bootstrap-branch-summary-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-compaction-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-compaction-policy.js +81 -0
- package/dist/core/extensions/bootstrap-compaction-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-lifecycle.d.ts +26 -0
- package/dist/core/extensions/bootstrap-lifecycle.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-lifecycle.js +181 -0
- package/dist/core/extensions/bootstrap-lifecycle.js.map +1 -0
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-overflow-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-overflow-policy.js +29 -0
- package/dist/core/extensions/bootstrap-overflow-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-retry-policy.d.ts +7 -0
- package/dist/core/extensions/bootstrap-retry-policy.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-retry-policy.js +28 -0
- package/dist/core/extensions/bootstrap-retry-policy.js.map +1 -0
- package/dist/core/extensions/bootstrap-skills.d.ts +16 -0
- package/dist/core/extensions/bootstrap-skills.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-skills.js +119 -0
- package/dist/core/extensions/bootstrap-skills.js.map +1 -0
- package/dist/core/extensions/bootstrap-tools.d.ts +20 -0
- package/dist/core/extensions/bootstrap-tools.d.ts.map +1 -0
- package/dist/core/extensions/bootstrap-tools.js +35 -0
- package/dist/core/extensions/bootstrap-tools.js.map +1 -0
- package/dist/core/extensions/capability-exports.d.ts +5 -0
- package/dist/core/extensions/capability-exports.d.ts.map +1 -0
- package/dist/core/extensions/capability-exports.js +4 -0
- package/dist/core/extensions/capability-exports.js.map +1 -0
- package/dist/core/extensions/capability-plugin.d.ts +69 -0
- package/dist/core/extensions/capability-plugin.d.ts.map +1 -0
- package/dist/core/extensions/capability-plugin.js +485 -0
- package/dist/core/extensions/capability-plugin.js.map +1 -0
- package/dist/core/extensions/capability-runtime-events.d.ts +22 -0
- package/dist/core/extensions/capability-runtime-events.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-events.js +381 -0
- package/dist/core/extensions/capability-runtime-events.js.map +1 -0
- package/dist/core/extensions/capability-runtime-guards.d.ts +93 -0
- package/dist/core/extensions/capability-runtime-guards.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-guards.js +800 -0
- package/dist/core/extensions/capability-runtime-guards.js.map +1 -0
- package/dist/core/extensions/capability-runtime-inspect.d.ts +12 -0
- package/dist/core/extensions/capability-runtime-inspect.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-inspect.js +106 -0
- package/dist/core/extensions/capability-runtime-inspect.js.map +1 -0
- package/dist/core/extensions/capability-runtime-manifest.d.ts +19 -0
- package/dist/core/extensions/capability-runtime-manifest.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-manifest.js +218 -0
- package/dist/core/extensions/capability-runtime-manifest.js.map +1 -0
- package/dist/core/extensions/capability-runtime-operation.d.ts +26 -0
- package/dist/core/extensions/capability-runtime-operation.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-operation.js +88 -0
- package/dist/core/extensions/capability-runtime-operation.js.map +1 -0
- package/dist/core/extensions/capability-runtime-snapshot.d.ts +11 -0
- package/dist/core/extensions/capability-runtime-snapshot.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-snapshot.js +81 -0
- package/dist/core/extensions/capability-runtime-snapshot.js.map +1 -0
- package/dist/core/extensions/capability-runtime-store.d.ts +34 -0
- package/dist/core/extensions/capability-runtime-store.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-store.js +153 -0
- package/dist/core/extensions/capability-runtime-store.js.map +1 -0
- package/dist/core/extensions/capability-runtime-tool.d.ts +10 -0
- package/dist/core/extensions/capability-runtime-tool.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-tool.js +10 -0
- package/dist/core/extensions/capability-runtime-tool.js.map +1 -0
- package/dist/core/extensions/capability-runtime-types.d.ts +303 -0
- package/dist/core/extensions/capability-runtime-types.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-types.js +2 -0
- package/dist/core/extensions/capability-runtime-types.js.map +1 -0
- package/dist/core/extensions/capability-runtime-validation.d.ts +35 -0
- package/dist/core/extensions/capability-runtime-validation.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime-validation.js +380 -0
- package/dist/core/extensions/capability-runtime-validation.js.map +1 -0
- package/dist/core/extensions/capability-runtime.d.ts +7 -0
- package/dist/core/extensions/capability-runtime.d.ts.map +1 -0
- package/dist/core/extensions/capability-runtime.js +2170 -0
- package/dist/core/extensions/capability-runtime.js.map +1 -0
- package/dist/core/extensions/compaction-memory-failure-mode.d.ts +43 -0
- package/dist/core/extensions/compaction-memory-failure-mode.d.ts.map +1 -0
- package/dist/core/extensions/compaction-memory-failure-mode.js +31 -0
- package/dist/core/extensions/compaction-memory-failure-mode.js.map +1 -0
- package/dist/core/extensions/context-strategy-binding.d.ts +12 -0
- package/dist/core/extensions/context-strategy-binding.d.ts.map +1 -0
- package/dist/core/extensions/context-strategy-binding.js +54 -0
- package/dist/core/extensions/context-strategy-binding.js.map +1 -0
- package/dist/core/extensions/index.d.ts +19 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +18 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/lifecycle-catalog.d.ts +584 -0
- package/dist/core/extensions/lifecycle-catalog.d.ts.map +1 -0
- package/dist/core/extensions/lifecycle-catalog.js +1903 -0
- package/dist/core/extensions/lifecycle-catalog.js.map +1 -0
- package/dist/core/extensions/lifecycle-delivery-queue.d.ts +48 -0
- package/dist/core/extensions/lifecycle-delivery-queue.d.ts.map +1 -0
- package/dist/core/extensions/lifecycle-delivery-queue.js +164 -0
- package/dist/core/extensions/lifecycle-delivery-queue.js.map +1 -0
- package/dist/core/extensions/microcompact.d.ts +71 -0
- package/dist/core/extensions/microcompact.d.ts.map +1 -0
- package/dist/core/extensions/microcompact.js +123 -0
- package/dist/core/extensions/microcompact.js.map +1 -0
- package/dist/core/extensions/public-api.d.ts +10 -0
- package/dist/core/extensions/public-api.d.ts.map +1 -0
- package/dist/core/extensions/public-api.js +9 -0
- package/dist/core/extensions/public-api.js.map +1 -0
- package/dist/core/facade/coding-agent-facade.d.ts +338 -0
- package/dist/core/facade/coding-agent-facade.d.ts.map +1 -0
- package/dist/core/facade/coding-agent-facade.js +115 -0
- package/dist/core/facade/coding-agent-facade.js.map +1 -0
- package/dist/core/facade/coding-agent-runtime-facade.d.ts +115 -0
- package/dist/core/facade/coding-agent-runtime-facade.d.ts.map +1 -0
- package/dist/core/facade/coding-agent-runtime-facade.js +63 -0
- package/dist/core/facade/coding-agent-runtime-facade.js.map +1 -0
- package/dist/core/facade/index.d.ts +6 -0
- package/dist/core/facade/index.d.ts.map +1 -0
- package/dist/core/facade/index.js +3 -0
- package/dist/core/facade/index.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +57 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +323 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/http-dispatcher.d.ts +22 -0
- package/dist/core/http-dispatcher.d.ts.map +1 -0
- package/dist/core/http-dispatcher.js +98 -0
- package/dist/core/http-dispatcher.js.map +1 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input-source.d.ts +9 -0
- package/dist/core/input-source.d.ts.map +1 -0
- package/dist/core/input-source.js +2 -0
- package/dist/core/input-source.js.map +1 -0
- package/dist/core/keybindings.d.ts +442 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +329 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/logger.d.ts +107 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +246 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/messages.d.ts +85 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +146 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-config.d.ts +586 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +258 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +49 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +115 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +124 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +590 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/model-runtime.d.ts +100 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +598 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +22 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +115 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/output-guard.d.ts +7 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +90 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-install-host.d.ts +23 -0
- package/dist/core/package-install-host.d.ts.map +1 -0
- package/dist/core/package-install-host.js +202 -0
- package/dist/core/package-install-host.js.map +1 -0
- package/dist/core/package-manager.d.ts +93 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +947 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/package-process-runner.d.ts +4 -0
- package/dist/core/package-process-runner.d.ts.map +1 -0
- package/dist/core/package-process-runner.js +47 -0
- package/dist/core/package-process-runner.js.map +1 -0
- package/dist/core/package-resource-collection.d.ts +16 -0
- package/dist/core/package-resource-collection.d.ts.map +1 -0
- package/dist/core/package-resource-collection.js +300 -0
- package/dist/core/package-resource-collection.js.map +1 -0
- package/dist/core/package-resource-discovery.d.ts +33 -0
- package/dist/core/package-resource-discovery.d.ts.map +1 -0
- package/dist/core/package-resource-discovery.js +449 -0
- package/dist/core/package-resource-discovery.js.map +1 -0
- package/dist/core/package-source.d.ts +157 -0
- package/dist/core/package-source.d.ts.map +1 -0
- package/dist/core/package-source.js +179 -0
- package/dist/core/package-source.js.map +1 -0
- package/dist/core/pi-manifest.d.ts +7 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +26 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +54 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +236 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/provider-composer.d.ts +58 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +403 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/radius.d.ts +2 -0
- package/dist/core/radius.d.ts.map +1 -0
- package/dist/core/radius.js +2 -0
- package/dist/core/radius.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +121 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +247 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +211 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +687 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +39 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +395 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +1112 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-export.d.ts +7 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +48 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts +463 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1583 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/session-start.d.ts +12 -0
- package/dist/core/session-start.d.ts.map +1 -0
- package/dist/core/session-start.js +2 -0
- package/dist/core/session-start.js.map +1 -0
- package/dist/core/session-storage.d.ts +130 -0
- package/dist/core/session-storage.d.ts.map +1 -0
- package/dist/core/session-storage.js +386 -0
- package/dist/core/session-storage.js.map +1 -0
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +352 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +987 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +60 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +382 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +33 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts +8 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +137 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +11 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +46 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +87 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +409 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +110 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +425 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +55 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +305 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-queue.js +52 -0
- package/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/dist/core/tools/find.d.ts +42 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +303 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +41 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +309 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +44 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +129 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +41 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +173 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/output-accumulator.d.ts +52 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +184 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +10 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +99 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/tools/read.d.ts +39 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +282 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/render-utils.d.ts +24 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +65 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +15 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +36 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/tool-definition.d.ts +123 -0
- package/dist/core/tools/tool-definition.d.ts.map +1 -0
- package/dist/core/tools/tool-definition.js +20 -0
- package/dist/core/tools/tool-definition.js.map +1 -0
- package/dist/core/tools/tool-search.d.ts +30 -0
- package/dist/core/tools/tool-search.d.ts.map +1 -0
- package/dist/core/tools/tool-search.js +99 -0
- package/dist/core/tools/tool-search.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +215 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +30 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +202 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/core/trace-retention.d.ts +19 -0
- package/dist/core/trace-retention.d.ts.map +1 -0
- package/dist/core/trace-retention.js +91 -0
- package/dist/core/trace-retention.js.map +1 -0
- package/dist/core/usage-totals.d.ts +21 -0
- package/dist/core/usage-totals.d.ts.map +1 -0
- package/dist/core/usage-totals.js +53 -0
- package/dist/core/usage-totals.js.map +1 -0
- package/dist/durable/durable-service.d.ts +136 -0
- package/dist/durable/durable-service.d.ts.map +1 -0
- package/dist/durable/durable-service.js +710 -0
- package/dist/durable/durable-service.js.map +1 -0
- package/dist/e2e/stdio-launcher.d.ts +25 -0
- package/dist/e2e/stdio-launcher.d.ts.map +1 -0
- package/dist/e2e/stdio-launcher.js +244 -0
- package/dist/e2e/stdio-launcher.js.map +1 -0
- package/dist/host/agent-retry-scheduler.d.ts +65 -0
- package/dist/host/agent-retry-scheduler.d.ts.map +1 -0
- package/dist/host/agent-retry-scheduler.js +52 -0
- package/dist/host/agent-retry-scheduler.js.map +1 -0
- package/dist/host/auto-compaction.d.ts +56 -0
- package/dist/host/auto-compaction.d.ts.map +1 -0
- package/dist/host/auto-compaction.js +62 -0
- package/dist/host/auto-compaction.js.map +1 -0
- package/dist/host/branch-reload.d.ts +56 -0
- package/dist/host/branch-reload.d.ts.map +1 -0
- package/dist/host/branch-reload.js +39 -0
- package/dist/host/branch-reload.js.map +1 -0
- package/dist/host/channel-adapter.d.ts +25 -0
- package/dist/host/channel-adapter.d.ts.map +1 -0
- package/dist/host/channel-adapter.js +45 -0
- package/dist/host/channel-adapter.js.map +1 -0
- package/dist/host/checkpoint-commit.d.ts +74 -0
- package/dist/host/checkpoint-commit.d.ts.map +1 -0
- package/dist/host/checkpoint-commit.js +76 -0
- package/dist/host/checkpoint-commit.js.map +1 -0
- package/dist/host/manual-compaction.d.ts +43 -0
- package/dist/host/manual-compaction.d.ts.map +1 -0
- package/dist/host/manual-compaction.js +63 -0
- package/dist/host/manual-compaction.js.map +1 -0
- package/dist/host/output-projection.d.ts +61 -0
- package/dist/host/output-projection.d.ts.map +1 -0
- package/dist/host/output-projection.js +74 -0
- package/dist/host/output-projection.js.map +1 -0
- package/dist/host/output-reducer.d.ts +43 -0
- package/dist/host/output-reducer.d.ts.map +1 -0
- package/dist/host/output-reducer.js +77 -0
- package/dist/host/output-reducer.js.map +1 -0
- package/dist/host/output-serializer.d.ts +31 -0
- package/dist/host/output-serializer.d.ts.map +1 -0
- package/dist/host/output-serializer.js +120 -0
- package/dist/host/output-serializer.js.map +1 -0
- package/dist/host/overflow-recovery.d.ts +55 -0
- package/dist/host/overflow-recovery.d.ts.map +1 -0
- package/dist/host/overflow-recovery.js +89 -0
- package/dist/host/overflow-recovery.js.map +1 -0
- package/dist/host/retry-common.d.ts +29 -0
- package/dist/host/retry-common.d.ts.map +1 -0
- package/dist/host/retry-common.js +12 -0
- package/dist/host/retry-common.js.map +1 -0
- package/dist/host/session-event-translation.d.ts +26 -0
- package/dist/host/session-event-translation.d.ts.map +1 -0
- package/dist/host/session-event-translation.js +61 -0
- package/dist/host/session-event-translation.js.map +1 -0
- package/dist/host/summary-retry.d.ts +54 -0
- package/dist/host/summary-retry.d.ts.map +1 -0
- package/dist/host/summary-retry.js +66 -0
- package/dist/host/summary-retry.js.map +1 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +176 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +36 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +1630 -0
- package/dist/main.js.map +1 -0
- package/dist/migration/migration-tool.d.ts +56 -0
- package/dist/migration/migration-tool.d.ts.map +1 -0
- package/dist/migration/migration-tool.js +72 -0
- package/dist/migration/migration-tool.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +272 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +10 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +336 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +25 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +151 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +34 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +176 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +56 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +113 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +857 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +19 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +71 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-entry.d.ts +19 -0
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-entry.js +52 -0
- package/dist/modes/interactive/components/custom-entry.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +22 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +87 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +141 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/dialog-editor.d.ts +21 -0
- package/dist/modes/interactive/components/dialog-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-editor.js +98 -0
- package/dist/modes/interactive/components/dialog-editor.js.map +1 -0
- package/dist/modes/interactive/components/dialog-input.d.ts +23 -0
- package/dist/modes/interactive/components/dialog-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-input.js +61 -0
- package/dist/modes/interactive/components/dialog-input.js.map +1 -0
- package/dist/modes/interactive/components/dialog-selector.d.ts +26 -0
- package/dist/modes/interactive/components/dialog-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/dialog-selector.js +83 -0
- package/dist/modes/interactive/components/dialog-selector.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts +25 -0
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -0
- package/dist/modes/interactive/components/first-time-setup.js +103 -0
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +33 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +248 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +34 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +35 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +13 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +36 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +52 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +188 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/mermaid.d.ts +11 -0
- package/dist/modes/interactive/components/mermaid.d.ts.map +1 -0
- package/dist/modes/interactive/components/mermaid.js +75 -0
- package/dist/modes/interactive/components/mermaid.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +67 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +381 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +33 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +165 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts +62 -0
- package/dist/modes/interactive/components/plugin-manager-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/plugin-manager-entry.js +294 -0
- package/dist/modes/interactive/components/plugin-manager-entry.js.map +1 -0
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts +82 -0
- package/dist/modes/interactive/components/plugin-selection-entry.d.ts.map +1 -0
- package/dist/modes/interactive/components/plugin-selection-entry.js +228 -0
- package/dist/modes/interactive/components/plugin-selection-entry.js.map +1 -0
- package/dist/modes/interactive/components/render-types.d.ts +26 -0
- package/dist/modes/interactive/components/render-types.d.ts.map +1 -0
- package/dist/modes/interactive/components/render-types.js +7 -0
- package/dist/modes/interactive/components/render-types.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +46 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +328 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +158 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +143 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +1053 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +88 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +677 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +165 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +39 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/status-indicator.d.ts +34 -0
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -0
- package/dist/modes/interactive/components/status-indicator.js +60 -0
- package/dist/modes/interactive/components/status-indicator.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +50 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +23 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +109 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +59 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +335 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-list.d.ts +67 -0
- package/dist/modes/interactive/components/tree-list.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-list.js +710 -0
- package/dist/modes/interactive/components/tree-list.js.map +1 -0
- package/dist/modes/interactive/components/tree-render.d.ts +17 -0
- package/dist/modes/interactive/components/tree-render.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-render.js +316 -0
- package/dist/modes/interactive/components/tree-render.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +25 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +235 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/tree-types.d.ts +35 -0
- package/dist/modes/interactive/components/tree-types.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-types.js +2 -0
- package/dist/modes/interactive/components/tree-types.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +114 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +16 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +49 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +38 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-auth.d.ts +90 -0
- package/dist/modes/interactive/interactive-auth.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-auth.js +492 -0
- package/dist/modes/interactive/interactive-auth.js.map +1 -0
- package/dist/modes/interactive/interactive-commands.d.ts +68 -0
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-commands.js +157 -0
- package/dist/modes/interactive/interactive-commands.js.map +1 -0
- package/dist/modes/interactive/interactive-dialog-ui.d.ts +73 -0
- package/dist/modes/interactive/interactive-dialog-ui.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-dialog-ui.js +189 -0
- package/dist/modes/interactive/interactive-dialog-ui.js.map +1 -0
- package/dist/modes/interactive/interactive-format.d.ts +65 -0
- package/dist/modes/interactive/interactive-format.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-format.js +268 -0
- package/dist/modes/interactive/interactive-format.js.map +1 -0
- package/dist/modes/interactive/interactive-helpers.d.ts +25 -0
- package/dist/modes/interactive/interactive-helpers.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-helpers.js +73 -0
- package/dist/modes/interactive/interactive-helpers.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +640 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +4107 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/interactive-selectors.d.ts +95 -0
- package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-selectors.js +356 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts +11 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +35 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/model-search.d.ts +12 -0
- package/dist/modes/interactive/model-search.d.ts.map +1 -0
- package/dist/modes/interactive/model-search.js +15 -0
- package/dist/modes/interactive/model-search.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +90 -0
- package/dist/modes/interactive/theme/light.json +89 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +40 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-controller.js +126 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +352 -0
- package/dist/modes/interactive/theme/theme.d.ts +122 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +1093 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/json-event.d.ts +34 -0
- package/dist/modes/json-event.d.ts.map +1 -0
- package/dist/modes/json-event.js +29 -0
- package/dist/modes/json-event.js.map +1 -0
- package/dist/modes/print-mode.d.ts +32 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +205 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/jsonl.d.ts +17 -0
- package/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/modes/rpc/jsonl.js +49 -0
- package/dist/modes/rpc/jsonl.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +254 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +496 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +53 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +540 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +486 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/package-manager-cli.d.ts +18 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +944 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/plugins/ecosystem/active-bindings.d.ts +92 -0
- package/dist/plugins/ecosystem/active-bindings.d.ts.map +1 -0
- package/dist/plugins/ecosystem/active-bindings.js +198 -0
- package/dist/plugins/ecosystem/active-bindings.js.map +1 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.d.ts +32 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.d.ts.map +1 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.js +32 -0
- package/dist/plugins/ecosystem/bootstrap-factory-manifest.js.map +1 -0
- package/dist/plugins/ecosystem/catalog.d.ts +38 -0
- package/dist/plugins/ecosystem/catalog.d.ts.map +1 -0
- package/dist/plugins/ecosystem/catalog.js +90 -0
- package/dist/plugins/ecosystem/catalog.js.map +1 -0
- package/dist/plugins/ecosystem/cli.d.ts +102 -0
- package/dist/plugins/ecosystem/cli.d.ts.map +1 -0
- package/dist/plugins/ecosystem/cli.js +970 -0
- package/dist/plugins/ecosystem/cli.js.map +1 -0
- package/dist/plugins/ecosystem/default-active-bindings.d.ts +33 -0
- package/dist/plugins/ecosystem/default-active-bindings.d.ts.map +1 -0
- package/dist/plugins/ecosystem/default-active-bindings.js +105 -0
- package/dist/plugins/ecosystem/default-active-bindings.js.map +1 -0
- package/dist/plugins/ecosystem/default-plugin-market.d.ts +68 -0
- package/dist/plugins/ecosystem/default-plugin-market.d.ts.map +1 -0
- package/dist/plugins/ecosystem/default-plugin-market.js +146 -0
- package/dist/plugins/ecosystem/default-plugin-market.js.map +1 -0
- package/dist/plugins/ecosystem/distribution.d.ts +113 -0
- package/dist/plugins/ecosystem/distribution.d.ts.map +1 -0
- package/dist/plugins/ecosystem/distribution.js +371 -0
- package/dist/plugins/ecosystem/distribution.js.map +1 -0
- package/dist/plugins/ecosystem/index.d.ts +56 -0
- package/dist/plugins/ecosystem/index.d.ts.map +1 -0
- package/dist/plugins/ecosystem/index.js +31 -0
- package/dist/plugins/ecosystem/index.js.map +1 -0
- package/dist/plugins/ecosystem/installer.d.ts +130 -0
- package/dist/plugins/ecosystem/installer.d.ts.map +1 -0
- package/dist/plugins/ecosystem/installer.js +316 -0
- package/dist/plugins/ecosystem/installer.js.map +1 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.d.ts +47 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.js +208 -0
- package/dist/plugins/ecosystem/node-disk-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-distribution-host.d.ts +55 -0
- package/dist/plugins/ecosystem/node-distribution-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-distribution-host.js +423 -0
- package/dist/plugins/ecosystem/node-distribution-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-local-package-source.d.ts +10 -0
- package/dist/plugins/ecosystem/node-local-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-local-package-source.js +97 -0
- package/dist/plugins/ecosystem/node-local-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts +58 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.js +326 -0
- package/dist/plugins/ecosystem/node-npm-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-host.d.ts +91 -0
- package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-host.js +857 -0
- package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.d.ts +34 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.js +221 -0
- package/dist/plugins/ecosystem/node-package-install-persistence.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-stack.d.ts +28 -0
- package/dist/plugins/ecosystem/node-package-install-stack.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-install-stack.js +65 -0
- package/dist/plugins/ecosystem/node-package-install-stack.js.map +1 -0
- package/dist/plugins/ecosystem/node-package-media.d.ts +14 -0
- package/dist/plugins/ecosystem/node-package-media.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-package-media.js +36 -0
- package/dist/plugins/ecosystem/node-package-media.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts +83 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js +423 -0
- package/dist/plugins/ecosystem/node-plugin-acquisition-host.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts +48 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js +191 -0
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts +26 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.js +120 -0
- package/dist/plugins/ecosystem/node-plugin-trust-root.js.map +1 -0
- package/dist/plugins/ecosystem/node-registry-source.d.ts +35 -0
- package/dist/plugins/ecosystem/node-registry-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-registry-source.js +286 -0
- package/dist/plugins/ecosystem/node-registry-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-release-package-source.d.ts +47 -0
- package/dist/plugins/ecosystem/node-release-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-release-package-source.js +336 -0
- package/dist/plugins/ecosystem/node-release-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/node-tar-package.d.ts +11 -0
- package/dist/plugins/ecosystem/node-tar-package.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-tar-package.js +294 -0
- package/dist/plugins/ecosystem/node-tar-package.js.map +1 -0
- package/dist/plugins/ecosystem/node-tar-writer.d.ts +16 -0
- package/dist/plugins/ecosystem/node-tar-writer.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-tar-writer.js +134 -0
- package/dist/plugins/ecosystem/node-tar-writer.js.map +1 -0
- package/dist/plugins/ecosystem/node-url-package-source.d.ts +31 -0
- package/dist/plugins/ecosystem/node-url-package-source.d.ts.map +1 -0
- package/dist/plugins/ecosystem/node-url-package-source.js +159 -0
- package/dist/plugins/ecosystem/node-url-package-source.js.map +1 -0
- package/dist/plugins/ecosystem/plugin-acquisition.d.ts +88 -0
- package/dist/plugins/ecosystem/plugin-acquisition.d.ts.map +1 -0
- package/dist/plugins/ecosystem/plugin-acquisition.js +197 -0
- package/dist/plugins/ecosystem/plugin-acquisition.js.map +1 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts +87 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.d.ts.map +1 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.js +134 -0
- package/dist/plugins/ecosystem/plugin-bootstrap.js.map +1 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.d.ts +8 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.d.ts.map +1 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.js +16 -0
- package/dist/plugins/ecosystem/registry-cli-adapter.js.map +1 -0
- package/dist/plugins/ecosystem/registry.d.ts +121 -0
- package/dist/plugins/ecosystem/registry.d.ts.map +1 -0
- package/dist/plugins/ecosystem/registry.js +324 -0
- package/dist/plugins/ecosystem/registry.js.map +1 -0
- package/dist/plugins/ecosystem/resolver.d.ts +32 -0
- package/dist/plugins/ecosystem/resolver.d.ts.map +1 -0
- package/dist/plugins/ecosystem/resolver.js +325 -0
- package/dist/plugins/ecosystem/resolver.js.map +1 -0
- package/dist/plugins/ecosystem/selection-store.d.ts +66 -0
- package/dist/plugins/ecosystem/selection-store.d.ts.map +1 -0
- package/dist/plugins/ecosystem/selection-store.js +241 -0
- package/dist/plugins/ecosystem/selection-store.js.map +1 -0
- package/dist/plugins/ecosystem/selection.d.ts +54 -0
- package/dist/plugins/ecosystem/selection.d.ts.map +1 -0
- package/dist/plugins/ecosystem/selection.js +116 -0
- package/dist/plugins/ecosystem/selection.js.map +1 -0
- package/dist/plugins/ecosystem/state.d.ts +96 -0
- package/dist/plugins/ecosystem/state.d.ts.map +1 -0
- package/dist/plugins/ecosystem/state.js +346 -0
- package/dist/plugins/ecosystem/state.js.map +1 -0
- package/dist/plugins/ecosystem/types.d.ts +90 -0
- package/dist/plugins/ecosystem/types.d.ts.map +1 -0
- package/dist/plugins/ecosystem/types.js +8 -0
- package/dist/plugins/ecosystem/types.js.map +1 -0
- package/dist/plugins/ecosystem/updates.d.ts +30 -0
- package/dist/plugins/ecosystem/updates.d.ts.map +1 -0
- package/dist/plugins/ecosystem/updates.js +148 -0
- package/dist/plugins/ecosystem/updates.js.map +1 -0
- package/dist/plugins/integrity-adapter.d.ts +58 -0
- package/dist/plugins/integrity-adapter.d.ts.map +1 -0
- package/dist/plugins/integrity-adapter.js +70 -0
- package/dist/plugins/integrity-adapter.js.map +1 -0
- package/dist/plugins/mcp-http.d.ts +78 -0
- package/dist/plugins/mcp-http.d.ts.map +1 -0
- package/dist/plugins/mcp-http.js +176 -0
- package/dist/plugins/mcp-http.js.map +1 -0
- package/dist/plugins/observability-types.d.ts +9 -0
- package/dist/plugins/observability-types.d.ts.map +1 -0
- package/dist/plugins/observability-types.js +9 -0
- package/dist/plugins/observability-types.js.map +1 -0
- package/dist/plugins/plugin-host.d.ts +46 -0
- package/dist/plugins/plugin-host.d.ts.map +1 -0
- package/dist/plugins/plugin-host.js +80 -0
- package/dist/plugins/plugin-host.js.map +1 -0
- package/dist/plugins/plugin-supervisor.d.ts +77 -0
- package/dist/plugins/plugin-supervisor.d.ts.map +1 -0
- package/dist/plugins/plugin-supervisor.js +82 -0
- package/dist/plugins/plugin-supervisor.js.map +1 -0
- package/dist/plugins/subagent-task/runner-entry.d.ts +35 -0
- package/dist/plugins/subagent-task/runner-entry.d.ts.map +1 -0
- package/dist/plugins/subagent-task/runner-entry.js +39 -0
- package/dist/plugins/subagent-task/runner-entry.js.map +1 -0
- package/dist/plugins/subagent-task/session-factory.d.ts +57 -0
- package/dist/plugins/subagent-task/session-factory.d.ts.map +1 -0
- package/dist/plugins/subagent-task/session-factory.js +51 -0
- package/dist/plugins/subagent-task/session-factory.js.map +1 -0
- package/dist/profile/child-facade.d.ts +44 -0
- package/dist/profile/child-facade.d.ts.map +1 -0
- package/dist/profile/child-facade.js +56 -0
- package/dist/profile/child-facade.js.map +1 -0
- package/dist/profile/dependency-wiring.d.ts +48 -0
- package/dist/profile/dependency-wiring.d.ts.map +1 -0
- package/dist/profile/dependency-wiring.js +56 -0
- package/dist/profile/dependency-wiring.js.map +1 -0
- package/dist/profile/domain-recovery.d.ts +60 -0
- package/dist/profile/domain-recovery.d.ts.map +1 -0
- package/dist/profile/domain-recovery.js +94 -0
- package/dist/profile/domain-recovery.js.map +1 -0
- package/dist/profile/first-roles.d.ts +30 -0
- package/dist/profile/first-roles.d.ts.map +1 -0
- package/dist/profile/first-roles.js +74 -0
- package/dist/profile/first-roles.js.map +1 -0
- package/dist/profile/goal-plugin.d.ts +38 -0
- package/dist/profile/goal-plugin.d.ts.map +1 -0
- package/dist/profile/goal-plugin.js +113 -0
- package/dist/profile/goal-plugin.js.map +1 -0
- package/dist/profile/identity.d.ts +58 -0
- package/dist/profile/identity.d.ts.map +1 -0
- package/dist/profile/identity.js +100 -0
- package/dist/profile/identity.js.map +1 -0
- package/dist/profile/lock.d.ts +59 -0
- package/dist/profile/lock.d.ts.map +1 -0
- package/dist/profile/lock.js +59 -0
- package/dist/profile/lock.js.map +1 -0
- package/dist/profile/plan-plugin.d.ts +44 -0
- package/dist/profile/plan-plugin.d.ts.map +1 -0
- package/dist/profile/plan-plugin.js +144 -0
- package/dist/profile/plan-plugin.js.map +1 -0
- package/dist/profile/plugin-profiles.d.ts +56 -0
- package/dist/profile/plugin-profiles.d.ts.map +1 -0
- package/dist/profile/plugin-profiles.js +192 -0
- package/dist/profile/plugin-profiles.js.map +1 -0
- package/dist/profile/policy-manifest.d.ts +53 -0
- package/dist/profile/policy-manifest.d.ts.map +1 -0
- package/dist/profile/policy-manifest.js +52 -0
- package/dist/profile/policy-manifest.js.map +1 -0
- package/dist/profile/profile-assembly.d.ts +74 -0
- package/dist/profile/profile-assembly.d.ts.map +1 -0
- package/dist/profile/profile-assembly.js +90 -0
- package/dist/profile/profile-assembly.js.map +1 -0
- package/dist/profile/profile-migration.d.ts +56 -0
- package/dist/profile/profile-migration.d.ts.map +1 -0
- package/dist/profile/profile-migration.js +60 -0
- package/dist/profile/profile-migration.js.map +1 -0
- package/dist/profile/profile-registry.d.ts +58 -0
- package/dist/profile/profile-registry.d.ts.map +1 -0
- package/dist/profile/profile-registry.js +74 -0
- package/dist/profile/profile-registry.js.map +1 -0
- package/dist/profile/role-assembly.d.ts +47 -0
- package/dist/profile/role-assembly.d.ts.map +1 -0
- package/dist/profile/role-assembly.js +31 -0
- package/dist/profile/role-assembly.js.map +1 -0
- package/dist/profile/role-catalog.d.ts +44 -0
- package/dist/profile/role-catalog.d.ts.map +1 -0
- package/dist/profile/role-catalog.js +130 -0
- package/dist/profile/role-catalog.js.map +1 -0
- package/dist/profile/role-orchestrator.d.ts +123 -0
- package/dist/profile/role-orchestrator.d.ts.map +1 -0
- package/dist/profile/role-orchestrator.js +194 -0
- package/dist/profile/role-orchestrator.js.map +1 -0
- package/dist/profile/role-runner.d.ts +99 -0
- package/dist/profile/role-runner.d.ts.map +1 -0
- package/dist/profile/role-runner.js +78 -0
- package/dist/profile/role-runner.js.map +1 -0
- package/dist/profile/root-facade.d.ts +36 -0
- package/dist/profile/root-facade.d.ts.map +1 -0
- package/dist/profile/root-facade.js +48 -0
- package/dist/profile/root-facade.js.map +1 -0
- package/dist/profile/skill-discovery-wiring.d.ts +58 -0
- package/dist/profile/skill-discovery-wiring.d.ts.map +1 -0
- package/dist/profile/skill-discovery-wiring.js +75 -0
- package/dist/profile/skill-discovery-wiring.js.map +1 -0
- package/dist/profile/state-store.d.ts +62 -0
- package/dist/profile/state-store.d.ts.map +1 -0
- package/dist/profile/state-store.js +140 -0
- package/dist/profile/state-store.js.map +1 -0
- package/dist/profile/todo-plugin.d.ts +37 -0
- package/dist/profile/todo-plugin.d.ts.map +1 -0
- package/dist/profile/todo-plugin.js +132 -0
- package/dist/profile/todo-plugin.js.map +1 -0
- package/dist/profiles/builtin-suites.d.ts +142 -0
- package/dist/profiles/builtin-suites.d.ts.map +1 -0
- package/dist/profiles/builtin-suites.js +395 -0
- package/dist/profiles/builtin-suites.js.map +1 -0
- package/dist/profiles/resolved-agent-profile.d.ts +83 -0
- package/dist/profiles/resolved-agent-profile.d.ts.map +1 -0
- package/dist/profiles/resolved-agent-profile.js +75 -0
- package/dist/profiles/resolved-agent-profile.js.map +1 -0
- package/dist/profiles/suite-lifecycle.d.ts +158 -0
- package/dist/profiles/suite-lifecycle.d.ts.map +1 -0
- package/dist/profiles/suite-lifecycle.js +447 -0
- package/dist/profiles/suite-lifecycle.js.map +1 -0
- package/dist/profiles/suite-loader.d.ts +410 -0
- package/dist/profiles/suite-loader.d.ts.map +1 -0
- package/dist/profiles/suite-loader.js +823 -0
- package/dist/profiles/suite-loader.js.map +1 -0
- package/dist/remote/server-assembly.d.ts +230 -0
- package/dist/remote/server-assembly.d.ts.map +1 -0
- package/dist/remote/server-assembly.js +1189 -0
- package/dist/remote/server-assembly.js.map +1 -0
- package/dist/remote/server-entry.d.ts +112 -0
- package/dist/remote/server-entry.d.ts.map +1 -0
- package/dist/remote/server-entry.js +239 -0
- package/dist/remote/server-entry.js.map +1 -0
- package/dist/remote/session-source.d.ts +101 -0
- package/dist/remote/session-source.d.ts.map +1 -0
- package/dist/remote/session-source.js +173 -0
- package/dist/remote/session-source.js.map +1 -0
- package/dist/rpc-entry.d.ts +3 -0
- package/dist/rpc-entry.d.ts.map +1 -0
- package/dist/rpc-entry.js +11 -0
- package/dist/rpc-entry.js.map +1 -0
- package/dist/server/create-harness.d.ts +26 -0
- package/dist/server/create-harness.d.ts.map +1 -0
- package/dist/server/create-harness.js +106 -0
- package/dist/server/create-harness.js.map +1 -0
- package/dist/share/session-share.d.ts +98 -0
- package/dist/share/session-share.d.ts.map +1 -0
- package/dist/share/session-share.js +89 -0
- package/dist/share/session-share.js.map +1 -0
- package/dist/share/share-viewer.d.ts +43 -0
- package/dist/share/share-viewer.d.ts.map +1 -0
- package/dist/share/share-viewer.js +103 -0
- package/dist/share/share-viewer.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-ai-server.d.ts +77 -0
- package/dist/testing/mock-ai-server.d.ts.map +1 -0
- package/dist/testing/mock-ai-server.js +69 -0
- package/dist/testing/mock-ai-server.js.map +1 -0
- package/dist/testing/plugin-testkit.d.ts +148 -0
- package/dist/testing/plugin-testkit.d.ts.map +1 -0
- package/dist/testing/plugin-testkit.js +493 -0
- package/dist/testing/plugin-testkit.js.map +1 -0
- package/dist/testing/runtime-delivery-queue.d.ts +47 -0
- package/dist/testing/runtime-delivery-queue.d.ts.map +1 -0
- package/dist/testing/runtime-delivery-queue.js +158 -0
- package/dist/testing/runtime-delivery-queue.js.map +1 -0
- package/dist/testing/session-plugin-testkit.d.ts +144 -0
- package/dist/testing/session-plugin-testkit.d.ts.map +1 -0
- package/dist/testing/session-plugin-testkit.js +444 -0
- package/dist/testing/session-plugin-testkit.js.map +1 -0
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -0
- package/dist/utils/abort.js +53 -0
- package/dist/utils/abort.js.map +1 -0
- package/dist/utils/agent-forge-user-agent.d.ts +2 -0
- package/dist/utils/agent-forge-user-agent.d.ts.map +1 -0
- package/dist/utils/agent-forge-user-agent.js +5 -0
- package/dist/utils/agent-forge-user-agent.js.map +1 -0
- package/dist/utils/ansi.d.ts +2 -0
- package/dist/utils/ansi.d.ts.map +1 -0
- package/dist/utils/ansi.js +53 -0
- package/dist/utils/ansi.js.map +1 -0
- package/dist/utils/changelog.d.ts +22 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +165 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/child-process.d.ts +18 -0
- package/dist/utils/child-process.d.ts.map +1 -0
- package/dist/utils/child-process.js +107 -0
- package/dist/utils/child-process.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +246 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +22 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +4 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +161 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/deprecation.d.ts +4 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/deprecation.js +13 -0
- package/dist/utils/deprecation.js.map +1 -0
- package/dist/utils/exif-orientation.d.ts +5 -0
- package/dist/utils/exif-orientation.d.ts.map +1 -0
- package/dist/utils/exif-orientation.js +158 -0
- package/dist/utils/exif-orientation.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +27 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/fs-watch.d.ts +5 -0
- package/dist/utils/fs-watch.d.ts.map +1 -0
- package/dist/utils/fs-watch.js +25 -0
- package/dist/utils/fs-watch.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +201 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/html.d.ts +7 -0
- package/dist/utils/html.d.ts.map +1 -0
- package/dist/utils/html.js +40 -0
- package/dist/utils/html.js.map +1 -0
- package/dist/utils/image-convert.d.ts +10 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +45 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-process.d.ts +18 -0
- package/dist/utils/image-process.d.ts.map +1 -0
- package/dist/utils/image-process.js +84 -0
- package/dist/utils/image-process.js.map +1 -0
- package/dist/utils/image-resize-core.d.ts +30 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -0
- package/dist/utils/image-resize-core.js +125 -0
- package/dist/utils/image-resize-core.js.map +1 -0
- package/dist/utils/image-resize-worker.d.ts +2 -0
- package/dist/utils/image-resize-worker.d.ts.map +1 -0
- package/dist/utils/image-resize-worker.js +31 -0
- package/dist/utils/image-resize-worker.js.map +1 -0
- package/dist/utils/image-resize.d.ts +16 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +100 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/json.d.ts +3 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +8 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/management-http.d.ts +25 -0
- package/dist/utils/management-http.d.ts.map +1 -0
- package/dist/utils/management-http.js +54 -0
- package/dist/utils/management-http.js.map +1 -0
- package/dist/utils/mime.d.ts +3 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +115 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/open-browser.d.ts +9 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +22 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/paths.d.ts +34 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +114 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +124 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +34 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +216 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/sync-sleep.d.ts +2 -0
- package/dist/utils/sync-sleep.d.ts.map +1 -0
- package/dist/utils/sync-sleep.js +11 -0
- package/dist/utils/sync-sleep.js.map +1 -0
- package/dist/utils/syntax-highlight.d.ts +13 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/utils/syntax-highlight.js +177 -0
- package/dist/utils/syntax-highlight.js.map +1 -0
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/dist/utils/tool-result-images.d.ts +19 -0
- package/dist/utils/tool-result-images.d.ts.map +1 -0
- package/dist/utils/tool-result-images.js +45 -0
- package/dist/utils/tool-result-images.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +24 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +437 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/dist/utils/version-check.d.ts +21 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +86 -0
- package/dist/utils/version-check.js.map +1 -0
- package/dist/utils/windows-self-update.d.ts +3 -0
- package/dist/utils/windows-self-update.d.ts.map +1 -0
- package/dist/utils/windows-self-update.js +77 -0
- package/dist/utils/windows-self-update.js.map +1 -0
- package/docs/compaction.md +348 -0
- package/docs/containerization.md +114 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/environment-variables.md +96 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +76 -0
- package/docs/json.md +98 -0
- package/docs/keybindings.md +245 -0
- package/docs/llama-cpp.md +101 -0
- package/docs/models.md +576 -0
- package/docs/packages.md +205 -0
- package/docs/prompt-templates.md +96 -0
- package/docs/providers.md +317 -0
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +1487 -0
- package/docs/sdk.md +1146 -0
- package/docs/security.md +24 -0
- package/docs/session-format.md +438 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +355 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +192 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +320 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +478 -0
- package/docs/usage.md +291 -0
- package/docs/windows.md +39 -0
- package/examples/README.md +21 -0
- package/examples/extensions/README.md +163 -0
- package/examples/extensions/bash-spawn-hook/index.ts +37 -0
- package/examples/extensions/bash-spawn-hook/plugin.json +10 -0
- package/examples/extensions/bookmark/index.ts +67 -0
- package/examples/extensions/bookmark/plugin.json +11 -0
- package/examples/extensions/built-in-tool-renderer/index.ts +262 -0
- package/examples/extensions/built-in-tool-renderer/plugin.json +10 -0
- package/examples/extensions/claude-rules/index.ts +119 -0
- package/examples/extensions/claude-rules/plugin.json +8 -0
- package/examples/extensions/cli-bridge/README.md +27 -0
- package/examples/extensions/cli-bridge/index.ts +320 -0
- package/examples/extensions/cli-bridge/plugin.json +10 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +53 -0
- package/examples/extensions/dynamic-resources/plugin.json +8 -0
- package/examples/extensions/dynamic-tools/index.ts +102 -0
- package/examples/extensions/dynamic-tools/plugin.json +14 -0
- package/examples/extensions/event-bus/index.ts +75 -0
- package/examples/extensions/event-bus/plugin.json +13 -0
- package/examples/extensions/file-trigger/index.ts +65 -0
- package/examples/extensions/file-trigger/plugin.json +13 -0
- package/examples/extensions/goal/README.md +16 -0
- package/examples/extensions/goal/index.ts +134 -0
- package/examples/extensions/goal/plugin.json +12 -0
- package/examples/extensions/hello/index.ts +29 -0
- package/examples/extensions/hello/plugin.json +10 -0
- package/examples/extensions/kimi-deferred-tools/index.ts +93 -0
- package/examples/extensions/kimi-deferred-tools/plugin.json +11 -0
- package/examples/extensions/mcp-stdio/README.md +19 -0
- package/examples/extensions/mcp-stdio/index.d.ts +64 -0
- package/examples/extensions/mcp-stdio/index.d.ts.map +1 -0
- package/examples/extensions/mcp-stdio/index.js +292 -0
- package/examples/extensions/mcp-stdio/index.js.map +1 -0
- package/examples/extensions/mcp-stdio/index.ts +381 -0
- package/examples/extensions/mcp-stdio/plugin.json +10 -0
- package/examples/extensions/memory-backend/index.ts +120 -0
- package/examples/extensions/memory-backend/plugin.json +10 -0
- package/examples/extensions/minimal-mode/index.ts +447 -0
- package/examples/extensions/minimal-mode/plugin.json +10 -0
- package/examples/extensions/multi-agent/README.md +7 -0
- package/examples/extensions/multi-agent/index.ts +592 -0
- package/examples/extensions/multi-agent/plugin.json +13 -0
- package/examples/extensions/notify/index.ts +70 -0
- package/examples/extensions/notify/plugin.json +8 -0
- package/examples/extensions/permission-gate/index.ts +55 -0
- package/examples/extensions/permission-gate/plugin.json +11 -0
- package/examples/extensions/pirate/index.ts +75 -0
- package/examples/extensions/pirate/plugin.json +8 -0
- package/examples/extensions/plan/README.md +16 -0
- package/examples/extensions/plan/index.ts +136 -0
- package/examples/extensions/plan/plugin.json +12 -0
- package/examples/extensions/prompt-customizer/index.ts +117 -0
- package/examples/extensions/prompt-customizer/plugin.json +8 -0
- package/examples/extensions/protected-paths/index.ts +44 -0
- package/examples/extensions/protected-paths/plugin.json +11 -0
- package/examples/extensions/provider-attribution/README.md +12 -0
- package/examples/extensions/provider-attribution/index.ts +86 -0
- package/examples/extensions/provider-attribution/plugin.json +10 -0
- package/examples/extensions/send-user-message/index.ts +118 -0
- package/examples/extensions/send-user-message/plugin.json +11 -0
- package/examples/extensions/session-name/index.ts +31 -0
- package/examples/extensions/session-name/plugin.json +11 -0
- package/examples/extensions/session-share/README.md +15 -0
- package/examples/extensions/session-share/index.ts +170 -0
- package/examples/extensions/session-share/plugin.json +15 -0
- package/examples/extensions/structured-output/index.ts +68 -0
- package/examples/extensions/structured-output/plugin.json +10 -0
- package/examples/extensions/subagent/README.md +177 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +157 -0
- package/examples/extensions/subagent/index.ts +1057 -0
- package/examples/extensions/subagent/plugin.json +13 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/suite-manager/README.md +45 -0
- package/examples/extensions/suite-manager/index.ts +182 -0
- package/examples/extensions/suite-manager/plugin.json +13 -0
- package/examples/extensions/timed-confirm/index.ts +93 -0
- package/examples/extensions/timed-confirm/plugin.json +13 -0
- package/examples/extensions/todo-set/README.md +18 -0
- package/examples/extensions/todo-set/index.ts +133 -0
- package/examples/extensions/todo-set/plugin.json +12 -0
- package/examples/extensions/tool-override/index.ts +159 -0
- package/examples/extensions/tool-override/plugin.json +11 -0
- package/examples/extensions/trigger-compact/index.ts +76 -0
- package/examples/extensions/trigger-compact/plugin.json +14 -0
- package/examples/extensions/truncated-tool/index.ts +204 -0
- package/examples/extensions/truncated-tool/plugin.json +10 -0
- package/examples/extensions/with-deps/index.ts +42 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/with-deps/plugin.json +10 -0
- package/examples/remote-client.ts +66 -0
- package/examples/rpc-extension-ui.ts +641 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +70 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/07-context-files.ts +42 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +72 -0
- package/examples/sdk/13-session-runtime.ts +71 -0
- package/examples/sdk/14-custom-session-storage.ts +132 -0
- package/examples/sdk/README.md +139 -0
- package/package.json +111 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-entry.js","sourceRoot":"","sources":["../../src/remote/server-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAEN,8BAA8B,EAG9B,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACN,yBAAyB,GAIzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAiC,MAAM,qBAAqB,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAU;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACpD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,IAAI,QAAQ,KAAK,EAAE;YAAE,OAAO,QAAQ,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACR,sEAAsE;IACvE,CAAC;IACD,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;IACxB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAA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E,CAAC;QACtE,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,GAAG,CAAC,OAAO,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;KACvG,CAAC,CAAC;IAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,OAAO;QACN,MAAM;QACN,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC;YAClB,mEAAmE;YACnE,mEAAmE;YACnE,mEAAmE;YACnE,iBAAiB;YACjB,IAAI,CAAC;gBACJ,OAAO,CAAC,kBAAkB,EAAE,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACR,gDAAgD;YACjD,CAAC;YACD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QAAA,CACtB;KACD,CAAC;AAAA,CACF","sourcesContent":["/**\n * Remote entry assembly: one function that wires the coding-agent session\n * source, the durable journal, and the server boundary into a started\n * `PiServer` handle.\n *\n * The CLI remote entry (`--serve <port>`, src/cli/serve.ts) is a thin wrapper\n * over this function: it supplies the loopback TCP listener, process signal\n * handling, and default error logging, while this entry owns the session\n * source, the durable journal, and the default model catalog. Hosts that need\n * custom listeners or auth use `assembleCodingAgentServer` directly.\n *\n * Defaults: the durable journal lives in the agent config directory\n * (`<agentDir>/remote-server-journal.jsonl`), never in the process cwd, so two\n * servers started from different directories but sharing one agentDir\n * journalize the same session timeline. The default model catalog is built\n * from the real agent model runtime (same agentDir domain as the session\n * source), so `list` reports models whose provider auth is configured and\n * `resolve` applies the local CLI resolution semantics: the ref must exist in\n * the catalog and its provider must have configured auth.\n *\n * Retry boundary: the gate advances only after a successful append so a failed\n * write can be retried; advancing before the write would permanently drop that\n * revision's boundary snapshot on the next same-revision broadcast.\n *\n * Journal boundary: the journal keeps snapshots at durable revision boundaries\n * only. Streaming intermediate states persist no SessionManager entry, so\n * their snapshots are not journaled (wire broadcasts are unaffected); after a\n * restart, replay converges to the same state as a local session reopen.\n *\n * Trust boundary: the expected deployment is loopback listeners with no default\n * authentication, and the session source accepts whatever `cwd` a client\n * submits — a local process can drive the agent in any directory. This entry\n * is therefore only safe in a single-user local trust environment; multi-tenant\n * authentication and workspace path restrictions are later slices (the CLI\n * offers an opt-in `--serve-workspace-root` boundary).\n */\n\nimport { randomUUID } from \"node:crypto\";\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport type { ModelMetadata, ModelRef, ServerEvent } from \"@agent-forge/protocol\";\nimport {\n\ttype DurableSessionEventJournal,\n\tFileDurableSessionEventJournal,\n\ttype PiServer,\n\ttype PiServerListener,\n\ttoProtocolModelMetadata,\n} from \"@agent-forge/server\";\nimport { getAgentDir } from \"../config.ts\";\nimport { ModelRuntime } from \"../core/model-runtime.ts\";\nimport {\n\tassembleCodingAgentServer,\n\ttype CodingAgentServerAssemblyOptions,\n\ttype CodingAgentServerModels,\n\ttype CodingAgentServerSessionSource,\n} from \"./server-assembly.ts\";\nimport { createFileSessionSource, type FileSessionSourceOptions } from \"./session-source.ts\";\n\n/**\n * Stable host-level writer identity for the default durable writer lease\n * (D-067 phase 2 S2): persisted under the agent dir and reused across\n * process restarts, so a restarted server re-claims its own still-live store\n * lease instantly (same writer id = the lease's idempotent refresh) instead\n * of waiting out a dead predecessor's TTL. Distinct nodes sharing one store\n * must each pin their own id via `options.writerId`.\n */\nexport function readOrCreateWriterId(agentDir: string): string {\n\tconst path = join(agentDir, \"durable\", \"writer-id\");\n\ttry {\n\t\tconst existing = readFileSync(path, \"utf8\").trim();\n\t\tif (existing !== \"\") return existing;\n\t} catch {\n\t\t// First start (or unreadable file): fall through and mint a fresh id.\n\t}\n\tconst id = randomUUID();\n\tmkdirSync(dirname(path), { recursive: true });\n\twriteFileSync(path, id);\n\treturn id;\n}\n\n/** Options for the programmatic remote server entry. */\nexport interface StartCodingAgentRemoteServerOptions {\n\t/** Session source; built from `sessionSourceOptions` when omitted. */\n\treadonly sessions?: CodingAgentServerSessionSource;\n\t/** Session source configuration, used when `sessions` is not supplied. */\n\treadonly sessionSourceOptions?: FileSessionSourceOptions;\n\t/**\n\t * Path to the durable journal JSONL file. Defaults to\n\t * `<agentDir>/remote-server-journal.jsonl`, derived from\n\t * `sessionSourceOptions.agentDir` (or the default agent dir), so the\n\t * journal never lands in the process cwd and servers sharing one agentDir\n\t * share one session timeline.\n\t */\n\treadonly journalPath?: string;\n\t/** Pre-built journal; overrides `journalPath`. The revision gate still applies. */\n\treadonly journal?: FileDurableSessionEventJournal;\n\t/**\n\t * Model catalog for `listModels` and `set_model` resolution. Defaults to\n\t * the real agent model runtime for the same agentDir domain as the session\n\t * source: `list` returns models whose provider auth is configured;\n\t * `resolve` requires the ref to exist in the catalog and its provider to\n\t * have configured auth (local CLI semantics).\n\t */\n\treadonly models?: CodingAgentServerModels;\n\t/** Transport listeners (loopback in tests; unix socket or TCP later). */\n\treadonly listeners: readonly PiServerListener[];\n\t/** Optional auth hook, passed through to `assembleCodingAgentServer`. */\n\treadonly authenticate?: CodingAgentServerAssemblyOptions[\"authenticate\"];\n\t/** Optional authorization hook, passed through unchanged. */\n\treadonly authorize?: CodingAgentServerAssemblyOptions[\"authorize\"];\n\t/** Optional server id. */\n\treadonly serverId?: string;\n\t/**\n\t * Durable service backing the server `operations`/`artifacts` surfaces.\n\t * Omission keeps those surfaces unconfigured: operations answer\n\t * `durable_unavailable` and artifacts answer `not_implemented`.\n\t */\n\treadonly durable?: CodingAgentServerAssemblyOptions[\"durable\"];\n\t/**\n\t * Writer id claimed on the durable service. Hosts that also inject the same\n\t * store into the session source (`sessionSourceOptions.agentTaskResults`)\n\t * pass the same id here so the server and the sessions share one writer.\n\t */\n\treadonly writerId?: CodingAgentServerAssemblyOptions[\"writerId\"];\n\t/** Executors for submitted operation types; unknown types terminate as rejected. */\n\treadonly operationExecutors?: CodingAgentServerAssemblyOptions[\"operationExecutors\"];\n\t/** Optional internal-error sink, passed through to `assembleCodingAgentServer`. */\n\treadonly onError?: CodingAgentServerAssemblyOptions[\"onError\"];\n}\n\n/** A started remote server handle. */\nexport interface CodingAgentRemoteServerHandle {\n\t/** The underlying `PiServer` for advanced control. */\n\treadonly server: PiServer;\n\t/** Human-readable listener addresses after startup. */\n\treadonly addresses: readonly string[];\n\t/** Stops the server, closes listeners, and flushes the journal. */\n\tclose(): Promise<void>;\n}\n\n/**\n * Journal decorator that journals snapshots only at durable revision\n * boundaries. The server appends a full snapshot for every runtime event, but\n * streaming intermediate states persist no SessionManager entry: their\n * snapshot revision does not advance. This gate drops `session_snapshot`\n * appends whose revision did not advance past the last journaled one for that\n * session, so per-chunk streaming updates no longer multiply journal entries\n * on disk. Wire broadcasts are unaffected (they flow through the server, not\n * the journal); `session_progress` and `session_removed` events pass through\n * unchanged. After a restart, replay converges to the same state as a local\n * session reopen: the latest snapshot at or before each persisted revision.\n *\n * Retry boundary: the gate advances only after a successful append so a failed\n * write can be retried. Because the server broadcasts snapshots\n * fire-and-forget, several same-revision appends can be in flight at once; a\n * synchronous in-flight claim (taken before the first await, like the old\n * pre-advance) keeps those duplicates dropped while the revision stays\n * retryable until one append actually lands.\n */\nclass RevisionGatedSessionJournal implements DurableSessionEventJournal {\n\t/** Last durably journaled revision per session id. */\n\tprivate readonly lastJournaledRevision = new Map<string, number>();\n\t/** Revisions whose append is currently in flight, keyed by `sessionId\\0revision`. */\n\tprivate readonly inFlightRevisions = new Set<string>();\n\tprivate readonly inner: DurableSessionEventJournal;\n\n\tconstructor(inner: DurableSessionEventJournal) {\n\t\tthis.inner = inner;\n\t}\n\n\tasync append(sessionId: string, event: ServerEvent): Promise<number> {\n\t\tif (event.type === \"session_snapshot\") {\n\t\t\tconst revision = event.snapshot.revision;\n\t\t\t// An empty map reads as -Infinity so the first snapshot is always\n\t\t\t// journaled, including the pre-first-entry revision 0. The first\n\t\t\t// snapshot after a revision advance is never missed: the gate only\n\t\t\t// drops revisions that are <= the last durably journaled one, plus\n\t\t\t// concurrent duplicates of a revision still being written.\n\t\t\tconst key = `${sessionId}\\0${revision}`;\n\t\t\tif (\n\t\t\t\trevision <= (this.lastJournaledRevision.get(sessionId) ?? Number.NEGATIVE_INFINITY) ||\n\t\t\t\tthis.inFlightRevisions.has(key)\n\t\t\t) {\n\t\t\t\t// No record was written; the server discards the snapshot append\n\t\t\t\t// cursor, so 0 (\"no record\") is safe to return here.\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t// Synchronous claim before the first await: concurrent same-revision\n\t\t\t// appends are dropped without waiting on the write.\n\t\t\tthis.inFlightRevisions.add(key);\n\t\t\ttry {\n\t\t\t\tconst cursor = await this.inner.append(sessionId, event);\n\t\t\t\t// Advance only after a successful append so a failed write can be\n\t\t\t\t// retried; an earlier revision completing late must not regress\n\t\t\t\t// the high-water mark of a later committed one.\n\t\t\t\tif (revision > (this.lastJournaledRevision.get(sessionId) ?? Number.NEGATIVE_INFINITY)) {\n\t\t\t\t\tthis.lastJournaledRevision.set(sessionId, revision);\n\t\t\t\t}\n\t\t\t\treturn cursor;\n\t\t\t} finally {\n\t\t\t\t// Release the claim on success and failure alike: on failure the\n\t\t\t\t// next same-revision broadcast retries the append instead of it\n\t\t\t\t// being dropped as already journaled.\n\t\t\t\tthis.inFlightRevisions.delete(key);\n\t\t\t}\n\t\t}\n\t\treturn this.inner.append(sessionId, event);\n\t}\n\n\treplay(\n\t\tsessionId: string,\n\t\tafterCursor: number,\n\t\tlimit: number,\n\t): Promise<{\n\t\treadonly events: readonly { readonly cursor: number; readonly event: ServerEvent }[];\n\t\treadonly nextCursor: number;\n\t\treadonly complete: boolean;\n\t\treadonly gap: boolean;\n\t}> {\n\t\treturn this.inner.replay(sessionId, afterCursor, limit);\n\t}\n\n\tclose(): Promise<void> {\n\t\treturn this.inner.close();\n\t}\n}\n\n/**\n * Default model catalog built from the real agent model runtime, mirroring how\n * `createAgentSession` builds one from `agentDir`. `list` projects the models\n * whose provider auth is configured (the local CLI `--list-models` semantics).\n * `resolve` mirrors local model restoration: the ref must exist in the catalog\n * and its provider must have configured auth; anything else fails with a\n * plain `Error` that the server boundary maps to `invalid_request`.\n *\n * Boundary: the catalog is a startup-time snapshot. Provider auth added while\n * the server runs is not reflected in `list` results (new sessions can still\n * resolve such models, since `resolve` checks auth on demand); hosts needing a\n * fresh catalog rebuild the server.\n */\nfunction createDefaultServerModels(modelRuntime: ModelRuntime): CodingAgentServerModels {\n\treturn {\n\t\tlist: async (): Promise<readonly ModelMetadata[]> => {\n\t\t\tconst available = await modelRuntime.getAvailable();\n\t\t\treturn available.map((model) =>\n\t\t\t\ttoProtocolModelMetadata(model, modelRuntime.hasConfiguredAuth(model.provider)),\n\t\t\t);\n\t\t},\n\t\tresolve: async (ref: ModelRef) => {\n\t\t\tconst model = modelRuntime.getModel(ref.provider, ref.id);\n\t\t\t// checkAuth resolves the provider's configured auth on demand, so\n\t\t\t// resolution does not depend on whether an availability refresh\n\t\t\t// (getAvailable) already populated the auth snapshot.\n\t\t\tconst auth = model === undefined ? undefined : await modelRuntime.checkAuth(ref.provider);\n\t\t\tif (model === undefined || auth === undefined) {\n\t\t\t\tthrow new Error(`Unknown or unavailable model: ${ref.provider}/${ref.id}`);\n\t\t\t}\n\t\t\treturn model;\n\t\t},\n\t};\n}\n\n/**\n * Assembles and starts a coding-agent remote server: session source + durable\n * journal + transport listeners behind the public server boundary.\n */\nexport async function startCodingAgentRemoteServer(\n\toptions: StartCodingAgentRemoteServerOptions,\n): Promise<CodingAgentRemoteServerHandle> {\n\tconst sessionSourceOptions: FileSessionSourceOptions | undefined = options.sessionSourceOptions;\n\tconst sessions =\n\t\toptions.sessions ??\n\t\t(sessionSourceOptions === undefined ? undefined : createFileSessionSource(sessionSourceOptions));\n\tif (sessions === undefined) {\n\t\tthrow new Error(\"Remote server requires a session source or sessionSourceOptions\");\n\t}\n\n\t// Default journal domain: the agent config directory the session source\n\t// resolves against (explicit agentDir, else the default agent dir) — never\n\t// the process cwd. Two servers sharing one agentDir therefore share one\n\t// journal for the same sessions, independent of where they were started.\n\tconst agentDir = sessionSourceOptions?.agentDir ?? getAgentDir();\n\tconst journal = new RevisionGatedSessionJournal(\n\t\toptions.journal ??\n\t\t\tnew FileDurableSessionEventJournal(options.journalPath ?? join(agentDir, \"remote-server-journal.jsonl\")),\n\t);\n\t// Default writer identity (D-067 phase 2 S2): stable per agent-dir domain\n\t// (persisted beside the durable log), so a restarted server re-claims its\n\t// own still-live store lease instantly — same writer id = the lease's\n\t// idempotent refresh — instead of being locked out by its dead\n\t// predecessor's TTL. Distinct nodes sharing one store must each pin their\n\t// own writer id via `options.writerId`.\n\tconst writerId = options.writerId ?? readOrCreateWriterId(agentDir);\n\n\t// Default model catalog: build a real runtime from the same agentDir\n\t// domain, mirroring `createAgentSession`'s authPath/modelsPath resolution.\n\tconst models: CodingAgentServerModels =\n\t\toptions.models ??\n\t\tcreateDefaultServerModels(\n\t\t\tawait ModelRuntime.create(\n\t\t\t\tsessionSourceOptions?.agentDir === undefined\n\t\t\t\t\t? {}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tauthPath: join(sessionSourceOptions.agentDir, \"auth.json\"),\n\t\t\t\t\t\t\tmodelsPath: join(sessionSourceOptions.agentDir, \"models.json\"),\n\t\t\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\tconst { server, service } = assembleCodingAgentServer({\n\t\tsessions,\n\t\tmodels,\n\t\tlisteners: options.listeners,\n\t\tjournal,\n\t\t...(options.authenticate === undefined ? {} : { authenticate: options.authenticate }),\n\t\t...(options.authorize === undefined ? {} : { authorize: options.authorize }),\n\t\t...(options.serverId === undefined ? {} : { serverId: options.serverId }),\n\t\t...(options.onError === undefined ? {} : { onError: options.onError }),\n\t\t...(options.durable === undefined ? {} : { durable: options.durable }),\n\t\t...(writerId === undefined ? {} : { writerId }),\n\t\t...(options.operationExecutors === undefined ? {} : { operationExecutors: options.operationExecutors }),\n\t});\n\n\tawait server.start();\n\n\treturn {\n\t\tserver,\n\t\taddresses: server.addresses,\n\t\tclose: async () => {\n\t\t\t// Graceful shutdown releases the store writer lease (D-067 phase 2\n\t\t\t// S2) so a successor process can claim immediately; crash recovery\n\t\t\t// stays the lease-TTL path. Best-effort: shutdown never fails on a\n\t\t\t// release error.\n\t\t\ttry {\n\t\t\t\tservice.releaseWriterLease();\n\t\t\t} catch {\n\t\t\t\t// Release failures surface nowhere at shutdown.\n\t\t\t}\n\t\t\tawait server.close();\n\t\t\tawait journal.close();\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production `CodingAgentServerSessionSource` backed by the `SessionManager`
|
|
3
|
+
* file-based persistence and `createAgentSession` from the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Owns the mapping between server descriptors and on-disk `.jsonl` session
|
|
6
|
+
* files. Each `open()` call reconstructs a full `AgentSession` whose messages
|
|
7
|
+
* are rebuilt from the JSONL entries, producing a transcript and durable
|
|
8
|
+
* revision identical to an in-process session.
|
|
9
|
+
*
|
|
10
|
+
* Honest boundary: model runtime, auth, tool suite, and extensions are resolved
|
|
11
|
+
* at `open`/`create` time from the host-provided `agentDir` and the session's
|
|
12
|
+
* own working directory (`descriptor.cwd` at create; the recorded cwd at open,
|
|
13
|
+
* with the host-level fallback for legacy cwd-less files).
|
|
14
|
+
* The source does not cache or pool sessions.
|
|
15
|
+
*/
|
|
16
|
+
import type { StreamFn } from "@agent-forge/agent-core";
|
|
17
|
+
import type { CredentialStore } from "@agent-forge/ai";
|
|
18
|
+
import type { Api, Model } from "@agent-forge/ai/compat";
|
|
19
|
+
import type { ThinkingLevel } from "@agent-forge/protocol";
|
|
20
|
+
import type { AgentTaskAdapter } from "../core/extensions/public-api.ts";
|
|
21
|
+
import type { HostLogger } from "../core/logger.ts";
|
|
22
|
+
import type { ModelRuntime } from "../core/model-runtime.ts";
|
|
23
|
+
import type { SessionStorageProvider } from "../core/session-storage.ts";
|
|
24
|
+
import type { SettingsManager } from "../core/settings-manager.ts";
|
|
25
|
+
import type { DurableServiceV1 } from "../durable/durable-service.ts";
|
|
26
|
+
import type { CodingAgentServerSessionSource } from "./server-assembly.ts";
|
|
27
|
+
/** Configuration for a file-backed session source. */
|
|
28
|
+
export interface FileSessionSourceOptions {
|
|
29
|
+
/** Absolute path to the sessions directory containing `.jsonl` files. */
|
|
30
|
+
readonly sessionsDir: string;
|
|
31
|
+
/**
|
|
32
|
+
* Fallback working directory. Opens of legacy session files that recorded
|
|
33
|
+
* no cwd (`SessionInfo.cwd` is `""`) run here, and so do creates whose
|
|
34
|
+
* descriptor carries no cwd. Sessions always prefer their own cwd:
|
|
35
|
+
* `descriptor.cwd` at create, the recorded cwd at open.
|
|
36
|
+
*/
|
|
37
|
+
readonly cwd: string;
|
|
38
|
+
/** Absolute path to the agent config directory (defaults to `~/.agent-forge/agent`). */
|
|
39
|
+
readonly agentDir?: string;
|
|
40
|
+
/** Optional pre-built model runtime; created from `agentDir` when omitted. */
|
|
41
|
+
readonly modelRuntime?: ModelRuntime;
|
|
42
|
+
/** Optional explicit stream function (faux providers in tests). */
|
|
43
|
+
readonly streamFn?: StreamFn;
|
|
44
|
+
/** Optional explicit model to attach on creation. */
|
|
45
|
+
readonly model?: Model<Api>;
|
|
46
|
+
/** Optional thinking level for new sessions. */
|
|
47
|
+
readonly thinkingLevel?: ThinkingLevel;
|
|
48
|
+
/** Optional pre-built settings manager. */
|
|
49
|
+
readonly settingsManager?: SettingsManager;
|
|
50
|
+
/** Opt-in workspace boundary: when provided, `create` rejects descriptors whose resolved cwd is not inside one of these roots. The check is purely lexical (`path.resolve` normalization); symlinks are not resolved. Omit for unrestricted local-trust operation; `open` is not gated (it reopens sessions already on disk). */
|
|
51
|
+
readonly workspaceRoots?: readonly string[];
|
|
52
|
+
/**
|
|
53
|
+
* Storage seam for the session records (D-067 phase 1). Defaults to the
|
|
54
|
+
* local JSONL file protocol; hosts may inject an alternative provider and
|
|
55
|
+
* every session this source builds uses it.
|
|
56
|
+
*/
|
|
57
|
+
readonly storage?: SessionStorageProvider;
|
|
58
|
+
/**
|
|
59
|
+
* Credential storage for the model runtime each session builds (D-067
|
|
60
|
+
* phase 1): forwarded to the default `ModelRuntime` construction. Ignored
|
|
61
|
+
* when `modelRuntime` is supplied explicitly. Defaults to the file at
|
|
62
|
+
* `<agentDir>/auth.json`.
|
|
63
|
+
*/
|
|
64
|
+
readonly credentials?: CredentialStore;
|
|
65
|
+
/**
|
|
66
|
+
* Host-process logger forwarded into every session this source builds
|
|
67
|
+
* (D-067 phase 1 seam: serve sessions previously had no logger at all —
|
|
68
|
+
* the SDK treats an absent logger as an explicit no-op).
|
|
69
|
+
*/
|
|
70
|
+
readonly hostLogger?: HostLogger;
|
|
71
|
+
/**
|
|
72
|
+
* Durable replay channel for agent task terminal outcomes, forwarded into
|
|
73
|
+
* every session this source builds (agent-result-replay-v1). The host owns
|
|
74
|
+
* the store and the writer claim; the writerId must be the same one the
|
|
75
|
+
* server assembly claims so a single writer serves the whole process.
|
|
76
|
+
*/
|
|
77
|
+
readonly agentTaskResults?: {
|
|
78
|
+
readonly store: DurableServiceV1;
|
|
79
|
+
readonly writerId: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* 本进程自身入口可信(承载退役切片 2):转发给每个会话的装配域,delegate 在未
|
|
83
|
+
* 显式配置池且 self-invocation 可解析时自动池化——serve 装配用它给会话一个
|
|
84
|
+
* 委派载体。SDK 嵌入方不传则委派面不注册。
|
|
85
|
+
*/
|
|
86
|
+
readonly subagentPoolFromSelfInvocation?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Per-session agent task carrier factory(承载退役切片 2):source 装配的每个
|
|
89
|
+
* 会话没有默认子任务 creator;SDK 嵌入方可用它按会话绑定父身份注入 in-process
|
|
90
|
+
* 或池化 adapter(生产 serve 走 `subagentPoolFromSelfInvocation`)。
|
|
91
|
+
*/
|
|
92
|
+
readonly createAgentTaskAdapter?: (parent: {
|
|
93
|
+
readonly sessionId: string;
|
|
94
|
+
}) => AgentTaskAdapter;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Creates a production `CodingAgentServerSessionSource` backed by on-disk
|
|
98
|
+
* `.jsonl` session files in `sessionsDir`.
|
|
99
|
+
*/
|
|
100
|
+
export declare function createFileSessionSource(options: FileSessionSourceOptions): CodingAgentServerSessionSource;
|
|
101
|
+
//# sourceMappingURL=session-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-source.d.ts","sourceRoot":"","sources":["../../src/remote/session-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,8BAA8B,EAAgC,MAAM,sBAAsB,CAAC;AAEzG,sDAAsD;AACtD,MAAM,WAAW,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O,EAAE,wBAAwB,GAAG,8BAA8B,CAwDzG","sourcesContent":["/**\n * Production `CodingAgentServerSessionSource` backed by the `SessionManager`\n * file-based persistence and `createAgentSession` from the SDK.\n *\n * Owns the mapping between server descriptors and on-disk `.jsonl` session\n * files. Each `open()` call reconstructs a full `AgentSession` whose messages\n * are rebuilt from the JSONL entries, producing a transcript and durable\n * revision identical to an in-process session.\n *\n * Honest boundary: model runtime, auth, tool suite, and extensions are resolved\n * at `open`/`create` time from the host-provided `agentDir` and the session's\n * own working directory (`descriptor.cwd` at create; the recorded cwd at open,\n * with the host-level fallback for legacy cwd-less files).\n * The source does not cache or pool sessions.\n */\n\nimport { stat } from \"node:fs/promises\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport type { StreamFn } from \"@agent-forge/agent-core\";\nimport type { CredentialStore } from \"@agent-forge/ai\";\nimport type { Api, Model } from \"@agent-forge/ai/compat\";\nimport type { ThinkingLevel } from \"@agent-forge/protocol\";\nimport type { AgentSession } from \"../core/agent-session.ts\";\nimport type { AgentTaskAdapter } from \"../core/extensions/public-api.ts\";\nimport type { HostLogger } from \"../core/logger.ts\";\nimport type { ModelRuntime } from \"../core/model-runtime.ts\";\nimport { createAgentSession } from \"../core/sdk.ts\";\nimport { type SessionInfo, SessionManager } from \"../core/session-manager.ts\";\nimport type { SessionStorageProvider } from \"../core/session-storage.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport type { DurableServiceV1 } from \"../durable/durable-service.ts\";\nimport type { CodingAgentServerSessionSource, CodingAgentSessionDescriptor } from \"./server-assembly.ts\";\n\n/** Configuration for a file-backed session source. */\nexport interface FileSessionSourceOptions {\n\t/** Absolute path to the sessions directory containing `.jsonl` files. */\n\treadonly sessionsDir: string;\n\t/**\n\t * Fallback working directory. Opens of legacy session files that recorded\n\t * no cwd (`SessionInfo.cwd` is `\"\"`) run here, and so do creates whose\n\t * descriptor carries no cwd. Sessions always prefer their own cwd:\n\t * `descriptor.cwd` at create, the recorded cwd at open.\n\t */\n\treadonly cwd: string;\n\t/** Absolute path to the agent config directory (defaults to `~/.agent-forge/agent`). */\n\treadonly agentDir?: string;\n\t/** Optional pre-built model runtime; created from `agentDir` when omitted. */\n\treadonly modelRuntime?: ModelRuntime;\n\t/** Optional explicit stream function (faux providers in tests). */\n\treadonly streamFn?: StreamFn;\n\t/** Optional explicit model to attach on creation. */\n\treadonly model?: Model<Api>;\n\t/** Optional thinking level for new sessions. */\n\treadonly thinkingLevel?: ThinkingLevel;\n\t/** Optional pre-built settings manager. */\n\treadonly settingsManager?: SettingsManager;\n\t/** Opt-in workspace boundary: when provided, `create` rejects descriptors whose resolved cwd is not inside one of these roots. The check is purely lexical (`path.resolve` normalization); symlinks are not resolved. Omit for unrestricted local-trust operation; `open` is not gated (it reopens sessions already on disk). */\n\treadonly workspaceRoots?: readonly string[];\n\t/**\n\t * Storage seam for the session records (D-067 phase 1). Defaults to the\n\t * local JSONL file protocol; hosts may inject an alternative provider and\n\t * every session this source builds uses it.\n\t */\n\treadonly storage?: SessionStorageProvider;\n\t/**\n\t * Credential storage for the model runtime each session builds (D-067\n\t * phase 1): forwarded to the default `ModelRuntime` construction. Ignored\n\t * when `modelRuntime` is supplied explicitly. Defaults to the file at\n\t * `<agentDir>/auth.json`.\n\t */\n\treadonly credentials?: CredentialStore;\n\t/**\n\t * Host-process logger forwarded into every session this source builds\n\t * (D-067 phase 1 seam: serve sessions previously had no logger at all —\n\t * the SDK treats an absent logger as an explicit no-op).\n\t */\n\treadonly hostLogger?: HostLogger;\n\t/**\n\t * Durable replay channel for agent task terminal outcomes, forwarded into\n\t * every session this source builds (agent-result-replay-v1). The host owns\n\t * the store and the writer claim; the writerId must be the same one the\n\t * server assembly claims so a single writer serves the whole process.\n\t */\n\treadonly agentTaskResults?: {\n\t\treadonly store: DurableServiceV1;\n\t\treadonly writerId: string;\n\t};\n\t/**\n\t * 本进程自身入口可信(承载退役切片 2):转发给每个会话的装配域,delegate 在未\n\t * 显式配置池且 self-invocation 可解析时自动池化——serve 装配用它给会话一个\n\t * 委派载体。SDK 嵌入方不传则委派面不注册。\n\t */\n\treadonly subagentPoolFromSelfInvocation?: boolean;\n\t/**\n\t * Per-session agent task carrier factory(承载退役切片 2):source 装配的每个\n\t * 会话没有默认子任务 creator;SDK 嵌入方可用它按会话绑定父身份注入 in-process\n\t * 或池化 adapter(生产 serve 走 `subagentPoolFromSelfInvocation`)。\n\t */\n\treadonly createAgentTaskAdapter?: (parent: { readonly sessionId: string }) => AgentTaskAdapter;\n}\n\n/**\n * Maps a `SessionInfo` from `SessionManager.listAll` to a\n * `CodingAgentSessionDescriptor` visible to the server boundary.\n */\nfunction infoToDescriptor(info: SessionInfo): CodingAgentSessionDescriptor {\n\treturn {\n\t\tid: info.id,\n\t\t...(info.name === undefined ? {} : { name: info.name }),\n\t\t// Legacy session files recorded no cwd (empty string); omit the field\n\t\t// like `name` instead of leaking a protocol-invalid empty cwd.\n\t\t...(info.cwd === \"\" ? {} : { cwd: info.cwd }),\n\t\t// Profile lock recorded in the header at creation; omit the keys when\n\t\t// absent so descriptors keep the protocol's optional-field semantics\n\t\t// and reopened-session snapshots echo exactly what was persisted.\n\t\t...(info.profileId === undefined ? {} : { profileId: info.profileId }),\n\t\t...(info.profileVersion === undefined ? {} : { profileVersion: info.profileVersion }),\n\t\tcreatedAt: info.created.getTime(),\n\t\tupdatedAt: info.modified.getTime(),\n\t};\n}\n\n/**\n * Shared logic to reconstruct an `AgentSession` from an existing\n * `SessionManager` instance (used by both `create` and `open`). `cwd` is the\n * session's own working directory — the one the descriptor recorded at create\n * (or the recorded cwd at open) — and drives tool ctx, resource discovery, and\n * the agents.md chain for this session regardless of the host-level fallback.\n * Optional `overrides` carry per-session descriptor values; they win over the\n * host-level `options` defaults.\n */\nasync function buildSession(\n\tsessionManager: SessionManager,\n\toptions: FileSessionSourceOptions,\n\tcwd: string,\n\toverrides?: { readonly model?: Model<Api>; readonly thinkingLevel?: ThinkingLevel },\n): Promise<AgentSession> {\n\tconst model = overrides?.model ?? options.model;\n\tconst thinkingLevel = overrides?.thinkingLevel ?? options.thinkingLevel;\n\tconst { session } = await createAgentSession({\n\t\tcwd,\n\t\t...(options.agentDir === undefined ? {} : { agentDir: options.agentDir }),\n\t\tsessionManager,\n\t\t...(options.modelRuntime === undefined ? {} : { modelRuntime: options.modelRuntime }),\n\t\t...(options.streamFn === undefined ? {} : { streamFn: options.streamFn }),\n\t\t...(model === undefined ? {} : { model }),\n\t\t...(thinkingLevel === undefined ? {} : { thinkingLevel }),\n\t\t...(options.settingsManager === undefined ? {} : { settingsManager: options.settingsManager }),\n\t\t...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n\t\t...(options.hostLogger === undefined ? {} : { hostLogger: options.hostLogger }),\n\t\t...(options.agentTaskResults === undefined ? {} : { agentTaskResults: options.agentTaskResults }),\n\t\t...(options.subagentPoolFromSelfInvocation === undefined\n\t\t\t? {}\n\t\t\t: { subagentPoolFromSelfInvocation: options.subagentPoolFromSelfInvocation }),\n\t\t...(options.createAgentTaskAdapter === undefined\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\tagentTaskAdapter: options.createAgentTaskAdapter({ sessionId: sessionManager.getSessionId() }),\n\t\t\t\t}),\n\t});\n\treturn session;\n}\n\n/**\n * Enforces the opt-in workspace boundary for `create`. Both the root and the\n * final cwd are resolved first; the cwd is inside when it is the root itself\n * or a descendant. On win32 `path.relative` compares case-insensitively by\n * platform default and yields an absolute path across drive letters, which\n * fails the containment check naturally. Throws a plain `Error` (matching the\n * existing session-source convention) so the server boundary maps it to a\n * request-class protocol error with the original message.\n */\nfunction assertWithinWorkspaceRoots(cwd: string, roots: readonly string[] | undefined): void {\n\tif (roots === undefined) return;\n\tconst resolvedCwd = resolve(cwd);\n\tfor (const root of roots) {\n\t\tconst resolvedRoot = resolve(root);\n\t\tconst rel = relative(resolvedRoot, resolvedCwd);\n\t\t// `rel === \"\"` means the cwd is the root itself, which is allowed. The\n\t\t// escape check is segment-precise so in-root entries that merely start\n\t\t// with \"..\" (e.g. `..foo`) are not mistaken for parent escapes.\n\t\tif (rel === \"\" || (!isAbsolute(rel) && rel !== \"..\" && !rel.startsWith(`..${sep}`))) return;\n\t}\n\tthrow new Error(\n\t\t`cwd \"${resolvedCwd}\" is outside the configured workspace roots: [${roots.map((root) => resolve(root)).join(\", \")}]`,\n\t);\n}\n\n/**\n * `create` targets a fresh session workspace, so a missing or non-directory\n * cwd must fail the create with a clear, path-bearing error instead of\n * producing a session whose tools fail on their first relative access.\n * `open` re-opens sessions already recorded on disk and is not gated. The\n * plain `Error` matches the session-source convention; the server boundary\n * maps it to an `invalid_request` protocol error with the original message.\n */\nasync function assertCwdIsDirectory(cwd: string): Promise<void> {\n\tconst stats = await stat(cwd).catch((error: unknown) => {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\t\tthrow error;\n\t});\n\tif (stats === undefined) {\n\t\tthrow new Error(`Cannot create session: cwd does not exist: ${cwd}`);\n\t}\n\tif (!stats.isDirectory()) {\n\t\tthrow new Error(`Cannot create session: cwd is not a directory: ${cwd}`);\n\t}\n}\n\n/**\n * Creates a production `CodingAgentServerSessionSource` backed by on-disk\n * `.jsonl` session files in `sessionsDir`.\n */\nexport function createFileSessionSource(options: FileSessionSourceOptions): CodingAgentServerSessionSource {\n\tconst sessionsDir = resolve(options.sessionsDir);\n\n\treturn {\n\t\tasync list(): Promise<readonly CodingAgentSessionDescriptor[]> {\n\t\t\tconst infos = await SessionManager.listAll(sessionsDir);\n\t\t\treturn infos.map(infoToDescriptor);\n\t\t},\n\n\t\t/**\n\t\t * Creates a session in the descriptor cwd (or the host-level fallback).\n\t\t * The final cwd must be inside the configured workspace roots (when\n\t\t * provided) and must exist as a directory; both checks run before any\n\t\t * session file is written, so a rejected create leaves the disk\n\t\t * untouched.\n\t\t */\n\t\tasync create(descriptor: CodingAgentSessionDescriptor): Promise<AgentSession> {\n\t\t\t// The server boundary rejects cwd-less creates; a direct host call\n\t\t\t// falls back to the host-level cwd like legacy opens.\n\t\t\tconst cwd = descriptor.cwd === undefined || descriptor.cwd === \"\" ? options.cwd : descriptor.cwd;\n\t\t\tassertWithinWorkspaceRoots(cwd, options.workspaceRoots);\n\t\t\tawait assertCwdIsDirectory(cwd);\n\t\t\tconst sm = SessionManager.create(\n\t\t\t\tcwd,\n\t\t\t\tsessionsDir,\n\t\t\t\t{\n\t\t\t\t\tid: descriptor.id,\n\t\t\t\t\t// Creation-time profile lock, persisted into the session header so\n\t\t\t\t\t// it survives restarts (read back via `list`/`open` descriptors).\n\t\t\t\t\t...(descriptor.profileId === undefined ? {} : { profileId: descriptor.profileId }),\n\t\t\t\t\t...(descriptor.profileVersion === undefined ? {} : { profileVersion: descriptor.profileVersion }),\n\t\t\t\t},\n\t\t\t\toptions.storage,\n\t\t\t);\n\t\t\treturn buildSession(sm, options, cwd, {\n\t\t\t\t...(descriptor.model === undefined ? {} : { model: descriptor.model }),\n\t\t\t\t...(descriptor.thinkingLevel === undefined ? {} : { thinkingLevel: descriptor.thinkingLevel }),\n\t\t\t});\n\t\t},\n\n\t\tasync open(descriptor: CodingAgentSessionDescriptor): Promise<AgentSession> {\n\t\t\t// Re-scan to locate the session file path for the given id.\n\t\t\tconst infos = await SessionManager.listAll(sessionsDir);\n\t\t\tconst match = infos.find((info) => info.id === descriptor.id);\n\t\t\tif (!match) {\n\t\t\t\tthrow new Error(`Session not found: ${descriptor.id}`);\n\t\t\t}\n\t\t\t// The session file records the cwd it ran in; legacy files may have\n\t\t\t// none (empty string), which falls back to the host-level cwd. The\n\t\t\t// override keeps the SessionManager cwd consistent with the build\n\t\t\t// cwd for consumers of `getCwd()` (extension surface, snapshot).\n\t\t\tconst cwd = match.cwd === \"\" ? options.cwd : match.cwd;\n\t\t\tconst sm = SessionManager.open(match.path, sessionsDir, cwd, options.storage);\n\t\t\treturn buildSession(sm, options, cwd);\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production `CodingAgentServerSessionSource` backed by the `SessionManager`
|
|
3
|
+
* file-based persistence and `createAgentSession` from the SDK.
|
|
4
|
+
*
|
|
5
|
+
* Owns the mapping between server descriptors and on-disk `.jsonl` session
|
|
6
|
+
* files. Each `open()` call reconstructs a full `AgentSession` whose messages
|
|
7
|
+
* are rebuilt from the JSONL entries, producing a transcript and durable
|
|
8
|
+
* revision identical to an in-process session.
|
|
9
|
+
*
|
|
10
|
+
* Honest boundary: model runtime, auth, tool suite, and extensions are resolved
|
|
11
|
+
* at `open`/`create` time from the host-provided `agentDir` and the session's
|
|
12
|
+
* own working directory (`descriptor.cwd` at create; the recorded cwd at open,
|
|
13
|
+
* with the host-level fallback for legacy cwd-less files).
|
|
14
|
+
* The source does not cache or pool sessions.
|
|
15
|
+
*/
|
|
16
|
+
import { stat } from "node:fs/promises";
|
|
17
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
18
|
+
import { createAgentSession } from "../core/sdk.js";
|
|
19
|
+
import { SessionManager } from "../core/session-manager.js";
|
|
20
|
+
/**
|
|
21
|
+
* Maps a `SessionInfo` from `SessionManager.listAll` to a
|
|
22
|
+
* `CodingAgentSessionDescriptor` visible to the server boundary.
|
|
23
|
+
*/
|
|
24
|
+
function infoToDescriptor(info) {
|
|
25
|
+
return {
|
|
26
|
+
id: info.id,
|
|
27
|
+
...(info.name === undefined ? {} : { name: info.name }),
|
|
28
|
+
// Legacy session files recorded no cwd (empty string); omit the field
|
|
29
|
+
// like `name` instead of leaking a protocol-invalid empty cwd.
|
|
30
|
+
...(info.cwd === "" ? {} : { cwd: info.cwd }),
|
|
31
|
+
// Profile lock recorded in the header at creation; omit the keys when
|
|
32
|
+
// absent so descriptors keep the protocol's optional-field semantics
|
|
33
|
+
// and reopened-session snapshots echo exactly what was persisted.
|
|
34
|
+
...(info.profileId === undefined ? {} : { profileId: info.profileId }),
|
|
35
|
+
...(info.profileVersion === undefined ? {} : { profileVersion: info.profileVersion }),
|
|
36
|
+
createdAt: info.created.getTime(),
|
|
37
|
+
updatedAt: info.modified.getTime(),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Shared logic to reconstruct an `AgentSession` from an existing
|
|
42
|
+
* `SessionManager` instance (used by both `create` and `open`). `cwd` is the
|
|
43
|
+
* session's own working directory — the one the descriptor recorded at create
|
|
44
|
+
* (or the recorded cwd at open) — and drives tool ctx, resource discovery, and
|
|
45
|
+
* the agents.md chain for this session regardless of the host-level fallback.
|
|
46
|
+
* Optional `overrides` carry per-session descriptor values; they win over the
|
|
47
|
+
* host-level `options` defaults.
|
|
48
|
+
*/
|
|
49
|
+
async function buildSession(sessionManager, options, cwd, overrides) {
|
|
50
|
+
const model = overrides?.model ?? options.model;
|
|
51
|
+
const thinkingLevel = overrides?.thinkingLevel ?? options.thinkingLevel;
|
|
52
|
+
const { session } = await createAgentSession({
|
|
53
|
+
cwd,
|
|
54
|
+
...(options.agentDir === undefined ? {} : { agentDir: options.agentDir }),
|
|
55
|
+
sessionManager,
|
|
56
|
+
...(options.modelRuntime === undefined ? {} : { modelRuntime: options.modelRuntime }),
|
|
57
|
+
...(options.streamFn === undefined ? {} : { streamFn: options.streamFn }),
|
|
58
|
+
...(model === undefined ? {} : { model }),
|
|
59
|
+
...(thinkingLevel === undefined ? {} : { thinkingLevel }),
|
|
60
|
+
...(options.settingsManager === undefined ? {} : { settingsManager: options.settingsManager }),
|
|
61
|
+
...(options.credentials === undefined ? {} : { credentials: options.credentials }),
|
|
62
|
+
...(options.hostLogger === undefined ? {} : { hostLogger: options.hostLogger }),
|
|
63
|
+
...(options.agentTaskResults === undefined ? {} : { agentTaskResults: options.agentTaskResults }),
|
|
64
|
+
...(options.subagentPoolFromSelfInvocation === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: { subagentPoolFromSelfInvocation: options.subagentPoolFromSelfInvocation }),
|
|
67
|
+
...(options.createAgentTaskAdapter === undefined
|
|
68
|
+
? {}
|
|
69
|
+
: {
|
|
70
|
+
agentTaskAdapter: options.createAgentTaskAdapter({ sessionId: sessionManager.getSessionId() }),
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
73
|
+
return session;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Enforces the opt-in workspace boundary for `create`. Both the root and the
|
|
77
|
+
* final cwd are resolved first; the cwd is inside when it is the root itself
|
|
78
|
+
* or a descendant. On win32 `path.relative` compares case-insensitively by
|
|
79
|
+
* platform default and yields an absolute path across drive letters, which
|
|
80
|
+
* fails the containment check naturally. Throws a plain `Error` (matching the
|
|
81
|
+
* existing session-source convention) so the server boundary maps it to a
|
|
82
|
+
* request-class protocol error with the original message.
|
|
83
|
+
*/
|
|
84
|
+
function assertWithinWorkspaceRoots(cwd, roots) {
|
|
85
|
+
if (roots === undefined)
|
|
86
|
+
return;
|
|
87
|
+
const resolvedCwd = resolve(cwd);
|
|
88
|
+
for (const root of roots) {
|
|
89
|
+
const resolvedRoot = resolve(root);
|
|
90
|
+
const rel = relative(resolvedRoot, resolvedCwd);
|
|
91
|
+
// `rel === ""` means the cwd is the root itself, which is allowed. The
|
|
92
|
+
// escape check is segment-precise so in-root entries that merely start
|
|
93
|
+
// with ".." (e.g. `..foo`) are not mistaken for parent escapes.
|
|
94
|
+
if (rel === "" || (!isAbsolute(rel) && rel !== ".." && !rel.startsWith(`..${sep}`)))
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
throw new Error(`cwd "${resolvedCwd}" is outside the configured workspace roots: [${roots.map((root) => resolve(root)).join(", ")}]`);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* `create` targets a fresh session workspace, so a missing or non-directory
|
|
101
|
+
* cwd must fail the create with a clear, path-bearing error instead of
|
|
102
|
+
* producing a session whose tools fail on their first relative access.
|
|
103
|
+
* `open` re-opens sessions already recorded on disk and is not gated. The
|
|
104
|
+
* plain `Error` matches the session-source convention; the server boundary
|
|
105
|
+
* maps it to an `invalid_request` protocol error with the original message.
|
|
106
|
+
*/
|
|
107
|
+
async function assertCwdIsDirectory(cwd) {
|
|
108
|
+
const stats = await stat(cwd).catch((error) => {
|
|
109
|
+
if (error.code === "ENOENT")
|
|
110
|
+
return undefined;
|
|
111
|
+
throw error;
|
|
112
|
+
});
|
|
113
|
+
if (stats === undefined) {
|
|
114
|
+
throw new Error(`Cannot create session: cwd does not exist: ${cwd}`);
|
|
115
|
+
}
|
|
116
|
+
if (!stats.isDirectory()) {
|
|
117
|
+
throw new Error(`Cannot create session: cwd is not a directory: ${cwd}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Creates a production `CodingAgentServerSessionSource` backed by on-disk
|
|
122
|
+
* `.jsonl` session files in `sessionsDir`.
|
|
123
|
+
*/
|
|
124
|
+
export function createFileSessionSource(options) {
|
|
125
|
+
const sessionsDir = resolve(options.sessionsDir);
|
|
126
|
+
return {
|
|
127
|
+
async list() {
|
|
128
|
+
const infos = await SessionManager.listAll(sessionsDir);
|
|
129
|
+
return infos.map(infoToDescriptor);
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* Creates a session in the descriptor cwd (or the host-level fallback).
|
|
133
|
+
* The final cwd must be inside the configured workspace roots (when
|
|
134
|
+
* provided) and must exist as a directory; both checks run before any
|
|
135
|
+
* session file is written, so a rejected create leaves the disk
|
|
136
|
+
* untouched.
|
|
137
|
+
*/
|
|
138
|
+
async create(descriptor) {
|
|
139
|
+
// The server boundary rejects cwd-less creates; a direct host call
|
|
140
|
+
// falls back to the host-level cwd like legacy opens.
|
|
141
|
+
const cwd = descriptor.cwd === undefined || descriptor.cwd === "" ? options.cwd : descriptor.cwd;
|
|
142
|
+
assertWithinWorkspaceRoots(cwd, options.workspaceRoots);
|
|
143
|
+
await assertCwdIsDirectory(cwd);
|
|
144
|
+
const sm = SessionManager.create(cwd, sessionsDir, {
|
|
145
|
+
id: descriptor.id,
|
|
146
|
+
// Creation-time profile lock, persisted into the session header so
|
|
147
|
+
// it survives restarts (read back via `list`/`open` descriptors).
|
|
148
|
+
...(descriptor.profileId === undefined ? {} : { profileId: descriptor.profileId }),
|
|
149
|
+
...(descriptor.profileVersion === undefined ? {} : { profileVersion: descriptor.profileVersion }),
|
|
150
|
+
}, options.storage);
|
|
151
|
+
return buildSession(sm, options, cwd, {
|
|
152
|
+
...(descriptor.model === undefined ? {} : { model: descriptor.model }),
|
|
153
|
+
...(descriptor.thinkingLevel === undefined ? {} : { thinkingLevel: descriptor.thinkingLevel }),
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
async open(descriptor) {
|
|
157
|
+
// Re-scan to locate the session file path for the given id.
|
|
158
|
+
const infos = await SessionManager.listAll(sessionsDir);
|
|
159
|
+
const match = infos.find((info) => info.id === descriptor.id);
|
|
160
|
+
if (!match) {
|
|
161
|
+
throw new Error(`Session not found: ${descriptor.id}`);
|
|
162
|
+
}
|
|
163
|
+
// The session file records the cwd it ran in; legacy files may have
|
|
164
|
+
// none (empty string), which falls back to the host-level cwd. The
|
|
165
|
+
// override keeps the SessionManager cwd consistent with the build
|
|
166
|
+
// cwd for consumers of `getCwd()` (extension surface, snapshot).
|
|
167
|
+
const cwd = match.cwd === "" ? options.cwd : match.cwd;
|
|
168
|
+
const sm = SessionManager.open(match.path, sessionsDir, cwd, options.storage);
|
|
169
|
+
return buildSession(sm, options, cwd);
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=session-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-source.js","sourceRoot":"","sources":["../../src/remote/session-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAS/D,OAAO,EAAE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,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;YACvD,MAAM,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC9E,OAAO,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QAAA,CACtC;KACD,CAAC;AAAA,CACF","sourcesContent":["/**\n * Production `CodingAgentServerSessionSource` backed by the `SessionManager`\n * file-based persistence and `createAgentSession` from the SDK.\n *\n * Owns the mapping between server descriptors and on-disk `.jsonl` session\n * files. Each `open()` call reconstructs a full `AgentSession` whose messages\n * are rebuilt from the JSONL entries, producing a transcript and durable\n * revision identical to an in-process session.\n *\n * Honest boundary: model runtime, auth, tool suite, and extensions are resolved\n * at `open`/`create` time from the host-provided `agentDir` and the session's\n * own working directory (`descriptor.cwd` at create; the recorded cwd at open,\n * with the host-level fallback for legacy cwd-less files).\n * The source does not cache or pool sessions.\n */\n\nimport { stat } from \"node:fs/promises\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport type { StreamFn } from \"@agent-forge/agent-core\";\nimport type { CredentialStore } from \"@agent-forge/ai\";\nimport type { Api, Model } from \"@agent-forge/ai/compat\";\nimport type { ThinkingLevel } from \"@agent-forge/protocol\";\nimport type { AgentSession } from \"../core/agent-session.ts\";\nimport type { AgentTaskAdapter } from \"../core/extensions/public-api.ts\";\nimport type { HostLogger } from \"../core/logger.ts\";\nimport type { ModelRuntime } from \"../core/model-runtime.ts\";\nimport { createAgentSession } from \"../core/sdk.ts\";\nimport { type SessionInfo, SessionManager } from \"../core/session-manager.ts\";\nimport type { SessionStorageProvider } from \"../core/session-storage.ts\";\nimport type { SettingsManager } from \"../core/settings-manager.ts\";\nimport type { DurableServiceV1 } from \"../durable/durable-service.ts\";\nimport type { CodingAgentServerSessionSource, CodingAgentSessionDescriptor } from \"./server-assembly.ts\";\n\n/** Configuration for a file-backed session source. */\nexport interface FileSessionSourceOptions {\n\t/** Absolute path to the sessions directory containing `.jsonl` files. */\n\treadonly sessionsDir: string;\n\t/**\n\t * Fallback working directory. Opens of legacy session files that recorded\n\t * no cwd (`SessionInfo.cwd` is `\"\"`) run here, and so do creates whose\n\t * descriptor carries no cwd. Sessions always prefer their own cwd:\n\t * `descriptor.cwd` at create, the recorded cwd at open.\n\t */\n\treadonly cwd: string;\n\t/** Absolute path to the agent config directory (defaults to `~/.agent-forge/agent`). */\n\treadonly agentDir?: string;\n\t/** Optional pre-built model runtime; created from `agentDir` when omitted. */\n\treadonly modelRuntime?: ModelRuntime;\n\t/** Optional explicit stream function (faux providers in tests). */\n\treadonly streamFn?: StreamFn;\n\t/** Optional explicit model to attach on creation. */\n\treadonly model?: Model<Api>;\n\t/** Optional thinking level for new sessions. */\n\treadonly thinkingLevel?: ThinkingLevel;\n\t/** Optional pre-built settings manager. */\n\treadonly settingsManager?: SettingsManager;\n\t/** Opt-in workspace boundary: when provided, `create` rejects descriptors whose resolved cwd is not inside one of these roots. The check is purely lexical (`path.resolve` normalization); symlinks are not resolved. Omit for unrestricted local-trust operation; `open` is not gated (it reopens sessions already on disk). */\n\treadonly workspaceRoots?: readonly string[];\n\t/**\n\t * Storage seam for the session records (D-067 phase 1). Defaults to the\n\t * local JSONL file protocol; hosts may inject an alternative provider and\n\t * every session this source builds uses it.\n\t */\n\treadonly storage?: SessionStorageProvider;\n\t/**\n\t * Credential storage for the model runtime each session builds (D-067\n\t * phase 1): forwarded to the default `ModelRuntime` construction. Ignored\n\t * when `modelRuntime` is supplied explicitly. Defaults to the file at\n\t * `<agentDir>/auth.json`.\n\t */\n\treadonly credentials?: CredentialStore;\n\t/**\n\t * Host-process logger forwarded into every session this source builds\n\t * (D-067 phase 1 seam: serve sessions previously had no logger at all —\n\t * the SDK treats an absent logger as an explicit no-op).\n\t */\n\treadonly hostLogger?: HostLogger;\n\t/**\n\t * Durable replay channel for agent task terminal outcomes, forwarded into\n\t * every session this source builds (agent-result-replay-v1). The host owns\n\t * the store and the writer claim; the writerId must be the same one the\n\t * server assembly claims so a single writer serves the whole process.\n\t */\n\treadonly agentTaskResults?: {\n\t\treadonly store: DurableServiceV1;\n\t\treadonly writerId: string;\n\t};\n\t/**\n\t * 本进程自身入口可信(承载退役切片 2):转发给每个会话的装配域,delegate 在未\n\t * 显式配置池且 self-invocation 可解析时自动池化——serve 装配用它给会话一个\n\t * 委派载体。SDK 嵌入方不传则委派面不注册。\n\t */\n\treadonly subagentPoolFromSelfInvocation?: boolean;\n\t/**\n\t * Per-session agent task carrier factory(承载退役切片 2):source 装配的每个\n\t * 会话没有默认子任务 creator;SDK 嵌入方可用它按会话绑定父身份注入 in-process\n\t * 或池化 adapter(生产 serve 走 `subagentPoolFromSelfInvocation`)。\n\t */\n\treadonly createAgentTaskAdapter?: (parent: { readonly sessionId: string }) => AgentTaskAdapter;\n}\n\n/**\n * Maps a `SessionInfo` from `SessionManager.listAll` to a\n * `CodingAgentSessionDescriptor` visible to the server boundary.\n */\nfunction infoToDescriptor(info: SessionInfo): CodingAgentSessionDescriptor {\n\treturn {\n\t\tid: info.id,\n\t\t...(info.name === undefined ? {} : { name: info.name }),\n\t\t// Legacy session files recorded no cwd (empty string); omit the field\n\t\t// like `name` instead of leaking a protocol-invalid empty cwd.\n\t\t...(info.cwd === \"\" ? {} : { cwd: info.cwd }),\n\t\t// Profile lock recorded in the header at creation; omit the keys when\n\t\t// absent so descriptors keep the protocol's optional-field semantics\n\t\t// and reopened-session snapshots echo exactly what was persisted.\n\t\t...(info.profileId === undefined ? {} : { profileId: info.profileId }),\n\t\t...(info.profileVersion === undefined ? {} : { profileVersion: info.profileVersion }),\n\t\tcreatedAt: info.created.getTime(),\n\t\tupdatedAt: info.modified.getTime(),\n\t};\n}\n\n/**\n * Shared logic to reconstruct an `AgentSession` from an existing\n * `SessionManager` instance (used by both `create` and `open`). `cwd` is the\n * session's own working directory — the one the descriptor recorded at create\n * (or the recorded cwd at open) — and drives tool ctx, resource discovery, and\n * the agents.md chain for this session regardless of the host-level fallback.\n * Optional `overrides` carry per-session descriptor values; they win over the\n * host-level `options` defaults.\n */\nasync function buildSession(\n\tsessionManager: SessionManager,\n\toptions: FileSessionSourceOptions,\n\tcwd: string,\n\toverrides?: { readonly model?: Model<Api>; readonly thinkingLevel?: ThinkingLevel },\n): Promise<AgentSession> {\n\tconst model = overrides?.model ?? options.model;\n\tconst thinkingLevel = overrides?.thinkingLevel ?? options.thinkingLevel;\n\tconst { session } = await createAgentSession({\n\t\tcwd,\n\t\t...(options.agentDir === undefined ? {} : { agentDir: options.agentDir }),\n\t\tsessionManager,\n\t\t...(options.modelRuntime === undefined ? {} : { modelRuntime: options.modelRuntime }),\n\t\t...(options.streamFn === undefined ? {} : { streamFn: options.streamFn }),\n\t\t...(model === undefined ? {} : { model }),\n\t\t...(thinkingLevel === undefined ? {} : { thinkingLevel }),\n\t\t...(options.settingsManager === undefined ? {} : { settingsManager: options.settingsManager }),\n\t\t...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n\t\t...(options.hostLogger === undefined ? {} : { hostLogger: options.hostLogger }),\n\t\t...(options.agentTaskResults === undefined ? {} : { agentTaskResults: options.agentTaskResults }),\n\t\t...(options.subagentPoolFromSelfInvocation === undefined\n\t\t\t? {}\n\t\t\t: { subagentPoolFromSelfInvocation: options.subagentPoolFromSelfInvocation }),\n\t\t...(options.createAgentTaskAdapter === undefined\n\t\t\t? {}\n\t\t\t: {\n\t\t\t\t\tagentTaskAdapter: options.createAgentTaskAdapter({ sessionId: sessionManager.getSessionId() }),\n\t\t\t\t}),\n\t});\n\treturn session;\n}\n\n/**\n * Enforces the opt-in workspace boundary for `create`. Both the root and the\n * final cwd are resolved first; the cwd is inside when it is the root itself\n * or a descendant. On win32 `path.relative` compares case-insensitively by\n * platform default and yields an absolute path across drive letters, which\n * fails the containment check naturally. Throws a plain `Error` (matching the\n * existing session-source convention) so the server boundary maps it to a\n * request-class protocol error with the original message.\n */\nfunction assertWithinWorkspaceRoots(cwd: string, roots: readonly string[] | undefined): void {\n\tif (roots === undefined) return;\n\tconst resolvedCwd = resolve(cwd);\n\tfor (const root of roots) {\n\t\tconst resolvedRoot = resolve(root);\n\t\tconst rel = relative(resolvedRoot, resolvedCwd);\n\t\t// `rel === \"\"` means the cwd is the root itself, which is allowed. The\n\t\t// escape check is segment-precise so in-root entries that merely start\n\t\t// with \"..\" (e.g. `..foo`) are not mistaken for parent escapes.\n\t\tif (rel === \"\" || (!isAbsolute(rel) && rel !== \"..\" && !rel.startsWith(`..${sep}`))) return;\n\t}\n\tthrow new Error(\n\t\t`cwd \"${resolvedCwd}\" is outside the configured workspace roots: [${roots.map((root) => resolve(root)).join(\", \")}]`,\n\t);\n}\n\n/**\n * `create` targets a fresh session workspace, so a missing or non-directory\n * cwd must fail the create with a clear, path-bearing error instead of\n * producing a session whose tools fail on their first relative access.\n * `open` re-opens sessions already recorded on disk and is not gated. The\n * plain `Error` matches the session-source convention; the server boundary\n * maps it to an `invalid_request` protocol error with the original message.\n */\nasync function assertCwdIsDirectory(cwd: string): Promise<void> {\n\tconst stats = await stat(cwd).catch((error: unknown) => {\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n\t\tthrow error;\n\t});\n\tif (stats === undefined) {\n\t\tthrow new Error(`Cannot create session: cwd does not exist: ${cwd}`);\n\t}\n\tif (!stats.isDirectory()) {\n\t\tthrow new Error(`Cannot create session: cwd is not a directory: ${cwd}`);\n\t}\n}\n\n/**\n * Creates a production `CodingAgentServerSessionSource` backed by on-disk\n * `.jsonl` session files in `sessionsDir`.\n */\nexport function createFileSessionSource(options: FileSessionSourceOptions): CodingAgentServerSessionSource {\n\tconst sessionsDir = resolve(options.sessionsDir);\n\n\treturn {\n\t\tasync list(): Promise<readonly CodingAgentSessionDescriptor[]> {\n\t\t\tconst infos = await SessionManager.listAll(sessionsDir);\n\t\t\treturn infos.map(infoToDescriptor);\n\t\t},\n\n\t\t/**\n\t\t * Creates a session in the descriptor cwd (or the host-level fallback).\n\t\t * The final cwd must be inside the configured workspace roots (when\n\t\t * provided) and must exist as a directory; both checks run before any\n\t\t * session file is written, so a rejected create leaves the disk\n\t\t * untouched.\n\t\t */\n\t\tasync create(descriptor: CodingAgentSessionDescriptor): Promise<AgentSession> {\n\t\t\t// The server boundary rejects cwd-less creates; a direct host call\n\t\t\t// falls back to the host-level cwd like legacy opens.\n\t\t\tconst cwd = descriptor.cwd === undefined || descriptor.cwd === \"\" ? options.cwd : descriptor.cwd;\n\t\t\tassertWithinWorkspaceRoots(cwd, options.workspaceRoots);\n\t\t\tawait assertCwdIsDirectory(cwd);\n\t\t\tconst sm = SessionManager.create(\n\t\t\t\tcwd,\n\t\t\t\tsessionsDir,\n\t\t\t\t{\n\t\t\t\t\tid: descriptor.id,\n\t\t\t\t\t// Creation-time profile lock, persisted into the session header so\n\t\t\t\t\t// it survives restarts (read back via `list`/`open` descriptors).\n\t\t\t\t\t...(descriptor.profileId === undefined ? {} : { profileId: descriptor.profileId }),\n\t\t\t\t\t...(descriptor.profileVersion === undefined ? {} : { profileVersion: descriptor.profileVersion }),\n\t\t\t\t},\n\t\t\t\toptions.storage,\n\t\t\t);\n\t\t\treturn buildSession(sm, options, cwd, {\n\t\t\t\t...(descriptor.model === undefined ? {} : { model: descriptor.model }),\n\t\t\t\t...(descriptor.thinkingLevel === undefined ? {} : { thinkingLevel: descriptor.thinkingLevel }),\n\t\t\t});\n\t\t},\n\n\t\tasync open(descriptor: CodingAgentSessionDescriptor): Promise<AgentSession> {\n\t\t\t// Re-scan to locate the session file path for the given id.\n\t\t\tconst infos = await SessionManager.listAll(sessionsDir);\n\t\t\tconst match = infos.find((info) => info.id === descriptor.id);\n\t\t\tif (!match) {\n\t\t\t\tthrow new Error(`Session not found: ${descriptor.id}`);\n\t\t\t}\n\t\t\t// The session file records the cwd it ran in; legacy files may have\n\t\t\t// none (empty string), which falls back to the host-level cwd. The\n\t\t\t// override keeps the SessionManager cwd consistent with the build\n\t\t\t// cwd for consumers of `getCwd()` (extension surface, snapshot).\n\t\t\tconst cwd = match.cwd === \"\" ? options.cwd : match.cwd;\n\t\t\tconst sm = SessionManager.open(match.path, sessionsDir, cwd, options.storage);\n\t\t\treturn buildSession(sm, options, cwd);\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-entry.d.ts","sourceRoot":"","sources":["../src/rpc-entry.ts"],"names":[],"mappings":"","sourcesContent":["#!/usr/bin/env node\nimport { APP_NAME } from \"./config.ts\";\nimport { configureHttpDispatcher } from \"./core/http-dispatcher.ts\";\nimport { main } from \"./main.ts\";\n\nprocess.title = `${APP_NAME}-rpc`;\nprocess.env.AGENT_FORGE = \"true\";\nprocess.env.AI_AGENT = \"agent-forge\";\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nconfigureHttpDispatcher();\n\nmain([\"--mode\", \"rpc\", ...process.argv.slice(2)]);\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { APP_NAME } from "./config.js";
|
|
3
|
+
import { configureHttpDispatcher } from "./core/http-dispatcher.js";
|
|
4
|
+
import { main } from "./main.js";
|
|
5
|
+
process.title = `${APP_NAME}-rpc`;
|
|
6
|
+
process.env.AGENT_FORGE = "true";
|
|
7
|
+
process.env.AI_AGENT = "agent-forge";
|
|
8
|
+
process.emitWarning = (() => { });
|
|
9
|
+
configureHttpDispatcher();
|
|
10
|
+
main(["--mode", "rpc", ...process.argv.slice(2)]);
|
|
11
|
+
//# sourceMappingURL=rpc-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc-entry.js","sourceRoot":"","sources":["../src/rpc-entry.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,CAAC,KAAK,GAAG,GAAG,QAAQ,MAAM,CAAC;AAClC,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC;AACjC,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;AACrC,OAAO,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,CAAC,EAAC,CAAC,CAA+B,CAAC;AAE/D,uBAAuB,EAAE,CAAC;AAE1B,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { APP_NAME } from \"./config.ts\";\nimport { configureHttpDispatcher } from \"./core/http-dispatcher.ts\";\nimport { main } from \"./main.ts\";\n\nprocess.title = `${APP_NAME}-rpc`;\nprocess.env.AGENT_FORGE = \"true\";\nprocess.env.AI_AGENT = \"agent-forge\";\nprocess.emitWarning = (() => {}) as typeof process.emitWarning;\n\nconfigureHttpDispatcher();\n\nmain([\"--mode\", \"rpc\", ...process.argv.slice(2)]);\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AgentHarness, type AgentHarnessOptions, type ExecutionEnv, type HarnessTool } from "@agent-forge/agent-core";
|
|
2
|
+
import { type BuildSystemPromptOptions } from "../core/system-prompt.ts";
|
|
3
|
+
export interface CodingAgentHarnessTool extends HarnessTool {
|
|
4
|
+
promptSnippet?: string;
|
|
5
|
+
promptGuidelines?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export interface CreateCodingAgentHarnessOptions extends Omit<AgentHarnessOptions, "toolContext" | "tools"> {
|
|
8
|
+
env: ExecutionEnv;
|
|
9
|
+
bashCommandPrefix?: string;
|
|
10
|
+
/** Path to the JSONL session file exposed to default bash commands as AGENT_FORGE_SESSION_FILE. */
|
|
11
|
+
sessionFile?: string;
|
|
12
|
+
tools?: CodingAgentHarnessTool[];
|
|
13
|
+
systemPromptOptions?: Omit<BuildSystemPromptOptions, "cwd" | "promptGuidelines" | "selectedTools" | "toolSnippets">;
|
|
14
|
+
}
|
|
15
|
+
export interface BuildCodingAgentHarnessSystemPromptOptions {
|
|
16
|
+
cwd: string;
|
|
17
|
+
tools: readonly CodingAgentHarnessTool[];
|
|
18
|
+
activeToolNames: readonly string[];
|
|
19
|
+
systemPromptOptions?: CreateCodingAgentHarnessOptions["systemPromptOptions"];
|
|
20
|
+
}
|
|
21
|
+
export declare function buildCodingAgentHarnessSystemPrompt(options: BuildCodingAgentHarnessSystemPromptOptions): string;
|
|
22
|
+
export declare function createCodingAgentHarness(options: CreateCodingAgentHarnessOptions): Promise<{
|
|
23
|
+
harness: AgentHarness;
|
|
24
|
+
suspended: import("@agent-forge/agent-core").SuspendedOperation[];
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=create-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-harness.d.ts","sourceRoot":"","sources":["../../src/server/create-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EACZ,KAAK,mBAAmB,EAMxB,KAAK,YAAY,EAEjB,KAAK,WAAW,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,wBAAwB,EAAqB,MAAM,0BAA0B,CAAC;AAM5F,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAgBD,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,mBAAmB,EAAE,aAAa,GAAG,OAAO,CAAC;IAC1G,GAAG,EAAE,YAAY,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACjC,mBAAmB,CAAC,EAAE,IAAI,CAAC,wBAAwB,EAAE,KAAK,GAAG,kBAAkB,GAAG,eAAe,GAAG,cAAc,CAAC,CAAC;CACpH;AAED,MAAM,WAAW,0CAA0C;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,+BAA+B,CAAC,qBAAqB,CAAC,CAAC;CAC7E;AAED,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,0CAA0C,GAAG,MAAM,CAsB/G;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,+BAA+B;;;GAkFtF","sourcesContent":["import {\n\tAgentHarness,\n\ttype AgentHarnessOptions,\n\ttype AgentHarnessTool,\n\tcreateBashTool,\n\tcreateEditTool,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype ExecutionEnv,\n\ttype ExecutionToolContext,\n\ttype HarnessTool,\n} from \"@agent-forge/agent-core\";\nimport type { Static, TSchema } from \"typebox\";\nimport { type BuildSystemPromptOptions, buildSystemPrompt } from \"../core/system-prompt.ts\";\nimport { bashToolSystemPromptContribution } from \"../core/tools/bash.ts\";\nimport { editToolSystemPromptContribution } from \"../core/tools/edit.ts\";\nimport { readToolSystemPromptContribution } from \"../core/tools/read.ts\";\nimport { writeToolSystemPromptContribution } from \"../core/tools/write.ts\";\n\nexport interface CodingAgentHarnessTool extends HarnessTool {\n\tpromptSnippet?: string;\n\tpromptGuidelines?: readonly string[];\n}\n\nfunction createCodingAgentHarnessTool<TParameters extends TSchema, TDetails>(\n\ttool: AgentHarnessTool<ExecutionToolContext, TParameters, TDetails>,\n\tcontext: ExecutionToolContext,\n\tprompt: Required<Pick<CodingAgentHarnessTool, \"promptSnippet\" | \"promptGuidelines\">>,\n): CodingAgentHarnessTool {\n\treturn {\n\t\t...tool,\n\t\t...prompt,\n\t\tconstrainedSampling: { type: \"json_schema\", strict: \"prefer\" },\n\t\texecute: (toolCallId, params, signal, onUpdate) =>\n\t\t\ttool.execute(toolCallId, params as Static<TParameters>, signal, onUpdate, context),\n\t};\n}\n\nexport interface CreateCodingAgentHarnessOptions extends Omit<AgentHarnessOptions, \"toolContext\" | \"tools\"> {\n\tenv: ExecutionEnv;\n\tbashCommandPrefix?: string;\n\t/** Path to the JSONL session file exposed to default bash commands as AGENT_FORGE_SESSION_FILE. */\n\tsessionFile?: string;\n\ttools?: CodingAgentHarnessTool[];\n\tsystemPromptOptions?: Omit<BuildSystemPromptOptions, \"cwd\" | \"promptGuidelines\" | \"selectedTools\" | \"toolSnippets\">;\n}\n\nexport interface BuildCodingAgentHarnessSystemPromptOptions {\n\tcwd: string;\n\ttools: readonly CodingAgentHarnessTool[];\n\tactiveToolNames: readonly string[];\n\tsystemPromptOptions?: CreateCodingAgentHarnessOptions[\"systemPromptOptions\"];\n}\n\nexport function buildCodingAgentHarnessSystemPrompt(options: BuildCodingAgentHarnessSystemPromptOptions): string {\n\tconst activeTools = options.activeToolNames.flatMap((name) => {\n\t\tconst tool = options.tools.find((candidate) => candidate.name === name);\n\t\treturn tool ? [tool] : [];\n\t});\n\tconst toolSnippets = Object.fromEntries(\n\t\tactiveTools.flatMap((tool) => {\n\t\t\tconst promptSnippet = tool.promptSnippet\n\t\t\t\t?.replace(/[\\r\\n]+/g, \" \")\n\t\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t\t.trim();\n\t\t\treturn promptSnippet ? [[tool.name, promptSnippet]] : [];\n\t\t}),\n\t);\n\tconst promptGuidelines = activeTools.flatMap((tool) => tool.promptGuidelines ?? []);\n\treturn buildSystemPrompt({\n\t\t...options.systemPromptOptions,\n\t\tcwd: options.cwd,\n\t\tselectedTools: activeTools.map((tool) => tool.name),\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t});\n}\n\nexport async function createCodingAgentHarness(options: CreateCodingAgentHarnessOptions) {\n\tconst {\n\t\tenv,\n\t\tbashCommandPrefix,\n\t\tsessionFile,\n\t\tsystemPromptOptions,\n\t\ttools: providedTools,\n\t\tactiveToolNames: providedActiveToolNames,\n\t\tsystemPrompt: providedSystemPrompt,\n\t\t...harnessOptions\n\t} = options;\n\tlet harness: AgentHarness | undefined;\n\tconst getHarness = (): AgentHarness => {\n\t\t// v8 ignore next -- harness 在 create 返回后同步赋值,回调只会在其后执行\n\t\tif (!harness) throw new Error(\"Coding-agent Harness callback ran before Harness initialization\");\n\t\treturn harness;\n\t};\n\tlet tools = providedTools;\n\tif (tools === undefined) {\n\t\tconst metadata = await options.session.getMetadata();\n\t\tconst toolContext = { env } satisfies ExecutionToolContext;\n\t\ttools = [\n\t\t\tcreateCodingAgentHarnessTool(createReadTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: readToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: readToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t\tcreateCodingAgentHarnessTool(\n\t\t\t\tcreateBashTool<ExecutionToolContext>({\n\t\t\t\t\tcommandPrefix: bashCommandPrefix,\n\t\t\t\t\tprepare: async (execution) => {\n\t\t\t\t\t\tconst currentHarness = getHarness();\n\t\t\t\t\t\tconst [model, thinkingLevel] = await Promise.all([\n\t\t\t\t\t\t\tcurrentHarness.getModel(),\n\t\t\t\t\t\t\tcurrentHarness.getThinkingLevel(),\n\t\t\t\t\t\t]);\n\t\t\t\t\t\texecution.env.AGENT_FORGE_SESSION_ID = metadata.id;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_SESSION_FILE = sessionFile ?? \"\";\n\t\t\t\t\t\texecution.env.AGENT_FORGE_PROVIDER = model.provider;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_MODEL = model.id;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_REASONING_LEVEL = thinkingLevel;\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\ttoolContext,\n\t\t\t\t{\n\t\t\t\t\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\t\t\t\t\tpromptGuidelines: bashToolSystemPromptContribution.guidelines,\n\t\t\t\t},\n\t\t\t),\n\t\t\tcreateCodingAgentHarnessTool(createEditTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: editToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: editToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t\tcreateCodingAgentHarnessTool(createWriteTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: writeToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: writeToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t];\n\t}\n\tconst activeToolNames = [...(providedActiveToolNames ?? tools.map((tool) => tool.name))];\n\tconst systemPrompt =\n\t\tprovidedSystemPrompt ??\n\t\t(async () => {\n\t\t\tconst currentHarness = getHarness();\n\t\t\tconst [currentTools, currentActiveToolNames] = await Promise.all([\n\t\t\t\tcurrentHarness.getTools(),\n\t\t\t\tcurrentHarness.getActiveTools(),\n\t\t\t]);\n\t\t\treturn buildCodingAgentHarnessSystemPrompt({\n\t\t\t\tcwd: env.cwd,\n\t\t\t\ttools: currentTools,\n\t\t\t\tactiveToolNames: currentActiveToolNames,\n\t\t\t\tsystemPromptOptions,\n\t\t\t});\n\t\t});\n\tconst created = await AgentHarness.create({\n\t\t...harnessOptions,\n\t\ttools,\n\t\tactiveToolNames,\n\t\tsystemPrompt,\n\t});\n\tharness = created.harness;\n\treturn created;\n}\n"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { AgentHarness, createBashTool, createEditTool, createReadTool, createWriteTool, } from "@agent-forge/agent-core";
|
|
2
|
+
import { buildSystemPrompt } from "../core/system-prompt.js";
|
|
3
|
+
import { bashToolSystemPromptContribution } from "../core/tools/bash.js";
|
|
4
|
+
import { editToolSystemPromptContribution } from "../core/tools/edit.js";
|
|
5
|
+
import { readToolSystemPromptContribution } from "../core/tools/read.js";
|
|
6
|
+
import { writeToolSystemPromptContribution } from "../core/tools/write.js";
|
|
7
|
+
function createCodingAgentHarnessTool(tool, context, prompt) {
|
|
8
|
+
return {
|
|
9
|
+
...tool,
|
|
10
|
+
...prompt,
|
|
11
|
+
constrainedSampling: { type: "json_schema", strict: "prefer" },
|
|
12
|
+
execute: (toolCallId, params, signal, onUpdate) => tool.execute(toolCallId, params, signal, onUpdate, context),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function buildCodingAgentHarnessSystemPrompt(options) {
|
|
16
|
+
const activeTools = options.activeToolNames.flatMap((name) => {
|
|
17
|
+
const tool = options.tools.find((candidate) => candidate.name === name);
|
|
18
|
+
return tool ? [tool] : [];
|
|
19
|
+
});
|
|
20
|
+
const toolSnippets = Object.fromEntries(activeTools.flatMap((tool) => {
|
|
21
|
+
const promptSnippet = tool.promptSnippet
|
|
22
|
+
?.replace(/[\r\n]+/g, " ")
|
|
23
|
+
.replace(/\s+/g, " ")
|
|
24
|
+
.trim();
|
|
25
|
+
return promptSnippet ? [[tool.name, promptSnippet]] : [];
|
|
26
|
+
}));
|
|
27
|
+
const promptGuidelines = activeTools.flatMap((tool) => tool.promptGuidelines ?? []);
|
|
28
|
+
return buildSystemPrompt({
|
|
29
|
+
...options.systemPromptOptions,
|
|
30
|
+
cwd: options.cwd,
|
|
31
|
+
selectedTools: activeTools.map((tool) => tool.name),
|
|
32
|
+
toolSnippets,
|
|
33
|
+
promptGuidelines,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export async function createCodingAgentHarness(options) {
|
|
37
|
+
const { env, bashCommandPrefix, sessionFile, systemPromptOptions, tools: providedTools, activeToolNames: providedActiveToolNames, systemPrompt: providedSystemPrompt, ...harnessOptions } = options;
|
|
38
|
+
let harness;
|
|
39
|
+
const getHarness = () => {
|
|
40
|
+
// v8 ignore next -- harness 在 create 返回后同步赋值,回调只会在其后执行
|
|
41
|
+
if (!harness)
|
|
42
|
+
throw new Error("Coding-agent Harness callback ran before Harness initialization");
|
|
43
|
+
return harness;
|
|
44
|
+
};
|
|
45
|
+
let tools = providedTools;
|
|
46
|
+
if (tools === undefined) {
|
|
47
|
+
const metadata = await options.session.getMetadata();
|
|
48
|
+
const toolContext = { env };
|
|
49
|
+
tools = [
|
|
50
|
+
createCodingAgentHarnessTool(createReadTool(), toolContext, {
|
|
51
|
+
promptSnippet: readToolSystemPromptContribution.snippet,
|
|
52
|
+
promptGuidelines: readToolSystemPromptContribution.guidelines,
|
|
53
|
+
}),
|
|
54
|
+
createCodingAgentHarnessTool(createBashTool({
|
|
55
|
+
commandPrefix: bashCommandPrefix,
|
|
56
|
+
prepare: async (execution) => {
|
|
57
|
+
const currentHarness = getHarness();
|
|
58
|
+
const [model, thinkingLevel] = await Promise.all([
|
|
59
|
+
currentHarness.getModel(),
|
|
60
|
+
currentHarness.getThinkingLevel(),
|
|
61
|
+
]);
|
|
62
|
+
execution.env.AGENT_FORGE_SESSION_ID = metadata.id;
|
|
63
|
+
execution.env.AGENT_FORGE_SESSION_FILE = sessionFile ?? "";
|
|
64
|
+
execution.env.AGENT_FORGE_PROVIDER = model.provider;
|
|
65
|
+
execution.env.AGENT_FORGE_MODEL = model.id;
|
|
66
|
+
execution.env.AGENT_FORGE_REASONING_LEVEL = thinkingLevel;
|
|
67
|
+
},
|
|
68
|
+
}), toolContext, {
|
|
69
|
+
promptSnippet: bashToolSystemPromptContribution.snippet,
|
|
70
|
+
promptGuidelines: bashToolSystemPromptContribution.guidelines,
|
|
71
|
+
}),
|
|
72
|
+
createCodingAgentHarnessTool(createEditTool(), toolContext, {
|
|
73
|
+
promptSnippet: editToolSystemPromptContribution.snippet,
|
|
74
|
+
promptGuidelines: editToolSystemPromptContribution.guidelines,
|
|
75
|
+
}),
|
|
76
|
+
createCodingAgentHarnessTool(createWriteTool(), toolContext, {
|
|
77
|
+
promptSnippet: writeToolSystemPromptContribution.snippet,
|
|
78
|
+
promptGuidelines: writeToolSystemPromptContribution.guidelines,
|
|
79
|
+
}),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
const activeToolNames = [...(providedActiveToolNames ?? tools.map((tool) => tool.name))];
|
|
83
|
+
const systemPrompt = providedSystemPrompt ??
|
|
84
|
+
(async () => {
|
|
85
|
+
const currentHarness = getHarness();
|
|
86
|
+
const [currentTools, currentActiveToolNames] = await Promise.all([
|
|
87
|
+
currentHarness.getTools(),
|
|
88
|
+
currentHarness.getActiveTools(),
|
|
89
|
+
]);
|
|
90
|
+
return buildCodingAgentHarnessSystemPrompt({
|
|
91
|
+
cwd: env.cwd,
|
|
92
|
+
tools: currentTools,
|
|
93
|
+
activeToolNames: currentActiveToolNames,
|
|
94
|
+
systemPromptOptions,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
const created = await AgentHarness.create({
|
|
98
|
+
...harnessOptions,
|
|
99
|
+
tools,
|
|
100
|
+
activeToolNames,
|
|
101
|
+
systemPrompt,
|
|
102
|
+
});
|
|
103
|
+
harness = created.harness;
|
|
104
|
+
return created;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=create-harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-harness.js","sourceRoot":"","sources":["../../src/server/create-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,EAGZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,GAIf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAiC,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAO3E,SA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AU,EAAE,CAAC;YACpC,MAAM,CAAC,YAAY,EAAE,sBAAsB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAChE,cAAc,CAAC,QAAQ,EAAE;gBACzB,cAAc,CAAC,cAAc,EAAE;aAC/B,CAAC,CAAC;YACH,OAAO,mCAAmC,CAAC;gBAC1C,GAAG,EAAE,GAAG,CAAC,GAAG;gBACZ,KAAK,EAAE,YAAY;gBACnB,eAAe,EAAE,sBAAsB;gBACvC,mBAAmB;aACnB,CAAC,CAAC;QAAA,CACH,CAAC,CAAC;IACJ,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC;QACzC,GAAG,cAAc;QACjB,KAAK;QACL,eAAe;QACf,YAAY;KACZ,CAAC,CAAC;IACH,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC1B,OAAO,OAAO,CAAC;AAAA,CACf","sourcesContent":["import {\n\tAgentHarness,\n\ttype AgentHarnessOptions,\n\ttype AgentHarnessTool,\n\tcreateBashTool,\n\tcreateEditTool,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype ExecutionEnv,\n\ttype ExecutionToolContext,\n\ttype HarnessTool,\n} from \"@agent-forge/agent-core\";\nimport type { Static, TSchema } from \"typebox\";\nimport { type BuildSystemPromptOptions, buildSystemPrompt } from \"../core/system-prompt.ts\";\nimport { bashToolSystemPromptContribution } from \"../core/tools/bash.ts\";\nimport { editToolSystemPromptContribution } from \"../core/tools/edit.ts\";\nimport { readToolSystemPromptContribution } from \"../core/tools/read.ts\";\nimport { writeToolSystemPromptContribution } from \"../core/tools/write.ts\";\n\nexport interface CodingAgentHarnessTool extends HarnessTool {\n\tpromptSnippet?: string;\n\tpromptGuidelines?: readonly string[];\n}\n\nfunction createCodingAgentHarnessTool<TParameters extends TSchema, TDetails>(\n\ttool: AgentHarnessTool<ExecutionToolContext, TParameters, TDetails>,\n\tcontext: ExecutionToolContext,\n\tprompt: Required<Pick<CodingAgentHarnessTool, \"promptSnippet\" | \"promptGuidelines\">>,\n): CodingAgentHarnessTool {\n\treturn {\n\t\t...tool,\n\t\t...prompt,\n\t\tconstrainedSampling: { type: \"json_schema\", strict: \"prefer\" },\n\t\texecute: (toolCallId, params, signal, onUpdate) =>\n\t\t\ttool.execute(toolCallId, params as Static<TParameters>, signal, onUpdate, context),\n\t};\n}\n\nexport interface CreateCodingAgentHarnessOptions extends Omit<AgentHarnessOptions, \"toolContext\" | \"tools\"> {\n\tenv: ExecutionEnv;\n\tbashCommandPrefix?: string;\n\t/** Path to the JSONL session file exposed to default bash commands as AGENT_FORGE_SESSION_FILE. */\n\tsessionFile?: string;\n\ttools?: CodingAgentHarnessTool[];\n\tsystemPromptOptions?: Omit<BuildSystemPromptOptions, \"cwd\" | \"promptGuidelines\" | \"selectedTools\" | \"toolSnippets\">;\n}\n\nexport interface BuildCodingAgentHarnessSystemPromptOptions {\n\tcwd: string;\n\ttools: readonly CodingAgentHarnessTool[];\n\tactiveToolNames: readonly string[];\n\tsystemPromptOptions?: CreateCodingAgentHarnessOptions[\"systemPromptOptions\"];\n}\n\nexport function buildCodingAgentHarnessSystemPrompt(options: BuildCodingAgentHarnessSystemPromptOptions): string {\n\tconst activeTools = options.activeToolNames.flatMap((name) => {\n\t\tconst tool = options.tools.find((candidate) => candidate.name === name);\n\t\treturn tool ? [tool] : [];\n\t});\n\tconst toolSnippets = Object.fromEntries(\n\t\tactiveTools.flatMap((tool) => {\n\t\t\tconst promptSnippet = tool.promptSnippet\n\t\t\t\t?.replace(/[\\r\\n]+/g, \" \")\n\t\t\t\t.replace(/\\s+/g, \" \")\n\t\t\t\t.trim();\n\t\t\treturn promptSnippet ? [[tool.name, promptSnippet]] : [];\n\t\t}),\n\t);\n\tconst promptGuidelines = activeTools.flatMap((tool) => tool.promptGuidelines ?? []);\n\treturn buildSystemPrompt({\n\t\t...options.systemPromptOptions,\n\t\tcwd: options.cwd,\n\t\tselectedTools: activeTools.map((tool) => tool.name),\n\t\ttoolSnippets,\n\t\tpromptGuidelines,\n\t});\n}\n\nexport async function createCodingAgentHarness(options: CreateCodingAgentHarnessOptions) {\n\tconst {\n\t\tenv,\n\t\tbashCommandPrefix,\n\t\tsessionFile,\n\t\tsystemPromptOptions,\n\t\ttools: providedTools,\n\t\tactiveToolNames: providedActiveToolNames,\n\t\tsystemPrompt: providedSystemPrompt,\n\t\t...harnessOptions\n\t} = options;\n\tlet harness: AgentHarness | undefined;\n\tconst getHarness = (): AgentHarness => {\n\t\t// v8 ignore next -- harness 在 create 返回后同步赋值,回调只会在其后执行\n\t\tif (!harness) throw new Error(\"Coding-agent Harness callback ran before Harness initialization\");\n\t\treturn harness;\n\t};\n\tlet tools = providedTools;\n\tif (tools === undefined) {\n\t\tconst metadata = await options.session.getMetadata();\n\t\tconst toolContext = { env } satisfies ExecutionToolContext;\n\t\ttools = [\n\t\t\tcreateCodingAgentHarnessTool(createReadTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: readToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: readToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t\tcreateCodingAgentHarnessTool(\n\t\t\t\tcreateBashTool<ExecutionToolContext>({\n\t\t\t\t\tcommandPrefix: bashCommandPrefix,\n\t\t\t\t\tprepare: async (execution) => {\n\t\t\t\t\t\tconst currentHarness = getHarness();\n\t\t\t\t\t\tconst [model, thinkingLevel] = await Promise.all([\n\t\t\t\t\t\t\tcurrentHarness.getModel(),\n\t\t\t\t\t\t\tcurrentHarness.getThinkingLevel(),\n\t\t\t\t\t\t]);\n\t\t\t\t\t\texecution.env.AGENT_FORGE_SESSION_ID = metadata.id;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_SESSION_FILE = sessionFile ?? \"\";\n\t\t\t\t\t\texecution.env.AGENT_FORGE_PROVIDER = model.provider;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_MODEL = model.id;\n\t\t\t\t\t\texecution.env.AGENT_FORGE_REASONING_LEVEL = thinkingLevel;\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\ttoolContext,\n\t\t\t\t{\n\t\t\t\t\tpromptSnippet: bashToolSystemPromptContribution.snippet,\n\t\t\t\t\tpromptGuidelines: bashToolSystemPromptContribution.guidelines,\n\t\t\t\t},\n\t\t\t),\n\t\t\tcreateCodingAgentHarnessTool(createEditTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: editToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: editToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t\tcreateCodingAgentHarnessTool(createWriteTool<ExecutionToolContext>(), toolContext, {\n\t\t\t\tpromptSnippet: writeToolSystemPromptContribution.snippet,\n\t\t\t\tpromptGuidelines: writeToolSystemPromptContribution.guidelines,\n\t\t\t}),\n\t\t];\n\t}\n\tconst activeToolNames = [...(providedActiveToolNames ?? tools.map((tool) => tool.name))];\n\tconst systemPrompt =\n\t\tprovidedSystemPrompt ??\n\t\t(async () => {\n\t\t\tconst currentHarness = getHarness();\n\t\t\tconst [currentTools, currentActiveToolNames] = await Promise.all([\n\t\t\t\tcurrentHarness.getTools(),\n\t\t\t\tcurrentHarness.getActiveTools(),\n\t\t\t]);\n\t\t\treturn buildCodingAgentHarnessSystemPrompt({\n\t\t\t\tcwd: env.cwd,\n\t\t\t\ttools: currentTools,\n\t\t\t\tactiveToolNames: currentActiveToolNames,\n\t\t\t\tsystemPromptOptions,\n\t\t\t});\n\t\t});\n\tconst created = await AgentHarness.create({\n\t\t...harnessOptions,\n\t\ttools,\n\t\tactiveToolNames,\n\t\tsystemPrompt,\n\t});\n\tharness = created.harness;\n\treturn created;\n}\n"]}
|