@myagentroam/agent 0.11.32 → 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,317 +0,0 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { open } from 'node:fs/promises';
|
|
3
|
-
import { MarAgentError } from '../../error.js';
|
|
4
|
-
import { TOOL_EXECUTION_LIMITS } from '../execution-limits.js';
|
|
5
|
-
import { processImage, readImageMetadata } from './image-processing.js';
|
|
6
|
-
export const viewImageToolDefinition = {
|
|
7
|
-
name: 'view_image',
|
|
8
|
-
allowedCallers: ['direct', 'programmatic'],
|
|
9
|
-
parallelSafety: 'safe',
|
|
10
|
-
description: 'View a PNG, JPEG, or WebP image by path or Session resourceId. Relative paths use the workspace; absolute paths are allowed. Use this tool instead of converting images through exec.',
|
|
11
|
-
inputSchema: {
|
|
12
|
-
type: 'object',
|
|
13
|
-
properties: {
|
|
14
|
-
path: { type: 'string', description: 'Relative workspace path or absolute image path.' },
|
|
15
|
-
resourceId: { type: 'string', description: 'Session image resource ID, instead of path.' },
|
|
16
|
-
region: {
|
|
17
|
-
type: 'object',
|
|
18
|
-
description: 'For close inspection of a specific area; coordinates use oriented source pixels.',
|
|
19
|
-
properties: {
|
|
20
|
-
x: { type: 'integer', minimum: 0 },
|
|
21
|
-
y: { type: 'integer', minimum: 0 },
|
|
22
|
-
width: { type: 'integer', minimum: 1 },
|
|
23
|
-
height: { type: 'integer', minimum: 1 }
|
|
24
|
-
},
|
|
25
|
-
required: ['x', 'y', 'width', 'height'],
|
|
26
|
-
additionalProperties: false
|
|
27
|
-
},
|
|
28
|
-
resize: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
description: 'For a smaller overview; fit the image or cropped region within these dimensions without enlargement.',
|
|
31
|
-
properties: {
|
|
32
|
-
maxWidth: { type: 'integer', minimum: 1 },
|
|
33
|
-
maxHeight: { type: 'integer', minimum: 1 }
|
|
34
|
-
},
|
|
35
|
-
additionalProperties: false
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
additionalProperties: false
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export class ViewImageTool {
|
|
42
|
-
paths;
|
|
43
|
-
constructor(paths) {
|
|
44
|
-
this.paths = paths;
|
|
45
|
-
}
|
|
46
|
-
async execute(arguments_, signal) {
|
|
47
|
-
const input = parseViewImageInput(arguments_);
|
|
48
|
-
if (input.path === undefined)
|
|
49
|
-
return invalidInput();
|
|
50
|
-
signal?.throwIfAborted();
|
|
51
|
-
const path = await this.paths.resolve(input.path);
|
|
52
|
-
const handle = await open(path, 'r');
|
|
53
|
-
try {
|
|
54
|
-
const stat = await handle.stat({ bigint: true });
|
|
55
|
-
if (!stat.isFile())
|
|
56
|
-
throw new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Path is not a regular file.');
|
|
57
|
-
if (stat.size > BigInt(TOOL_EXECUTION_LIMITS.viewImageMaxSourceBytes))
|
|
58
|
-
throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', `Image exceeds the ${TOOL_EXECUTION_LIMITS.viewImageMaxSourceBytes}-byte source limit. Use an external image tool to reduce it first.`);
|
|
59
|
-
const hasTransform = input.region !== undefined || input.resize !== undefined;
|
|
60
|
-
if (!hasTransform && stat.size > BigInt(TOOL_EXECUTION_LIMITS.viewImageMaxBytes))
|
|
61
|
-
throw imageOutputLimit('Image exceeds 3 MiB. Use resize or region.');
|
|
62
|
-
signal?.throwIfAborted();
|
|
63
|
-
const data = Buffer.allocUnsafe(Number(stat.size));
|
|
64
|
-
let offset = 0;
|
|
65
|
-
while (offset < data.byteLength) {
|
|
66
|
-
signal?.throwIfAborted();
|
|
67
|
-
const { bytesRead } = await handle.read(data, offset, data.byteLength - offset, offset);
|
|
68
|
-
if (bytesRead === 0)
|
|
69
|
-
incompleteImage();
|
|
70
|
-
offset += bytesRead;
|
|
71
|
-
}
|
|
72
|
-
signal?.throwIfAborted();
|
|
73
|
-
const after = await handle.stat({ bigint: true });
|
|
74
|
-
signal?.throwIfAborted();
|
|
75
|
-
if (stat.size !== after.size ||
|
|
76
|
-
after.size !== BigInt(data.byteLength) ||
|
|
77
|
-
stat.mtimeNs !== after.mtimeNs ||
|
|
78
|
-
stat.ctimeNs !== after.ctimeNs)
|
|
79
|
-
return incompleteImage();
|
|
80
|
-
return await renderViewImage(data, input, signal);
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
await handle.close();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/** Resolve Session-owned bytes without using the resource's public URL or original path. */
|
|
88
|
-
export async function viewResourceImage(arguments_, readResource, signal) {
|
|
89
|
-
const input = parseViewImageInput(arguments_);
|
|
90
|
-
if (input.resourceId === undefined)
|
|
91
|
-
return invalidInput();
|
|
92
|
-
signal?.throwIfAborted();
|
|
93
|
-
const resource = await readResource(input.resourceId);
|
|
94
|
-
signal?.throwIfAborted();
|
|
95
|
-
if (!resource)
|
|
96
|
-
throw new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Image resource was not found in this Session.');
|
|
97
|
-
const data = Buffer.from(resource.dataBase64, 'base64');
|
|
98
|
-
if (data.length > TOOL_EXECUTION_LIMITS.viewImageMaxSourceBytes)
|
|
99
|
-
throw imageOutputLimit('Image exceeds the source limit.');
|
|
100
|
-
if (!input.region && !input.resize && data.length > TOOL_EXECUTION_LIMITS.viewImageMaxBytes)
|
|
101
|
-
throw imageOutputLimit('Image exceeds 3 MiB. Use resize or region.');
|
|
102
|
-
return renderViewImage(data, input, signal);
|
|
103
|
-
}
|
|
104
|
-
async function renderViewImage(data, input, signal) {
|
|
105
|
-
const mimeType = detectImageMime(data);
|
|
106
|
-
validateImageContainer(data, mimeType);
|
|
107
|
-
const sourceMetadata = await readImageMetadata(data, mimeType, signal);
|
|
108
|
-
if (input.region &&
|
|
109
|
-
(input.region.x > sourceMetadata.width ||
|
|
110
|
-
input.region.y > sourceMetadata.height ||
|
|
111
|
-
input.region.width > sourceMetadata.width - input.region.x ||
|
|
112
|
-
input.region.height > sourceMetadata.height - input.region.y))
|
|
113
|
-
throw new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Image region is outside the oriented source dimensions.');
|
|
114
|
-
const visual = input.region !== undefined || input.resize !== undefined
|
|
115
|
-
? await processImage(data, sourceMetadata, input, signal)
|
|
116
|
-
: {
|
|
117
|
-
bytes: data,
|
|
118
|
-
width: sourceMetadata.width,
|
|
119
|
-
height: sourceMetadata.height,
|
|
120
|
-
mimeType
|
|
121
|
-
};
|
|
122
|
-
signal?.throwIfAborted();
|
|
123
|
-
const resultMetadata = {
|
|
124
|
-
...(input.path ? { path: input.path } : { resourceId: input.resourceId }),
|
|
125
|
-
mimeType: visual.mimeType,
|
|
126
|
-
bytes: visual.bytes.byteLength,
|
|
127
|
-
width: visual.width,
|
|
128
|
-
height: visual.height,
|
|
129
|
-
...('sourceWidth' in visual && visual.sourceWidth !== undefined
|
|
130
|
-
? { sourceWidth: visual.sourceWidth, sourceHeight: visual.sourceHeight }
|
|
131
|
-
: {}),
|
|
132
|
-
...('region' in visual && visual.region ? { region: visual.region } : {}),
|
|
133
|
-
sha256: createHash('sha256').update(visual.bytes).digest('hex')
|
|
134
|
-
};
|
|
135
|
-
return {
|
|
136
|
-
content: describeImageResult(resultMetadata),
|
|
137
|
-
data: resultMetadata,
|
|
138
|
-
images: [{ mimeType: visual.mimeType, dataBase64: visual.bytes.toString('base64') }]
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function parseViewImageInput(value) {
|
|
142
|
-
if (!value || typeof value !== 'object')
|
|
143
|
-
return invalidInput();
|
|
144
|
-
const input = value;
|
|
145
|
-
if (Object.keys(input).some((key) => !['path', 'resourceId', 'region', 'resize'].includes(key)) ||
|
|
146
|
-
(input.path == null) === (input.resourceId == null) ||
|
|
147
|
-
(input.path != null && (typeof input.path !== 'string' || input.path.length === 0)) ||
|
|
148
|
-
(input.resourceId != null &&
|
|
149
|
-
(typeof input.resourceId !== 'string' || input.resourceId.length === 0)))
|
|
150
|
-
return invalidInput();
|
|
151
|
-
return {
|
|
152
|
-
...(typeof input.path === 'string'
|
|
153
|
-
? { path: input.path }
|
|
154
|
-
: { resourceId: input.resourceId }),
|
|
155
|
-
...(input.region == null ? {} : { region: parseRegion(input.region) }),
|
|
156
|
-
...(input.resize == null ? {} : { resize: parseResize(input.resize) })
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function parseRegion(value) {
|
|
160
|
-
if (!isRecord(value) ||
|
|
161
|
-
Object.keys(value).some((key) => !['x', 'y', 'width', 'height'].includes(key)) ||
|
|
162
|
-
!Number.isSafeInteger(value.x) ||
|
|
163
|
-
value.x < 0 ||
|
|
164
|
-
!Number.isSafeInteger(value.y) ||
|
|
165
|
-
value.y < 0 ||
|
|
166
|
-
!isPositiveSafeInteger(value.width) ||
|
|
167
|
-
!isPositiveSafeInteger(value.height))
|
|
168
|
-
return invalidInput();
|
|
169
|
-
return {
|
|
170
|
-
x: value.x,
|
|
171
|
-
y: value.y,
|
|
172
|
-
width: value.width,
|
|
173
|
-
height: value.height
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function parseResize(value) {
|
|
177
|
-
if (!isRecord(value) ||
|
|
178
|
-
(value.maxWidth == null && value.maxHeight == null) ||
|
|
179
|
-
Object.keys(value).some((key) => key !== 'maxWidth' && key !== 'maxHeight') ||
|
|
180
|
-
(value.maxWidth != null && !isPositiveSafeInteger(value.maxWidth)) ||
|
|
181
|
-
(value.maxHeight != null && !isPositiveSafeInteger(value.maxHeight)))
|
|
182
|
-
return invalidInput();
|
|
183
|
-
return {
|
|
184
|
-
...(value.maxWidth == null ? {} : { maxWidth: value.maxWidth }),
|
|
185
|
-
...(value.maxHeight == null ? {} : { maxHeight: value.maxHeight })
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function isRecord(value) {
|
|
189
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
190
|
-
}
|
|
191
|
-
function isPositiveSafeInteger(value) {
|
|
192
|
-
return Number.isSafeInteger(value) && value > 0;
|
|
193
|
-
}
|
|
194
|
-
function describeImageResult(result) {
|
|
195
|
-
const details = [`${result.width}×${result.height} px`, result.mimeType, `${result.bytes} bytes`];
|
|
196
|
-
if (result.sourceWidth !== undefined && result.sourceHeight !== undefined)
|
|
197
|
-
details.push(`source ${result.sourceWidth}×${result.sourceHeight} px`);
|
|
198
|
-
if (result.region)
|
|
199
|
-
details.push(`region ${result.region.x},${result.region.y} ${result.region.width}×${result.region.height} px`);
|
|
200
|
-
return `Viewed image ${result.path ?? result.resourceId} (${details.join(', ')}).`;
|
|
201
|
-
}
|
|
202
|
-
function imageOutputLimit(message) {
|
|
203
|
-
return new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', message);
|
|
204
|
-
}
|
|
205
|
-
export function detectImageMime(data) {
|
|
206
|
-
if (data.length >= 8 &&
|
|
207
|
-
data.subarray(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])))
|
|
208
|
-
return 'image/png';
|
|
209
|
-
if (data.length >= 3 && data[0] === 0xff && data[1] === 0xd8 && data[2] === 0xff)
|
|
210
|
-
return 'image/jpeg';
|
|
211
|
-
if (data.length >= 12 &&
|
|
212
|
-
data.subarray(0, 4).toString('ascii') === 'RIFF' &&
|
|
213
|
-
data.subarray(8, 12).toString('ascii') === 'WEBP')
|
|
214
|
-
return 'image/webp';
|
|
215
|
-
throw new MarAgentError('MAR_AGENT_IMAGE_FORMAT_UNSUPPORTED', 'Only PNG, JPEG, and WebP images are supported.');
|
|
216
|
-
}
|
|
217
|
-
function invalidInput() {
|
|
218
|
-
throw new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'View image input is invalid.');
|
|
219
|
-
}
|
|
220
|
-
// Basic container checks catch partial writes without decoding or changing pixels.
|
|
221
|
-
function validateImageContainer(data, mimeType) {
|
|
222
|
-
if (mimeType === 'image/jpeg') {
|
|
223
|
-
let offset = 2;
|
|
224
|
-
let inScan = false;
|
|
225
|
-
let hasScan = false;
|
|
226
|
-
while (offset < data.length) {
|
|
227
|
-
if (data[offset++] !== 0xff) {
|
|
228
|
-
if (!inScan)
|
|
229
|
-
incompleteImage();
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
while (data[offset] === 0xff)
|
|
233
|
-
offset++;
|
|
234
|
-
if (offset >= data.length)
|
|
235
|
-
incompleteImage();
|
|
236
|
-
const marker = data[offset++];
|
|
237
|
-
if (marker === 0 || (marker >= 0xd0 && marker <= 0xd7)) {
|
|
238
|
-
if (!inScan)
|
|
239
|
-
incompleteImage();
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
if (marker === 0xd9) {
|
|
243
|
-
if (!hasScan)
|
|
244
|
-
incompleteImage();
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (marker === 0xd8)
|
|
248
|
-
incompleteImage();
|
|
249
|
-
if (marker === 1)
|
|
250
|
-
continue;
|
|
251
|
-
if (data.length - offset < 2)
|
|
252
|
-
incompleteImage();
|
|
253
|
-
const length = data.readUInt16BE(offset);
|
|
254
|
-
if (length < 2 || offset + length > data.length)
|
|
255
|
-
incompleteImage();
|
|
256
|
-
offset += length;
|
|
257
|
-
if (marker === 0xda)
|
|
258
|
-
hasScan = true;
|
|
259
|
-
inScan = marker === 0xda || (inScan && marker === 0xdc);
|
|
260
|
-
}
|
|
261
|
-
incompleteImage();
|
|
262
|
-
}
|
|
263
|
-
if (mimeType === 'image/webp') {
|
|
264
|
-
const end = data.readUInt32LE(4) + 8;
|
|
265
|
-
if (end > data.length || end < 20)
|
|
266
|
-
incompleteImage();
|
|
267
|
-
let offset = 12;
|
|
268
|
-
let hasPixels = false;
|
|
269
|
-
while (offset < end) {
|
|
270
|
-
if (end - offset < 8)
|
|
271
|
-
incompleteImage();
|
|
272
|
-
const length = data.readUInt32LE(offset + 4);
|
|
273
|
-
const next = offset + 8 + length + (length % 2);
|
|
274
|
-
if (next > end)
|
|
275
|
-
incompleteImage();
|
|
276
|
-
const type = data.toString('ascii', offset, offset + 4);
|
|
277
|
-
if ((type === 'VP8 ' || type === 'VP8L' || type === 'ANMF') && length > 0)
|
|
278
|
-
hasPixels = true;
|
|
279
|
-
offset = next;
|
|
280
|
-
}
|
|
281
|
-
if (!hasPixels)
|
|
282
|
-
incompleteImage();
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
let offset = 8;
|
|
286
|
-
let hasPixels = false;
|
|
287
|
-
while (offset < data.length) {
|
|
288
|
-
if (data.length - offset < 12)
|
|
289
|
-
incompleteImage();
|
|
290
|
-
const length = data.readUInt32BE(offset);
|
|
291
|
-
const next = offset + 12 + length;
|
|
292
|
-
if (next > data.length)
|
|
293
|
-
incompleteImage();
|
|
294
|
-
const type = data.toString('ascii', offset + 4, offset + 8);
|
|
295
|
-
if (offset === 8) {
|
|
296
|
-
if (type !== 'IHDR' ||
|
|
297
|
-
length !== 13 ||
|
|
298
|
-
data.readUInt32BE(offset + 8) === 0 ||
|
|
299
|
-
data.readUInt32BE(offset + 12) === 0)
|
|
300
|
-
incompleteImage();
|
|
301
|
-
}
|
|
302
|
-
else if (type === 'IHDR')
|
|
303
|
-
incompleteImage();
|
|
304
|
-
if (type === 'IDAT' && length > 0)
|
|
305
|
-
hasPixels = true;
|
|
306
|
-
if (type === 'IEND') {
|
|
307
|
-
if (length !== 0 || !hasPixels)
|
|
308
|
-
incompleteImage();
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
offset = next;
|
|
312
|
-
}
|
|
313
|
-
incompleteImage();
|
|
314
|
-
}
|
|
315
|
-
function incompleteImage() {
|
|
316
|
-
throw new MarAgentError('MAR_AGENT_IMAGE_INCOMPLETE', 'Image file is incomplete, malformed, or changed while reading. Wait for the writer to finish and read it again.');
|
|
317
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type ExecInput } from './exec.js';
|
|
2
|
-
export type { ExecInput, ExecResult } from './exec.js';
|
|
3
|
-
import { ReadTool } from './read.js';
|
|
4
|
-
/** @deprecated Use the individual tool modules or LocalAgentHost. */
|
|
5
|
-
export declare class LocalWorkspaceTools {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(root: string, maxOutputBytes?: number);
|
|
8
|
-
read(input: Parameters<ReadTool['execute']>[0]): Promise<import("./read.js").BatchReadResult>;
|
|
9
|
-
applyPatch(patch: string): Promise<import("./apply-patch.js").ApplyPatchResult>;
|
|
10
|
-
exec(input: ExecInput): Promise<import("./exec.js").ExecResult>;
|
|
11
|
-
dispose(): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ApplyPatchTool } from './apply-patch.js';
|
|
2
|
-
import { ExecTool } from './exec.js';
|
|
3
|
-
import { ReadTool } from './read.js';
|
|
4
|
-
import { WorkspacePathResolver } from '../shared/path-resolver.js';
|
|
5
|
-
/** @deprecated Use the individual tool modules or LocalAgentHost. */
|
|
6
|
-
export class LocalWorkspaceTools {
|
|
7
|
-
#read;
|
|
8
|
-
#applyPatch;
|
|
9
|
-
#exec;
|
|
10
|
-
constructor(root, maxOutputBytes = 1_000_000) {
|
|
11
|
-
const paths = new WorkspacePathResolver(root);
|
|
12
|
-
this.#read = new ReadTool(paths);
|
|
13
|
-
this.#applyPatch = new ApplyPatchTool(paths);
|
|
14
|
-
this.#exec = new ExecTool(paths, maxOutputBytes);
|
|
15
|
-
}
|
|
16
|
-
read(input) {
|
|
17
|
-
return this.#read.execute(input);
|
|
18
|
-
}
|
|
19
|
-
applyPatch(patch) {
|
|
20
|
-
return this.#applyPatch.execute(patch);
|
|
21
|
-
}
|
|
22
|
-
exec(input) {
|
|
23
|
-
return this.#exec.execute(input);
|
|
24
|
-
}
|
|
25
|
-
dispose() {
|
|
26
|
-
return this.#exec.dispose();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { MarAgentError } from '../../error.js';
|
|
2
|
-
export const MCP_DEFINITION_LIMITS = Object.freeze({
|
|
3
|
-
depth: 64,
|
|
4
|
-
nodes: 32768,
|
|
5
|
-
definitionBytes: 256 * 1024,
|
|
6
|
-
catalogBytes: 16 * 1024 * 1024,
|
|
7
|
-
tools: 10000,
|
|
8
|
-
servers: 256
|
|
9
|
-
});
|
|
10
|
-
function invalid() {
|
|
11
|
-
throw new MarAgentError('MAR_AGENT_MCP_CATALOG_INVALID', 'MCP catalog contains invalid or oversized definitions.');
|
|
12
|
-
}
|
|
13
|
-
const record = (value) => value !== null &&
|
|
14
|
-
typeof value === 'object' &&
|
|
15
|
-
!Array.isArray(value) &&
|
|
16
|
-
[Object.prototype, null].includes(Object.getPrototypeOf(value));
|
|
17
|
-
const text = (value, maximum) => typeof value === 'string' && value.length > 0 && value.length <= maximum;
|
|
18
|
-
const onlyKeys = (value, keys) => Object.keys(value).every((key) => keys.includes(key));
|
|
19
|
-
/** Bound all JSON, including unknown extension keywords, before recursive lowering. */
|
|
20
|
-
function assertJson(value) {
|
|
21
|
-
const stack = [{ value, depth: 0 }];
|
|
22
|
-
const seen = new Set();
|
|
23
|
-
let nodes = 0;
|
|
24
|
-
while (stack.length) {
|
|
25
|
-
const current = stack.pop();
|
|
26
|
-
if (current.exit) {
|
|
27
|
-
seen.delete(current.value);
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (++nodes > MCP_DEFINITION_LIMITS.nodes || current.depth > MCP_DEFINITION_LIMITS.depth)
|
|
31
|
-
invalid();
|
|
32
|
-
const item = current.value;
|
|
33
|
-
if (item === null ||
|
|
34
|
-
typeof item === 'string' ||
|
|
35
|
-
typeof item === 'boolean' ||
|
|
36
|
-
(typeof item === 'number' && Number.isFinite(item)))
|
|
37
|
-
continue;
|
|
38
|
-
if (!Array.isArray(item) && !record(item))
|
|
39
|
-
invalid();
|
|
40
|
-
if (seen.has(item))
|
|
41
|
-
invalid();
|
|
42
|
-
seen.add(item);
|
|
43
|
-
stack.push({ value: item, depth: current.depth, exit: true });
|
|
44
|
-
for (const child of Object.values(item))
|
|
45
|
-
stack.push({ value: child, depth: current.depth + 1 });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function assertSchema(schema) {
|
|
49
|
-
if (!record(schema) || schema.type !== 'object')
|
|
50
|
-
invalid();
|
|
51
|
-
assertJson(schema);
|
|
52
|
-
const stack = [schema];
|
|
53
|
-
const types = new Set(['null', 'boolean', 'object', 'array', 'number', 'integer', 'string']);
|
|
54
|
-
while (stack.length) {
|
|
55
|
-
const value = stack.pop();
|
|
56
|
-
if (typeof value === 'boolean')
|
|
57
|
-
continue;
|
|
58
|
-
if (!record(value))
|
|
59
|
-
invalid();
|
|
60
|
-
if (value.type !== undefined) {
|
|
61
|
-
const entries = Array.isArray(value.type) ? value.type : [value.type];
|
|
62
|
-
if (!entries.length ||
|
|
63
|
-
new Set(entries).size !== entries.length ||
|
|
64
|
-
entries.some((type) => typeof type !== 'string' || !types.has(type)))
|
|
65
|
-
invalid();
|
|
66
|
-
}
|
|
67
|
-
if (value.required !== undefined &&
|
|
68
|
-
(!Array.isArray(value.required) ||
|
|
69
|
-
value.required.some((name) => typeof name !== 'string') ||
|
|
70
|
-
new Set(value.required).size !== value.required.length))
|
|
71
|
-
invalid();
|
|
72
|
-
for (const key of [
|
|
73
|
-
'properties',
|
|
74
|
-
'patternProperties',
|
|
75
|
-
'$defs',
|
|
76
|
-
'definitions',
|
|
77
|
-
'dependentSchemas'
|
|
78
|
-
]) {
|
|
79
|
-
const children = value[key];
|
|
80
|
-
if (children === undefined)
|
|
81
|
-
continue;
|
|
82
|
-
if (!record(children))
|
|
83
|
-
invalid();
|
|
84
|
-
stack.push(...Object.values(children));
|
|
85
|
-
}
|
|
86
|
-
for (const key of ['allOf', 'anyOf', 'oneOf', 'prefixItems']) {
|
|
87
|
-
const children = value[key];
|
|
88
|
-
if (children === undefined)
|
|
89
|
-
continue;
|
|
90
|
-
if (!Array.isArray(children) || !children.length)
|
|
91
|
-
invalid();
|
|
92
|
-
stack.push(...children);
|
|
93
|
-
}
|
|
94
|
-
for (const key of [
|
|
95
|
-
'additionalProperties',
|
|
96
|
-
'unevaluatedProperties',
|
|
97
|
-
'additionalItems',
|
|
98
|
-
'unevaluatedItems',
|
|
99
|
-
'contains',
|
|
100
|
-
'propertyNames',
|
|
101
|
-
'not',
|
|
102
|
-
'if',
|
|
103
|
-
'then',
|
|
104
|
-
'else',
|
|
105
|
-
'items'
|
|
106
|
-
]) {
|
|
107
|
-
const child = value[key];
|
|
108
|
-
if (child !== undefined) {
|
|
109
|
-
if (key === 'items' && Array.isArray(child))
|
|
110
|
-
stack.push(...child);
|
|
111
|
-
else
|
|
112
|
-
stack.push(child);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
for (const key of ['$ref', '$id', '$schema', 'title', 'description', 'format', 'pattern'])
|
|
116
|
-
if (value[key] !== undefined && typeof value[key] !== 'string')
|
|
117
|
-
invalid();
|
|
118
|
-
for (const key of ['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf'])
|
|
119
|
-
if (value[key] !== undefined &&
|
|
120
|
-
(typeof value[key] !== 'number' ||
|
|
121
|
-
!Number.isFinite(value[key]) ||
|
|
122
|
-
(key === 'multipleOf' && Number(value[key]) <= 0)))
|
|
123
|
-
invalid();
|
|
124
|
-
for (const key of [
|
|
125
|
-
'minLength',
|
|
126
|
-
'maxLength',
|
|
127
|
-
'minItems',
|
|
128
|
-
'maxItems',
|
|
129
|
-
'minProperties',
|
|
130
|
-
'maxProperties'
|
|
131
|
-
])
|
|
132
|
-
if (value[key] !== undefined && (!Number.isSafeInteger(value[key]) || Number(value[key]) < 0))
|
|
133
|
-
invalid();
|
|
134
|
-
if (value.enum !== undefined && (!Array.isArray(value.enum) || !value.enum.length))
|
|
135
|
-
invalid();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/** Shared Host and Node publication boundary, not a provider-specific conversion. */
|
|
139
|
-
export function assertMcpToolDefinition(value, options = {}) {
|
|
140
|
-
if (!record(value) ||
|
|
141
|
-
!text(value.name, 256) ||
|
|
142
|
-
(!options.nativeToolNames && !/^mcp__[A-Za-z0-9_-]+__[A-Za-z0-9_-]+$/u.test(value.name)) ||
|
|
143
|
-
typeof value.description !== 'string' ||
|
|
144
|
-
value.description.length > 65536 ||
|
|
145
|
-
(value.parallelSafety !== undefined &&
|
|
146
|
-
!['safe', 'serial'].includes(String(value.parallelSafety))) ||
|
|
147
|
-
(value.agentScope !== undefined &&
|
|
148
|
-
!['ROOT_AND_SUBAGENTS', 'ROOT_ONLY'].includes(String(value.agentScope))) ||
|
|
149
|
-
(value.allowedCallers !== undefined &&
|
|
150
|
-
(!Array.isArray(value.allowedCallers) ||
|
|
151
|
-
!value.allowedCallers.length ||
|
|
152
|
-
value.allowedCallers.some((caller) => caller !== 'direct' && caller !== 'programmatic'))) ||
|
|
153
|
-
(value.codeModeExposure !== undefined && value.codeModeExposure !== 'both') ||
|
|
154
|
-
(value.inputMode !== undefined && value.inputMode !== 'json'))
|
|
155
|
-
invalid();
|
|
156
|
-
assertJson(value);
|
|
157
|
-
assertSchema(value.inputSchema);
|
|
158
|
-
if (value.outputSchema !== undefined)
|
|
159
|
-
assertSchema(value.outputSchema);
|
|
160
|
-
if (Buffer.byteLength(JSON.stringify(value)) > MCP_DEFINITION_LIMITS.definitionBytes)
|
|
161
|
-
invalid();
|
|
162
|
-
}
|
|
163
|
-
export function assertMcpToolCatalog(value, options = {}) {
|
|
164
|
-
if (!record(value) ||
|
|
165
|
-
typeof value.revision !== 'string' ||
|
|
166
|
-
value.revision.length > 512 ||
|
|
167
|
-
!onlyKeys(value, ['revision', 'servers', 'tools']) ||
|
|
168
|
-
!Array.isArray(value.servers) ||
|
|
169
|
-
value.servers.length > MCP_DEFINITION_LIMITS.servers ||
|
|
170
|
-
!Array.isArray(value.tools) ||
|
|
171
|
-
value.tools.length > MCP_DEFINITION_LIMITS.tools)
|
|
172
|
-
invalid();
|
|
173
|
-
const servers = new Set();
|
|
174
|
-
for (const server of value.servers) {
|
|
175
|
-
if (!record(server) ||
|
|
176
|
-
!text(server.id, 512) ||
|
|
177
|
-
!text(server.name, 256) ||
|
|
178
|
-
servers.has(server.id) ||
|
|
179
|
-
!onlyKeys(server, ['id', 'name', 'description', 'instructions']) ||
|
|
180
|
-
(server.description !== undefined &&
|
|
181
|
-
(typeof server.description !== 'string' || server.description.length > 65536)) ||
|
|
182
|
-
(server.instructions !== undefined &&
|
|
183
|
-
(typeof server.instructions !== 'string' || server.instructions.length > 65536)))
|
|
184
|
-
invalid();
|
|
185
|
-
servers.add(server.id);
|
|
186
|
-
}
|
|
187
|
-
const names = new Set();
|
|
188
|
-
for (const tool of value.tools) {
|
|
189
|
-
if (!record(tool) ||
|
|
190
|
-
!text(tool.serverId, 512) ||
|
|
191
|
-
!servers.has(tool.serverId) ||
|
|
192
|
-
!onlyKeys(tool, [
|
|
193
|
-
'definition',
|
|
194
|
-
'serverId',
|
|
195
|
-
'rawName',
|
|
196
|
-
'sourceIdentity',
|
|
197
|
-
'definitionRevision',
|
|
198
|
-
'lifetime',
|
|
199
|
-
'exposure',
|
|
200
|
-
'annotations'
|
|
201
|
-
]) ||
|
|
202
|
-
!text(tool.rawName, 256) ||
|
|
203
|
-
!text(tool.sourceIdentity, 512) ||
|
|
204
|
-
!text(tool.definitionRevision, 512) ||
|
|
205
|
-
!['session', 'execution'].includes(String(tool.lifetime)) ||
|
|
206
|
-
!['direct', 'deferred'].includes(String(tool.exposure)))
|
|
207
|
-
invalid();
|
|
208
|
-
assertMcpToolDefinition(tool.definition, options);
|
|
209
|
-
if (tool.annotations !== undefined) {
|
|
210
|
-
if (!record(tool.annotations))
|
|
211
|
-
invalid();
|
|
212
|
-
assertJson(tool.annotations);
|
|
213
|
-
}
|
|
214
|
-
if (names.has(tool.definition.name))
|
|
215
|
-
invalid();
|
|
216
|
-
names.add(tool.definition.name);
|
|
217
|
-
}
|
|
218
|
-
if (Buffer.byteLength(JSON.stringify(value)) > MCP_DEFINITION_LIMITS.catalogBytes)
|
|
219
|
-
invalid();
|
|
220
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ModelMessage } from '../../model/contracts.js';
|
|
2
|
-
import type { DeferredMcpRegistry } from './tool-search.js';
|
|
3
|
-
export declare function discoveredMcpToolNames(messages: readonly ModelMessage[]): string[];
|
|
4
|
-
export declare function rebindMcpToolSearchOutputs(messages: readonly ModelMessage[], registry: DeferredMcpRegistry): void;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ClientToolDefinition } from '../../model/contracts.js';
|
|
2
|
-
import type { McpCatalogTool, McpToolCatalog, ToolExecutionResult } from '../contracts.js';
|
|
3
|
-
import type { ToolRuntimeContext } from '../runtime-context.js';
|
|
4
|
-
export declare const TOOL_SEARCH_LIMITS: Readonly<{
|
|
5
|
-
defaultLimit: 5;
|
|
6
|
-
maximumLimit: 20;
|
|
7
|
-
queryBytes: 4096;
|
|
8
|
-
catalogBytes: number;
|
|
9
|
-
maximumDefinitionTokens: 16384;
|
|
10
|
-
definitionWindowFraction: 0.25;
|
|
11
|
-
minimumContinuationTokens: 1024;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const toolSearchToolDefinition: ClientToolDefinition;
|
|
14
|
-
export declare function parseToolSearchInput(input: unknown): {
|
|
15
|
-
query: string;
|
|
16
|
-
limit: number;
|
|
17
|
-
};
|
|
18
|
-
/** Deferred discovery state reconstructed from the current post-GC model history. */
|
|
19
|
-
export declare class DeferredMcpRegistry {
|
|
20
|
-
#private;
|
|
21
|
-
constructor(discoveredNames: readonly string[]);
|
|
22
|
-
restore(discoveredNames: readonly string[]): void;
|
|
23
|
-
update(catalog: McpToolCatalog, eligible: (tool: McpCatalogTool) => boolean, options?: {
|
|
24
|
-
nativeToolNames?: boolean;
|
|
25
|
-
}): void;
|
|
26
|
-
get hasDeferred(): boolean;
|
|
27
|
-
snapshot(): readonly string[];
|
|
28
|
-
expectedTool(name: string): {
|
|
29
|
-
sourceIdentity: string;
|
|
30
|
-
definitionRevision: string;
|
|
31
|
-
} | undefined;
|
|
32
|
-
restoredDefinitions(names: readonly string[]): readonly ClientToolDefinition[];
|
|
33
|
-
projectDirect(base: readonly ClientToolDefinition[]): ClientToolDefinition[];
|
|
34
|
-
project(base: readonly ClientToolDefinition[], selection?: readonly string[], executionSelection?: Set<string>): ClientToolDefinition[];
|
|
35
|
-
search(query: string, limit: number): McpCatalogTool[];
|
|
36
|
-
expose(input: unknown, context: {
|
|
37
|
-
signal: AbortSignal;
|
|
38
|
-
base: readonly ClientToolDefinition[];
|
|
39
|
-
window: number;
|
|
40
|
-
system: string;
|
|
41
|
-
}): Promise<ToolExecutionResult>;
|
|
42
|
-
assertBudget(base: readonly ClientToolDefinition[], window: number, system: string, selection?: readonly string[], executionSelection?: ReadonlySet<string>): void;
|
|
43
|
-
navigation(): string | undefined;
|
|
44
|
-
}
|
|
45
|
-
export declare function executeToolSearch(input: unknown, context: ToolRuntimeContext): Promise<ToolExecutionResult>;
|