operon-agents-core 0.1.0-alpha.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/LICENSE +55 -0
- package/README.md +7 -0
- package/dist/agent/agent.d.ts +65 -0
- package/dist/agent/agent.js +39 -0
- package/dist/agent/compose-hooks.d.ts +13 -0
- package/dist/agent/compose-hooks.js +197 -0
- package/dist/agent/concurrency.d.ts +22 -0
- package/dist/agent/concurrency.js +70 -0
- package/dist/agent/context-report.d.ts +60 -0
- package/dist/agent/context-report.js +45 -0
- package/dist/agent/graph.d.ts +48 -0
- package/dist/agent/graph.js +129 -0
- package/dist/agent/guardrail.d.ts +105 -0
- package/dist/agent/guardrail.js +314 -0
- package/dist/agent/handoff-executor.d.ts +21 -0
- package/dist/agent/handoff-executor.js +95 -0
- package/dist/agent/handoff.d.ts +42 -0
- package/dist/agent/handoff.js +70 -0
- package/dist/agent/index.d.ts +25 -0
- package/dist/agent/index.js +19 -0
- package/dist/agent/instruction-context.d.ts +33 -0
- package/dist/agent/instruction-context.js +100 -0
- package/dist/agent/pause.d.ts +12 -0
- package/dist/agent/pause.js +82 -0
- package/dist/agent/profile-builtins.d.ts +8 -0
- package/dist/agent/profile-builtins.js +130 -0
- package/dist/agent/profiles.d.ts +94 -0
- package/dist/agent/profiles.js +264 -0
- package/dist/agent/recovery.d.ts +10 -0
- package/dist/agent/recovery.js +151 -0
- package/dist/agent/run-support.d.ts +79 -0
- package/dist/agent/run-support.js +211 -0
- package/dist/agent/runner.d.ts +246 -0
- package/dist/agent/runner.js +786 -0
- package/dist/agent/session.d.ts +363 -0
- package/dist/agent/session.js +937 -0
- package/dist/agent/subagent-tools.d.ts +18 -0
- package/dist/agent/subagent-tools.js +650 -0
- package/dist/agent/subagent.d.ts +56 -0
- package/dist/agent/subagent.js +50 -0
- package/dist/agent/toolset.d.ts +24 -0
- package/dist/agent/toolset.js +112 -0
- package/dist/agent/workflow/index.d.ts +9 -0
- package/dist/agent/workflow/index.js +8 -0
- package/dist/agent/workflow/journal.d.ts +180 -0
- package/dist/agent/workflow/journal.js +224 -0
- package/dist/agent/workflow/manager.d.ts +27 -0
- package/dist/agent/workflow/manager.js +33 -0
- package/dist/agent/workflow/parse.d.ts +17 -0
- package/dist/agent/workflow/parse.js +174 -0
- package/dist/agent/workflow/prompt.d.ts +8 -0
- package/dist/agent/workflow/prompt.js +84 -0
- package/dist/agent/workflow/runtime.d.ts +64 -0
- package/dist/agent/workflow/runtime.js +380 -0
- package/dist/agent/workflow/sandbox.d.ts +35 -0
- package/dist/agent/workflow/sandbox.js +90 -0
- package/dist/agent/workflow/snapshot.d.ts +36 -0
- package/dist/agent/workflow/snapshot.js +9 -0
- package/dist/agent/workflow/structured.d.ts +35 -0
- package/dist/agent/workflow/structured.js +79 -0
- package/dist/agent/workflow/tool.d.ts +14 -0
- package/dist/agent/workflow/tool.js +569 -0
- package/dist/agent/workflow/types.d.ts +100 -0
- package/dist/agent/workflow/types.js +17 -0
- package/dist/agent/worktree.d.ts +38 -0
- package/dist/agent/worktree.js +56 -0
- package/dist/capabilities/assembler.d.ts +39 -0
- package/dist/capabilities/assembler.js +171 -0
- package/dist/capabilities/background/agent-task.d.ts +51 -0
- package/dist/capabilities/background/agent-task.js +101 -0
- package/dist/capabilities/background/command-task.d.ts +43 -0
- package/dist/capabilities/background/command-task.js +86 -0
- package/dist/capabilities/background/index.d.ts +20 -0
- package/dist/capabilities/background/index.js +57 -0
- package/dist/capabilities/background/manager.d.ts +194 -0
- package/dist/capabilities/background/manager.js +1131 -0
- package/dist/capabilities/background/persist-disk.d.ts +17 -0
- package/dist/capabilities/background/persist-disk.js +66 -0
- package/dist/capabilities/background/persist.d.ts +61 -0
- package/dist/capabilities/background/persist.js +117 -0
- package/dist/capabilities/background/question-task.d.ts +32 -0
- package/dist/capabilities/background/question-task.js +56 -0
- package/dist/capabilities/background/registrar.d.ts +12 -0
- package/dist/capabilities/background/registrar.js +9 -0
- package/dist/capabilities/background/swappable-sink.d.ts +20 -0
- package/dist/capabilities/background/swappable-sink.js +20 -0
- package/dist/capabilities/background/task.d.ts +114 -0
- package/dist/capabilities/background/task.js +20 -0
- package/dist/capabilities/background/tools.d.ts +6 -0
- package/dist/capabilities/background/tools.js +190 -0
- package/dist/capabilities/background/workflow-task.d.ts +48 -0
- package/dist/capabilities/background/workflow-task.js +91 -0
- package/dist/capabilities/capability-state.d.ts +13 -0
- package/dist/capabilities/capability-state.js +37 -0
- package/dist/capabilities/capability.d.ts +145 -0
- package/dist/capabilities/capability.js +2 -0
- package/dist/capabilities/compaction/full.d.ts +27 -0
- package/dist/capabilities/compaction/full.js +155 -0
- package/dist/capabilities/compaction/index.d.ts +17 -0
- package/dist/capabilities/compaction/index.js +145 -0
- package/dist/capabilities/compaction/instruction.d.ts +2 -0
- package/dist/capabilities/compaction/instruction.js +31 -0
- package/dist/capabilities/compaction/micro.d.ts +17 -0
- package/dist/capabilities/compaction/micro.js +57 -0
- package/dist/capabilities/compaction/service.d.ts +28 -0
- package/dist/capabilities/compaction/service.js +52 -0
- package/dist/capabilities/compaction/strategy.d.ts +43 -0
- package/dist/capabilities/compaction/strategy.js +116 -0
- package/dist/capabilities/compaction/tokens.d.ts +5 -0
- package/dist/capabilities/compaction/tokens.js +28 -0
- package/dist/capabilities/goal/goal-store.d.ts +69 -0
- package/dist/capabilities/goal/goal-store.js +172 -0
- package/dist/capabilities/goal/index.d.ts +6 -0
- package/dist/capabilities/goal/index.js +31 -0
- package/dist/capabilities/goal/injector.d.ts +9 -0
- package/dist/capabilities/goal/injector.js +79 -0
- package/dist/capabilities/goal/tools.d.ts +6 -0
- package/dist/capabilities/goal/tools.js +86 -0
- package/dist/capabilities/index.d.ts +25 -0
- package/dist/capabilities/index.js +22 -0
- package/dist/capabilities/injection.d.ts +44 -0
- package/dist/capabilities/injection.js +112 -0
- package/dist/capabilities/plan/index.d.ts +6 -0
- package/dist/capabilities/plan/index.js +25 -0
- package/dist/capabilities/plan/injector.d.ts +13 -0
- package/dist/capabilities/plan/injector.js +83 -0
- package/dist/capabilities/plan/plan-mode.d.ts +38 -0
- package/dist/capabilities/plan/plan-mode.js +113 -0
- package/dist/capabilities/plan/policies.d.ts +6 -0
- package/dist/capabilities/plan/policies.js +89 -0
- package/dist/capabilities/plan/tools.d.ts +15 -0
- package/dist/capabilities/plan/tools.js +87 -0
- package/dist/capabilities/skills/flow-provider.d.ts +6 -0
- package/dist/capabilities/skills/flow-provider.js +50 -0
- package/dist/capabilities/skills/index.d.ts +43 -0
- package/dist/capabilities/skills/index.js +48 -0
- package/dist/capabilities/skills/injector.d.ts +11 -0
- package/dist/capabilities/skills/injector.js +27 -0
- package/dist/capabilities/skills/parser.d.ts +36 -0
- package/dist/capabilities/skills/parser.js +334 -0
- package/dist/capabilities/skills/registry.d.ts +33 -0
- package/dist/capabilities/skills/registry.js +118 -0
- package/dist/capabilities/skills/scanner.d.ts +26 -0
- package/dist/capabilities/skills/scanner.js +154 -0
- package/dist/capabilities/skills/service.d.ts +39 -0
- package/dist/capabilities/skills/service.js +68 -0
- package/dist/capabilities/skills/skill-tool.d.ts +13 -0
- package/dist/capabilities/skills/skill-tool.js +72 -0
- package/dist/capabilities/skills/types.d.ts +62 -0
- package/dist/capabilities/skills/types.js +26 -0
- package/dist/capabilities/task/index.d.ts +23 -0
- package/dist/capabilities/task/index.js +38 -0
- package/dist/capabilities/task/injector.d.ts +9 -0
- package/dist/capabilities/task/injector.js +62 -0
- package/dist/capabilities/task/persist-disk.d.ts +19 -0
- package/dist/capabilities/task/persist-disk.js +84 -0
- package/dist/capabilities/task/persist.d.ts +52 -0
- package/dist/capabilities/task/persist.js +84 -0
- package/dist/capabilities/task/task-store.d.ts +44 -0
- package/dist/capabilities/task/task-store.js +106 -0
- package/dist/capabilities/task/tools.d.ts +12 -0
- package/dist/capabilities/task/tools.js +164 -0
- package/dist/capabilities/todo/index.d.ts +8 -0
- package/dist/capabilities/todo/index.js +21 -0
- package/dist/capabilities/todo/injector.d.ts +9 -0
- package/dist/capabilities/todo/injector.js +68 -0
- package/dist/capabilities/todo/todo-store.d.ts +19 -0
- package/dist/capabilities/todo/todo-store.js +36 -0
- package/dist/capabilities/todo/tools.d.ts +6 -0
- package/dist/capabilities/todo/tools.js +70 -0
- package/dist/capabilities/tool-provider.d.ts +12 -0
- package/dist/capabilities/tool-provider.js +20 -0
- package/dist/capabilities/user-hooks/engine.d.ts +22 -0
- package/dist/capabilities/user-hooks/engine.js +105 -0
- package/dist/capabilities/user-hooks/index.d.ts +13 -0
- package/dist/capabilities/user-hooks/index.js +126 -0
- package/dist/capabilities/user-hooks/types.d.ts +26 -0
- package/dist/capabilities/user-hooks/types.js +19 -0
- package/dist/capabilities/workflow/index.d.ts +16 -0
- package/dist/capabilities/workflow/index.js +15 -0
- package/dist/commands/index.d.ts +31 -0
- package/dist/commands/index.js +318 -0
- package/dist/config/config-store.d.ts +29 -0
- package/dist/config/config-store.js +103 -0
- package/dist/config/file-source.d.ts +40 -0
- package/dist/config/file-source.js +78 -0
- package/dist/config/flags.d.ts +13 -0
- package/dist/config/flags.js +25 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.js +10 -0
- package/dist/config/merge.d.ts +5 -0
- package/dist/config/merge.js +57 -0
- package/dist/config/model-catalog.d.ts +17 -0
- package/dist/config/model-catalog.js +37 -0
- package/dist/config/paths.d.ts +31 -0
- package/dist/config/paths.js +28 -0
- package/dist/config/provider-manager.d.ts +57 -0
- package/dist/config/provider-manager.js +344 -0
- package/dist/config/resolver.d.ts +40 -0
- package/dist/config/resolver.js +52 -0
- package/dist/config/schema.d.ts +389 -0
- package/dist/config/schema.js +132 -0
- package/dist/events/events.d.ts +348 -0
- package/dist/events/events.js +146 -0
- package/dist/events/index.d.ts +10 -0
- package/dist/events/index.js +5 -0
- package/dist/events/projection.d.ts +207 -0
- package/dist/events/projection.js +438 -0
- package/dist/events/publisher.d.ts +48 -0
- package/dist/events/publisher.js +404 -0
- package/dist/events/redacting-sink.d.ts +11 -0
- package/dist/events/redacting-sink.js +31 -0
- package/dist/home.d.ts +16 -0
- package/dist/home.js +20 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -0
- package/dist/internal.d.ts +33 -0
- package/dist/internal.js +29 -0
- package/dist/llm/auth.d.ts +22 -0
- package/dist/llm/auth.js +112 -0
- package/dist/llm/capability.d.ts +13 -0
- package/dist/llm/capability.js +45 -0
- package/dist/llm/define-model.d.ts +110 -0
- package/dist/llm/define-model.js +252 -0
- package/dist/llm/errors.d.ts +33 -0
- package/dist/llm/errors.js +154 -0
- package/dist/llm/index.d.ts +14 -0
- package/dist/llm/index.js +8 -0
- package/dist/llm/model.d.ts +43 -0
- package/dist/llm/model.js +9 -0
- package/dist/llm/retry.d.ts +35 -0
- package/dist/llm/retry.js +160 -0
- package/dist/llm/runtime.d.ts +25 -0
- package/dist/llm/runtime.js +38 -0
- package/dist/logging/diagnostics.d.ts +21 -0
- package/dist/logging/diagnostics.js +46 -0
- package/dist/logging/index.d.ts +11 -0
- package/dist/logging/index.js +7 -0
- package/dist/logging/logger.d.ts +25 -0
- package/dist/logging/logger.js +54 -0
- package/dist/logging/paths.d.ts +11 -0
- package/dist/logging/paths.js +20 -0
- package/dist/logging/policy.d.ts +5 -0
- package/dist/logging/policy.js +19 -0
- package/dist/logging/redact.d.ts +10 -0
- package/dist/logging/redact.js +95 -0
- package/dist/logging/sinks.d.ts +67 -0
- package/dist/logging/sinks.js +117 -0
- package/dist/loop/context.d.ts +69 -0
- package/dist/loop/context.js +129 -0
- package/dist/loop/errors.d.ts +8 -0
- package/dist/loop/errors.js +27 -0
- package/dist/loop/events.d.ts +14 -0
- package/dist/loop/events.js +2 -0
- package/dist/loop/index.d.ts +10 -0
- package/dist/loop/index.js +7 -0
- package/dist/loop/interruption.d.ts +118 -0
- package/dist/loop/interruption.js +191 -0
- package/dist/loop/run-turn.d.ts +54 -0
- package/dist/loop/run-turn.js +203 -0
- package/dist/loop/scheduler.d.ts +18 -0
- package/dist/loop/scheduler.js +71 -0
- package/dist/loop/steer.d.ts +122 -0
- package/dist/loop/steer.js +209 -0
- package/dist/loop/tool-call.d.ts +41 -0
- package/dist/loop/tool-call.js +326 -0
- package/dist/loop/turn-step.d.ts +57 -0
- package/dist/loop/turn-step.js +298 -0
- package/dist/loop/types.d.ts +217 -0
- package/dist/loop/types.js +2 -0
- package/dist/loop/usage.d.ts +6 -0
- package/dist/loop/usage.js +44 -0
- package/dist/mcp/auth-tool.d.ts +12 -0
- package/dist/mcp/auth-tool.js +92 -0
- package/dist/mcp/capability.d.ts +7 -0
- package/dist/mcp/capability.js +91 -0
- package/dist/mcp/config-loader.d.ts +28 -0
- package/dist/mcp/config-loader.js +115 -0
- package/dist/mcp/filter.d.ts +18 -0
- package/dist/mcp/filter.js +35 -0
- package/dist/mcp/index.d.ts +23 -0
- package/dist/mcp/index.js +13 -0
- package/dist/mcp/manager.d.ts +51 -0
- package/dist/mcp/manager.js +412 -0
- package/dist/mcp/mock-transport.d.ts +40 -0
- package/dist/mcp/mock-transport.js +68 -0
- package/dist/mcp/oauth/callback-server.d.ts +14 -0
- package/dist/mcp/oauth/callback-server.js +122 -0
- package/dist/mcp/oauth/index.d.ts +9 -0
- package/dist/mcp/oauth/index.js +5 -0
- package/dist/mcp/oauth/provider.d.ts +39 -0
- package/dist/mcp/oauth/provider.js +121 -0
- package/dist/mcp/oauth/service.d.ts +34 -0
- package/dist/mcp/oauth/service.js +130 -0
- package/dist/mcp/oauth/store.d.ts +40 -0
- package/dist/mcp/oauth/store.js +134 -0
- package/dist/mcp/output.d.ts +12 -0
- package/dist/mcp/output.js +110 -0
- package/dist/mcp/provider.d.ts +7 -0
- package/dist/mcp/provider.js +56 -0
- package/dist/mcp/sdk-transport.d.ts +25 -0
- package/dist/mcp/sdk-transport.js +228 -0
- package/dist/mcp/server.d.ts +77 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/tool-naming.d.ts +4 -0
- package/dist/mcp/tool-naming.js +26 -0
- package/dist/mcp/types.d.ts +75 -0
- package/dist/mcp/types.js +2 -0
- package/dist/net/index.d.ts +3 -0
- package/dist/net/index.js +2 -0
- package/dist/net/proxy.d.ts +16 -0
- package/dist/net/proxy.js +42 -0
- package/dist/permission/auto-approver/index.d.ts +3 -0
- package/dist/permission/auto-approver/index.js +3 -0
- package/dist/permission/auto-approver/llm-auto-approver.d.ts +53 -0
- package/dist/permission/auto-approver/llm-auto-approver.js +122 -0
- package/dist/permission/auto-approver/prompts-data.d.ts +9 -0
- package/dist/permission/auto-approver/prompts-data.js +155 -0
- package/dist/permission/auto-approver/prompts.d.ts +18 -0
- package/dist/permission/auto-approver/prompts.js +40 -0
- package/dist/permission/auto-approver/transcript.d.ts +22 -0
- package/dist/permission/auto-approver/transcript.js +75 -0
- package/dist/permission/auto-approver/xml.d.ts +5 -0
- package/dist/permission/auto-approver/xml.js +25 -0
- package/dist/permission/index.d.ts +7 -0
- package/dist/permission/index.js +5 -0
- package/dist/permission/manager.d.ts +74 -0
- package/dist/permission/manager.js +162 -0
- package/dist/permission/matches-rule.d.ts +27 -0
- package/dist/permission/matches-rule.js +54 -0
- package/dist/permission/policies.d.ts +14 -0
- package/dist/permission/policies.js +233 -0
- package/dist/permission/types.d.ts +84 -0
- package/dist/permission/types.js +2 -0
- package/dist/plugins/archive.d.ts +3 -0
- package/dist/plugins/archive.js +58 -0
- package/dist/plugins/github-resolver.d.ts +13 -0
- package/dist/plugins/github-resolver.js +20 -0
- package/dist/plugins/hooks.d.ts +28 -0
- package/dist/plugins/hooks.js +296 -0
- package/dist/plugins/index.d.ts +23 -0
- package/dist/plugins/index.js +23 -0
- package/dist/plugins/injector.d.ts +11 -0
- package/dist/plugins/injector.js +32 -0
- package/dist/plugins/manager.d.ts +37 -0
- package/dist/plugins/manager.js +330 -0
- package/dist/plugins/manifest.d.ts +9 -0
- package/dist/plugins/manifest.js +234 -0
- package/dist/plugins/marketplace.d.ts +85 -0
- package/dist/plugins/marketplace.js +205 -0
- package/dist/plugins/source.d.ts +23 -0
- package/dist/plugins/source.js +87 -0
- package/dist/plugins/store.d.ts +20 -0
- package/dist/plugins/store.js +30 -0
- package/dist/plugins/types.d.ts +118 -0
- package/dist/plugins/types.js +5 -0
- package/dist/protocol/index.d.ts +4 -0
- package/dist/protocol/index.js +2 -0
- package/dist/protocol/tool-schema.d.ts +6 -0
- package/dist/protocol/tool-schema.js +2 -0
- package/dist/store/blob-store.d.ts +45 -0
- package/dist/store/blob-store.js +120 -0
- package/dist/store/catalog-store.d.ts +32 -0
- package/dist/store/catalog-store.js +73 -0
- package/dist/store/disk-store.d.ts +58 -0
- package/dist/store/disk-store.js +369 -0
- package/dist/store/index.d.ts +23 -0
- package/dist/store/index.js +15 -0
- package/dist/store/lock.d.ts +86 -0
- package/dist/store/lock.js +104 -0
- package/dist/store/log-store.d.ts +89 -0
- package/dist/store/log-store.js +296 -0
- package/dist/store/migrate.d.ts +26 -0
- package/dist/store/migrate.js +32 -0
- package/dist/store/origin.d.ts +89 -0
- package/dist/store/origin.js +16 -0
- package/dist/store/pg.d.ts +90 -0
- package/dist/store/pg.js +344 -0
- package/dist/store/redacting-store.d.ts +21 -0
- package/dist/store/redacting-store.js +46 -0
- package/dist/store/redis.d.ts +89 -0
- package/dist/store/redis.js +370 -0
- package/dist/store/repository.d.ts +150 -0
- package/dist/store/repository.js +508 -0
- package/dist/store/session-catalog.d.ts +32 -0
- package/dist/store/session-catalog.js +117 -0
- package/dist/store/storage.d.ts +27 -0
- package/dist/store/storage.js +54 -0
- package/dist/store/store.d.ts +262 -0
- package/dist/store/store.js +129 -0
- package/dist/store/workdir-key.d.ts +4 -0
- package/dist/store/workdir-key.js +28 -0
- package/dist/tool/access.d.ts +37 -0
- package/dist/tool/access.js +79 -0
- package/dist/tool/ask.d.ts +22 -0
- package/dist/tool/ask.js +38 -0
- package/dist/tool/background.d.ts +109 -0
- package/dist/tool/background.js +39 -0
- package/dist/tool/builtin/ask-user-question.d.ts +2 -0
- package/dist/tool/builtin/ask-user-question.js +175 -0
- package/dist/tool/builtin/bash.d.ts +2 -0
- package/dist/tool/builtin/bash.js +407 -0
- package/dist/tool/builtin/edit.d.ts +2 -0
- package/dist/tool/builtin/edit.js +202 -0
- package/dist/tool/builtin/glob.d.ts +3 -0
- package/dist/tool/builtin/glob.js +260 -0
- package/dist/tool/builtin/grep.d.ts +2 -0
- package/dist/tool/builtin/grep.js +574 -0
- package/dist/tool/builtin/line-endings.d.ts +10 -0
- package/dist/tool/builtin/line-endings.js +41 -0
- package/dist/tool/builtin/read.d.ts +28 -0
- package/dist/tool/builtin/read.js +498 -0
- package/dist/tool/builtin/write.d.ts +2 -0
- package/dist/tool/builtin/write.js +179 -0
- package/dist/tool/define.d.ts +46 -0
- package/dist/tool/define.js +45 -0
- package/dist/tool/file-freshness.d.ts +81 -0
- package/dist/tool/file-freshness.js +67 -0
- package/dist/tool/filesystem-tools.d.ts +16 -0
- package/dist/tool/filesystem-tools.js +19 -0
- package/dist/tool/git-context.d.ts +20 -0
- package/dist/tool/git-context.js +114 -0
- package/dist/tool/index.d.ts +37 -0
- package/dist/tool/index.js +34 -0
- package/dist/tool/machine-base.d.ts +138 -0
- package/dist/tool/machine-base.js +388 -0
- package/dist/tool/machine-local.d.ts +35 -0
- package/dist/tool/machine-local.js +316 -0
- package/dist/tool/machine-null.d.ts +36 -0
- package/dist/tool/machine-null.js +64 -0
- package/dist/tool/machine-ssh.d.ts +86 -0
- package/dist/tool/machine-ssh.js +576 -0
- package/dist/tool/machine.d.ts +333 -0
- package/dist/tool/machine.js +15 -0
- package/dist/tool/policies/path-access.d.ts +48 -0
- package/dist/tool/policies/path-access.js +186 -0
- package/dist/tool/policies/sensitive.d.ts +3 -0
- package/dist/tool/policies/sensitive.js +60 -0
- package/dist/tool/questions.d.ts +40 -0
- package/dist/tool/questions.js +8 -0
- package/dist/tool/search/activation.d.ts +13 -0
- package/dist/tool/search/activation.js +31 -0
- package/dist/tool/search/deferral.d.ts +37 -0
- package/dist/tool/search/deferral.js +128 -0
- package/dist/tool/search/search-tool.d.ts +9 -0
- package/dist/tool/search/search-tool.js +62 -0
- package/dist/tool/shell-env.d.ts +9 -0
- package/dist/tool/shell-env.js +34 -0
- package/dist/tool/support/bash-destructive.d.ts +24 -0
- package/dist/tool/support/bash-destructive.js +63 -0
- package/dist/tool/support/bash-paths.d.ts +7 -0
- package/dist/tool/support/bash-paths.js +247 -0
- package/dist/tool/support/bash-read-only.d.ts +8 -0
- package/dist/tool/support/bash-read-only.js +165 -0
- package/dist/tool/support/bash-rule-match.d.ts +20 -0
- package/dist/tool/support/bash-rule-match.js +191 -0
- package/dist/tool/support/file-type.d.ts +10 -0
- package/dist/tool/support/file-type.js +149 -0
- package/dist/tool/support/git-worktree.d.ts +10 -0
- package/dist/tool/support/git-worktree.js +63 -0
- package/dist/tool/support/image-compress.d.ts +69 -0
- package/dist/tool/support/image-compress.js +265 -0
- package/dist/tool/support/machine-ops.d.ts +34 -0
- package/dist/tool/support/machine-ops.js +34 -0
- package/dist/tool/support/path-glob-match.d.ts +12 -0
- package/dist/tool/support/path-glob-match.js +84 -0
- package/dist/tool/support/result-builder.d.ts +27 -0
- package/dist/tool/support/result-builder.js +108 -0
- package/dist/tool/support/rg-locator.d.ts +20 -0
- package/dist/tool/support/rg-locator.js +42 -0
- package/dist/tool/support/ripgrep-run.d.ts +65 -0
- package/dist/tool/support/ripgrep-run.js +40 -0
- package/dist/tool/support/rule-match.d.ts +6 -0
- package/dist/tool/support/rule-match.js +23 -0
- package/dist/tool/support/tool-path.d.ts +8 -0
- package/dist/tool/support/tool-path.js +28 -0
- package/dist/tool/support/workspace.d.ts +5 -0
- package/dist/tool/support/workspace.js +2 -0
- package/dist/tool/types.d.ts +131 -0
- package/dist/tool/types.js +2 -0
- package/dist/tool/web/fetch-url.d.ts +4 -0
- package/dist/tool/web/fetch-url.js +61 -0
- package/dist/tool/web/index.d.ts +11 -0
- package/dist/tool/web/index.js +7 -0
- package/dist/tool/web/providers/direct-fetch.d.ts +33 -0
- package/dist/tool/web/providers/direct-fetch.js +198 -0
- package/dist/tool/web/providers/firecrawl.d.ts +16 -0
- package/dist/tool/web/providers/firecrawl.js +59 -0
- package/dist/tool/web/providers/tavily.d.ts +14 -0
- package/dist/tool/web/providers/tavily.js +43 -0
- package/dist/tool/web/types.d.ts +41 -0
- package/dist/tool/web/types.js +7 -0
- package/dist/tool/web/web-search.d.ts +4 -0
- package/dist/tool/web/web-search.js +68 -0
- package/dist/tool/workspace-spec.d.ts +74 -0
- package/dist/tool/workspace-spec.js +177 -0
- package/dist/tracing/bridge.d.ts +7 -0
- package/dist/tracing/bridge.js +171 -0
- package/dist/tracing/index.d.ts +9 -0
- package/dist/tracing/index.js +5 -0
- package/dist/tracing/otel.d.ts +38 -0
- package/dist/tracing/otel.js +221 -0
- package/dist/tracing/processor.d.ts +47 -0
- package/dist/tracing/processor.js +94 -0
- package/dist/tracing/spans.d.ts +94 -0
- package/dist/tracing/spans.js +56 -0
- package/dist/ui/ai-sdk.d.ts +114 -0
- package/dist/ui/ai-sdk.js +175 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/package.json +101 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import type { Machine, MachineFactory } from "../tool/machine.ts";
|
|
2
|
+
import { FileFreshnessLedger } from "../tool/file-freshness.ts";
|
|
3
|
+
import type { ChatModel } from "../llm/define-model.ts";
|
|
4
|
+
import type { ThinkingLevel } from "../llm/model.ts";
|
|
5
|
+
import type { PermissionMode, Responder } from "../permission/types.ts";
|
|
6
|
+
import { PermissionManager, type PermissionManagerOptions } from "../permission/manager.ts";
|
|
7
|
+
import type { BackgroundSpawner } from "../tool/background.ts";
|
|
8
|
+
import type { BackgroundManager, BackgroundTaskInfo, BackgroundTaskOutputDelta, BackgroundTaskOutputSnapshot } from "../capabilities/background/index.ts";
|
|
9
|
+
import type { GoalSnapshot, GoalStore } from "../capabilities/goal/index.ts";
|
|
10
|
+
import type { WorkflowManager } from "../capabilities/workflow/index.ts";
|
|
11
|
+
import type { WorkflowSnapshot } from "./workflow/snapshot.ts";
|
|
12
|
+
import type { ContextBreakdown } from "./context-report.ts";
|
|
13
|
+
import type { PlanData, PlanMode } from "../capabilities/plan/index.ts";
|
|
14
|
+
import type { CompactRequestOptions, CompactionService, PendingCompaction } from "../capabilities/compaction/index.ts";
|
|
15
|
+
import type { ActivateSkillRequest, SkillActivationResult, SkillSummary, SkillsService } from "../capabilities/skills/index.ts";
|
|
16
|
+
import type { PluginInfo, PluginManager, PluginSummary, ReloadSummary } from "../plugins/index.ts";
|
|
17
|
+
import { type EventPublicationMode, type EventSink } from "../events/index.ts";
|
|
18
|
+
import { type Logger } from "../logging/index.ts";
|
|
19
|
+
import { type AgentRecord, type SessionStore } from "../store/index.ts";
|
|
20
|
+
import { type TracingProcessor } from "../tracing/index.ts";
|
|
21
|
+
import { ConversationContext } from "../loop/context.ts";
|
|
22
|
+
import type { McpServersHandle, McpServerView } from "../mcp/index.ts";
|
|
23
|
+
import { SteerBus, type SteerContent, type SteerOrigin } from "../loop/steer.ts";
|
|
24
|
+
import type { Capability, CapabilityDiagnostic, SessionControls } from "../capabilities/capability.ts";
|
|
25
|
+
import { type SubagentRecord } from "./subagent.ts";
|
|
26
|
+
import { type SystemPromptContext } from "./instruction-context.ts";
|
|
27
|
+
/** Test-only (exported via `operon-agents-core/internal`): shrink the close deadlines
|
|
28
|
+
* so hang-isolation tests don't wait wall-clock seconds. */
|
|
29
|
+
export declare function setSessionCloseTimeoutsForTest(ms: {
|
|
30
|
+
close?: number;
|
|
31
|
+
storeFlush?: number;
|
|
32
|
+
}): void;
|
|
33
|
+
export declare function newSessionId(): string;
|
|
34
|
+
export interface SessionConfig {
|
|
35
|
+
/**
|
|
36
|
+
* The machine this session operates. Pass a {@link Machine} directly, or a
|
|
37
|
+
* {@link MachineFactory} when it can only be built once the session id is known.
|
|
38
|
+
* Omitted → a {@link NullMachine}: a stateless session with no filesystem, where any
|
|
39
|
+
* file tool that slips through fails loudly instead of touching the host disk.
|
|
40
|
+
*
|
|
41
|
+
* Either way the session only OPERATES the machine — disposal stays with whoever
|
|
42
|
+
* created it. See {@link MachineFactory}.
|
|
43
|
+
*/
|
|
44
|
+
readonly machine?: Machine | MachineFactory;
|
|
45
|
+
readonly store?: SessionStore;
|
|
46
|
+
readonly events?: EventSink;
|
|
47
|
+
/** `immediate` is optimized for an in-process UI. `committed` makes one ordered stream in
|
|
48
|
+
* which record-backed events are emitted only after durable append succeeds. */
|
|
49
|
+
readonly eventPublication?: EventPublicationMode;
|
|
50
|
+
readonly tracing?: TracingProcessor;
|
|
51
|
+
readonly responder?: Responder;
|
|
52
|
+
readonly permission?: PermissionManagerOptions;
|
|
53
|
+
readonly capabilities?: readonly Capability[];
|
|
54
|
+
readonly steer?: SteerBus;
|
|
55
|
+
readonly background?: BackgroundSpawner;
|
|
56
|
+
readonly sessionId?: string;
|
|
57
|
+
readonly signal?: AbortSignal;
|
|
58
|
+
readonly logger?: Logger;
|
|
59
|
+
/**
|
|
60
|
+
* The session's full append log, pre-read by the caller. `open` then skips its own
|
|
61
|
+
* `readLog` and every open-time consumer (log-fold capabilities, context pre-build)
|
|
62
|
+
* folds THESE records — sharing the read AND the `Message` object graph with whatever
|
|
63
|
+
* else the caller seeded from them (e.g. a `SessionProjection`), instead of holding a
|
|
64
|
+
* second parsed+blob-rehydrated copy for the session's lifetime.
|
|
65
|
+
* Must be the complete log (all addresses, append order) as `readRecords()` returns it.
|
|
66
|
+
*/
|
|
67
|
+
readonly preloadedLog?: readonly AgentRecord[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Thrown by `Session`'s capability-backed convenience methods when the capability they
|
|
71
|
+
* wrap is not open on this session. Detect with `instanceof`; `capability` names the
|
|
72
|
+
* missing one. The probe tier never throws — the getters (`session.cron`, `.goal`, …)
|
|
73
|
+
* return `undefined` instead.
|
|
74
|
+
*/
|
|
75
|
+
export declare class CapabilityMissingError extends Error {
|
|
76
|
+
readonly capability: string;
|
|
77
|
+
constructor(capability: string);
|
|
78
|
+
}
|
|
79
|
+
/** The current owner and root conversation shard for the next user prompt. */
|
|
80
|
+
export interface ConversationHead {
|
|
81
|
+
readonly agentKey: string;
|
|
82
|
+
readonly address: string;
|
|
83
|
+
}
|
|
84
|
+
export interface BackgroundTaskListOptions {
|
|
85
|
+
readonly activeOnly?: boolean;
|
|
86
|
+
readonly limit?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface ReadBackgroundTaskOutputOptions {
|
|
89
|
+
readonly maxBytes?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface ReadBackgroundTaskOutputDeltaOptions {
|
|
92
|
+
readonly cursor: number;
|
|
93
|
+
readonly maxBytes?: number;
|
|
94
|
+
}
|
|
95
|
+
export interface CreateGoalInput {
|
|
96
|
+
readonly objective: string;
|
|
97
|
+
readonly completionCriterion?: string;
|
|
98
|
+
readonly budget?: GoalBudgetInput;
|
|
99
|
+
}
|
|
100
|
+
export interface GoalBudgetInput {
|
|
101
|
+
readonly turns?: number;
|
|
102
|
+
readonly tokens?: number;
|
|
103
|
+
readonly wallClockMs?: number;
|
|
104
|
+
}
|
|
105
|
+
export interface GoalStatusInput {
|
|
106
|
+
readonly reason?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface PlanModeOptions {
|
|
109
|
+
readonly createFile?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The narrow session surface a runtime frame (`RunState.session`) may touch. The full
|
|
113
|
+
* `Session` carries every capability convenience; the engine and the spawn tools must not
|
|
114
|
+
* depend on that breadth — everything they are allowed to reach is enumerated here, so a
|
|
115
|
+
* new dependency on session state is an explicit interface change, not a silent grab.
|
|
116
|
+
* Settings exposed as getters (`modelSetting`/`thinkingSetting`) stay lazy on purpose:
|
|
117
|
+
* they take effect per step, never snapshotted at run start.
|
|
118
|
+
*/
|
|
119
|
+
export interface SessionPort {
|
|
120
|
+
readonly store?: SessionStore;
|
|
121
|
+
readonly logger: Logger;
|
|
122
|
+
/** Per-address file-freshness ledger (read-before-write state shared across turns). */
|
|
123
|
+
fileLedgerFor(address: string): FileFreshnessLedger;
|
|
124
|
+
/** Session model override; wins over the agent's own model. */
|
|
125
|
+
readonly modelSetting: string | ChatModel | undefined;
|
|
126
|
+
readonly thinkingSetting: ThinkingLevel | undefined;
|
|
127
|
+
/** Compaction service view: reserved headroom plus full-compaction invalidation revision. */
|
|
128
|
+
readonly compaction: {
|
|
129
|
+
readonly reservedContextTokens: number;
|
|
130
|
+
readonly revision: number;
|
|
131
|
+
} | undefined;
|
|
132
|
+
readonly workflow: WorkflowManager | undefined;
|
|
133
|
+
resolveSystemPromptContext(machine: Machine): Promise<SystemPromptContext>;
|
|
134
|
+
recordContextBreakdown(breakdown: ContextBreakdown): void;
|
|
135
|
+
flushEvents(): Promise<void>;
|
|
136
|
+
setLiveContext(address: string, ctx: ConversationContext): void;
|
|
137
|
+
setConversationHead(head: ConversationHead): void;
|
|
138
|
+
/** Register a forked frame's inbox; the returned function unregisters it. */
|
|
139
|
+
registerFrameBus(address: string, bus: SteerBus): () => void;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Capability access on a session has two tiers, one rule each:
|
|
143
|
+
* - PROBE — the service getters (`session.cron`, `.goal`, `.plan`, `.backgroundManager`,
|
|
144
|
+
* `.mcp`, …) return `undefined` when that capability is not open. Use these to feature-test.
|
|
145
|
+
* - REQUIRE — the convenience wrappers (`createCronTask()`, `compact()`, `listSkills()`, …)
|
|
146
|
+
* assume the capability and throw {@link CapabilityMissingError} when it is missing.
|
|
147
|
+
* The only exceptions are list views documented as degrading to empty when the capability
|
|
148
|
+
* is off (`listWorkflows`, `listSubagents`, `listMcpServers`) — views over durable state
|
|
149
|
+
* that stay meaningful on a session opened without the capability.
|
|
150
|
+
*/
|
|
151
|
+
export declare class Session implements SessionPort {
|
|
152
|
+
readonly id: string;
|
|
153
|
+
readonly machine: Machine;
|
|
154
|
+
readonly store?: SessionStore;
|
|
155
|
+
readonly events: EventSink;
|
|
156
|
+
private readonly eventPublisher;
|
|
157
|
+
readonly responder?: Responder;
|
|
158
|
+
private readonly permissionOptions?;
|
|
159
|
+
/** Session-lived permission manager: one policy chain + approval memory +
|
|
160
|
+
* mode for the whole session. Constructed in `openCapabilities` (needs capability policy
|
|
161
|
+
* slots and the replayed log); runs reference it instead of building their own. */
|
|
162
|
+
private _permission;
|
|
163
|
+
readonly steer: SteerBus;
|
|
164
|
+
readonly signal: AbortSignal;
|
|
165
|
+
/** Upstream of `signal`. Fires only via `abort()`; a host signal aborts independently. */
|
|
166
|
+
private readonly ownController;
|
|
167
|
+
readonly logger: Logger;
|
|
168
|
+
private readonly tracing?;
|
|
169
|
+
private readonly unsubscribeTracing?;
|
|
170
|
+
private readonly injectedBackground?;
|
|
171
|
+
private readonly allCapabilities;
|
|
172
|
+
private readonly services;
|
|
173
|
+
private readonly systemPromptContexts;
|
|
174
|
+
private readonly liveContexts;
|
|
175
|
+
/** Inboxes of frames currently running under this session, keyed by journal address. */
|
|
176
|
+
private readonly frameBuses;
|
|
177
|
+
private activeConversationHead;
|
|
178
|
+
private readonly fileLedgers;
|
|
179
|
+
private modelOverride?;
|
|
180
|
+
/** Caller-supplied one-shot log for open (see SessionConfig.preloadedLog); cleared after
|
|
181
|
+
* openCapabilities so the array itself is not pinned for the session's lifetime. */
|
|
182
|
+
private preloadedLog?;
|
|
183
|
+
private thinkingOverride?;
|
|
184
|
+
private openedCapabilities;
|
|
185
|
+
private isOpen;
|
|
186
|
+
private runChain;
|
|
187
|
+
private readonly pendingDiagnostics;
|
|
188
|
+
private lastContextBreakdown?;
|
|
189
|
+
private constructor();
|
|
190
|
+
static open(cfg: SessionConfig): Promise<Session>;
|
|
191
|
+
private openCapabilities;
|
|
192
|
+
/**
|
|
193
|
+
* Construct the session-lived PermissionManager: capability policy slots are collected from
|
|
194
|
+
* the opened capabilities' static `policies` (session-tier fault isolation: a capability whose
|
|
195
|
+
* `openSession` failed contributes nothing; a per-run `start()` failure does NOT retract its
|
|
196
|
+
* policies — they are pure evaluators over session-lived state). Then runtime permission
|
|
197
|
+
* state is folded back from the log — `permission.set_mode` (last wins) and approve-for-session
|
|
198
|
+
* grants (`permission.record_approval` with scope "session").
|
|
199
|
+
*/
|
|
200
|
+
private buildPermissionManager;
|
|
201
|
+
/** The session-lived permission manager (policy chain + mode + approval memory). */
|
|
202
|
+
get permission(): PermissionManager;
|
|
203
|
+
get capabilities(): readonly Capability[];
|
|
204
|
+
service<T = unknown>(name: string): T | undefined;
|
|
205
|
+
/** The REQUIRE tier (see the class doc): unwrap a probed service or throw the typed error. */
|
|
206
|
+
private requireCapability;
|
|
207
|
+
get goal(): GoalStore | undefined;
|
|
208
|
+
get workflow(): WorkflowManager | undefined;
|
|
209
|
+
get skills(): SkillsService | undefined;
|
|
210
|
+
get plugins(): PluginManager | undefined;
|
|
211
|
+
get backgroundManager(): BackgroundManager | undefined;
|
|
212
|
+
get plan(): PlanMode | undefined;
|
|
213
|
+
get compaction(): CompactionService | undefined;
|
|
214
|
+
get mcp(): McpServersHandle | undefined;
|
|
215
|
+
get background(): BackgroundSpawner | undefined;
|
|
216
|
+
listBackgroundTasks(options?: BackgroundTaskListOptions): Promise<readonly BackgroundTaskInfo[]>;
|
|
217
|
+
/** Past BACKGROUND workflow runs (newest first), from the durable task store. A foreground
|
|
218
|
+
* workflow is a plain `Workflow` tool call — its record is the conversation plus its journal
|
|
219
|
+
* shard — so it is not listed here (its shard stays resumable by runId). */
|
|
220
|
+
listWorkflows(): Promise<readonly WorkflowSnapshot[]>;
|
|
221
|
+
/** One background workflow run's snapshot by runId, or undefined if unknown. */
|
|
222
|
+
getWorkflow(runId: string): Promise<WorkflowSnapshot | undefined>;
|
|
223
|
+
/** The most-recent context-window breakdown (system/tools/messages/injections/free), stamped
|
|
224
|
+
* by the Runner at each turn boundary — or undefined if no turn has assembled a request yet.
|
|
225
|
+
* A read-only snapshot: it reflects the last turn sent, not a fresh recomputation. */
|
|
226
|
+
getContextBreakdown(): ContextBreakdown | undefined;
|
|
227
|
+
/** Runner-internal: record the breakdown assembled for the turn about to be sent. */
|
|
228
|
+
recordContextBreakdown(breakdown: ContextBreakdown): void;
|
|
229
|
+
/** The background subagents of this session, from the durable task store (live + reconciled
|
|
230
|
+
* ghosts). Foreground subagents are plain `Agent` tool calls — their record is the conversation
|
|
231
|
+
* plus their own shard — so they are not listed here (their shard stays resumable by id). */
|
|
232
|
+
listSubagents(): Promise<readonly SubagentRecord[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Reclassify orphaned background work (spawned by a dead process, never settled) as `lost`
|
|
235
|
+
* through the task store: the manager writes the terminal status back and steers the lost
|
|
236
|
+
* notification (the durable settle record), so later opens won't re-report. Also emits a warning
|
|
237
|
+
* per reclassified subagent. Call when reopening an existing session. Returns the lost subagents
|
|
238
|
+
* (resume any with `Agent(resume="<id>", ...)`).
|
|
239
|
+
*/
|
|
240
|
+
reconcileSubagents(): Promise<readonly SubagentRecord[]>;
|
|
241
|
+
/** Every record of an address in append order (for rendering the transcript). */
|
|
242
|
+
getRecords(address?: string): Promise<AgentRecord[]>;
|
|
243
|
+
/** @internal The kept live context for an address, or undefined (cold → caller replays). */
|
|
244
|
+
liveContext(address: string): ConversationContext | undefined;
|
|
245
|
+
/** @internal Cache the live context so the next turn on this address reuses it. */
|
|
246
|
+
setLiveContext(address: string, ctx: ConversationContext): void;
|
|
247
|
+
/**
|
|
248
|
+
* @internal Register a running frame's inbox so `steerTo` can reach it.
|
|
249
|
+
*
|
|
250
|
+
* Called when a subagent frame is forked; the returned function unregisters. Guarded by identity
|
|
251
|
+
* so a late unregister from a finished run cannot evict a newer frame that reused the address.
|
|
252
|
+
*/
|
|
253
|
+
registerFrameBus(address: string, bus: SteerBus): () => void;
|
|
254
|
+
/**
|
|
255
|
+
* Hand a message to the frame running at `address`; `false` when nobody is there.
|
|
256
|
+
*
|
|
257
|
+
* This is the whole seam an external coordinator needs in order to address a subagent: it can
|
|
258
|
+
* already learn who exists from `agent.started` / `agent.ended` (both carry `address`), but it
|
|
259
|
+
* has no way to reach a child's inbox — every frame owns a private `SteerBus`. Deliberately
|
|
260
|
+
* knows nothing about peers, rosters or visibility: those are policy, and policy belongs to
|
|
261
|
+
* whoever is coordinating, not to the engine.
|
|
262
|
+
*/
|
|
263
|
+
steerTo(address: string, content: SteerContent, origin: SteerOrigin): boolean;
|
|
264
|
+
/** @internal Cached conversation owner. Durable sessions can always rebuild it from the log. */
|
|
265
|
+
conversationHead(): ConversationHead | undefined;
|
|
266
|
+
/** @internal Update the cache only after the source-side handoff commit has been flushed. */
|
|
267
|
+
setConversationHead(head: ConversationHead): void;
|
|
268
|
+
/** @internal Force the next prompt to fold the handoff chain again. */
|
|
269
|
+
invalidateConversationHead(): void;
|
|
270
|
+
/** Drop the cached live context(s) so the next turn replays from the store (e.g. after a log
|
|
271
|
+
* rewrite, or an out-of-band store mutation). Omit `address` to clear all. */
|
|
272
|
+
invalidateLiveContext(address?: string): void;
|
|
273
|
+
/** The file freshness ledger for one agent line (address); created on first use and kept for
|
|
274
|
+
* the session lifetime, so read-before-write state survives across turns and run() calls. */
|
|
275
|
+
fileLedgerFor(address: string): FileFreshnessLedger;
|
|
276
|
+
/** Resolve environment + AGENTS.md for the active runtime frame, cached for this Session. */
|
|
277
|
+
resolveSystemPromptContext(machine: Machine): Promise<SystemPromptContext>;
|
|
278
|
+
/** A bounded view of the task's authoritative output, with explicit size/truncation metadata. */
|
|
279
|
+
readBackgroundTaskOutput(taskId: string, options?: ReadBackgroundTaskOutputOptions): Promise<BackgroundTaskOutputSnapshot>;
|
|
280
|
+
/**
|
|
281
|
+
* Everything a task appended since `cursor` — what a live panel polls so each tick
|
|
282
|
+
* carries only what is new, instead of re-fetching the same window. `followable: false`
|
|
283
|
+
* means this task keeps no byte-addressable output; use `readBackgroundTaskOutput` instead.
|
|
284
|
+
*/
|
|
285
|
+
readBackgroundTaskOutputDelta(taskId: string, options: ReadBackgroundTaskOutputDeltaOptions): Promise<BackgroundTaskOutputDelta>;
|
|
286
|
+
stopBackgroundTask(taskId: string, reason?: string): Promise<BackgroundTaskInfo | undefined>;
|
|
287
|
+
/**
|
|
288
|
+
* Move a running, detachable tool call (bash / subagent / workflow) from the foreground into
|
|
289
|
+
* a background task — the "move to background" action. Returns false if no such call is
|
|
290
|
+
* currently in its detachable window (already finished, or not a detachable tool).
|
|
291
|
+
*/
|
|
292
|
+
detachTool(toolCallId: string): boolean;
|
|
293
|
+
/** Connected MCP servers and their status. Empty when no MCP capability is open. */
|
|
294
|
+
listMcpServers(): readonly McpServerView[];
|
|
295
|
+
/** Force-reconnect one MCP server by name. Throws if no MCP capability is open. */
|
|
296
|
+
reconnectMcpServer(name: string): Promise<void>;
|
|
297
|
+
createGoal(input: CreateGoalInput): Promise<GoalSnapshot>;
|
|
298
|
+
getGoal(): Promise<GoalSnapshot | null>;
|
|
299
|
+
pauseGoal(options?: GoalStatusInput): Promise<GoalSnapshot | null>;
|
|
300
|
+
resumeGoal(options?: GoalStatusInput): Promise<GoalSnapshot | null>;
|
|
301
|
+
cancelGoal(options?: GoalStatusInput): Promise<GoalSnapshot | null>;
|
|
302
|
+
setGoalBudget(budget: GoalBudgetInput): Promise<GoalSnapshot | null>;
|
|
303
|
+
setPlanMode(enabled: boolean, options?: PlanModeOptions): Promise<PlanData>;
|
|
304
|
+
getPlan(): Promise<PlanData>;
|
|
305
|
+
clearPlan(): Promise<PlanData>;
|
|
306
|
+
/**
|
|
307
|
+
* The `SessionControls` view handed to capabilities that act on the session (the extension
|
|
308
|
+
* runtime's `ctx.actions`). Bound methods over the same public operations a host would call —
|
|
309
|
+
* no new reach, just a typed handle that does not leak the whole Session.
|
|
310
|
+
*/
|
|
311
|
+
controls(): SessionControls;
|
|
312
|
+
/**
|
|
313
|
+
* Cancel the session: every run riding `session.signal` unwinds as `status: "aborted"`.
|
|
314
|
+
* The reason is shaped as an `AbortError` so the loop classifies it as cancellation rather
|
|
315
|
+
* than as a failure (see `isAbortError`). Idempotent — a second call is a no-op.
|
|
316
|
+
*/
|
|
317
|
+
abort(reason?: string): void;
|
|
318
|
+
compact(options?: CompactRequestOptions): Promise<PendingCompaction>;
|
|
319
|
+
pendingCompaction(): Promise<PendingCompaction | null>;
|
|
320
|
+
cancelCompaction(): Promise<PendingCompaction | null>;
|
|
321
|
+
private updateExistingGoal;
|
|
322
|
+
private emitControlEvent;
|
|
323
|
+
listSkills(): Promise<readonly SkillSummary[]>;
|
|
324
|
+
activateSkill(name: string, args?: string): Promise<SkillActivationResult>;
|
|
325
|
+
activateSkill(request: ActivateSkillRequest): Promise<SkillActivationResult>;
|
|
326
|
+
listPlugins(): Promise<readonly PluginSummary[]>;
|
|
327
|
+
getPluginInfo(id: string): Promise<PluginInfo | undefined>;
|
|
328
|
+
installPlugin(source: string): Promise<PluginSummary>;
|
|
329
|
+
setPluginEnabled(id: string, enabled: boolean): Promise<void>;
|
|
330
|
+
setPluginMcpServerEnabled(id: string, server: string, enabled: boolean): Promise<void>;
|
|
331
|
+
removePlugin(id: string): Promise<void>;
|
|
332
|
+
reloadPlugins(): Promise<ReloadSummary>;
|
|
333
|
+
setModel(model: string | ChatModel): void;
|
|
334
|
+
setThinking(level: ThinkingLevel): void;
|
|
335
|
+
/**
|
|
336
|
+
* Switch the permission mode. Takes effect in memory immediately — policies read the
|
|
337
|
+
* manager's mode lazily at each tool authorization, so the next tool call (mid-turn
|
|
338
|
+
* included) sees it. The returned promise settles when the mode is also journaled
|
|
339
|
+
* (so it survives reopen) and REJECTS if that persistence fails, so callers who care
|
|
340
|
+
* about durability can surface the failure. Fire-and-forget callers may ignore it:
|
|
341
|
+
* the in-memory switch has already happened, and the failure is still logged (the
|
|
342
|
+
* rejection is pre-handled internally, so ignoring it never trips unhandledRejection).
|
|
343
|
+
*/
|
|
344
|
+
setPermissionMode(mode: PermissionMode): Promise<void>;
|
|
345
|
+
get modelSetting(): string | ChatModel | undefined;
|
|
346
|
+
get thinkingSetting(): ThinkingLevel | undefined;
|
|
347
|
+
get permissionModeSetting(): PermissionMode | undefined;
|
|
348
|
+
drainDiagnostics(): CapabilityDiagnostic[];
|
|
349
|
+
withRunLock<T>(body: () => Promise<T>): Promise<T>;
|
|
350
|
+
flushEvents(): Promise<void>;
|
|
351
|
+
close(): Promise<void>;
|
|
352
|
+
/** Public URL for a port inside the machine, or undefined when the backend can't expose one. */
|
|
353
|
+
resolveExposedPort(port: number): Promise<string | undefined>;
|
|
354
|
+
}
|
|
355
|
+
/** Plain text of a message content (string, or the text parts of a content array). */
|
|
356
|
+
/**
|
|
357
|
+
* `AbortController.abort(x)` stores `x` verbatim as `signal.reason`, and `throwIfAborted()`
|
|
358
|
+
* rethrows exactly that. The loop classifies cancellation by `error.name === "AbortError"`
|
|
359
|
+
* (`isAbortError`), so a caller-supplied reason has to be wrapped, or an intentional abort
|
|
360
|
+
* would surface as a run failure.
|
|
361
|
+
*/
|
|
362
|
+
export declare function abortReason(message: string): Error;
|
|
363
|
+
//# sourceMappingURL=session.d.ts.map
|