@myagentroam/agent 0.11.33 → 0.11.35
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/fork-session.d.ts +19 -0
- package/dist/session/store/jsonl/fork-session.js +142 -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 +2395 -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 +87 -0
- package/dist/subagent/session-controller.js +1343 -0
- package/dist/subagent/task.d.ts +134 -0
- package/dist/subagent/task.js +436 -0
- package/dist/subagent/turn-contracts.d.ts +64 -0
- package/dist/subagent/turn-contracts.js +1 -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,60 +0,0 @@
|
|
|
1
|
-
import type { SessionRecord } from './store/index.js';
|
|
2
|
-
import { type CodeObservation, type CodeToolCallRecord } from '../tools/code-mode/observations.js';
|
|
3
|
-
/** Resolve private observation identity to real dispatch facts, not Provider tool calls. */
|
|
4
|
-
export declare function codeObservationEvidence(records: readonly SessionRecord[], result: SessionRecord, observation: Extract<CodeObservation, {
|
|
5
|
-
type: 'tool_result';
|
|
6
|
-
}>): {
|
|
7
|
-
callId: string;
|
|
8
|
-
call: SessionRecord;
|
|
9
|
-
completed: SessionRecord;
|
|
10
|
-
result: {
|
|
11
|
-
payload: {
|
|
12
|
-
role: string;
|
|
13
|
-
callId: string;
|
|
14
|
-
content: string;
|
|
15
|
-
observationId: string;
|
|
16
|
-
};
|
|
17
|
-
schemaVersion: 1;
|
|
18
|
-
recordId: string;
|
|
19
|
-
sequence: number;
|
|
20
|
-
timestamp: string;
|
|
21
|
-
sessionId: string;
|
|
22
|
-
executionId?: string;
|
|
23
|
-
turnId?: string;
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
} | undefined;
|
|
27
|
-
export declare function observationsFromRecord(record: SessionRecord): CodeObservation[] | undefined;
|
|
28
|
-
export declare function codeCallEvidence(records: readonly SessionRecord[], result: SessionRecord, entry: CodeToolCallRecord): {
|
|
29
|
-
result: {
|
|
30
|
-
payload: {
|
|
31
|
-
role: string;
|
|
32
|
-
callId: string;
|
|
33
|
-
content: string;
|
|
34
|
-
};
|
|
35
|
-
schemaVersion: 1;
|
|
36
|
-
recordId: string;
|
|
37
|
-
sequence: number;
|
|
38
|
-
timestamp: string;
|
|
39
|
-
sessionId: string;
|
|
40
|
-
executionId?: string;
|
|
41
|
-
turnId?: string;
|
|
42
|
-
type: string;
|
|
43
|
-
};
|
|
44
|
-
callId: string;
|
|
45
|
-
call: SessionRecord;
|
|
46
|
-
completed: SessionRecord;
|
|
47
|
-
} | undefined;
|
|
48
|
-
/** Failed patch calls can prove applied file units, never successful input reclamation. */
|
|
49
|
-
export declare function codePartialPatchCallEvidence(records: readonly SessionRecord[], result: SessionRecord, entry: CodeToolCallRecord): {
|
|
50
|
-
callId: string;
|
|
51
|
-
call: SessionRecord;
|
|
52
|
-
failed: SessionRecord;
|
|
53
|
-
result: SessionRecord;
|
|
54
|
-
} | undefined;
|
|
55
|
-
export declare function callsFromRecord(record: SessionRecord): CodeToolCallRecord[] | undefined;
|
|
56
|
-
export declare function retainedCodeInputs(records: readonly SessionRecord[], parentCallId: string): {
|
|
57
|
-
callId: unknown;
|
|
58
|
-
toolName: unknown;
|
|
59
|
-
input: unknown;
|
|
60
|
-
}[];
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
-
import { codeCellCompletionSequence, contextGcPatchResultFromCompletedPayload, contextGcPatchResultFromFailedPayload } from './context-gc-replacements.js';
|
|
3
|
-
import { parseCodeCalls, parseObservations } from '../tools/code-mode/observations.js';
|
|
4
|
-
/** Resolve private observation identity to real dispatch facts, not Provider tool calls. */
|
|
5
|
-
export function codeObservationEvidence(records, result, observation) {
|
|
6
|
-
if (observation.outcome !== 'completed')
|
|
7
|
-
return undefined;
|
|
8
|
-
const evidence = codeToolEvidence(records, result, observation.source, 'completed');
|
|
9
|
-
if (!evidence)
|
|
10
|
-
return undefined;
|
|
11
|
-
return {
|
|
12
|
-
callId: evidence.callId,
|
|
13
|
-
call: evidence.call,
|
|
14
|
-
completed: evidence.terminal,
|
|
15
|
-
result: {
|
|
16
|
-
...result,
|
|
17
|
-
payload: {
|
|
18
|
-
role: 'tool',
|
|
19
|
-
callId: evidence.callId,
|
|
20
|
-
content: observation.result.content,
|
|
21
|
-
observationId: observation.id
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function codeToolEvidence(records, result, source, outcome) {
|
|
27
|
-
const started = records.findLast((record) => record.sequence < result.sequence &&
|
|
28
|
-
record.type === 'tool.started' &&
|
|
29
|
-
isRecord(record.payload) &&
|
|
30
|
-
record.payload.callId === source.callId &&
|
|
31
|
-
record.payload.toolName === source.toolName &&
|
|
32
|
-
typeof record.payload.parentCallId === 'string' &&
|
|
33
|
-
isDeepStrictEqual(record.payload.input, source.input));
|
|
34
|
-
if (!started || !isRecord(started.payload))
|
|
35
|
-
return undefined;
|
|
36
|
-
const parentId = started.payload.parentCallId;
|
|
37
|
-
const parent = records.find((record) => record.type === 'model.context' &&
|
|
38
|
-
record.sequence < started.sequence &&
|
|
39
|
-
isRecord(record.payload) &&
|
|
40
|
-
record.payload.role === 'tool_call' &&
|
|
41
|
-
record.payload.callId === parentId &&
|
|
42
|
-
record.payload.name === 'code_exec');
|
|
43
|
-
if (!parent)
|
|
44
|
-
return undefined;
|
|
45
|
-
const original = records.find((record) => record.recordId === result.recordId) ?? result;
|
|
46
|
-
if (!isRecord(original.payload))
|
|
47
|
-
return undefined;
|
|
48
|
-
const outerId = original.payload.callId;
|
|
49
|
-
const outer = records.findLast((record) => record.sequence < result.sequence &&
|
|
50
|
-
(record.type === 'tool.completed' ||
|
|
51
|
-
(outcome === 'failed' && record.type === 'tool.failed')) &&
|
|
52
|
-
isRecord(record.payload) &&
|
|
53
|
-
record.payload.callId === outerId &&
|
|
54
|
-
(record.payload.toolName === 'code_exec' || record.payload.toolName === 'code_exec_wait'));
|
|
55
|
-
if (!outer ||
|
|
56
|
-
(outcome === 'completed'
|
|
57
|
-
? codeCellCompletionSequence(records, outer)
|
|
58
|
-
: partialPatchCellTerminalSequence(records, outer)) === undefined ||
|
|
59
|
-
(outcome === 'completed' &&
|
|
60
|
-
records.some((record) => record.sequence < result.sequence &&
|
|
61
|
-
record.type === 'tool.failed' &&
|
|
62
|
-
isRecord(record.payload) &&
|
|
63
|
-
record.payload.callId === outerId)))
|
|
64
|
-
return undefined;
|
|
65
|
-
if (original.payload.callId !== parentId) {
|
|
66
|
-
const initial = records.find((record) => record.sequence < outer.sequence &&
|
|
67
|
-
record.type === 'tool.completed' &&
|
|
68
|
-
isRecord(record.payload) &&
|
|
69
|
-
record.payload.callId === parentId);
|
|
70
|
-
if (!initial ||
|
|
71
|
-
!isRecord(outer.payload) ||
|
|
72
|
-
outer.payload.toolName !== 'code_exec_wait' ||
|
|
73
|
-
!isRecord(initial.payload) ||
|
|
74
|
-
!isRecord(outer.payload.data) ||
|
|
75
|
-
!isRecord(initial.payload.data) ||
|
|
76
|
-
typeof outer.payload.data.cellId !== 'string' ||
|
|
77
|
-
outer.payload.data.cellId !== initial.payload.data.cellId)
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const completed = records.findLast((record) => record.sequence > started.sequence &&
|
|
81
|
-
record.sequence < result.sequence &&
|
|
82
|
-
record.type === `tool.${outcome}` &&
|
|
83
|
-
isRecord(record.payload) &&
|
|
84
|
-
record.payload.callId === source.callId &&
|
|
85
|
-
record.payload.toolName === source.toolName &&
|
|
86
|
-
record.payload.parentCallId === parentId);
|
|
87
|
-
if (!completed ||
|
|
88
|
-
records.some((record) => record.sequence > started.sequence &&
|
|
89
|
-
record.sequence < result.sequence &&
|
|
90
|
-
record.type === (outcome === 'completed' ? 'tool.failed' : 'tool.completed') &&
|
|
91
|
-
isRecord(record.payload) &&
|
|
92
|
-
record.payload.callId === source.callId))
|
|
93
|
-
return undefined;
|
|
94
|
-
const call = {
|
|
95
|
-
...started,
|
|
96
|
-
payload: {
|
|
97
|
-
role: 'tool_call',
|
|
98
|
-
name: source.toolName,
|
|
99
|
-
callId: source.callId,
|
|
100
|
-
arguments: source.input
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return { callId: source.callId, call, terminal: completed, result };
|
|
104
|
-
}
|
|
105
|
-
function partialPatchCellTerminalSequence(records, result) {
|
|
106
|
-
if (!isRecord(result.payload) || !isRecord(result.payload.data))
|
|
107
|
-
return undefined;
|
|
108
|
-
const data = result.payload.data;
|
|
109
|
-
if (typeof data.cellId !== 'string')
|
|
110
|
-
return undefined;
|
|
111
|
-
const terminal = (status) => status === 'completed' || status === 'failed' || status === 'cancelled';
|
|
112
|
-
if (terminal(data.status))
|
|
113
|
-
return result.sequence;
|
|
114
|
-
if (data.status !== 'running')
|
|
115
|
-
return undefined;
|
|
116
|
-
return records.findLast((record) => record.type === 'code.cell.completed' &&
|
|
117
|
-
isRecord(record.payload) &&
|
|
118
|
-
record.payload.cellId === data.cellId &&
|
|
119
|
-
terminal(record.payload.status))?.sequence;
|
|
120
|
-
}
|
|
121
|
-
export function observationsFromRecord(record) {
|
|
122
|
-
return isRecord(record.payload) ? parseObservations(record.payload.observations) : undefined;
|
|
123
|
-
}
|
|
124
|
-
export function codeCallEvidence(records, result, entry) {
|
|
125
|
-
if (entry.status !== 'completed')
|
|
126
|
-
return undefined;
|
|
127
|
-
const evidence = codeObservationEvidence(records, result, {
|
|
128
|
-
type: 'tool_result',
|
|
129
|
-
id: `call:${entry.callId}`,
|
|
130
|
-
source: { callId: entry.callId, toolName: entry.toolName, input: entry.input },
|
|
131
|
-
outcome: 'completed',
|
|
132
|
-
result: { content: '' }
|
|
133
|
-
});
|
|
134
|
-
if (!evidence || !isRecord(evidence.completed.payload))
|
|
135
|
-
return undefined;
|
|
136
|
-
return {
|
|
137
|
-
...evidence,
|
|
138
|
-
result: {
|
|
139
|
-
...evidence.result,
|
|
140
|
-
payload: {
|
|
141
|
-
role: 'tool',
|
|
142
|
-
callId: entry.callId,
|
|
143
|
-
content: JSON.stringify(evidence.completed.payload.data ?? {})
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/** Failed patch calls can prove applied file units, never successful input reclamation. */
|
|
149
|
-
export function codePartialPatchCallEvidence(records, result, entry) {
|
|
150
|
-
if (entry.status !== 'failed' || entry.toolName !== 'apply_patch')
|
|
151
|
-
return undefined;
|
|
152
|
-
const evidence = codeToolEvidence(records, result, { callId: entry.callId, toolName: entry.toolName, input: entry.input }, 'failed');
|
|
153
|
-
if (!evidence || !contextGcPatchResultFromFailedPayload(evidence.terminal.payload))
|
|
154
|
-
return undefined;
|
|
155
|
-
return { callId: evidence.callId, call: evidence.call, failed: evidence.terminal, result };
|
|
156
|
-
}
|
|
157
|
-
export function callsFromRecord(record) {
|
|
158
|
-
return isRecord(record.payload) ? parseCodeCalls(record.payload.calls) : undefined;
|
|
159
|
-
}
|
|
160
|
-
export function retainedCodeInputs(records, parentCallId) {
|
|
161
|
-
return records.flatMap((record) => {
|
|
162
|
-
if (!isRecord(record.payload) ||
|
|
163
|
-
record.type !== 'tool.started' ||
|
|
164
|
-
record.payload.parentCallId !== parentCallId)
|
|
165
|
-
return [];
|
|
166
|
-
const call = record.payload;
|
|
167
|
-
const completedPatch = call.toolName === 'apply_patch' &&
|
|
168
|
-
records.some((next) => next.sequence > record.sequence &&
|
|
169
|
-
next.type === 'tool.completed' &&
|
|
170
|
-
isRecord(next.payload) &&
|
|
171
|
-
next.payload.callId === call.callId &&
|
|
172
|
-
next.payload.toolName === 'apply_patch' &&
|
|
173
|
-
next.payload.parentCallId === parentCallId &&
|
|
174
|
-
contextGcPatchResultFromCompletedPayload(next.payload) !== undefined) &&
|
|
175
|
-
!records.some((next) => next.sequence > record.sequence &&
|
|
176
|
-
next.type === 'tool.failed' &&
|
|
177
|
-
isRecord(next.payload) &&
|
|
178
|
-
next.payload.callId === call.callId);
|
|
179
|
-
// Successful patches have durable file evidence; other inputs retain their direct-mode semantics.
|
|
180
|
-
return completedPatch
|
|
181
|
-
? []
|
|
182
|
-
: [{ callId: call.callId, toolName: call.toolName, input: call.input }];
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
function isRecord(value) {
|
|
186
|
-
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
187
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export type ContextGcWebToolName = 'web_search' | 'web_fetch';
|
|
2
|
-
export interface ContextGcCodeModeInput {
|
|
3
|
-
readonly code: string;
|
|
4
|
-
readonly inputMode: 'freeform' | 'json';
|
|
5
|
-
}
|
|
6
|
-
export declare function normalizeContextGcCodeModeInput(arguments_: unknown): ContextGcCodeModeInput | undefined;
|
|
7
|
-
export declare function contextGcCodeModeInputReplacement(input: ContextGcCodeModeInput, retainedInputs?: readonly unknown[]): unknown;
|
|
8
|
-
export declare function contextGcCodeModeOutputReplacement(originalContent: string, truncated: boolean): string;
|
|
9
|
-
export interface ContextGcPatchFile {
|
|
10
|
-
readonly path: string;
|
|
11
|
-
readonly targetPath?: string;
|
|
12
|
-
readonly operation: 'added' | 'modified' | 'deleted' | 'moved';
|
|
13
|
-
readonly addedLines: number;
|
|
14
|
-
readonly deletedLines: number;
|
|
15
|
-
}
|
|
16
|
-
export interface ContextGcPatchResult {
|
|
17
|
-
readonly files: readonly ContextGcPatchFile[];
|
|
18
|
-
readonly totals: {
|
|
19
|
-
readonly files: number;
|
|
20
|
-
readonly addedLines: number;
|
|
21
|
-
readonly deletedLines: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export type ContextGcExecResult = {
|
|
25
|
-
readonly source: 'STRUCTURED';
|
|
26
|
-
readonly status: 'running' | 'completed' | 'cancelled';
|
|
27
|
-
readonly processId?: string;
|
|
28
|
-
readonly exitCode?: number | null;
|
|
29
|
-
readonly truncated: boolean;
|
|
30
|
-
readonly stdoutBytes: number;
|
|
31
|
-
readonly stderrBytes: number;
|
|
32
|
-
readonly stdoutDroppedBytes: number;
|
|
33
|
-
readonly stderrDroppedBytes: number;
|
|
34
|
-
readonly stdout: string;
|
|
35
|
-
readonly stderr: string;
|
|
36
|
-
} | {
|
|
37
|
-
readonly source: 'MODEL_CONTEXT_TRUNCATED';
|
|
38
|
-
readonly status: 'completed' | 'cancelled';
|
|
39
|
-
readonly processId?: string;
|
|
40
|
-
readonly exitCode?: number | null;
|
|
41
|
-
readonly truncated: boolean;
|
|
42
|
-
readonly stdoutBytes: number;
|
|
43
|
-
readonly stderrBytes: number;
|
|
44
|
-
readonly stdoutDroppedBytes: number;
|
|
45
|
-
readonly stderrDroppedBytes: number;
|
|
46
|
-
readonly modelContextContent: string;
|
|
47
|
-
};
|
|
48
|
-
export declare function contextGcPatchResultFromCompletedPayload(payload: unknown): ContextGcPatchResult | undefined;
|
|
49
|
-
export declare function contextGcPatchResultFromFailedPayload(payload: unknown): ContextGcPatchResult | undefined;
|
|
50
|
-
export declare function contextGcApplyPatchInputReplacement(arguments_: unknown, result: ContextGcPatchResult): string;
|
|
51
|
-
export declare function contextGcStaleReadReplacement(input: {
|
|
52
|
-
readonly path: string;
|
|
53
|
-
readonly content: string;
|
|
54
|
-
readonly operation: Exclude<ContextGcPatchFile['operation'], 'added'>;
|
|
55
|
-
}): string;
|
|
56
|
-
export declare function contextGcWebOutputReplacement(toolName: ContextGcWebToolName, originalContent: string, truncated: boolean): string;
|
|
57
|
-
export declare function contextGcExecInputReplacement(arguments_: unknown, toolName?: string): unknown;
|
|
58
|
-
export declare function contextGcExecOutputReplacement(result: ContextGcExecResult): string;
|
|
59
|
-
export declare function normalizeContextGcExecResult(modelContent: unknown, completedPayload: unknown): ContextGcExecResult | undefined;
|
|
60
|
-
export declare function parseContextGcExecResult(value: unknown): ContextGcExecResult | undefined;
|
|
61
|
-
/** A returned tool wait is not proof that its retained JavaScript cell finished. */
|
|
62
|
-
export declare function codeCellCompletionSequence(records: readonly import('./store/index.js').SessionRecord[], completed: import('./store/index.js').SessionRecord): number | undefined;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export type ContextGcSubagentToolName = 'agent_start' | 'agent_wait' | 'agent_message' | 'agent_cancel';
|
|
2
|
-
export interface ContextGcSubagentSnapshot {
|
|
3
|
-
readonly agentId: string;
|
|
4
|
-
readonly description: string;
|
|
5
|
-
readonly status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
|
|
6
|
-
readonly modelId?: string;
|
|
7
|
-
readonly modelName?: string;
|
|
8
|
-
readonly reasoningEffort?: string;
|
|
9
|
-
readonly latestMessage?: {
|
|
10
|
-
readonly itemId: string;
|
|
11
|
-
readonly turnId: string;
|
|
12
|
-
readonly phase: 'commentary' | 'final_answer';
|
|
13
|
-
readonly text: string;
|
|
14
|
-
readonly timestamp: string;
|
|
15
|
-
readonly truncated?: boolean;
|
|
16
|
-
};
|
|
17
|
-
readonly latestActivity?: {
|
|
18
|
-
readonly kind: 'message';
|
|
19
|
-
readonly timestamp: string;
|
|
20
|
-
readonly phase: 'commentary' | 'final_answer';
|
|
21
|
-
} | {
|
|
22
|
-
readonly kind: 'tool';
|
|
23
|
-
readonly timestamp: string;
|
|
24
|
-
readonly toolName: string;
|
|
25
|
-
readonly status: 'started' | 'completed' | 'failed';
|
|
26
|
-
};
|
|
27
|
-
readonly summary?: string;
|
|
28
|
-
readonly changedFiles?: readonly string[];
|
|
29
|
-
readonly verification?: readonly string[];
|
|
30
|
-
readonly evidence?: readonly {
|
|
31
|
-
readonly path: string;
|
|
32
|
-
readonly startLine?: number;
|
|
33
|
-
readonly endLine?: number;
|
|
34
|
-
}[];
|
|
35
|
-
readonly errorCode?: string;
|
|
36
|
-
readonly errorMessage?: string;
|
|
37
|
-
readonly messageId?: string;
|
|
38
|
-
readonly turnId?: string;
|
|
39
|
-
readonly deliveryStatus?: 'accepted' | 'applied' | 'cancelled' | 'failed';
|
|
40
|
-
readonly waitOutcome?: 'snapshot' | 'message' | 'completion' | 'timeout';
|
|
41
|
-
}
|
|
42
|
-
export declare function normalizeContextGcSubagentSnapshot(modelContent: unknown, completedPayload: unknown, toolName: ContextGcSubagentToolName): ContextGcSubagentSnapshot | undefined;
|
|
43
|
-
export declare function contextGcCompletedSubagentTurnId(snapshot: ContextGcSubagentSnapshot): string | undefined;
|
|
44
|
-
export declare function contextGcSubagentSnapshotTurnId(snapshot: ContextGcSubagentSnapshot): string | undefined;
|
|
45
|
-
export declare function contextGcSubagentNeedsRetainedPriorFinal(snapshot: ContextGcSubagentSnapshot): boolean;
|
|
46
|
-
export declare function contextGcSubagentPriorFinalIsRetained(source: ContextGcSubagentSnapshot, retained: ContextGcSubagentSnapshot | undefined): boolean;
|
|
47
|
-
export declare function contextGcSubagentSnapshotIsSuperseded(source: ContextGcSubagentSnapshot, terminal: ContextGcSubagentSnapshot, retainedPriorFinal?: ContextGcSubagentSnapshot): boolean;
|
|
48
|
-
export declare function contextGcSubagentSnapshotIsPreciselyCovered(source: ContextGcSubagentSnapshot, retained: ContextGcSubagentSnapshot): boolean;
|
|
49
|
-
export declare function contextGcSubagentOutputReplacement(input: {
|
|
50
|
-
readonly sourceContent: string;
|
|
51
|
-
readonly source: ContextGcSubagentSnapshot;
|
|
52
|
-
readonly terminal: ContextGcSubagentSnapshot;
|
|
53
|
-
}): string;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SessionRecord } from './store/index.js';
|
|
2
|
-
/** The application is self-contained; the receive record may precede the Compact window. */
|
|
3
|
-
export declare function appliedInputRecord(record: SessionRecord): SessionRecord | undefined;
|
|
4
|
-
/** Only the last checkpoint and its tail are needed, never a historical consume index. */
|
|
5
|
-
export declare function pendingDeferredInputs(records: readonly SessionRecord[]): Map<string, SessionRecord>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { MarAgentError } from '../error.js';
|
|
2
|
-
/** The application is self-contained; the receive record may precede the Compact window. */
|
|
3
|
-
export function appliedInputRecord(record) {
|
|
4
|
-
if (record.type !== 'model.context' || !record.payload || typeof record.payload !== 'object')
|
|
5
|
-
return undefined;
|
|
6
|
-
const payload = record.payload;
|
|
7
|
-
if (payload.inputRef === undefined)
|
|
8
|
-
return undefined;
|
|
9
|
-
const input = payload.input;
|
|
10
|
-
if (payload.role !== 'user' ||
|
|
11
|
-
typeof payload.content !== 'string' ||
|
|
12
|
-
typeof payload.inputRef !== 'string' ||
|
|
13
|
-
!payload.inputRef ||
|
|
14
|
-
!input ||
|
|
15
|
-
typeof input !== 'object' ||
|
|
16
|
-
Array.isArray(input) ||
|
|
17
|
-
typeof input.prompt !== 'string' ||
|
|
18
|
-
input.deferred !== true ||
|
|
19
|
-
payload.content !==
|
|
20
|
-
(input.modelText ?? input.prompt))
|
|
21
|
-
throw new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Deferred input application is invalid.');
|
|
22
|
-
return { ...record, type: 'turn.user', recordId: payload.inputRef, payload: input };
|
|
23
|
-
}
|
|
24
|
-
/** Only the last checkpoint and its tail are needed, never a historical consume index. */
|
|
25
|
-
export function pendingDeferredInputs(records) {
|
|
26
|
-
const pending = new Map();
|
|
27
|
-
const applied = new Set();
|
|
28
|
-
for (const record of records) {
|
|
29
|
-
const payload = (record.payload ?? {});
|
|
30
|
-
if (record.type === 'compact.completed' && typeof payload.summary === 'string') {
|
|
31
|
-
pending.clear();
|
|
32
|
-
applied.clear();
|
|
33
|
-
if (payload.pendingInputs !== undefined) {
|
|
34
|
-
if (!Array.isArray(payload.pendingInputs))
|
|
35
|
-
corrupt();
|
|
36
|
-
for (const item of payload.pendingInputs) {
|
|
37
|
-
if (!item ||
|
|
38
|
-
item.type !== 'turn.user' ||
|
|
39
|
-
item.sessionId !== record.sessionId ||
|
|
40
|
-
typeof item.recordId !== 'string' ||
|
|
41
|
-
!Number.isSafeInteger(item.sequence) ||
|
|
42
|
-
item.sequence < 1 ||
|
|
43
|
-
item.sequence >= record.sequence ||
|
|
44
|
-
!item.payload ||
|
|
45
|
-
item.payload.deferred !== true ||
|
|
46
|
-
typeof item.payload.prompt !== 'string' ||
|
|
47
|
-
pending.has(item.recordId))
|
|
48
|
-
corrupt();
|
|
49
|
-
pending.set(item.recordId, item);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (record.type === 'turn.user' && payload.deferred === true) {
|
|
54
|
-
if (typeof payload.prompt !== 'string' ||
|
|
55
|
-
pending.has(record.recordId) ||
|
|
56
|
-
applied.has(record.recordId))
|
|
57
|
-
corrupt();
|
|
58
|
-
pending.set(record.recordId, record);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
const input = appliedInputRecord(record);
|
|
62
|
-
if (!input)
|
|
63
|
-
continue;
|
|
64
|
-
if (applied.has(input.recordId))
|
|
65
|
-
corrupt();
|
|
66
|
-
applied.add(input.recordId);
|
|
67
|
-
pending.delete(input.recordId);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return new Map([...pending].sort(([, a], [, b]) => a.sequence - b.sequence));
|
|
71
|
-
}
|
|
72
|
-
function corrupt() {
|
|
73
|
-
throw new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Deferred input state is invalid.');
|
|
74
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { ModelMessage, ModelRequest } from '../model/contracts.js';
|
|
2
|
-
import type { ModelImage } from '../model/image.js';
|
|
3
|
-
import type { SessionRecord } from './store/types.js';
|
|
4
|
-
export declare const INLINE_MEDIA_POLICY: Readonly<{
|
|
5
|
-
historicalInlineMediaTrigger: number;
|
|
6
|
-
historicalInlineMediaTarget: number;
|
|
7
|
-
requestInlineMediaHardLimit: number;
|
|
8
|
-
}>;
|
|
9
|
-
export interface InlineMediaCursor {
|
|
10
|
-
sourceId: string;
|
|
11
|
-
imageIndex: number;
|
|
12
|
-
}
|
|
13
|
-
/** Processing progress, not evidence that the provider inspected an image. */
|
|
14
|
-
export interface InlineMediaState {
|
|
15
|
-
version: 1;
|
|
16
|
-
consideredThrough?: InlineMediaCursor;
|
|
17
|
-
evictedThrough?: InlineMediaCursor;
|
|
18
|
-
}
|
|
19
|
-
export interface InlineMediaGcCheckpoint {
|
|
20
|
-
readonly reason: 'SOFT_LIMIT' | 'HARD_LIMIT' | 'TEXT_GC';
|
|
21
|
-
readonly state: InlineMediaState;
|
|
22
|
-
readonly beforeBytes: number;
|
|
23
|
-
readonly afterBytes: number;
|
|
24
|
-
}
|
|
25
|
-
export interface InlineMediaGcCandidate extends InlineMediaGcCheckpoint {
|
|
26
|
-
/** Apply the proposed eviction to the current visual-window projection. */
|
|
27
|
-
readonly project: (messages: readonly ModelMessage[]) => ModelMessage[];
|
|
28
|
-
}
|
|
29
|
-
export declare function parseInlineMediaGc(value: unknown): InlineMediaGcCheckpoint | undefined;
|
|
30
|
-
export declare function inlineMediaSource(message: ModelMessage): string | ModelMessage;
|
|
31
|
-
/** GC may advance only a durable, already-considered source prefix. */
|
|
32
|
-
export declare function inlineMediaGcAnchored(records: readonly SessionRecord[], media: InlineMediaGcCheckpoint): boolean;
|
|
33
|
-
export declare function inlineMediaBytes(image: ModelImage): number;
|
|
34
|
-
export declare function inlineMediaLimit(): never;
|
|
35
|
-
/** Final encoding guard; URL-only images do not consume the inline budget. */
|
|
36
|
-
export declare function assertInlineMediaBudget(request: Pick<ModelRequest, 'messages' | 'images'>): void;
|
|
37
|
-
export declare function parseInlineMediaState(value: unknown): InlineMediaState | undefined;
|
|
38
|
-
/** Recover ordering once at the lifecycle boundary, including GC-omitted sources. */
|
|
39
|
-
export declare function inlineMediaHistory(records: readonly SessionRecord[]): {
|
|
40
|
-
cursors: (InlineMediaCursor & {
|
|
41
|
-
rollout: number;
|
|
42
|
-
})[];
|
|
43
|
-
rollouts: number;
|
|
44
|
-
state?: InlineMediaState;
|
|
45
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { MarAgentError } from '../error.js';
|
|
2
|
-
import { appliedInputRecord } from './deferred-input.js';
|
|
3
|
-
const MiB = 1_048_576;
|
|
4
|
-
export const INLINE_MEDIA_POLICY = Object.freeze({
|
|
5
|
-
historicalInlineMediaTrigger: 7 * MiB,
|
|
6
|
-
historicalInlineMediaTarget: 5 * MiB,
|
|
7
|
-
requestInlineMediaHardLimit: 12 * MiB
|
|
8
|
-
});
|
|
9
|
-
export function parseInlineMediaGc(value) {
|
|
10
|
-
if (!value || typeof value !== 'object')
|
|
11
|
-
return undefined;
|
|
12
|
-
const item = value;
|
|
13
|
-
const state = parseInlineMediaState(item.state);
|
|
14
|
-
return state?.evictedThrough &&
|
|
15
|
-
state.consideredThrough &&
|
|
16
|
-
Number.isSafeInteger(item.beforeBytes) &&
|
|
17
|
-
item.beforeBytes > 0 &&
|
|
18
|
-
Number.isSafeInteger(item.afterBytes) &&
|
|
19
|
-
item.afterBytes >= 0 &&
|
|
20
|
-
item.afterBytes <= INLINE_MEDIA_POLICY.historicalInlineMediaTarget &&
|
|
21
|
-
item.afterBytes < item.beforeBytes &&
|
|
22
|
-
(item.reason === 'SOFT_LIMIT' || item.reason === 'HARD_LIMIT' || item.reason === 'TEXT_GC') &&
|
|
23
|
-
(item.reason !== 'SOFT_LIMIT' ||
|
|
24
|
-
item.beforeBytes > INLINE_MEDIA_POLICY.historicalInlineMediaTrigger) &&
|
|
25
|
-
(item.reason !== 'TEXT_GC' ||
|
|
26
|
-
item.beforeBytes > INLINE_MEDIA_POLICY.historicalInlineMediaTarget)
|
|
27
|
-
? { reason: item.reason, state, beforeBytes: item.beforeBytes, afterBytes: item.afterBytes }
|
|
28
|
-
: undefined;
|
|
29
|
-
}
|
|
30
|
-
export function inlineMediaSource(message) {
|
|
31
|
-
return message.callId !== undefined
|
|
32
|
-
? `tool:${message.callId}`
|
|
33
|
-
: message.metadata?.recordId !== undefined
|
|
34
|
-
? `input:${message.metadata.recordId}`
|
|
35
|
-
: message;
|
|
36
|
-
}
|
|
37
|
-
/** GC may advance only a durable, already-considered source prefix. */
|
|
38
|
-
export function inlineMediaGcAnchored(records, media) {
|
|
39
|
-
const history = inlineMediaHistory(records);
|
|
40
|
-
const positions = new Map();
|
|
41
|
-
const key = (cursor) => JSON.stringify([cursor?.sourceId, cursor?.imageIndex]);
|
|
42
|
-
for (const cursor of history.cursors) {
|
|
43
|
-
const identity = key({ sourceId: cursor.sourceId, imageIndex: cursor.imageIndex });
|
|
44
|
-
if (!positions.has(identity))
|
|
45
|
-
positions.set(identity, { index: positions.size, rollout: cursor.rollout });
|
|
46
|
-
}
|
|
47
|
-
const evicted = positions.get(key(media.state.evictedThrough));
|
|
48
|
-
const considered = positions.get(key(media.state.consideredThrough));
|
|
49
|
-
const previous = positions.get(key(history.state?.evictedThrough));
|
|
50
|
-
return (evicted !== undefined &&
|
|
51
|
-
considered !== undefined &&
|
|
52
|
-
key(media.state.consideredThrough) === key(history.state?.consideredThrough) &&
|
|
53
|
-
evicted.index <= considered.index &&
|
|
54
|
-
evicted.index > (previous?.index ?? -1) &&
|
|
55
|
-
(media.reason === 'HARD_LIMIT' || history.rollouts - evicted.rollout >= 2));
|
|
56
|
-
}
|
|
57
|
-
export function inlineMediaBytes(image) {
|
|
58
|
-
const bytes = image.dataBase64 !== undefined
|
|
59
|
-
? image.dataBase64.length
|
|
60
|
-
: image.byteSize !== undefined
|
|
61
|
-
? 4 * Math.ceil(image.byteSize / 3)
|
|
62
|
-
: undefined;
|
|
63
|
-
if (bytes === undefined)
|
|
64
|
-
throw new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Resource size is unavailable.');
|
|
65
|
-
return bytes + Buffer.byteLength(`data:${image.mimeType};base64,`);
|
|
66
|
-
}
|
|
67
|
-
export function inlineMediaLimit() {
|
|
68
|
-
throw new MarAgentError('MAR_AGENT_INLINE_MEDIA_LIMIT', 'Inline images exceed the 12 MiB request limit. Reduce this image batch or use view_image with resize or region before retrying.');
|
|
69
|
-
}
|
|
70
|
-
/** Final encoding guard; URL-only images do not consume the inline budget. */
|
|
71
|
-
export function assertInlineMediaBudget(request) {
|
|
72
|
-
let total = 0;
|
|
73
|
-
for (const message of request.messages)
|
|
74
|
-
for (const image of message.images ?? [])
|
|
75
|
-
if (image.dataBase64 !== undefined)
|
|
76
|
-
total += inlineMediaBytes(image);
|
|
77
|
-
for (const image of request.images ?? [])
|
|
78
|
-
if (image.dataBase64 !== undefined)
|
|
79
|
-
total += inlineMediaBytes(image);
|
|
80
|
-
if (total > INLINE_MEDIA_POLICY.requestInlineMediaHardLimit)
|
|
81
|
-
inlineMediaLimit();
|
|
82
|
-
}
|
|
83
|
-
export function parseInlineMediaState(value) {
|
|
84
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
85
|
-
return undefined;
|
|
86
|
-
const state = value;
|
|
87
|
-
const cursor = (value) => {
|
|
88
|
-
if (!value || typeof value !== 'object')
|
|
89
|
-
return false;
|
|
90
|
-
const item = value;
|
|
91
|
-
return (typeof item.sourceId === 'string' &&
|
|
92
|
-
item.sourceId.length > 0 &&
|
|
93
|
-
item.sourceId.length <= 256 &&
|
|
94
|
-
Number.isSafeInteger(item.imageIndex) &&
|
|
95
|
-
item.imageIndex >= 0);
|
|
96
|
-
};
|
|
97
|
-
if (state.version !== 1 ||
|
|
98
|
-
(state.consideredThrough !== undefined && !cursor(state.consideredThrough)) ||
|
|
99
|
-
(state.evictedThrough !== undefined && !cursor(state.evictedThrough)))
|
|
100
|
-
return undefined;
|
|
101
|
-
return structuredClone(state);
|
|
102
|
-
}
|
|
103
|
-
/** Recover ordering once at the lifecycle boundary, including GC-omitted sources. */
|
|
104
|
-
export function inlineMediaHistory(records) {
|
|
105
|
-
const cursors = [];
|
|
106
|
-
let rollouts = 0;
|
|
107
|
-
let state;
|
|
108
|
-
const add = (sourceId, images) => {
|
|
109
|
-
if (!sourceId || !Array.isArray(images))
|
|
110
|
-
return;
|
|
111
|
-
for (let imageIndex = 0; imageIndex < images.length; imageIndex++)
|
|
112
|
-
cursors.push({ sourceId, imageIndex, rollout: rollouts });
|
|
113
|
-
};
|
|
114
|
-
for (const record of records) {
|
|
115
|
-
const payload = record.payload;
|
|
116
|
-
if (!payload || typeof payload !== 'object')
|
|
117
|
-
continue;
|
|
118
|
-
if (record.type === 'model.attempt' &&
|
|
119
|
-
payload.purpose === 'EXECUTION' &&
|
|
120
|
-
payload.state === 'SUCCEEDED')
|
|
121
|
-
rollouts++;
|
|
122
|
-
if (record.type === 'compact.completed') {
|
|
123
|
-
cursors.splice(0);
|
|
124
|
-
state = parseInlineMediaState(payload.inlineMediaState);
|
|
125
|
-
for (const item of (payload.retainedModelContext ?? [])) {
|
|
126
|
-
const applied = appliedInputRecord({ ...record, type: 'model.context', payload: item });
|
|
127
|
-
if (applied) {
|
|
128
|
-
add(`input:${applied.recordId}`, applied.payload.images);
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
const key = inlineMediaSource(item);
|
|
132
|
-
add(typeof key === 'string' ? key : undefined, item.images);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else if (record.type === 'resource.window') {
|
|
136
|
-
state = parseInlineMediaState(payload);
|
|
137
|
-
}
|
|
138
|
-
else if (record.type === 'context.gc.completed' && payload.inlineMedia !== undefined) {
|
|
139
|
-
const media = parseInlineMediaGc(payload.inlineMedia);
|
|
140
|
-
if (!media)
|
|
141
|
-
throw new MarAgentError('MAR_AGENT_SESSION_CORRUPT', 'Inline media GC state is invalid.');
|
|
142
|
-
state = media.state;
|
|
143
|
-
}
|
|
144
|
-
else if ((record.type === 'turn.user' || record.type === 'extension.input') &&
|
|
145
|
-
payload.deferred !== true) {
|
|
146
|
-
add(`input:${record.recordId}`, payload.images);
|
|
147
|
-
}
|
|
148
|
-
else if (record.type === 'model.context') {
|
|
149
|
-
const applied = appliedInputRecord(record);
|
|
150
|
-
if (applied) {
|
|
151
|
-
add(`input:${applied.recordId}`, applied.payload.images);
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
const key = typeof payload.inputRef === 'string'
|
|
155
|
-
? `input:${payload.inputRef}`
|
|
156
|
-
: typeof payload.callId === 'string'
|
|
157
|
-
? `tool:${payload.callId}`
|
|
158
|
-
: undefined;
|
|
159
|
-
add(key, payload.images);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return { cursors, rollouts, ...(state ? { state } : {}) };
|
|
163
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { SessionRecord } from './store/types.js';
|
|
2
|
-
export type MarAgentSessionRollbackInput = {
|
|
3
|
-
readonly boundaryTurnId: string | null;
|
|
4
|
-
readonly beforeInput?: never;
|
|
5
|
-
} | {
|
|
6
|
-
readonly boundaryTurnId?: never;
|
|
7
|
-
readonly beforeInput: {
|
|
8
|
-
readonly turnId: string;
|
|
9
|
-
readonly clientMessageId: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
/** Resolve the retained prefix only from records read under the Session maintenance lease. */
|
|
13
|
-
export declare function rollbackBoundaryIndex(records: readonly SessionRecord[], input: MarAgentSessionRollbackInput): number;
|