@myagentroam/agent 0.11.33 → 0.11.34
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/dist/cli/catalog-file.d.ts +78 -0
- package/dist/cli/catalog-file.js +102 -0
- package/dist/cli/codex-auth-file.d.ts +1 -1
- package/dist/cli/codex-auth-file.js +9 -10
- package/dist/cli/main.js +44 -54
- package/dist/error.d.ts +15 -0
- package/dist/error.js +74 -0
- package/dist/extensions/agents.d.ts +100 -0
- package/dist/extensions/agents.js +121 -0
- package/dist/extensions/capabilities.d.ts +4 -0
- package/dist/extensions/commands.d.ts +23 -0
- package/dist/extensions/commands.js +45 -0
- package/dist/extensions/compaction.d.ts +36 -0
- package/dist/extensions/contracts.d.ts +147 -0
- package/dist/extensions/data.d.ts +81 -0
- package/dist/extensions/data.js +78 -0
- package/dist/extensions/environment.d.ts +39 -0
- package/dist/extensions/environment.js +52 -0
- package/dist/extensions/files.d.ts +68 -0
- package/dist/extensions/files.js +26 -0
- package/dist/extensions/hooks.d.ts +32 -0
- package/dist/extensions/host-ports.d.ts +24 -0
- package/dist/extensions/manager.d.ts +42 -0
- package/dist/extensions/manager.js +457 -0
- package/dist/extensions/mcp.d.ts +116 -0
- package/dist/extensions/mcp.js +434 -0
- package/dist/extensions/model-request.d.ts +65 -0
- package/dist/extensions/model-request.js +197 -0
- package/dist/extensions/model-stream.d.ts +18 -0
- package/dist/extensions/model-stream.js +108 -0
- package/dist/extensions/models.d.ts +46 -0
- package/dist/extensions/models.js +7 -0
- package/dist/extensions/network.d.ts +40 -0
- package/dist/extensions/network.js +97 -0
- package/dist/extensions/operation.d.ts +32 -0
- package/dist/extensions/processes.d.ts +64 -0
- package/dist/extensions/processes.js +284 -0
- package/dist/extensions/prompt-composition.d.ts +38 -0
- package/dist/extensions/prompt-composition.js +100 -0
- package/dist/extensions/prompt-input.d.ts +30 -0
- package/dist/extensions/prompt-input.js +48 -0
- package/dist/extensions/prompts.d.ts +31 -0
- package/dist/extensions/prompts.js +88 -0
- package/dist/extensions/resources.d.ts +26 -0
- package/dist/extensions/resources.js +221 -0
- package/dist/extensions/services.d.ts +31 -0
- package/dist/extensions/services.js +61 -0
- package/dist/extensions/session-api.d.ts +6 -0
- package/dist/extensions/session-api.js +52 -0
- package/dist/extensions/session-input.d.ts +184 -0
- package/dist/extensions/session-input.js +422 -0
- package/dist/extensions/session-messages.d.ts +41 -0
- package/dist/extensions/session-messages.js +76 -0
- package/dist/extensions/session-tools.d.ts +32 -0
- package/dist/extensions/session-tools.js +208 -0
- package/dist/extensions/session.d.ts +60 -0
- package/dist/extensions/session.js +265 -0
- package/dist/extensions/settings.d.ts +76 -0
- package/dist/extensions/settings.js +115 -0
- package/dist/extensions/store.d.ts +10 -0
- package/dist/extensions/store.js +131 -0
- package/dist/extensions/tool-runtime.d.ts +16 -0
- package/dist/extensions/tools.d.ts +80 -0
- package/dist/extensions/tools.js +270 -0
- package/dist/extensions.d.ts +22 -0
- package/dist/host/contracts.d.ts +58 -0
- package/dist/host/contracts.js +18 -0
- package/dist/host/description.d.ts +19 -0
- package/dist/host/local-agent-host.d.ts +96 -0
- package/dist/host/local-agent-host.js +429 -0
- package/dist/host/local-exec-tool.d.ts +26 -0
- package/dist/host/local-exec-tool.js +686 -0
- package/dist/host/local-file-access.d.ts +30 -0
- package/dist/host/local-file-access.js +107 -0
- package/dist/host/local-network-access.d.ts +6 -0
- package/dist/host/local-network-access.js +101 -0
- package/dist/host/local-process-executor.d.ts +5 -0
- package/dist/host/local-process-executor.js +17 -0
- package/dist/host/local-session-environment.d.ts +18 -0
- package/dist/host/local-shell.d.ts +3 -0
- package/dist/host/local-tool-registry.d.ts +34 -0
- package/dist/host/local-tool-registry.js +134 -0
- package/dist/host/network.d.ts +5 -0
- package/dist/host/network.js +42 -0
- package/dist/host/process-control.d.ts +2 -0
- package/dist/host/process-control.js +26 -0
- package/dist/host/skill-contract.d.ts +6 -0
- package/dist/host.d.ts +17 -0
- package/dist/host.js +3 -0
- package/dist/index.d.ts +26 -51
- package/dist/index.js +9 -12
- package/dist/model/anthropic-messages.d.ts +10 -0
- package/dist/model/anthropic-messages.js +692 -0
- package/dist/model/anthropic-thinking.js +33 -0
- package/dist/model/configuration.d.ts +111 -0
- package/dist/model/configuration.js +201 -0
- package/dist/model/contracts.d.ts +229 -0
- package/dist/model/http.d.ts +13 -0
- package/dist/model/http.js +119 -0
- package/dist/model/image-contract.d.ts +10 -0
- package/dist/model/image.d.ts +9 -0
- package/dist/model/inline-media-budget.d.ts +7 -0
- package/dist/model/inline-media-budget.js +36 -0
- package/dist/model/input-images.d.ts +3 -0
- package/dist/model/input-images.js +16 -0
- package/dist/model/openai-responses.d.ts +59 -0
- package/dist/model/openai-responses.js +1586 -0
- package/dist/model/recovery.js +80 -0
- package/dist/model/request-configuration.d.ts +17 -0
- package/dist/model/request-configuration.js +47 -0
- package/dist/model/responses-event-projection.d.ts +24 -0
- package/dist/model/responses-event-projection.js +194 -0
- package/dist/model/responses-request.d.ts +5 -0
- package/dist/model/responses-request.js +363 -0
- package/dist/model/responses-session-cache.d.ts +33 -0
- package/dist/model/responses-session-cache.js +64 -0
- package/dist/model/runtime-credential.d.ts +1 -0
- package/dist/model/runtime-credential.js +1 -0
- package/dist/model/sse.js +281 -0
- package/dist/model/text-blocks.js +40 -0
- package/dist/model/tool-declarations.d.ts +4 -0
- package/dist/model/tool-definition-projection.d.ts +6 -0
- package/dist/model/tool-definition-projection.js +11 -0
- package/dist/model/tool-schema.d.ts +2 -0
- package/dist/model/tool-schema.js +17 -0
- package/dist/model/transport-test.d.ts +10 -0
- package/dist/model/transport-test.js +27 -0
- package/dist/model/usage-observer.d.ts +5 -0
- package/dist/model/usage.d.ts +40 -0
- package/dist/network/credential-runtime.d.ts +8 -0
- package/dist/network/credential-runtime.js +72 -0
- package/dist/network/credentials.d.ts +20 -0
- package/dist/network/credentials.js +18 -0
- package/dist/network/http.d.ts +20 -0
- package/dist/network/http.js +421 -0
- package/dist/network/product-user-agent.d.ts +5 -0
- package/dist/network/product-user-agent.js +22 -0
- package/dist/network/transport-error.d.ts +5 -0
- package/dist/network/transport-error.js +31 -0
- package/dist/process/contracts.d.ts +26 -0
- package/dist/prompts/index.d.ts +20 -0
- package/dist/prompts/index.js +49 -0
- package/dist/prompts/prompt-sections.d.ts +6 -0
- package/dist/prompts/prompt-sections.js +6 -0
- package/dist/prompts/read-context.js +152 -0
- package/dist/runtime/compaction/contracts.d.ts +23 -0
- package/dist/runtime/compaction/coordinator.js +88 -0
- package/dist/runtime/compaction/generate.d.ts +31 -0
- package/dist/runtime/compaction/generate.js +84 -0
- package/dist/runtime/compaction/history.d.ts +16 -0
- package/dist/runtime/compaction/operation.d.ts +30 -0
- package/dist/runtime/compaction/operation.js +131 -0
- package/dist/runtime/compaction/requests.d.ts +16 -0
- package/dist/runtime/compaction/requests.js +114 -0
- package/dist/runtime/compaction/retained-context.d.ts +6 -0
- package/dist/runtime/compaction/retained-context.js +48 -0
- package/dist/runtime/compaction/smart.d.ts +14 -0
- package/dist/runtime/compaction/smart.js +59 -0
- package/dist/runtime/context/contextual-blocks.d.ts +31 -0
- package/dist/runtime/context/contextual-blocks.js +158 -0
- package/dist/runtime/context/environment.d.ts +5 -0
- package/dist/runtime/context/gc-candidates-code.d.ts +6 -0
- package/dist/runtime/context/gc-candidates-code.js +102 -0
- package/dist/runtime/context/gc-candidates-exec.d.ts +6 -0
- package/dist/runtime/context/gc-candidates-exec.js +131 -0
- package/dist/runtime/context/gc-candidates-read-patch.d.ts +7 -0
- package/dist/runtime/context/gc-candidates-read-patch.js +118 -0
- package/dist/runtime/context/gc-candidates-subagent.d.ts +6 -0
- package/dist/runtime/context/gc-candidates-subagent.js +100 -0
- package/dist/runtime/context/gc-candidates-web.d.ts +6 -0
- package/dist/runtime/context/gc-candidates-web.js +58 -0
- package/dist/runtime/context/gc-candidates.d.ts +12 -0
- package/dist/runtime/context/gc-candidates.js +192 -0
- package/dist/runtime/context/gc-contracts.d.ts +57 -0
- package/dist/runtime/context/gc-economics.d.ts +48 -0
- package/dist/runtime/context/gc-economics.js +161 -0
- package/dist/runtime/context/gc-runtime.d.ts +43 -0
- package/dist/runtime/context/gc-tokens.d.ts +26 -0
- package/dist/runtime/context/gc-tokens.js +106 -0
- package/dist/runtime/context/gc.d.ts +7 -0
- package/dist/runtime/context/gc.js +552 -0
- package/dist/runtime/context/instructions.d.ts +37 -0
- package/dist/runtime/context/instructions.js +297 -0
- package/dist/runtime/context/normalize.d.ts +5 -0
- package/dist/runtime/context/projection.d.ts +23 -0
- package/dist/runtime/context/projection.js +284 -0
- package/dist/runtime/context/request-budget.d.ts +5 -0
- package/dist/runtime/context/request-budget.js +25 -0
- package/dist/runtime/context/restore.d.ts +27 -0
- package/dist/runtime/context/restore.js +186 -0
- package/dist/runtime/context/usage.d.ts +17 -0
- package/dist/runtime/context/usage.js +124 -0
- package/dist/runtime/context/world-state.d.ts +34 -0
- package/dist/runtime/context/world-state.js +232 -0
- package/dist/runtime/contracts.d.ts +29 -0
- package/dist/runtime/event-projection.d.ts +14 -0
- package/dist/runtime/event-projection.js +87 -0
- package/dist/runtime/events.d.ts +195 -0
- package/dist/runtime/execution-handle.d.ts +12 -0
- package/dist/runtime/execution-handle.js +1 -0
- package/dist/runtime/execution.d.ts +55 -0
- package/dist/runtime/execution.js +444 -0
- package/dist/runtime/model-progress.js +85 -0
- package/dist/runtime/resource-publication.d.ts +27 -0
- package/dist/runtime/resource-publication.js +60 -0
- package/dist/runtime/tool-round-contract.d.ts +19 -0
- package/dist/runtime/tool-round-contract.js +1 -0
- package/dist/runtime/wait.js +82 -0
- package/dist/sandbox/linux/bubblewrap-sandbox-executor.d.ts +1 -1
- package/dist/sandbox/linux/bubblewrap-sandbox-executor.js +8 -8
- package/dist/sdk/agent.d.ts +7 -0
- package/dist/sdk/agent.js +321 -0
- package/dist/sdk/execution-code-mode.d.ts +18 -0
- package/dist/sdk/execution-code-mode.js +51 -0
- package/dist/sdk/execution-compact-commit.d.ts +23 -0
- package/dist/sdk/execution-compact-commit.js +41 -0
- package/dist/sdk/execution-compact-extension.d.ts +12 -0
- package/dist/sdk/execution-compact-extension.js +46 -0
- package/dist/sdk/execution-compact-generation.d.ts +17 -0
- package/dist/sdk/execution-compact-generation.js +30 -0
- package/dist/sdk/execution-compaction-flight.d.ts +31 -0
- package/dist/sdk/execution-compaction-flight.js +50 -0
- package/dist/sdk/execution-compaction.d.ts +47 -0
- package/dist/sdk/execution-compaction.js +121 -0
- package/dist/sdk/execution-context-coordinator.d.ts +56 -0
- package/dist/sdk/execution-context-coordinator.js +102 -0
- package/dist/sdk/execution-input.d.ts +58 -0
- package/dist/sdk/execution-input.js +266 -0
- package/dist/sdk/execution-model-context.d.ts +52 -0
- package/dist/sdk/execution-model-context.js +156 -0
- package/dist/sdk/execution-model-lifecycle.d.ts +39 -0
- package/dist/sdk/execution-model-lifecycle.js +73 -0
- package/dist/sdk/execution-model-request.d.ts +40 -0
- package/dist/sdk/execution-model-request.js +45 -0
- package/dist/sdk/execution-round-preparation.d.ts +11 -0
- package/dist/sdk/execution-round-preparation.js +18 -0
- package/dist/sdk/execution-round-request.d.ts +30 -0
- package/dist/sdk/execution-round-request.js +31 -0
- package/dist/sdk/execution-tool-catalog.d.ts +46 -0
- package/dist/sdk/execution-tool-catalog.js +103 -0
- package/dist/sdk/execution-tool-scope.d.ts +67 -0
- package/dist/sdk/execution-tool-scope.js +147 -0
- package/dist/sdk/extension-agent-controller.d.ts +3 -0
- package/dist/sdk/extension-agent-controller.js +69 -0
- package/dist/sdk/extension-agents.d.ts +9 -0
- package/dist/sdk/extension-agents.js +58 -0
- package/dist/sdk/extension-models.d.ts +17 -0
- package/dist/sdk/extension-models.js +142 -0
- package/dist/sdk/extension-session-launch.d.ts +18 -0
- package/dist/sdk/extension-session-launch.js +73 -0
- package/dist/sdk/extension-session.d.ts +30 -0
- package/dist/sdk/extension-session.js +107 -0
- package/dist/sdk/extension-tool-runtime.d.ts +2 -0
- package/dist/sdk/extension-tool-runtime.js +14 -0
- package/dist/sdk/extension-tools.d.ts +16 -0
- package/dist/sdk/extension-tools.js +126 -0
- package/dist/sdk/model-input-projection.d.ts +4 -0
- package/dist/sdk/model-input-projection.js +27 -0
- package/dist/sdk/model-runtime.d.ts +21 -0
- package/dist/sdk/model-runtime.js +91 -0
- package/dist/sdk/native-steer.d.ts +20 -0
- package/dist/sdk/native-steer.js +84 -0
- package/dist/sdk/request-preparation.d.ts +9 -0
- package/dist/sdk/resource-input.d.ts +33 -0
- package/dist/sdk/resource-input.js +402 -0
- package/dist/sdk/session-catalog.d.ts +2 -0
- package/dist/sdk/session-catalog.js +12 -0
- package/dist/sdk/session-composition.d.ts +54 -0
- package/dist/sdk/session-composition.js +1 -0
- package/dist/sdk/session-execution-factory.d.ts +43 -0
- package/dist/sdk/session-execution-factory.js +937 -0
- package/dist/sdk/session-execution.d.ts +163 -0
- package/dist/sdk/session-execution.js +388 -0
- package/dist/sdk/session-extension-messages.d.ts +16 -0
- package/dist/sdk/session-extension-messages.js +64 -0
- package/dist/sdk/session-extension-prompt.d.ts +35 -0
- package/dist/sdk/session-extension-prompt.js +62 -0
- package/dist/sdk/session-maintenance.d.ts +25 -0
- package/dist/sdk/session-maintenance.js +205 -0
- package/dist/sdk/session-model-adapters.d.ts +28 -0
- package/dist/sdk/session-model-adapters.js +96 -0
- package/dist/sdk/session-open.d.ts +22 -0
- package/dist/sdk/session-open.js +44 -0
- package/dist/sdk/session-registry.d.ts +17 -0
- package/dist/sdk/session-registry.js +83 -0
- package/dist/sdk/session-runtime.d.ts +72 -0
- package/dist/sdk/session-runtime.js +205 -0
- package/dist/sdk/session.d.ts +3 -0
- package/dist/sdk/session.js +313 -0
- package/dist/sdk/subagent-backend.d.ts +3 -0
- package/dist/sdk/subagent-backend.js +49 -0
- package/dist/sdk/types.d.ts +80 -0
- package/dist/sdk/types.js +1 -0
- package/dist/session/catalog.d.ts +70 -0
- package/dist/session/catalog.js +194 -0
- package/dist/session/code-observation-contract.d.ts +40 -0
- package/dist/session/code-observation-contract.js +1 -0
- package/dist/session/code-observation-projection.d.ts +54 -0
- package/dist/session/code-observation-projection.js +165 -0
- package/dist/session/code-state.d.ts +27 -0
- package/dist/session/code-state.js +89 -0
- package/dist/session/context-gc-checkpoint.d.ts +26 -0
- package/dist/session/context-gc-checkpoint.js +935 -0
- package/dist/session/context-gc-contract.d.ts +141 -0
- package/dist/session/context-gc-contract.js +1 -0
- package/dist/session/context-gc-observations.d.ts +58 -0
- package/dist/session/context-gc-observations.js +187 -0
- package/dist/session/context-gc-replacements.d.ts +63 -0
- package/dist/session/context-gc-subagent.d.ts +54 -0
- package/dist/session/deferred-input.d.ts +5 -0
- package/dist/session/deferred-input.js +74 -0
- package/dist/session/extension-checkpoint.d.ts +8 -0
- package/dist/session/extension-checkpoint.js +30 -0
- package/dist/session/history-input-limits.d.ts +4 -0
- package/dist/session/history-input-limits.js +4 -0
- package/dist/session/inline-media-contract.d.ts +16 -0
- package/dist/session/inline-media-contract.js +1 -0
- package/dist/session/inline-media.d.ts +26 -0
- package/dist/session/inline-media.js +138 -0
- package/dist/session/model-request.d.ts +14 -0
- package/dist/session/model-request.js +1 -0
- package/dist/session/record-contract.d.ts +19 -0
- package/dist/session/record-contract.js +1 -0
- package/dist/session/record-projection.d.ts +6 -0
- package/dist/session/record-projection.js +80 -0
- package/dist/session/resource-contract.d.ts +9 -0
- package/dist/session/resource-contract.js +1 -0
- package/dist/session/rollback.d.ts +13 -0
- package/dist/session/rollback.js +46 -0
- package/dist/session/store/contracts.d.ts +160 -0
- package/dist/session/store/contracts.js +1 -0
- package/dist/session/store/current-state.d.ts +17 -0
- package/dist/session/store/current-state.js +53 -0
- package/dist/session/store/execution-state.d.ts +13 -0
- package/dist/session/store/execution-state.js +103 -0
- package/dist/session/store/index.d.ts +4 -0
- package/dist/session/store/index.js +2 -0
- package/dist/session/store/jsonl/directory-index.d.ts +26 -0
- package/dist/session/store/jsonl/directory-index.js +283 -0
- package/dist/session/store/jsonl/fs-durability.d.ts +3 -0
- package/dist/session/store/jsonl/fs-durability.js +17 -0
- package/dist/session/store/jsonl/history-replacement.d.ts +48 -0
- package/dist/session/store/jsonl/history-replacement.js +147 -0
- package/dist/session/store/jsonl/history.d.ts +25 -0
- package/dist/session/store/jsonl/history.js +181 -0
- package/dist/session/store/jsonl/images.d.ts +19 -0
- package/dist/session/store/jsonl/images.js +122 -0
- package/dist/session/store/jsonl/index-transaction.d.ts +13 -0
- package/dist/session/store/jsonl/index-transaction.js +87 -0
- package/dist/session/store/jsonl/jsonl-admission.d.ts +10 -0
- package/dist/session/store/jsonl/jsonl-admission.js +205 -0
- package/dist/session/store/jsonl/jsonl-codec.d.ts +11 -0
- package/dist/session/store/jsonl/jsonl-codec.js +138 -0
- package/dist/session/store/jsonl/jsonl-migration.d.ts +12 -0
- package/dist/session/store/jsonl/jsonl-migration.js +105 -0
- package/dist/session/store/jsonl/jsonl-store.d.ts +171 -0
- package/dist/session/store/jsonl/jsonl-store.js +2482 -0
- package/dist/session/store/jsonl/open-recovery.d.ts +13 -0
- package/dist/session/store/jsonl/open-recovery.js +131 -0
- package/dist/session/store/jsonl/read-pins.d.ts +4 -0
- package/dist/session/store/jsonl/read-pins.js +131 -0
- package/dist/session/store/jsonl/record-append.d.ts +16 -0
- package/dist/session/store/jsonl/record-append.js +49 -0
- package/dist/session/store/jsonl/records.d.ts +30 -0
- package/dist/session/store/jsonl/records.js +313 -0
- package/dist/session/store/jsonl/resources.d.ts +19 -0
- package/dist/session/store/jsonl/resources.js +209 -0
- package/dist/session/store/jsonl/store-pool.d.ts +12 -0
- package/dist/session/store/jsonl/store-pool.js +55 -0
- package/dist/session/store/jsonl/transaction-recovery.d.ts +48 -0
- package/dist/session/store/jsonl/transaction-recovery.js +374 -0
- package/dist/session/store/jsonl/tree-maintenance.d.ts +12 -0
- package/dist/session/store/jsonl/tree-maintenance.js +59 -0
- package/dist/session/store/types.d.ts +69 -0
- package/dist/session/store/types.js +1 -0
- package/dist/session/summary.d.ts +18 -0
- package/dist/session/summary.js +1 -0
- package/dist/session/todo.d.ts +11 -0
- package/dist/session/todo.js +30 -0
- package/dist/session/tool-result-resources.d.ts +27 -0
- package/dist/session/tool-result-resources.js +255 -0
- package/dist/session/types.js +1 -0
- package/dist/session/user-history.d.ts +17 -0
- package/dist/session/user-history.js +1 -0
- package/dist/session-store.d.ts +2 -0
- package/dist/session-store.js +1 -0
- package/dist/shared/auto-title.d.ts +3 -3
- package/dist/shared/auto-title.js +6 -6
- package/dist/shared/model-text.d.ts +8 -8
- package/dist/shared/model-text.js +8 -7
- package/dist/storage/file-lock.js +83 -0
- package/dist/subagent/contracts.d.ts +107 -0
- package/dist/subagent/contracts.js +1 -0
- package/dist/subagent/limits.d.ts +17 -0
- package/dist/subagent/limits.js +17 -0
- package/dist/subagent/model-update.js +81 -0
- package/dist/subagent/session-controller.d.ts +148 -0
- package/dist/subagent/session-controller.js +1761 -0
- package/dist/subagent/wait-targets.d.ts +10 -0
- package/dist/subagent/wait-targets.js +26 -0
- package/dist/subagent/wait.d.ts +26 -0
- package/dist/subagent/wait.js +73 -0
- package/dist/tools/agent/agent-cancel.d.ts +7 -0
- package/dist/tools/agent/agent-cancel.js +29 -0
- package/dist/tools/agent/agent-message.d.ts +7 -0
- package/dist/tools/agent/agent-message.js +57 -0
- package/dist/tools/agent/agent-start.d.ts +12 -0
- package/dist/tools/agent/agent-start.js +106 -0
- package/dist/tools/agent/agent-wait.d.ts +7 -0
- package/dist/tools/agent/agent-wait.js +91 -0
- package/dist/tools/agent/question.d.ts +7 -0
- package/dist/tools/agent/question.js +125 -0
- package/dist/tools/agent/skill.d.ts +11 -0
- package/dist/tools/agent/skill.js +38 -0
- package/dist/tools/agent/sleep.d.ts +9 -0
- package/dist/tools/agent/sleep.js +54 -0
- package/dist/tools/agent/smart-compact.d.ts +9 -0
- package/dist/tools/agent/smart-compact.js +23 -0
- package/dist/tools/agent/todo-read.d.ts +14 -0
- package/dist/tools/agent/todo-write.d.ts +14 -0
- package/dist/tools/agent/todo-write.js +66 -0
- package/dist/tools/agent/todo.d.ts +25 -0
- package/dist/tools/agent/todo.js +32 -0
- package/dist/tools/callers.d.ts +7 -0
- package/dist/tools/callers.js +39 -0
- package/dist/tools/code-mode/cells.d.ts +29 -0
- package/dist/tools/code-mode/cells.js +338 -0
- package/dist/tools/code-mode/dispatch.d.ts +20 -0
- package/dist/tools/code-mode/dispatch.js +80 -0
- package/dist/tools/code-mode/engine.d.ts +60 -0
- package/dist/tools/code-mode/engine.js +1 -0
- package/dist/tools/code-mode/index.d.ts +31 -0
- package/dist/tools/code-mode/index.js +751 -0
- package/dist/tools/code-mode/observations.d.ts +8 -0
- package/dist/tools/code-mode/observations.js +64 -0
- package/dist/tools/code-mode/worker.d.ts +1 -0
- package/dist/tools/contracts.d.ts +193 -0
- package/dist/tools/contracts.js +1 -0
- package/dist/tools/definition-projection.d.ts +1 -0
- package/dist/tools/definition-projection.js +1 -0
- package/dist/tools/execution-limits.d.ts +69 -0
- package/dist/tools/execution-limits.js +58 -0
- package/dist/tools/execution.d.ts +30 -0
- package/dist/tools/execution.js +191 -0
- package/dist/tools/local/apply-patch-parser.js +177 -0
- package/dist/tools/local/apply-patch.d.ts +19 -0
- package/dist/tools/local/apply-patch.js +489 -0
- package/dist/tools/local/exec.d.ts +28 -0
- package/dist/tools/local/exec.js +194 -0
- package/dist/tools/local/image-processing.js +146 -0
- package/dist/tools/local/read.d.ts +43 -0
- package/dist/tools/local/read.js +470 -0
- package/dist/tools/local/view-image.d.ts +15 -0
- package/dist/tools/local/view-image.js +317 -0
- package/dist/tools/mcp/catalog.js +220 -0
- package/dist/tools/mcp/history.d.ts +4 -0
- package/dist/tools/mcp/tool-search.d.ts +45 -0
- package/dist/tools/mcp/tool-search.js +294 -0
- package/dist/tools/output-projection.d.ts +18 -0
- package/dist/tools/output-projection.js +341 -0
- package/dist/tools/permission-contract.d.ts +25 -0
- package/dist/tools/permission-contract.js +1 -0
- package/dist/tools/permissions.d.ts +61 -0
- package/dist/tools/permissions.js +237 -0
- package/dist/tools/registry.d.ts +7 -0
- package/dist/tools/result-extension-contract.d.ts +37 -0
- package/dist/tools/result-extension-contract.js +32 -0
- package/dist/tools/result-extensions.d.ts +12 -0
- package/dist/tools/result-extensions.js +104 -0
- package/dist/tools/runtime-context.d.ts +89 -0
- package/dist/tools/runtime-context.js +1 -0
- package/dist/tools/runtime-resource-handles.js +28 -0
- package/dist/tools/runtime.js +77 -0
- package/dist/tools/scheduler.d.ts +12 -0
- package/dist/tools/shared/path-resolver.js +133 -0
- package/dist/tools/wait.d.ts +1 -0
- package/dist/tools/wait.js +1 -0
- package/package.json +15 -3
- package/dist/agent-core/error.d.ts +0 -15
- package/dist/agent-core/error.js +0 -74
- package/dist/agent-core/extensions/agents.d.ts +0 -79
- package/dist/agent-core/extensions/agents.js +0 -186
- package/dist/agent-core/extensions/compaction.d.ts +0 -48
- package/dist/agent-core/extensions/contracts.d.ts +0 -265
- package/dist/agent-core/extensions/data.d.ts +0 -84
- package/dist/agent-core/extensions/data.js +0 -83
- package/dist/agent-core/extensions/environment.d.ts +0 -27
- package/dist/agent-core/extensions/environment.js +0 -52
- package/dist/agent-core/extensions/files.d.ts +0 -64
- package/dist/agent-core/extensions/files.js +0 -26
- package/dist/agent-core/extensions/hooks.d.ts +0 -32
- package/dist/agent-core/extensions/manager.d.ts +0 -39
- package/dist/agent-core/extensions/manager.js +0 -458
- package/dist/agent-core/extensions/mcp.d.ts +0 -99
- package/dist/agent-core/extensions/mcp.js +0 -433
- package/dist/agent-core/extensions/model-request.d.ts +0 -56
- package/dist/agent-core/extensions/model-request.js +0 -197
- package/dist/agent-core/extensions/model-stream.d.ts +0 -9
- package/dist/agent-core/extensions/model-stream.js +0 -108
- package/dist/agent-core/extensions/models.d.ts +0 -43
- package/dist/agent-core/extensions/network.d.ts +0 -32
- package/dist/agent-core/extensions/network.js +0 -97
- package/dist/agent-core/extensions/operation.d.ts +0 -30
- package/dist/agent-core/extensions/processes.d.ts +0 -52
- package/dist/agent-core/extensions/processes.js +0 -284
- package/dist/agent-core/extensions/prompt-composition.d.ts +0 -24
- package/dist/agent-core/extensions/prompt-composition.js +0 -106
- package/dist/agent-core/extensions/prompt-input.d.ts +0 -23
- package/dist/agent-core/extensions/prompt-input.js +0 -48
- package/dist/agent-core/extensions/resources.d.ts +0 -27
- package/dist/agent-core/extensions/resources.js +0 -221
- package/dist/agent-core/extensions/services.d.ts +0 -31
- package/dist/agent-core/extensions/services.js +0 -61
- package/dist/agent-core/extensions/session-input.d.ts +0 -163
- package/dist/agent-core/extensions/session-input.js +0 -411
- package/dist/agent-core/extensions/session-messages.d.ts +0 -41
- package/dist/agent-core/extensions/session-messages.js +0 -76
- package/dist/agent-core/extensions/session.d.ts +0 -69
- package/dist/agent-core/extensions/session.js +0 -607
- package/dist/agent-core/extensions/settings.d.ts +0 -59
- package/dist/agent-core/extensions/settings.js +0 -115
- package/dist/agent-core/extensions/store.d.ts +0 -10
- package/dist/agent-core/extensions/store.js +0 -131
- package/dist/agent-core/extensions/tools.d.ts +0 -61
- package/dist/agent-core/extensions/tools.js +0 -269
- package/dist/agent-core/host/contracts.d.ts +0 -100
- package/dist/agent-core/host/contracts.js +0 -18
- package/dist/agent-core/host/local-agent-host.d.ts +0 -96
- package/dist/agent-core/host/local-agent-host.js +0 -425
- package/dist/agent-core/host/local-file-access.d.ts +0 -30
- package/dist/agent-core/host/local-file-access.js +0 -107
- package/dist/agent-core/host/local-network-access.d.ts +0 -6
- package/dist/agent-core/host/local-network-access.js +0 -101
- package/dist/agent-core/host/local-process-executor.d.ts +0 -29
- package/dist/agent-core/host/local-process-executor.js +0 -41
- package/dist/agent-core/host/local-session-environment.d.ts +0 -18
- package/dist/agent-core/host/local-shell.d.ts +0 -3
- package/dist/agent-core/host/network.d.ts +0 -4
- package/dist/agent-core/host/network.js +0 -6
- package/dist/agent-core/model/anthropic-messages.d.ts +0 -10
- package/dist/agent-core/model/anthropic-messages.js +0 -707
- package/dist/agent-core/model/anthropic-thinking.js +0 -33
- package/dist/agent-core/model/catalog-file.d.ts +0 -80
- package/dist/agent-core/model/catalog-file.js +0 -103
- package/dist/agent-core/model/configuration.d.ts +0 -127
- package/dist/agent-core/model/configuration.js +0 -168
- package/dist/agent-core/model/contracts.d.ts +0 -229
- package/dist/agent-core/model/http.d.ts +0 -27
- package/dist/agent-core/model/http.js +0 -534
- package/dist/agent-core/model/image.d.ts +0 -17
- package/dist/agent-core/model/openai-responses.d.ts +0 -77
- package/dist/agent-core/model/openai-responses.js +0 -2123
- package/dist/agent-core/model/product-user-agent.d.ts +0 -5
- package/dist/agent-core/model/product-user-agent.js +0 -22
- package/dist/agent-core/model/recovery.js +0 -80
- package/dist/agent-core/model/request-configuration.d.ts +0 -17
- package/dist/agent-core/model/request-configuration.js +0 -47
- package/dist/agent-core/model/runtime-credential.d.ts +0 -8
- package/dist/agent-core/model/runtime-credential.js +0 -72
- package/dist/agent-core/model/sse.js +0 -281
- package/dist/agent-core/model/text-blocks.js +0 -40
- package/dist/agent-core/model/tool-declarations.d.ts +0 -4
- package/dist/agent-core/model/transport-test.d.ts +0 -3
- package/dist/agent-core/model/transport-test.js +0 -23
- package/dist/agent-core/model/usage-observer.d.ts +0 -31
- package/dist/agent-core/prompts/index.d.ts +0 -20
- package/dist/agent-core/prompts/index.js +0 -49
- package/dist/agent-core/runtime/compaction/coordinator.js +0 -88
- package/dist/agent-core/runtime/compaction/generate.d.ts +0 -28
- package/dist/agent-core/runtime/compaction/generate.js +0 -84
- package/dist/agent-core/runtime/compaction/history.d.ts +0 -16
- package/dist/agent-core/runtime/compaction/operation.d.ts +0 -29
- package/dist/agent-core/runtime/compaction/operation.js +0 -131
- package/dist/agent-core/runtime/compaction/requests.d.ts +0 -16
- package/dist/agent-core/runtime/compaction/requests.js +0 -114
- package/dist/agent-core/runtime/compaction/retained-context.d.ts +0 -6
- package/dist/agent-core/runtime/compaction/retained-context.js +0 -47
- package/dist/agent-core/runtime/compaction/smart.d.ts +0 -14
- package/dist/agent-core/runtime/compaction/smart.js +0 -59
- package/dist/agent-core/runtime/context/contextual-blocks.d.ts +0 -30
- package/dist/agent-core/runtime/context/contextual-blocks.js +0 -146
- package/dist/agent-core/runtime/context/environment.d.ts +0 -5
- package/dist/agent-core/runtime/context/gc-runtime.d.ts +0 -38
- package/dist/agent-core/runtime/context/gc-tokens.d.ts +0 -25
- package/dist/agent-core/runtime/context/gc-tokens.js +0 -103
- package/dist/agent-core/runtime/context/gc.d.ts +0 -75
- package/dist/agent-core/runtime/context/gc.js +0 -1386
- package/dist/agent-core/runtime/context/instructions.d.ts +0 -37
- package/dist/agent-core/runtime/context/instructions.js +0 -297
- package/dist/agent-core/runtime/context/normalize.d.ts +0 -5
- package/dist/agent-core/runtime/context/projection.d.ts +0 -23
- package/dist/agent-core/runtime/context/projection.js +0 -284
- package/dist/agent-core/runtime/context/request-budget.d.ts +0 -4
- package/dist/agent-core/runtime/context/request-budget.js +0 -25
- package/dist/agent-core/runtime/context/restore.d.ts +0 -25
- package/dist/agent-core/runtime/context/restore.js +0 -186
- package/dist/agent-core/runtime/context/usage.d.ts +0 -17
- package/dist/agent-core/runtime/context/usage.js +0 -124
- package/dist/agent-core/runtime/context/world-state.d.ts +0 -33
- package/dist/agent-core/runtime/context/world-state.js +0 -232
- package/dist/agent-core/runtime/contracts.d.ts +0 -41
- package/dist/agent-core/runtime/event-projection.d.ts +0 -14
- package/dist/agent-core/runtime/event-projection.js +0 -87
- package/dist/agent-core/runtime/events.d.ts +0 -197
- package/dist/agent-core/runtime/execution-handle.d.ts +0 -12
- package/dist/agent-core/runtime/execution.d.ts +0 -50
- package/dist/agent-core/runtime/execution.js +0 -445
- package/dist/agent-core/runtime/model-progress.js +0 -85
- package/dist/agent-core/runtime/resource-publication.d.ts +0 -8
- package/dist/agent-core/runtime/resource-publication.js +0 -60
- package/dist/agent-core/sdk/agent.d.ts +0 -11
- package/dist/agent-core/sdk/agent.js +0 -474
- package/dist/agent-core/sdk/extension-agents.d.ts +0 -9
- package/dist/agent-core/sdk/extension-agents.js +0 -58
- package/dist/agent-core/sdk/extension-models.d.ts +0 -13
- package/dist/agent-core/sdk/extension-models.js +0 -137
- package/dist/agent-core/sdk/extension-session.d.ts +0 -30
- package/dist/agent-core/sdk/extension-session.js +0 -105
- package/dist/agent-core/sdk/extension-tools.d.ts +0 -16
- package/dist/agent-core/sdk/extension-tools.js +0 -126
- package/dist/agent-core/sdk/model-runtime.d.ts +0 -18
- package/dist/agent-core/sdk/model-runtime.js +0 -93
- package/dist/agent-core/sdk/native-steer.d.ts +0 -20
- package/dist/agent-core/sdk/native-steer.js +0 -84
- package/dist/agent-core/sdk/request-preparation.d.ts +0 -7
- package/dist/agent-core/sdk/resource-input.d.ts +0 -32
- package/dist/agent-core/sdk/resource-input.js +0 -403
- package/dist/agent-core/sdk/session.d.ts +0 -94
- package/dist/agent-core/sdk/session.js +0 -2377
- package/dist/agent-core/sdk/subagent-backend.d.ts +0 -3
- package/dist/agent-core/sdk/subagent-backend.js +0 -49
- package/dist/agent-core/sdk/types.d.ts +0 -81
- package/dist/agent-core/session/catalog.d.ts +0 -99
- package/dist/agent-core/session/catalog.js +0 -200
- package/dist/agent-core/session/context-gc-checkpoint.d.ts +0 -165
- package/dist/agent-core/session/context-gc-checkpoint.js +0 -935
- package/dist/agent-core/session/context-gc-observations.d.ts +0 -60
- package/dist/agent-core/session/context-gc-observations.js +0 -187
- package/dist/agent-core/session/context-gc-replacements.d.ts +0 -62
- package/dist/agent-core/session/context-gc-subagent.d.ts +0 -53
- package/dist/agent-core/session/deferred-input.d.ts +0 -5
- package/dist/agent-core/session/deferred-input.js +0 -74
- package/dist/agent-core/session/inline-media.d.ts +0 -45
- package/dist/agent-core/session/inline-media.js +0 -163
- package/dist/agent-core/session/rollback.d.ts +0 -13
- package/dist/agent-core/session/rollback.js +0 -46
- package/dist/agent-core/session/store/contracts.d.ts +0 -158
- package/dist/agent-core/session/store/current-state.d.ts +0 -17
- package/dist/agent-core/session/store/current-state.js +0 -53
- package/dist/agent-core/session/store/directory-index.d.ts +0 -18
- package/dist/agent-core/session/store/directory-index.js +0 -169
- package/dist/agent-core/session/store/execution-state.d.ts +0 -18
- package/dist/agent-core/session/store/execution-state.js +0 -175
- package/dist/agent-core/session/store/history.d.ts +0 -25
- package/dist/agent-core/session/store/history.js +0 -181
- package/dist/agent-core/session/store/images.d.ts +0 -19
- package/dist/agent-core/session/store/images.js +0 -110
- package/dist/agent-core/session/store/index.d.ts +0 -4
- package/dist/agent-core/session/store/index.js +0 -2
- package/dist/agent-core/session/store/jsonl-store.d.ts +0 -171
- package/dist/agent-core/session/store/jsonl-store.js +0 -2078
- package/dist/agent-core/session/store/records.d.ts +0 -23
- package/dist/agent-core/session/store/records.js +0 -261
- package/dist/agent-core/session/store/resources.d.ts +0 -26
- package/dist/agent-core/session/store/resources.js +0 -197
- package/dist/agent-core/session/store/types.d.ts +0 -82
- package/dist/agent-core/session/tool-result-resources.d.ts +0 -26
- package/dist/agent-core/session/tool-result-resources.js +0 -256
- package/dist/agent-core/session/transaction-recovery.d.ts +0 -16
- package/dist/agent-core/session/transaction-recovery.js +0 -135
- package/dist/agent-core/storage/file-lock.js +0 -83
- package/dist/agent-core/subagent/contracts.d.ts +0 -117
- package/dist/agent-core/subagent/model-update.js +0 -81
- package/dist/agent-core/subagent/scheduler.d.ts +0 -135
- package/dist/agent-core/subagent/scheduler.js +0 -369
- package/dist/agent-core/subagent/session-controller.d.ts +0 -138
- package/dist/agent-core/subagent/session-controller.js +0 -1594
- package/dist/agent-core/subagent/wait.d.ts +0 -14
- package/dist/agent-core/subagent/wait.js +0 -32
- package/dist/agent-core/tools/agent/agent-cancel.d.ts +0 -7
- package/dist/agent-core/tools/agent/agent-cancel.js +0 -29
- package/dist/agent-core/tools/agent/agent-message.d.ts +0 -7
- package/dist/agent-core/tools/agent/agent-message.js +0 -57
- package/dist/agent-core/tools/agent/agent-start.d.ts +0 -12
- package/dist/agent-core/tools/agent/agent-start.js +0 -106
- package/dist/agent-core/tools/agent/agent-wait.d.ts +0 -7
- package/dist/agent-core/tools/agent/agent-wait.js +0 -91
- package/dist/agent-core/tools/agent/question.d.ts +0 -7
- package/dist/agent-core/tools/agent/question.js +0 -125
- package/dist/agent-core/tools/agent/skill.d.ts +0 -11
- package/dist/agent-core/tools/agent/skill.js +0 -38
- package/dist/agent-core/tools/agent/sleep.d.ts +0 -12
- package/dist/agent-core/tools/agent/sleep.js +0 -54
- package/dist/agent-core/tools/agent/smart-compact.d.ts +0 -9
- package/dist/agent-core/tools/agent/smart-compact.js +0 -23
- package/dist/agent-core/tools/agent/todo-read.d.ts +0 -14
- package/dist/agent-core/tools/agent/todo-write.d.ts +0 -14
- package/dist/agent-core/tools/agent/todo-write.js +0 -66
- package/dist/agent-core/tools/agent/todo.d.ts +0 -26
- package/dist/agent-core/tools/agent/todo.js +0 -60
- package/dist/agent-core/tools/callers.d.ts +0 -6
- package/dist/agent-core/tools/callers.js +0 -39
- package/dist/agent-core/tools/code-mode/cells.d.ts +0 -29
- package/dist/agent-core/tools/code-mode/cells.js +0 -337
- package/dist/agent-core/tools/code-mode/dispatch.d.ts +0 -20
- package/dist/agent-core/tools/code-mode/dispatch.js +0 -80
- package/dist/agent-core/tools/code-mode/engine.d.ts +0 -60
- package/dist/agent-core/tools/code-mode/index.d.ts +0 -29
- package/dist/agent-core/tools/code-mode/index.js +0 -749
- package/dist/agent-core/tools/code-mode/observations.d.ts +0 -98
- package/dist/agent-core/tools/code-mode/observations.js +0 -228
- package/dist/agent-core/tools/code-mode/state.d.ts +0 -9
- package/dist/agent-core/tools/code-mode/state.js +0 -82
- package/dist/agent-core/tools/contracts.d.ts +0 -211
- package/dist/agent-core/tools/definition-projection.d.ts +0 -7
- package/dist/agent-core/tools/definition-projection.js +0 -26
- package/dist/agent-core/tools/execution-limits.d.ts +0 -69
- package/dist/agent-core/tools/execution-limits.js +0 -69
- package/dist/agent-core/tools/execution.d.ts +0 -46
- package/dist/agent-core/tools/execution.js +0 -191
- package/dist/agent-core/tools/local/apply-patch-parser.js +0 -177
- package/dist/agent-core/tools/local/apply-patch.d.ts +0 -19
- package/dist/agent-core/tools/local/apply-patch.js +0 -489
- package/dist/agent-core/tools/local/exec.d.ts +0 -53
- package/dist/agent-core/tools/local/exec.js +0 -877
- package/dist/agent-core/tools/local/image-processing.js +0 -146
- package/dist/agent-core/tools/local/read-context.js +0 -152
- package/dist/agent-core/tools/local/read.d.ts +0 -43
- package/dist/agent-core/tools/local/read.js +0 -470
- package/dist/agent-core/tools/local/registry.d.ts +0 -34
- package/dist/agent-core/tools/local/registry.js +0 -132
- package/dist/agent-core/tools/local/view-image.d.ts +0 -15
- package/dist/agent-core/tools/local/view-image.js +0 -317
- package/dist/agent-core/tools/local/workspace-tools.d.ts +0 -12
- package/dist/agent-core/tools/local/workspace-tools.js +0 -28
- package/dist/agent-core/tools/mcp/catalog.js +0 -220
- package/dist/agent-core/tools/mcp/history.d.ts +0 -4
- package/dist/agent-core/tools/mcp/tool-search.d.ts +0 -45
- package/dist/agent-core/tools/mcp/tool-search.js +0 -294
- package/dist/agent-core/tools/output-projection.d.ts +0 -18
- package/dist/agent-core/tools/output-projection.js +0 -341
- package/dist/agent-core/tools/permissions.d.ts +0 -85
- package/dist/agent-core/tools/permissions.js +0 -237
- package/dist/agent-core/tools/registry.d.ts +0 -7
- package/dist/agent-core/tools/result-extensions.d.ts +0 -46
- package/dist/agent-core/tools/result-extensions.js +0 -134
- package/dist/agent-core/tools/runtime-context.d.ts +0 -74
- package/dist/agent-core/tools/runtime-resource-handles.js +0 -28
- package/dist/agent-core/tools/runtime.js +0 -77
- package/dist/agent-core/tools/scheduler.d.ts +0 -12
- package/dist/agent-core/tools/shared/path-resolver.js +0 -133
- package/dist/agent-core/tools/wait.js +0 -82
- /package/dist/{agent-core/extensions/models.js → extensions/capabilities.js} +0 -0
- /package/dist/{agent-core/extensions → extensions}/compaction.js +0 -0
- /package/dist/{agent-core/model → extensions}/contracts.js +0 -0
- /package/dist/{agent-core/extensions → extensions}/hooks.js +0 -0
- /package/dist/{agent-core/runtime/context/contracts.js → extensions/host-ports.js} +0 -0
- /package/dist/{agent-core/extensions → extensions}/operation.js +0 -0
- /package/dist/{agent-core/runtime/contracts.js → extensions/tool-runtime.js} +0 -0
- /package/dist/{agent-core/extensions/contracts.js → extensions.js} +0 -0
- /package/dist/{agent-core/runtime/events.js → host/description.js} +0 -0
- /package/dist/{agent-core/host → host}/local-session-environment.js +0 -0
- /package/dist/{agent-core/host → host}/local-shell.js +0 -0
- /package/dist/{agent-core/runtime/execution-handle.js → host/skill-contract.js} +0 -0
- /package/dist/{agent-core/model → model}/anthropic-thinking.d.ts +0 -0
- /package/dist/{agent-core/model → model}/attempt-diagnostics.d.ts +0 -0
- /package/dist/{agent-core/model → model}/attempt-diagnostics.js +0 -0
- /package/dist/{agent-core/session/store → model}/contracts.js +0 -0
- /package/dist/{agent-core/sdk/types.js → model/image-contract.js} +0 -0
- /package/dist/{agent-core/model → model}/image.js +0 -0
- /package/dist/{agent-core/model → model}/native-context.d.ts +0 -0
- /package/dist/{agent-core/model → model}/native-context.js +0 -0
- /package/dist/{agent-core/model → model}/recovery.d.ts +0 -0
- /package/dist/{agent-core/model → model}/sse.d.ts +0 -0
- /package/dist/{agent-core/model → model}/text-blocks.d.ts +0 -0
- /package/dist/{agent-core/model → model}/tool-declarations.js +0 -0
- /package/dist/{agent-core/model → model}/tool-input.d.ts +0 -0
- /package/dist/{agent-core/model → model}/tool-input.js +0 -0
- /package/dist/{agent-core/model → model}/usage-observer.js +0 -0
- /package/dist/{agent-core/session/store/types.js → model/usage.js} +0 -0
- /package/dist/{agent-core/subagent → process}/contracts.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/compact.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/compact.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/core.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/core.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/markup.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/markup.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/modes.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/modes.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/output.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/output.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/permissions.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/permissions.js +0 -0
- /package/dist/{agent-core/tools/local → prompts}/read-context.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/resources.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/resources.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/subagent.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/subagent.js +0 -0
- /package/dist/{agent-core/prompts → prompts}/workflow.d.ts +0 -0
- /package/dist/{agent-core/prompts → prompts}/workflow.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/async-queue.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/async-queue.js +0 -0
- /package/dist/{agent-core/tools → runtime/compaction}/contracts.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/compaction/coordinator.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/compaction/history.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/context/contracts.d.ts +0 -0
- /package/dist/{agent-core/session/types.js → runtime/context/contracts.js} +0 -0
- /package/dist/{agent-core/runtime → runtime}/context/environment.js +0 -0
- /package/dist/{agent-core/tools/code-mode/engine.js → runtime/context/gc-contracts.js} +0 -0
- /package/dist/{agent-core/runtime → runtime}/context/gc-runtime.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/context/normalize.js +0 -0
- /package/dist/{agent-core/tools/code-mode/worker.d.ts → runtime/contracts.js} +0 -0
- /package/dist/{agent-core/tools/runtime-context.js → runtime/events.js} +0 -0
- /package/dist/{agent-core/runtime → runtime}/execution-policy.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/execution-policy.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/model-generation-timing.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/model-generation-timing.js +0 -0
- /package/dist/{agent-core/runtime → runtime}/model-progress.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/plan-output.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/plan-output.js +0 -0
- /package/dist/{agent-core/tools/public-metadata.d.ts → runtime/public-tool-metadata.d.ts} +0 -0
- /package/dist/{agent-core/tools/public-metadata.js → runtime/public-tool-metadata.js} +0 -0
- /package/dist/{agent-core/runtime → runtime}/token-budget.d.ts +0 -0
- /package/dist/{agent-core/runtime → runtime}/token-budget.js +0 -0
- /package/dist/{agent-core/tools → runtime}/wait.d.ts +0 -0
- /package/dist/{agent-core/sdk → sdk}/request-preparation.js +0 -0
- /package/dist/{agent-core/session → session}/context-gc-markup.d.ts +0 -0
- /package/dist/{agent-core/session → session}/context-gc-markup.js +0 -0
- /package/dist/{agent-core/session → session}/context-gc-replacements.js +0 -0
- /package/dist/{agent-core/session → session}/context-gc-subagent.js +0 -0
- /package/dist/{agent-core/session → session}/types.d.ts +0 -0
- /package/dist/{agent-core/storage → storage}/file-lock.d.ts +0 -0
- /package/dist/{agent-core/subagent → subagent}/model-update.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/agent/todo-read.js +0 -0
- /package/dist/{agent-core/tools → tools}/code-mode/quickjs-engine.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/code-mode/quickjs-engine.js +0 -0
- /package/dist/{agent-core/tools → tools}/code-mode/text-output.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/code-mode/text-output.js +0 -0
- /package/dist/{agent-core/tools → tools}/code-mode/worker.js +0 -0
- /package/dist/{agent-core/tools → tools}/file-change-diff.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/file-change-diff.js +0 -0
- /package/dist/{agent-core/tools → tools}/input-diagnostics/source-preview.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/input-diagnostics/source-preview.js +0 -0
- /package/dist/{agent-core/tools → tools}/input.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/input.js +0 -0
- /package/dist/{agent-core/tools → tools}/local/apply-patch-parser.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/local/image-processing.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/mcp/catalog.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/mcp/history.js +0 -0
- /package/dist/{agent-core/tools → tools}/registry.js +0 -0
- /package/dist/{agent-core/tools → tools}/runtime-resource-handles.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/runtime.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/scheduler.js +0 -0
- /package/dist/{agent-core/tools → tools}/shared/patch-result.d.ts +0 -0
- /package/dist/{agent-core/tools → tools}/shared/patch-result.js +0 -0
- /package/dist/{agent-core/tools → tools}/shared/path-resolver.d.ts +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { ModelImage } from '../../model/image.js';
|
|
2
|
-
/** Execution metadata is independent of explicit model observations. */
|
|
3
|
-
export interface CodeToolCallRecord {
|
|
4
|
-
callId: string;
|
|
5
|
-
toolName: string;
|
|
6
|
-
input: unknown;
|
|
7
|
-
status: 'running' | 'completed' | 'failed';
|
|
8
|
-
resultExtensions?: readonly import('../result-extensions.js').ToolResultExtension[];
|
|
9
|
-
result?: {
|
|
10
|
-
content: string;
|
|
11
|
-
data?: unknown;
|
|
12
|
-
truncated?: boolean;
|
|
13
|
-
};
|
|
14
|
-
error?: {
|
|
15
|
-
code: string;
|
|
16
|
-
message: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare function parseCodeCalls(value: unknown): CodeToolCallRecord[] | undefined;
|
|
20
|
-
export type CodeObservation = {
|
|
21
|
-
type: 'tool_result';
|
|
22
|
-
id: string;
|
|
23
|
-
source: {
|
|
24
|
-
callId: string;
|
|
25
|
-
toolName: string;
|
|
26
|
-
input: unknown;
|
|
27
|
-
};
|
|
28
|
-
outcome: 'completed' | 'failed';
|
|
29
|
-
result: {
|
|
30
|
-
content: string;
|
|
31
|
-
data?: unknown;
|
|
32
|
-
truncated?: boolean;
|
|
33
|
-
imageIndices?: number[];
|
|
34
|
-
};
|
|
35
|
-
} | {
|
|
36
|
-
type: 'value';
|
|
37
|
-
id: string;
|
|
38
|
-
format: 'text' | 'json' | 'image';
|
|
39
|
-
value: string;
|
|
40
|
-
truncated?: boolean;
|
|
41
|
-
imageIndices?: number[];
|
|
42
|
-
};
|
|
43
|
-
export declare function observationContent(value: CodeObservation): string;
|
|
44
|
-
export declare function observationImages(value: CodeObservation): readonly number[];
|
|
45
|
-
export declare function selectObservationImages(values: readonly CodeObservation[], images: readonly ModelImage[], offset?: number): {
|
|
46
|
-
observations: ({
|
|
47
|
-
result: {
|
|
48
|
-
imageIndices: number[];
|
|
49
|
-
content: string;
|
|
50
|
-
data?: unknown;
|
|
51
|
-
truncated?: boolean;
|
|
52
|
-
};
|
|
53
|
-
type: "tool_result";
|
|
54
|
-
id: string;
|
|
55
|
-
source: {
|
|
56
|
-
callId: string;
|
|
57
|
-
toolName: string;
|
|
58
|
-
input: unknown;
|
|
59
|
-
};
|
|
60
|
-
outcome: "completed" | "failed";
|
|
61
|
-
} | {
|
|
62
|
-
imageIndices: number[];
|
|
63
|
-
type: "value";
|
|
64
|
-
id: string;
|
|
65
|
-
format: "text" | "json" | "image";
|
|
66
|
-
value: string;
|
|
67
|
-
truncated?: boolean;
|
|
68
|
-
})[];
|
|
69
|
-
images: ModelImage[];
|
|
70
|
-
};
|
|
71
|
-
/** Only the visible projection crosses into model text; program data and inputs stay private. */
|
|
72
|
-
export declare function visibleObservation(value: CodeObservation): Record<string, unknown>;
|
|
73
|
-
export declare function renderObservations(values: readonly CodeObservation[]): string;
|
|
74
|
-
export declare function renderObservationResult(values: readonly CodeObservation[], original: string): string;
|
|
75
|
-
/** Truncate each body before encoding, never a JSON array or its trusted identity. */
|
|
76
|
-
export declare function boundObservations(values: readonly CodeObservation[], maximumTokens: number): {
|
|
77
|
-
observations: CodeObservation[];
|
|
78
|
-
content: string;
|
|
79
|
-
truncated: boolean;
|
|
80
|
-
};
|
|
81
|
-
export declare function newObservationId(): string;
|
|
82
|
-
export declare function observationModelParts(message: {
|
|
83
|
-
content?: string;
|
|
84
|
-
textBlocks?: readonly {
|
|
85
|
-
readonly text: string;
|
|
86
|
-
}[];
|
|
87
|
-
observations?: readonly CodeObservation[];
|
|
88
|
-
images?: readonly import('../../model/image.js').ModelImage[];
|
|
89
|
-
}): Array<{
|
|
90
|
-
type: 'text';
|
|
91
|
-
text: string;
|
|
92
|
-
} | {
|
|
93
|
-
type: 'image';
|
|
94
|
-
image: import('../../model/image.js').ModelImage;
|
|
95
|
-
}> | undefined;
|
|
96
|
-
/** Uses the same visible text as both adapters, without pixels or private observation data. */
|
|
97
|
-
export declare function observationModelText(message: Parameters<typeof observationModelParts>[0]): string | undefined;
|
|
98
|
-
export declare function parseObservations(value: unknown): CodeObservation[] | undefined;
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { truncateModelText, countModelTokens } from '../../runtime/token-budget.js';
|
|
3
|
-
export function parseCodeCalls(value) {
|
|
4
|
-
if (!Array.isArray(value) || value.length > 128)
|
|
5
|
-
return undefined;
|
|
6
|
-
const ids = new Set();
|
|
7
|
-
for (const item of value) {
|
|
8
|
-
if (!item ||
|
|
9
|
-
typeof item !== 'object' ||
|
|
10
|
-
typeof item.callId !== 'string' ||
|
|
11
|
-
!item.callId ||
|
|
12
|
-
ids.has(item.callId) ||
|
|
13
|
-
typeof item.toolName !== 'string' ||
|
|
14
|
-
!['running', 'completed', 'failed'].includes(item.status))
|
|
15
|
-
return undefined;
|
|
16
|
-
if (item.result !== undefined && (!item.result || typeof item.result.content !== 'string'))
|
|
17
|
-
return undefined;
|
|
18
|
-
ids.add(item.callId);
|
|
19
|
-
}
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
export function observationContent(value) {
|
|
23
|
-
return value.type === 'tool_result' ? value.result.content : value.value;
|
|
24
|
-
}
|
|
25
|
-
export function observationImages(value) {
|
|
26
|
-
return value.type === 'tool_result'
|
|
27
|
-
? (value.result.imageIndices ?? [])
|
|
28
|
-
: (value.imageIndices ?? []);
|
|
29
|
-
}
|
|
30
|
-
export function selectObservationImages(values, images, offset = 0) {
|
|
31
|
-
const selected = [];
|
|
32
|
-
const indices = new Map();
|
|
33
|
-
const observations = values.map((value) => {
|
|
34
|
-
const remap = observationImages(value).flatMap((index) => {
|
|
35
|
-
const image = images[index - offset];
|
|
36
|
-
if (!image)
|
|
37
|
-
return [];
|
|
38
|
-
let next = indices.get(index);
|
|
39
|
-
if (next === undefined) {
|
|
40
|
-
next = selected.length;
|
|
41
|
-
indices.set(index, next);
|
|
42
|
-
selected.push(image);
|
|
43
|
-
}
|
|
44
|
-
return [next];
|
|
45
|
-
});
|
|
46
|
-
return value.type === 'tool_result'
|
|
47
|
-
? { ...value, result: { ...value.result, imageIndices: remap } }
|
|
48
|
-
: { ...value, imageIndices: remap };
|
|
49
|
-
});
|
|
50
|
-
return { observations, images: selected };
|
|
51
|
-
}
|
|
52
|
-
/** Only the visible projection crosses into model text; program data and inputs stay private. */
|
|
53
|
-
export function visibleObservation(value) {
|
|
54
|
-
return value.type === 'tool_result'
|
|
55
|
-
? {
|
|
56
|
-
type: value.type,
|
|
57
|
-
toolName: value.source.toolName,
|
|
58
|
-
outcome: value.outcome,
|
|
59
|
-
content: value.result.content,
|
|
60
|
-
...(value.result.truncated ? { truncated: true } : {})
|
|
61
|
-
}
|
|
62
|
-
: {
|
|
63
|
-
type: value.type,
|
|
64
|
-
format: value.format,
|
|
65
|
-
value: value.value,
|
|
66
|
-
...(value.truncated ? { truncated: true } : {})
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export function renderObservations(values) {
|
|
70
|
-
return JSON.stringify(values.map(visibleObservation));
|
|
71
|
-
}
|
|
72
|
-
function visibleObservationText(value) {
|
|
73
|
-
const { content: _content, value: _value, ...header } = visibleObservation(value);
|
|
74
|
-
const body = observationContent(value);
|
|
75
|
-
return JSON.stringify(header) + (body.length ? `\n${body}` : '');
|
|
76
|
-
}
|
|
77
|
-
export function renderObservationResult(values, original) {
|
|
78
|
-
try {
|
|
79
|
-
const envelope = JSON.parse(original);
|
|
80
|
-
if (envelope && !Array.isArray(envelope) && typeof envelope === 'object')
|
|
81
|
-
return JSON.stringify({ ...envelope, observations: values.map(visibleObservation) });
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
// A non-JSON envelope falls back to the bounded observation rendering.
|
|
85
|
-
}
|
|
86
|
-
return renderObservations(values);
|
|
87
|
-
}
|
|
88
|
-
/** Truncate each body before encoding, never a JSON array or its trusted identity. */
|
|
89
|
-
export function boundObservations(values, maximumTokens) {
|
|
90
|
-
let remaining = Math.max(0, maximumTokens - 2);
|
|
91
|
-
let truncated = false;
|
|
92
|
-
const observations = [];
|
|
93
|
-
const selected = [];
|
|
94
|
-
let overheadBudget = 0;
|
|
95
|
-
for (const original of values) {
|
|
96
|
-
const empty = original.type === 'tool_result'
|
|
97
|
-
? { ...original, result: { ...original.result, content: '', truncated: true } }
|
|
98
|
-
: { ...original, value: '', truncated: true };
|
|
99
|
-
const overhead = countModelTokens(visibleObservationText(empty)) + 8;
|
|
100
|
-
if (overheadBudget + overhead > remaining) {
|
|
101
|
-
truncated = true;
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
selected.push({ original, overhead });
|
|
105
|
-
overheadBudget += overhead;
|
|
106
|
-
}
|
|
107
|
-
for (const { original, overhead } of selected) {
|
|
108
|
-
let bodyBudget = Math.max(0, remaining - overheadBudget - 12);
|
|
109
|
-
let value;
|
|
110
|
-
let bodyTruncated = false;
|
|
111
|
-
for (;;) {
|
|
112
|
-
const bounded = truncateModelText(observationContent(original), bodyBudget);
|
|
113
|
-
bodyTruncated ||= bounded.truncated;
|
|
114
|
-
value =
|
|
115
|
-
original.type === 'tool_result'
|
|
116
|
-
? {
|
|
117
|
-
...original,
|
|
118
|
-
result: {
|
|
119
|
-
...original.result,
|
|
120
|
-
content: bounded.content,
|
|
121
|
-
truncated: original.result.truncated === true || bodyTruncated
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
: {
|
|
125
|
-
...original,
|
|
126
|
-
value: bounded.content,
|
|
127
|
-
truncated: original.truncated === true || bodyTruncated
|
|
128
|
-
};
|
|
129
|
-
if (countModelTokens(visibleObservationText(value)) + 1 <=
|
|
130
|
-
remaining - (overheadBudget - overhead) ||
|
|
131
|
-
bodyBudget === 0)
|
|
132
|
-
break;
|
|
133
|
-
bodyBudget = Math.floor(bodyBudget / 2);
|
|
134
|
-
}
|
|
135
|
-
overheadBudget -= overhead;
|
|
136
|
-
observations.push(value);
|
|
137
|
-
remaining -= countModelTokens(visibleObservationText(value)) + 1;
|
|
138
|
-
truncated ||=
|
|
139
|
-
bodyTruncated ||
|
|
140
|
-
(original.type === 'tool_result'
|
|
141
|
-
? original.result.truncated === true
|
|
142
|
-
: original.truncated === true);
|
|
143
|
-
}
|
|
144
|
-
return { observations, content: renderObservations(observations), truncated };
|
|
145
|
-
}
|
|
146
|
-
export function newObservationId() {
|
|
147
|
-
return randomUUID();
|
|
148
|
-
}
|
|
149
|
-
export function observationModelParts(message) {
|
|
150
|
-
if (message.textBlocks !== undefined || message.observations === undefined)
|
|
151
|
-
return undefined;
|
|
152
|
-
const prefix = [];
|
|
153
|
-
try {
|
|
154
|
-
const parsed = JSON.parse(message.content ?? '');
|
|
155
|
-
if (parsed && !Array.isArray(parsed) && typeof parsed === 'object') {
|
|
156
|
-
const { observations: _observations, ...metadata } = parsed;
|
|
157
|
-
const cellEnvelope = typeof metadata.cellId === 'string' &&
|
|
158
|
-
typeof metadata.status === 'string' &&
|
|
159
|
-
Array.isArray(_observations);
|
|
160
|
-
if (!message.observations.length && !cellEnvelope)
|
|
161
|
-
return undefined;
|
|
162
|
-
if (cellEnvelope) {
|
|
163
|
-
// Keep execution facts in storage; project only actionable lifecycle metadata.
|
|
164
|
-
delete metadata.toolCalls;
|
|
165
|
-
delete metadata.outputBytes;
|
|
166
|
-
if (metadata.outputDroppedBytes === 0)
|
|
167
|
-
delete metadata.outputDroppedBytes;
|
|
168
|
-
if (metadata.truncated === false)
|
|
169
|
-
delete metadata.truncated;
|
|
170
|
-
if (metadata.cached === false)
|
|
171
|
-
delete metadata.cached;
|
|
172
|
-
}
|
|
173
|
-
prefix.push({ type: 'text', text: JSON.stringify(metadata) });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
// Malformed envelope metadata must not hide structured observations.
|
|
178
|
-
}
|
|
179
|
-
if (!message.observations.length && !prefix.length)
|
|
180
|
-
return undefined;
|
|
181
|
-
return [
|
|
182
|
-
...prefix,
|
|
183
|
-
...message.observations.flatMap((value) => {
|
|
184
|
-
const parts = [{ type: 'text', text: visibleObservationText(value) }];
|
|
185
|
-
for (const index of observationImages(value)) {
|
|
186
|
-
const image = message.images?.[index];
|
|
187
|
-
if (image)
|
|
188
|
-
parts.push({ type: 'image', image });
|
|
189
|
-
}
|
|
190
|
-
return parts;
|
|
191
|
-
})
|
|
192
|
-
];
|
|
193
|
-
}
|
|
194
|
-
/** Uses the same visible text as both adapters, without pixels or private observation data. */
|
|
195
|
-
export function observationModelText(message) {
|
|
196
|
-
return observationModelParts(message)
|
|
197
|
-
?.flatMap((part) => (part.type === 'text' ? [part.text] : []))
|
|
198
|
-
.join('\n');
|
|
199
|
-
}
|
|
200
|
-
export function parseObservations(value) {
|
|
201
|
-
if (!Array.isArray(value) || value.length > 4096)
|
|
202
|
-
return undefined;
|
|
203
|
-
const ids = new Set();
|
|
204
|
-
for (const item of value) {
|
|
205
|
-
if (!item || typeof item !== 'object' || typeof item.id !== 'string' || ids.has(item.id))
|
|
206
|
-
return undefined;
|
|
207
|
-
ids.add(item.id);
|
|
208
|
-
if (item.type === 'tool_result') {
|
|
209
|
-
if (!item.source ||
|
|
210
|
-
typeof item.source.callId !== 'string' ||
|
|
211
|
-
typeof item.source.toolName !== 'string' ||
|
|
212
|
-
!['completed', 'failed'].includes(item.outcome) ||
|
|
213
|
-
!item.result ||
|
|
214
|
-
typeof item.result.content !== 'string')
|
|
215
|
-
return undefined;
|
|
216
|
-
}
|
|
217
|
-
else if (item.type !== 'value' ||
|
|
218
|
-
!['text', 'json', 'image'].includes(item.format) ||
|
|
219
|
-
typeof item.value !== 'string')
|
|
220
|
-
return undefined;
|
|
221
|
-
const indices = item.type === 'tool_result' ? item.result.imageIndices : item.imageIndices;
|
|
222
|
-
if (indices !== undefined &&
|
|
223
|
-
(!Array.isArray(indices) ||
|
|
224
|
-
indices.some((i) => !Number.isSafeInteger(i) || Number(i) < 0 || Number(i) >= 5)))
|
|
225
|
-
return undefined;
|
|
226
|
-
}
|
|
227
|
-
return value;
|
|
228
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CodeModeStateEntry, CodeModeStateMutation } from '../contracts.js';
|
|
2
|
-
export type { CodeModeStateEntry, CodeModeStateMutation } from '../contracts.js';
|
|
3
|
-
type StateRecord = {
|
|
4
|
-
readonly type: string;
|
|
5
|
-
readonly payload: unknown;
|
|
6
|
-
};
|
|
7
|
-
export declare function parseCodeModeStateMutations(value: unknown): CodeModeStateMutation[];
|
|
8
|
-
export declare function restoreCodeModeState(records: readonly StateRecord[], initialState?: CodeModeStateEntry[]): CodeModeStateEntry[];
|
|
9
|
-
export declare function applyCodeModeStateMutations(entries: readonly CodeModeStateEntry[], mutations: readonly CodeModeStateMutation[]): CodeModeStateEntry[];
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { MarAgentError } from '../../error.js';
|
|
2
|
-
import { TOOL_EXECUTION_LIMITS as limits } from '../execution-limits.js';
|
|
3
|
-
export function parseCodeModeStateMutations(value) {
|
|
4
|
-
if (!Array.isArray(value) || value.length > limits.codeStateMaxMutations)
|
|
5
|
-
throw invalidState();
|
|
6
|
-
return value.map((item) => {
|
|
7
|
-
if (!isObject(item) || !validKey(item.key))
|
|
8
|
-
throw invalidState();
|
|
9
|
-
if (item.operation === 'delete' &&
|
|
10
|
-
Object.keys(item).every((key) => ['operation', 'key'].includes(key)))
|
|
11
|
-
return { operation: 'delete', key: item.key };
|
|
12
|
-
if (item.operation === 'set' &&
|
|
13
|
-
Object.keys(item).every((key) => ['operation', 'key', 'value'].includes(key)) &&
|
|
14
|
-
Object.prototype.hasOwnProperty.call(item, 'value'))
|
|
15
|
-
return { operation: 'set', key: item.key, value: cloneStateValue(item.value) };
|
|
16
|
-
throw invalidState();
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export function restoreCodeModeState(records, initialState = []) {
|
|
20
|
-
let state = initialState;
|
|
21
|
-
for (const record of records) {
|
|
22
|
-
if (record.type !== 'code.state.updated')
|
|
23
|
-
continue;
|
|
24
|
-
if (!isObject(record.payload) ||
|
|
25
|
-
!Object.keys(record.payload).every((key) => key === 'mutations'))
|
|
26
|
-
throw corruptState();
|
|
27
|
-
let mutations;
|
|
28
|
-
try {
|
|
29
|
-
mutations = parseCodeModeStateMutations(record.payload.mutations);
|
|
30
|
-
state = applyCodeModeStateMutations(state, mutations);
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
if (error instanceof MarAgentError)
|
|
34
|
-
throw new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Code Mode state is corrupt.', {
|
|
35
|
-
cause: error
|
|
36
|
-
});
|
|
37
|
-
throw error;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return state;
|
|
41
|
-
}
|
|
42
|
-
export function applyCodeModeStateMutations(entries, mutations) {
|
|
43
|
-
const state = new Map(entries.map((entry) => [entry.key, cloneStateValue(entry.value)]));
|
|
44
|
-
for (const mutation of mutations) {
|
|
45
|
-
if (mutation.operation === 'delete')
|
|
46
|
-
state.delete(mutation.key);
|
|
47
|
-
else
|
|
48
|
-
state.set(mutation.key, cloneStateValue(mutation.value));
|
|
49
|
-
}
|
|
50
|
-
if (state.size > limits.codeStateMaxEntries)
|
|
51
|
-
throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', 'Code Mode state has too many entries.');
|
|
52
|
-
const result = [...state].map(([key, value]) => ({ key, value }));
|
|
53
|
-
if (Buffer.byteLength(JSON.stringify(result)) > limits.codeStateMaxTotalBytes)
|
|
54
|
-
throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', 'Code Mode state is too large.');
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
function validKey(value) {
|
|
58
|
-
return (typeof value === 'string' &&
|
|
59
|
-
value.length > 0 &&
|
|
60
|
-
Buffer.byteLength(value) <= limits.codeStateMaxKeyBytes);
|
|
61
|
-
}
|
|
62
|
-
function cloneStateValue(value) {
|
|
63
|
-
let serialized;
|
|
64
|
-
try {
|
|
65
|
-
serialized = JSON.stringify(value);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
throw invalidState();
|
|
69
|
-
}
|
|
70
|
-
if (serialized === undefined || Buffer.byteLength(serialized) > limits.codeStateMaxValueBytes)
|
|
71
|
-
throw invalidState();
|
|
72
|
-
return JSON.parse(serialized);
|
|
73
|
-
}
|
|
74
|
-
function invalidState() {
|
|
75
|
-
return new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Code Mode state mutation is invalid.');
|
|
76
|
-
}
|
|
77
|
-
function corruptState() {
|
|
78
|
-
return new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Code Mode state is corrupt.');
|
|
79
|
-
}
|
|
80
|
-
function isObject(value) {
|
|
81
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
82
|
-
}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import type { ExecutionMode } from '../runtime/contracts.js';
|
|
2
|
-
export type ToolCaller = 'direct' | 'programmatic';
|
|
3
|
-
export interface ClientToolDefinition {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
inputSchema: Record<string, unknown>;
|
|
7
|
-
/** Runtime-only provider lowering hint; unsupported adapters fall back to a normal function tool. */
|
|
8
|
-
nativeType?: 'tool_search';
|
|
9
|
-
/** Runtime-only result contract; never forwarded as an upstream tool field. */
|
|
10
|
-
outputSchema?: Record<string, unknown>;
|
|
11
|
-
/** Runtime-only policy. MCP defaults to both callers; other tools default to direct only. */
|
|
12
|
-
allowedCallers?: readonly ToolCaller[];
|
|
13
|
-
/** Runtime-only exposure override; retains both permitted entry points with Code Mode enabled. */
|
|
14
|
-
codeModeExposure?: 'both';
|
|
15
|
-
inputMode?: 'json' | 'freeform';
|
|
16
|
-
parallelSafety?: 'safe' | 'serial';
|
|
17
|
-
/** Preserved business-schema eligibility after framework metadata projection. */
|
|
18
|
-
parameterless?: boolean;
|
|
19
|
-
/** Runtime-only Agent catalog scope; never forwarded as an upstream tool field. */
|
|
20
|
-
agentScope?: 'ROOT_AND_SUBAGENTS' | 'ROOT_ONLY';
|
|
21
|
-
}
|
|
22
|
-
export interface ToolCall {
|
|
23
|
-
name: string;
|
|
24
|
-
arguments: unknown;
|
|
25
|
-
callId?: string;
|
|
26
|
-
/** Framework metadata for native invocations, never a business argument. */
|
|
27
|
-
permission?: import('./permissions.js').ToolPermission | null;
|
|
28
|
-
}
|
|
29
|
-
export interface ToolExecutionContext {
|
|
30
|
-
mode: ExecutionMode;
|
|
31
|
-
signal: AbortSignal;
|
|
32
|
-
waitInterrupt?: import('./wait.js').ToolWaitInterrupt | undefined;
|
|
33
|
-
/** Live-only process output; does not consume the eventual tool result. */
|
|
34
|
-
onOutput?: (output: ExecOutputSnapshot) => Promise<void>;
|
|
35
|
-
sessionId: string;
|
|
36
|
-
executionId: string;
|
|
37
|
-
/** Current model identity for neutral Host-owned tool policies. */
|
|
38
|
-
modelId?: string;
|
|
39
|
-
recentImages?: readonly {
|
|
40
|
-
readonly mimeType: string;
|
|
41
|
-
readonly data: Buffer;
|
|
42
|
-
}[];
|
|
43
|
-
codeMode?: {
|
|
44
|
-
retainSession?(): Promise<() => Promise<void>>;
|
|
45
|
-
onSettled?(result: CodeCellEventData): Promise<void>;
|
|
46
|
-
supportsImages?: boolean;
|
|
47
|
-
permissionStop?(): import('./permissions.js').PermissionStop | undefined;
|
|
48
|
-
tools: readonly ClientToolDefinition[];
|
|
49
|
-
state?: readonly CodeModeStateEntry[];
|
|
50
|
-
commitState?(mutations: readonly CodeModeStateMutation[]): Promise<readonly CodeModeStateEntry[]>;
|
|
51
|
-
invoke(call: ToolCall, signal: AbortSignal): Promise<ToolExecutionResult>;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export interface McpToolCatalogContext extends Pick<ToolExecutionContext, 'sessionId' | 'executionId' | 'modelId'> {
|
|
55
|
-
executionScopeId?: string;
|
|
56
|
-
claimExecutionScope?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface McpToolCatalog {
|
|
59
|
-
readonly revision: string;
|
|
60
|
-
readonly servers: readonly {
|
|
61
|
-
readonly id: string;
|
|
62
|
-
readonly name: string;
|
|
63
|
-
readonly description?: string;
|
|
64
|
-
readonly instructions?: string;
|
|
65
|
-
}[];
|
|
66
|
-
readonly tools: readonly McpCatalogTool[];
|
|
67
|
-
}
|
|
68
|
-
export interface McpCatalogTool {
|
|
69
|
-
readonly definition: ClientToolDefinition;
|
|
70
|
-
readonly serverId: string;
|
|
71
|
-
readonly rawName: string;
|
|
72
|
-
readonly sourceIdentity: string;
|
|
73
|
-
readonly definitionRevision: string;
|
|
74
|
-
readonly lifetime: 'session' | 'execution';
|
|
75
|
-
readonly exposure: 'direct' | 'deferred';
|
|
76
|
-
/** Untrusted MCP hints; never an authorization or parallel-safety decision. */
|
|
77
|
-
readonly annotations?: Readonly<Record<string, unknown>>;
|
|
78
|
-
}
|
|
79
|
-
export interface McpToolCallContext extends Pick<ToolExecutionContext, 'sessionId' | 'executionId'> {
|
|
80
|
-
readonly mode?: ExecutionMode;
|
|
81
|
-
readonly expectedTool?: {
|
|
82
|
-
readonly sourceIdentity: string;
|
|
83
|
-
readonly definitionRevision: string;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
export interface MarAgentToolImageArtifact {
|
|
87
|
-
kind: 'image';
|
|
88
|
-
name: string;
|
|
89
|
-
mimeType: 'image/png';
|
|
90
|
-
byteSize: number;
|
|
91
|
-
sha256: string;
|
|
92
|
-
fileName: string;
|
|
93
|
-
}
|
|
94
|
-
export type MarAgentToolArtifact = MarAgentToolImageArtifact;
|
|
95
|
-
export interface ExecOutputSnapshot {
|
|
96
|
-
processId: string;
|
|
97
|
-
stdout: string;
|
|
98
|
-
stderr: string;
|
|
99
|
-
truncated: boolean;
|
|
100
|
-
}
|
|
101
|
-
export interface ToolExecutionResult {
|
|
102
|
-
calls?: readonly import('./code-mode/observations.js').CodeToolCallRecord[];
|
|
103
|
-
content: string;
|
|
104
|
-
observations?: readonly import('./code-mode/observations.js').CodeObservation[];
|
|
105
|
-
data?: unknown;
|
|
106
|
-
/** Runtime-only definitions used to encode a Tool Search output. */
|
|
107
|
-
toolSearchTools?: readonly ClientToolDefinition[];
|
|
108
|
-
truncated?: boolean;
|
|
109
|
-
images?: readonly import('../model/image.js').ModelImage[];
|
|
110
|
-
artifacts?: readonly MarAgentToolArtifact[];
|
|
111
|
-
/** Host-facing evidence, excluded from model and programmatic guest results. */
|
|
112
|
-
resultExtensions?: readonly import('./result-extensions.js').ToolResultExtension[];
|
|
113
|
-
}
|
|
114
|
-
export interface CodeCellEventData {
|
|
115
|
-
permissionStop?: import('./permissions.js').PermissionStop;
|
|
116
|
-
calls?: readonly import('./code-mode/observations.js').CodeToolCallRecord[];
|
|
117
|
-
cellId: string;
|
|
118
|
-
status: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
119
|
-
waitOutcome?: import('./wait.js').ToolWaitOutcome;
|
|
120
|
-
reason?: 'steer';
|
|
121
|
-
cached?: boolean;
|
|
122
|
-
observations?: readonly import('./code-mode/observations.js').CodeObservation[];
|
|
123
|
-
}
|
|
124
|
-
export interface ExecResult {
|
|
125
|
-
status: 'running' | 'completed' | 'cancelled';
|
|
126
|
-
waitOutcome?: import('./wait.js').ToolWaitOutcome;
|
|
127
|
-
reason?: 'steer';
|
|
128
|
-
processId?: string;
|
|
129
|
-
stdout: string;
|
|
130
|
-
stderr: string;
|
|
131
|
-
exitCode?: number | null;
|
|
132
|
-
truncated: boolean;
|
|
133
|
-
stdoutBytes: number;
|
|
134
|
-
stderrBytes: number;
|
|
135
|
-
stdoutDroppedBytes: number;
|
|
136
|
-
stderrDroppedBytes: number;
|
|
137
|
-
/** A terminal snapshot replay rather than new process output. */
|
|
138
|
-
cached?: boolean;
|
|
139
|
-
}
|
|
140
|
-
export interface ApplyPatchFileResult {
|
|
141
|
-
path: string;
|
|
142
|
-
targetPath?: string;
|
|
143
|
-
operation: 'added' | 'modified' | 'deleted' | 'moved';
|
|
144
|
-
addedLines: number;
|
|
145
|
-
deletedLines: number;
|
|
146
|
-
}
|
|
147
|
-
export interface ApplyPatchResult {
|
|
148
|
-
files: ApplyPatchFileResult[];
|
|
149
|
-
totals: {
|
|
150
|
-
files: number;
|
|
151
|
-
addedLines: number;
|
|
152
|
-
deletedLines: number;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
export interface ApplyPatchPartialResult extends ApplyPatchResult {
|
|
156
|
-
failedFile: string;
|
|
157
|
-
pendingFiles: string[];
|
|
158
|
-
}
|
|
159
|
-
export interface ReadEventData {
|
|
160
|
-
mode: 'batch';
|
|
161
|
-
results: Array<{
|
|
162
|
-
path: string;
|
|
163
|
-
startLine?: number;
|
|
164
|
-
endLine?: number;
|
|
165
|
-
error?: {
|
|
166
|
-
code: string;
|
|
167
|
-
message: string;
|
|
168
|
-
};
|
|
169
|
-
}>;
|
|
170
|
-
truncated: boolean;
|
|
171
|
-
}
|
|
172
|
-
export interface ViewImageRegion {
|
|
173
|
-
x: number;
|
|
174
|
-
y: number;
|
|
175
|
-
width: number;
|
|
176
|
-
height: number;
|
|
177
|
-
}
|
|
178
|
-
export interface ViewImageResult {
|
|
179
|
-
/** The input source; transformations may produce a different output resource. */
|
|
180
|
-
path?: string;
|
|
181
|
-
resourceId?: string;
|
|
182
|
-
mimeType: 'image/png' | 'image/jpeg' | 'image/webp';
|
|
183
|
-
bytes: number;
|
|
184
|
-
width: number;
|
|
185
|
-
height: number;
|
|
186
|
-
sourceWidth?: number;
|
|
187
|
-
sourceHeight?: number;
|
|
188
|
-
region?: ViewImageRegion;
|
|
189
|
-
sha256: string;
|
|
190
|
-
}
|
|
191
|
-
export interface TodoItem {
|
|
192
|
-
id: string;
|
|
193
|
-
step: string;
|
|
194
|
-
status: 'pending' | 'in_progress' | 'completed';
|
|
195
|
-
}
|
|
196
|
-
export interface TodoSnapshot {
|
|
197
|
-
revision: number;
|
|
198
|
-
items: TodoItem[];
|
|
199
|
-
}
|
|
200
|
-
export interface CodeModeStateEntry {
|
|
201
|
-
readonly key: string;
|
|
202
|
-
readonly value: unknown;
|
|
203
|
-
}
|
|
204
|
-
export type CodeModeStateMutation = {
|
|
205
|
-
readonly operation: 'set';
|
|
206
|
-
readonly key: string;
|
|
207
|
-
readonly value: unknown;
|
|
208
|
-
} | {
|
|
209
|
-
readonly operation: 'delete';
|
|
210
|
-
readonly key: string;
|
|
211
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ClientToolDefinition } from './contracts.js';
|
|
2
|
-
/** Stable model declarations, not a serializer for historical messages or tool results. */
|
|
3
|
-
export declare function stableToolSchema<T>(schema: T): T;
|
|
4
|
-
export declare function stableToolDefinition(definition: ClientToolDefinition): ClientToolDefinition;
|
|
5
|
-
export declare function orderToolDefinitions<T extends {
|
|
6
|
-
readonly name: string;
|
|
7
|
-
}>(definitions: readonly T[]): T[];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** Stable model declarations, not a serializer for historical messages or tool results. */
|
|
2
|
-
export function stableToolSchema(schema) {
|
|
3
|
-
return stableSchemaValue(schema);
|
|
4
|
-
}
|
|
5
|
-
function stableSchemaValue(value) {
|
|
6
|
-
if (Array.isArray(value))
|
|
7
|
-
return value.map(stableSchemaValue);
|
|
8
|
-
if (value === null || typeof value !== 'object')
|
|
9
|
-
return value;
|
|
10
|
-
const prototype = Object.getPrototypeOf(value);
|
|
11
|
-
if (prototype !== Object.prototype && prototype !== null)
|
|
12
|
-
return value;
|
|
13
|
-
const fields = value;
|
|
14
|
-
return Object.fromEntries(Object.keys(fields)
|
|
15
|
-
.sort()
|
|
16
|
-
.map((key) => [key, stableSchemaValue(fields[key])]));
|
|
17
|
-
}
|
|
18
|
-
export function stableToolDefinition(definition) {
|
|
19
|
-
return {
|
|
20
|
-
...definition,
|
|
21
|
-
inputSchema: stableToolSchema(definition.inputSchema)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export function orderToolDefinitions(definitions) {
|
|
25
|
-
return [...definitions].sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0);
|
|
26
|
-
}
|