@code-yeongyu/senpi 2026.9.4 → 2026.9.5-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +131 -0
- package/README.md +5 -4
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +2 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-runtime.js +2 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +17 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +106 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +31 -41
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +20 -7
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/credential-pool/state-store.d.ts +1 -0
- package/dist/core/credential-pool/state-store.d.ts.map +1 -1
- package/dist/core/credential-pool/state-store.js +22 -2
- package/dist/core/credential-pool/state-store.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js +1 -5
- package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +0 -2
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +3 -4
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts +5 -0
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js +11 -4
- package/dist/core/extensions/builtin/compaction/model-usability-budget.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote-convert.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote-convert.js +2 -0
- package/dist/core/extensions/builtin/compaction/openai-remote-convert.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +1 -3
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js +8 -20
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js +3 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.js.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/auth.js +10 -2
- package/dist/core/extensions/builtin/imagegen/auth.js.map +1 -1
- package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/index.js +20 -1
- package/dist/core/extensions/builtin/loop/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop/store.d.ts +8 -6
- package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/store.js +54 -88
- package/dist/core/extensions/builtin/loop/store.js.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts +6 -1
- package/dist/core/extensions/builtin/loop/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/tools.js +8 -1
- package/dist/core/extensions/builtin/loop/tools.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +2 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +10 -6
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +27 -12
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js +1 -0
- package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +12 -4
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/durable-command.d.ts +31 -0
- package/dist/core/extensions/builtin/terminal/durable-command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-command.js +96 -0
- package/dist/core/extensions/builtin/terminal/durable-command.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-file.d.ts +42 -0
- package/dist/core/extensions/builtin/terminal/durable-file.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/durable-file.js +102 -0
- package/dist/core/extensions/builtin/terminal/durable-file.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +226 -3
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.d.ts +10 -0
- package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.js +21 -0
- package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts +24 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js +105 -0
- package/dist/core/extensions/builtin/terminal/manifest-lease.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +5 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +42 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +73 -2
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js +21 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/prompt.js +9 -5
- package/dist/core/extensions/builtin/terminal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/restore.d.ts +56 -0
- package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/restore.js +177 -0
- package/dist/core/extensions/builtin/terminal/restore.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/shared.d.ts +25 -0
- package/dist/core/extensions/builtin/terminal/shared.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/shared.js +25 -0
- package/dist/core/extensions/builtin/terminal/shared.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts +91 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js +14 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest-model.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts +62 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js +204 -0
- package/dist/core/extensions/builtin/terminal/terminal-manifest.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/bash-input.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-input.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/bash-output.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js +3 -2
- package/dist/core/extensions/builtin/terminal/tools/bash-resize.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +8 -0
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js +10 -0
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js +5 -4
- package/dist/core/extensions/builtin/terminal/tools/kill-bash.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts +4 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +114 -22
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/prompt.js +3 -6
- package/dist/core/extensions/builtin/todotools/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js +1 -1
- package/dist/core/extensions/builtin/tool-search/index.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts +9 -4
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.js +11 -6
- package/dist/core/extensions/builtin/tool-search/native-search.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts +13 -0
- package/dist/core/extensions/builtin/tool-search/native-support.d.ts.map +1 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js +45 -0
- package/dist/core/extensions/builtin/tool-search/native-support.js.map +1 -0
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +44 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +26 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +18 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js +2 -0
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/lockfile-policy.d.ts +11 -0
- package/dist/core/lockfile-policy.d.ts.map +1 -1
- package/dist/core/lockfile-policy.js +19 -0
- package/dist/core/lockfile-policy.js.map +1 -1
- package/dist/core/manual-continue.d.ts +13 -0
- package/dist/core/manual-continue.d.ts.map +1 -0
- package/dist/core/manual-continue.js +19 -0
- package/dist/core/manual-continue.js.map +1 -0
- package/dist/core/messages.d.ts +7 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +10 -2
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +13 -2
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/retry-fallback/chains.d.ts +1 -13
- package/dist/core/retry-fallback/chains.d.ts.map +1 -1
- package/dist/core/retry-fallback/chains.js +3 -49
- package/dist/core/retry-fallback/chains.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +4 -9
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/expansion.js +1 -1
- package/dist/core/retry-fallback/expansion.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts +2 -4
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +7 -36
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +6 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +12 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +39 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-sidecar-store.d.ts +62 -0
- package/dist/core/session-sidecar-store.d.ts.map +1 -0
- package/dist/core/session-sidecar-store.js +149 -0
- package/dist/core/session-sidecar-store.js.map +1 -0
- package/dist/core/settings-manager.d.ts +5 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +45 -15
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +19 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/terminal-settings.d.ts +3 -0
- package/dist/core/terminal-settings.d.ts.map +1 -1
- package/dist/core/terminal-settings.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -2
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -2
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -2
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -3
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +33 -3
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +57 -6
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/daemon.js +9 -1
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +5 -11
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +21 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -2
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +2 -2
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.js +5 -2
- package/dist/modes/interactive/grok/welcome-card.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +86 -14
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/version-label.d.ts +7 -0
- package/dist/modes/interactive/version-label.d.ts.map +1 -0
- package/dist/modes/interactive/version-label.js +9 -0
- package/dist/modes/interactive/version-label.js.map +1 -0
- package/dist/modes/rpc/host-ensure.d.ts +2 -0
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +77 -18
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +3 -4
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +2 -0
- package/docs/environment-variables.md +5 -0
- package/docs/extensions.md +22 -2
- package/docs/keybindings.md +1 -1
- package/docs/models.md +3 -0
- package/docs/quickstart.md +1 -1
- package/docs/rpc.md +1 -1
- package/docs/settings.md +13 -5
- package/docs/terminal-setup.md +27 -0
- package/docs/terminal-tools.md +35 -4
- package/docs/usage.md +5 -3
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +96 -0
- package/node_modules/@anthropic-ai/sdk/README.md +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.js +5 -7
- package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +5 -7
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.js +4 -4
- package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +4 -4
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts +45 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts +45 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js +58 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs +54 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/standard-schema.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js +3 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs +3 -1
- package/node_modules/@anthropic-ai/sdk/internal/errors.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js +23 -25
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +5 -6
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.js +22 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs +19 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.mts +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.js +24 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.mjs +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/node.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js +10 -6
- package/node_modules/@anthropic-ai/sdk/internal/uploads.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs +10 -6
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +6 -4
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +4 -2
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +3 -4
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +1 -2
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +2 -3
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +2 -3
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js +30 -7
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +30 -7
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +3 -46
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +3 -46
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts +131 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts +131 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js +45 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs +41 -0
- package/node_modules/@anthropic-ai/sdk/lib/standard-schema.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +35 -6
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +35 -6
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/package.json +4 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +13 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +13 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +28 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +28 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +8 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +8 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +25 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +25 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +7 -7
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +5 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +5 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +11 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +8 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts +8 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +198 -29
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +198 -29
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts +177 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts +177 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js +56 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/api-keys.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts +74 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs +48 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/compliance-settings.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts +272 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts +272 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js +119 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs +115 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/external-keys.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts +14 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js +21 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts +353 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts +353 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js +169 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs +165 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/issuers.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts +468 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts +468 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js +198 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs +193 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js +114 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation/rules.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js +25 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs +12 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts +162 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts +162 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js +76 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs +72 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/invites.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts +73 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts +73 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js +62 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs +57 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/organization.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts +77 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts +77 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js +31 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs +27 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/rate-limits.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js +174 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js +125 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts +124 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js +67 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs +63 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/users.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts +5 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js +13 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts +135 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts +135 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js +102 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs +98 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/members.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js +34 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs +30 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js +189 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts +303 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts +303 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js +112 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs +107 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization/workspaces.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/organization.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +2 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts +48 -120
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts +48 -120
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +12 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +12 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts +35 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts +35 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +18 -18
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +18 -18
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +21 -25
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts +21 -25
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +16 -17
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +16 -17
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +21 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +21 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +5 -7
- package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +4 -3
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/standard-schema.ts +99 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/detect-platform.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/errors.ts +3 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +11 -10
- package/node_modules/@anthropic-ai/sdk/src/internal/node.browser.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/node.ts +14 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/uploads.ts +10 -7
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/values.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +5 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +1 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +2 -3
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +33 -9
- package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +7 -49
- package/node_modules/@anthropic-ai/sdk/src/lib/standard-schema.ts +209 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +38 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +45 -15
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +6 -6
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +8 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +34 -11
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +13 -7
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +12 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +8 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +5 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +221 -38
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/api-keys.ts +231 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/compliance-settings.ts +96 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/external-keys.ts +365 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/federation.ts +71 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/index.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/issuers.ts +486 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/rules.ts +624 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation/rules.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/federation.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/index.ts +92 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/invites.ts +207 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/organization.ts +269 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/rate-limits.ts +104 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/index.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/service-accounts.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/users.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/index.ts +43 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/members.ts +209 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/rate-limits.ts +113 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces/workspaces.ts +450 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization/workspaces.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/organization.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +10 -10
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +7 -10
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +60 -150
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +43 -166
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +24 -27
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +25 -29
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2 -8
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +6 -5
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +5 -3
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +1 -5
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +122 -17
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +10 -43
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +13 -15
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +3 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +6 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +5 -3
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +1 -2
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +1 -2
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +0 -4
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +0 -3
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +11 -9
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +11 -9
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +96 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +96 -7
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +0 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +0 -8
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +20 -46
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +9 -33
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +59 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +4 -2
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +29 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/session-manager.ts +8 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +3 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/display-image.js +162 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/prelude.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/worker-runtime.js +29 -60
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/py/prelude.py +66 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +35 -96
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +7 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +6 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +14 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +12 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +58 -64
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +3 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +17 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +17 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +6 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +5 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +7 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +40 -10
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +8 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +130 -15
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +30 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +8 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +30 -0
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +27 -3
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/anthropic.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +22 -2
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js +58 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/drop-failed-assistant-turns.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js +53 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/node-http-proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +36 -3
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +106 -6
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +17 -4
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +11 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +57 -15
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +22 -7
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../src/harness/reducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAkCtC,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAG7C,YAAY,MAAiC,EAAE,OAAe;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAuFD,SAAS,OAAO,CAAC,MAAiC,EAAE,OAAe;IAClE,MAAM,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,MAAkB;IACnC,OAAO,OAAO,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC9D,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,MAAwB;IACtE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IACpF,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,6BAA6B,CAAC,WAAuC,EAAE,MAAwB;IACvG,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzC,IAAI,KAAK,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;QACtD,OAAO,CACN,4BAA4B,EAC5B,qBAAqB,MAAM,CAAC,EAAE,gDAAgD,CAC9E,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAC3B,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AE,CACV,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,CAAC,KAAK,KAAK,gBAAgB,IAAI,MAAM,CAAC,OAAO,KAAK,cAAc,CAAC,EAAE,CACrG;YACD,CAAC,gBAAgB,EAAE,IAAI,KAAK,SAAS;gBACpC,gBAAgB,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW;gBAC7C,gBAAgB,CAAC,OAAO,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC;QACtD,IAAI,cAAc,IAAI,uBAAuB,EAAE,CAAC;YAC/C,eAAe,GAAG;gBACjB,OAAO,EAAE,cAAc,CAAC,EAAE;gBAC1B,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB;gBAClD,OAAO,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;aACtC,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO;QACN,SAAS,EAAE;YACV,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,SAAS,EAAE;gBACV,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;gBACzB,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBAC7B,QAAQ;gBACR,IAAI;gBACJ,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,CAAC;gBACnG,sBAAsB;gBACtB,YAAY;gBACZ,eAAe;gBACf,aAAa;gBACb,QAAQ;gBACR,oBAAoB;gBACpB,SAAS;gBACT,OAAO;aACP;YACD,cAAc;SACd;QACD,sBAAsB;QACtB,eAAe;KACf,CAAC;AACH,CAAC","sourcesContent":["import type { AssistantMessage, DeferredHandle, StopReason } from \"@earendil-works/pi-ai\";\nimport { Guard } from \"typebox/guard\";\nimport type { AgentMessage, AgentToolCall, ThinkingLevel } from \"../types.ts\";\nimport type {\n\tEntry,\n\tLaneRecord,\n\tOperationStartedRecord,\n\tProvisionedEntry,\n\tQueueEnqueuedRecord,\n\tStepAttemptRecord,\n\tToolStartedRecord,\n\tWriteDeferredRecord,\n} from \"./session/types.ts\";\n\n/**\n * Machine-readable category for a contradiction in a lane's durable recovery\n * slice. These indicate states the single-writer record protocol cannot\n * produce, not ordinary operation failures or incomplete-but-recoverable\n * intent/result prefixes. Restore must reject such states rather than repair or\n * continue it; the accompanying error message supplies human-readable detail.\n */\nexport type RecordLogCorruptionReason =\n\t| \"multiple_open_operations\"\n\t| \"unknown_operation\"\n\t| \"record_after_finish\"\n\t| \"non_consecutive_attempt\"\n\t| \"invalid_compaction_reason\"\n\t| \"queue_after_abort\"\n\t| \"invalid_queue_cancellation\"\n\t| \"inconsistent_step\"\n\t| \"tool_call_mismatch\"\n\t| \"duplicate_tool_invocation\"\n\t| \"provisioned_entry_mismatch\"\n\t| \"invalid_deferred_handle\";\n\nexport class RecordLogCorruption extends Error {\n\treadonly reason: RecordLogCorruptionReason;\n\n\tconstructor(reason: RecordLogCorruptionReason, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"RecordLogCorruption\";\n\t\tthis.reason = reason;\n\t}\n}\n\nexport interface RecordLogSlice {\n\tlane: string;\n\topenOperations: readonly OperationStartedRecord[];\n\trecords: readonly LaneRecord[];\n\t/** Operation-owned entries plus entries fetched directly by provisioned or referenced ids. */\n\tentries: readonly Entry[];\n}\n\nexport interface EffectiveLaneConfiguration {\n\tmodel: { provider: string; modelId: string };\n\tthinkingLevel: ThinkingLevel;\n\tactiveToolNames: string[];\n}\n\nexport interface TerminalFailureState {\n\tentryId: string;\n\tsource: \"step\" | \"deferred_fetch\";\n\tmessage: AssistantMessage;\n}\n\nexport interface ToolBatchState {\n\tassistantEntryId: string;\n\tcalls: {\n\t\ttoolIndex: number;\n\t\ttoolCall: AgentToolCall;\n\t\tstarted?: ToolStartedRecord;\n\t\tresultExists: boolean;\n\t\tterminate?: boolean;\n\t}[];\n\ttruncated: boolean;\n\tunresolved: boolean;\n}\n\nexport interface LaneState {\n\tlane: string;\n\tleafId: string | null;\n\toperation: null | {\n\t\tid: string;\n\t\tkind: \"run\" | \"compaction\" | \"navigation\";\n\t\tintent: OperationStartedRecord[\"intent\"];\n\t\taborting: boolean;\n\t\tstep: null | {\n\t\t\tkind: \"assistant\" | \"compaction\" | \"branch_summary\";\n\t\t\tattempts: number;\n\t\t\tresultEntryId: string;\n\t\t\tcompactionReason?: \"manual\" | \"threshold\" | \"overflow\";\n\t\t};\n\t\ttoolBatch: ToolBatchState | null;\n\t\tmissingInitialMessages: ProvisionedEntry[];\n\t\tpendingSteer: ProvisionedEntry[];\n\t\tpendingFollowUp: ProvisionedEntry[];\n\t\tpendingWrites: ProvisionedEntry[];\n\t\tdeferred: DeferredHandle | null;\n\t\toverflowRecoveryUsed: boolean;\n\t\tnewestOwn: null | {\n\t\t\tentryId: string;\n\t\t\ttype: Entry[\"type\"];\n\t\t\trole?: AgentMessage[\"role\"];\n\t\t\tstopReason?: StopReason;\n\t\t};\n\t\ttargets: { result?: boolean; summary?: boolean };\n\t};\n\tpendingNextRun: ProvisionedEntry[];\n}\n\nexport interface LaneReductionInput extends RecordLogSlice {\n\tleafId: string | null;\n\t/** Entries appended by the open operation, oldest first. Empty when idle. */\n\townEntries: readonly Entry[];\n\t/** Bounded effective-state lookups at the operation anchor or idle leaf, oldest first. */\n\tconfigurationEntries: readonly Entry[];\n\t/** Harness option fallbacks used when no persisted value exists. */\n\tdefaults: EffectiveLaneConfiguration;\n}\n\nexport interface LaneReductionResult {\n\tlaneState: LaneState;\n\teffectiveConfiguration: EffectiveLaneConfiguration;\n\tterminalFailure: TerminalFailureState | null;\n}\n\ninterface AttemptSeries {\n\trecord: StepAttemptRecord;\n}\n\nfunction corrupt(reason: RecordLogCorruptionReason, message: string): never {\n\tthrow new RecordLogCorruption(reason, message);\n}\n\nfunction hasRunId(record: LaneRecord): record is Exclude<LaneRecord, OperationStartedRecord> & { runId: string } {\n\treturn \"runId\" in record && typeof record.runId === \"string\";\n}\n\nfunction matchesProvisionedEntry(entry: Entry, target: ProvisionedEntry): boolean {\n\tconst { parentId: _parentId, seq: _seq, timestamp: _timestamp, ...payload } = entry;\n\treturn Guard.IsDeepEqual(payload, target);\n}\n\nfunction validateExactProvisionedEntry(entriesById: ReadonlyMap<string, Entry>, target: ProvisionedEntry): void {\n\tconst entry = entriesById.get(target.id);\n\tif (entry && !matchesProvisionedEntry(entry, target)) {\n\t\tcorrupt(\n\t\t\t\"provisioned_entry_mismatch\",\n\t\t\t`Provisioned entry ${target.id} exists with content different from its intent`,\n\t\t);\n\t}\n}\n\nfunction validateResultEntry(\n\tentriesById: ReadonlyMap<string, Entry>,\n\tresultEntryId: string,\n\tmatches: (entry: Entry) => boolean,\n\tdescription: string,\n): void {\n\tconst entry = entriesById.get(resultEntryId);\n\tif (entry && !matches(entry)) {\n\t\tcorrupt(\n\t\t\t\"provisioned_entry_mismatch\",\n\t\t\t`Provisioned ${description} entry ${resultEntryId} exists with different content`,\n\t\t);\n\t}\n}\n\nfunction validateAttemptReason(record: StepAttemptRecord): void {\n\tconst reason = (record as { compactionReason?: unknown }).compactionReason;\n\tif (record.step === \"compaction\") {\n\t\tif (reason !== \"manual\" && reason !== \"threshold\" && reason !== \"overflow\") {\n\t\t\tcorrupt(\"invalid_compaction_reason\", `Compaction attempt ${record.id} has no valid compaction reason`);\n\t\t}\n\t} else if (reason !== undefined) {\n\t\tcorrupt(\"invalid_compaction_reason\", `${record.step} attempt ${record.id} has a compaction reason`);\n\t}\n}\n\nfunction validateAttemptSequence(\n\trecord: StepAttemptRecord,\n\tprevious: AttemptSeries | undefined,\n\tentriesById: ReadonlyMap<string, Entry>,\n): void {\n\tconst previousRecord = previous?.record;\n\tconst previousResult = previousRecord ? entriesById.get(previousRecord.resultEntryId) : undefined;\n\tconst continuesSeries =\n\t\tpreviousRecord !== undefined &&\n\t\tpreviousRecord.step === record.step &&\n\t\t(previousResult === undefined || previousResult.seq >= record.seq);\n\tconst expectedAttempt = continuesSeries ? previousRecord.attempt + 1 : 1;\n\tif (record.attempt !== expectedAttempt) {\n\t\tcorrupt(\n\t\t\t\"non_consecutive_attempt\",\n\t\t\t`${record.step} attempt ${record.id} is ${record.attempt}; expected ${expectedAttempt}`,\n\t\t);\n\t}\n\tif (!continuesSeries || record.step === \"assistant\" || previousRecord === undefined) return;\n\tif (record.resultEntryId !== previousRecord.resultEntryId) {\n\t\tcorrupt(\"inconsistent_step\", `${record.step} attempts disagree on their result entry id`);\n\t}\n\tif (record.compactionReason !== previousRecord.compactionReason) {\n\t\tcorrupt(\"inconsistent_step\", `${record.step} attempts disagree on their compaction reason`);\n\t}\n}\n\nfunction validateAttemptResult(entriesById: ReadonlyMap<string, Entry>, record: StepAttemptRecord): void {\n\tswitch (record.step) {\n\t\tcase \"assistant\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"message\" && entry.message.role === \"assistant\",\n\t\t\t\t\"assistant result\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"compaction\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"compaction\",\n\t\t\t\t\"compaction result\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"branch_summary\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"branch_summary\",\n\t\t\t\t\"branch-summary result\",\n\t\t\t);\n\t\t\tbreak;\n\t}\n}\n\nfunction validateToolStart(\n\trecord: Extract<LaneRecord, { type: \"tool_started\" }>,\n\tentriesById: ReadonlyMap<string, Entry>,\n\tinvocations: Set<string>,\n): void {\n\tconst invocation = `${record.assistantEntryId}\\u0000${record.toolIndex}`;\n\tif (invocations.has(invocation)) {\n\t\tcorrupt(\n\t\t\t\"duplicate_tool_invocation\",\n\t\t\t`Tool invocation ${record.assistantEntryId}:${record.toolIndex} is duplicated`,\n\t\t);\n\t}\n\tinvocations.add(invocation);\n\n\tconst assistantEntry = entriesById.get(record.assistantEntryId);\n\tif (assistantEntry?.type !== \"message\" || assistantEntry.message.role !== \"assistant\") {\n\t\tcorrupt(\"tool_call_mismatch\", `Tool start ${record.id} does not reference an assistant entry`);\n\t}\n\tconst toolCalls = assistantEntry.message.content.filter((content) => content.type === \"toolCall\");\n\tconst toolCall = toolCalls[record.toolIndex];\n\tif (!toolCall || toolCall.id !== record.toolCallId || toolCall.name !== record.toolName) {\n\t\tcorrupt(\"tool_call_mismatch\", `Tool start ${record.id} does not match its assistant tool-call ordinal`);\n\t}\n\n\tvalidateResultEntry(\n\t\tentriesById,\n\t\trecord.resultEntryId,\n\t\t(entry) =>\n\t\t\tentry.type === \"message\" &&\n\t\t\tentry.message.role === \"toolResult\" &&\n\t\t\tentry.message.toolCallId === record.toolCallId &&\n\t\t\tentry.message.toolName === record.toolName,\n\t\t\"tool result\",\n\t);\n}\n\nfunction validateDeferredHandles(entries: Iterable<Entry>): void {\n\tfor (const entry of entries) {\n\t\tif (\n\t\t\tentry.type === \"message\" &&\n\t\t\tentry.message.role === \"assistant\" &&\n\t\t\tentry.message.stopReason === \"deferred\" &&\n\t\t\t!entry.message.deferred\n\t\t) {\n\t\t\tcorrupt(\"invalid_deferred_handle\", `Deferred assistant entry ${entry.id} does not carry a handle`);\n\t\t}\n\t}\n}\n\nfunction validateOperationResult(entriesById: ReadonlyMap<string, Entry>, record: OperationStartedRecord): void {\n\tswitch (record.intent.kind) {\n\t\tcase \"run\":\n\t\t\tfor (const target of record.intent.initialMessages) validateExactProvisionedEntry(entriesById, target);\n\t\t\tbreak;\n\t\tcase \"compaction\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.intent.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"compaction\",\n\t\t\t\t\"manual compaction\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"navigation\":\n\t\t\tif (record.intent.summaryEntryId) {\n\t\t\t\tvalidateResultEntry(\n\t\t\t\t\tentriesById,\n\t\t\t\t\trecord.intent.summaryEntryId,\n\t\t\t\t\t(entry) => entry.type === \"branch_summary\",\n\t\t\t\t\t\"navigation summary\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n\n/** Validates a bounded lane recovery slice without reading or mutating session state. */\nexport function validateRecordLog(input: RecordLogSlice): void {\n\tif (input.openOperations.length > 1) {\n\t\tcorrupt(\"multiple_open_operations\", `Lane ${input.lane} has at least two open operations`);\n\t}\n\n\tconst entriesById = new Map(input.entries.map((entry) => [entry.id, entry]));\n\tvalidateDeferredHandles(entriesById.values());\n\tconst starts = new Map<string, OperationStartedRecord>();\n\tconst finishedAt = new Map<string, number>();\n\tconst abortedAt = new Map<string, number>();\n\tconst queueEnqueues = new Map<string, Extract<LaneRecord, { type: \"queue_enqueued\" }>>();\n\tconst latestAttempt = new Map<string, AttemptSeries>();\n\tconst toolInvocations = new Set<string>();\n\tconst records = [...input.records].sort((left, right) => left.seq - right.seq);\n\n\tfor (const record of records) {\n\t\tif (record.type === \"operation_started\") {\n\t\t\tstarts.set(record.id, record);\n\t\t\tvalidateOperationResult(entriesById, record);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (hasRunId(record)) {\n\t\t\tif (!starts.has(record.runId)) {\n\t\t\t\tcorrupt(\"unknown_operation\", `Record ${record.id} references unknown operation ${record.runId}`);\n\t\t\t}\n\t\t\tconst finishSeq = finishedAt.get(record.runId);\n\t\t\tif (finishSeq !== undefined && record.seq > finishSeq) {\n\t\t\t\tcorrupt(\"record_after_finish\", `Record ${record.id} follows the finish of operation ${record.runId}`);\n\t\t\t}\n\t\t}\n\n\t\tswitch (record.type) {\n\t\t\tcase \"operation_finished\":\n\t\t\t\tfinishedAt.set(record.runId, record.seq);\n\t\t\t\tbreak;\n\t\t\tcase \"abort_requested\":\n\t\t\t\tabortedAt.set(record.runId, record.seq);\n\t\t\t\tbreak;\n\t\t\tcase \"step_attempt\":\n\t\t\t\tvalidateAttemptReason(record);\n\t\t\t\tvalidateAttemptSequence(record, latestAttempt.get(record.runId), entriesById);\n\t\t\t\tvalidateAttemptResult(entriesById, record);\n\t\t\t\tlatestAttempt.set(record.runId, { record });\n\t\t\t\tbreak;\n\t\t\tcase \"tool_started\":\n\t\t\t\tvalidateToolStart(record, entriesById, toolInvocations);\n\t\t\t\tbreak;\n\t\t\tcase \"queue_enqueued\":\n\t\t\t\tif (\n\t\t\t\t\trecord.queue !== \"nextRun\" &&\n\t\t\t\t\tabortedAt.get(record.runId) !== undefined &&\n\t\t\t\t\trecord.seq > abortedAt.get(record.runId)!\n\t\t\t\t) {\n\t\t\t\t\tcorrupt(\"queue_after_abort\", `${record.queue} item ${record.target.id} was enqueued after abort`);\n\t\t\t\t}\n\t\t\t\tqueueEnqueues.set(record.target.id, record);\n\t\t\t\tvalidateExactProvisionedEntry(entriesById, record.target);\n\t\t\t\tbreak;\n\t\t\tcase \"queue_cancelled\": {\n\t\t\t\tconst enqueue = queueEnqueues.get(record.entryId);\n\t\t\t\tif (\n\t\t\t\t\t!enqueue ||\n\t\t\t\t\tenqueue.seq >= record.seq ||\n\t\t\t\t\tenqueue.runId !== record.runId ||\n\t\t\t\t\tentriesById.has(record.entryId)\n\t\t\t\t) {\n\t\t\t\t\tcorrupt(\"invalid_queue_cancellation\", `Queue cancellation ${record.id} has no pending matching enqueue`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"write_deferred\":\n\t\t\t\tvalidateExactProvisionedEntry(entriesById, record.target);\n\t\t\t\tbreak;\n\t\t\tcase \"usage\":\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction clone<T>(value: T): T {\n\treturn structuredClone(value);\n}\n\nfunction bySequence<T extends { seq: number }>(values: readonly T[]): T[] {\n\treturn [...values].sort((left, right) => left.seq - right.seq);\n}\n\nfunction deriveEffectiveConfiguration(input: LaneReductionInput): EffectiveLaneConfiguration {\n\tlet configuration = clone(input.defaults);\n\tconst entriesById = new Map<string, Entry>();\n\tfor (const entry of [...input.configurationEntries, ...input.ownEntries]) entriesById.set(entry.id, entry);\n\n\tfor (const entry of bySequence([...entriesById.values()])) {\n\t\tswitch (entry.type) {\n\t\t\tcase \"model_change\":\n\t\t\t\tconfiguration = { ...configuration, model: { provider: entry.provider, modelId: entry.modelId } };\n\t\t\t\tbreak;\n\t\t\tcase \"thinking_level_change\":\n\t\t\t\tconfiguration = { ...configuration, thinkingLevel: entry.thinkingLevel as ThinkingLevel };\n\t\t\t\tbreak;\n\t\t\tcase \"active_tools_change\":\n\t\t\t\tconfiguration = { ...configuration, activeToolNames: [...entry.activeToolNames] };\n\t\t\t\tbreak;\n\t\t\tcase \"message\":\n\t\t\t\tif (entry.message.role === \"assistant\") {\n\t\t\t\t\tconfiguration = {\n\t\t\t\t\t\t...configuration,\n\t\t\t\t\t\tmodel: { provider: entry.message.provider, modelId: entry.message.model },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn configuration;\n}\n\nfunction deriveNewestOwn(\n\tentry: Entry | undefined,\n): NonNullable<NonNullable<LaneState[\"operation\"]>[\"newestOwn\"]> | null {\n\tif (!entry) return null;\n\tif (entry.type !== \"message\") return { entryId: entry.id, type: entry.type };\n\tif (entry.message.role !== \"assistant\") {\n\t\treturn { entryId: entry.id, type: entry.type, role: entry.message.role };\n\t}\n\treturn {\n\t\tentryId: entry.id,\n\t\ttype: entry.type,\n\t\trole: entry.message.role,\n\t\tstopReason: entry.message.stopReason,\n\t};\n}\n\nfunction deriveToolBatch(\n\toperationId: string,\n\trecords: readonly LaneRecord[],\n\townEntries: readonly Entry[],\n\tentriesById: ReadonlyMap<string, Entry>,\n\tdeferredWriteIds: ReadonlySet<string>,\n): ToolBatchState | null {\n\tconst assistantEntry = [...ownEntries]\n\t\t.reverse()\n\t\t.find(\n\t\t\t(entry) =>\n\t\t\t\tentry.type === \"message\" &&\n\t\t\t\tentry.message.role === \"assistant\" &&\n\t\t\t\tentry.message.content.some((content) => content.type === \"toolCall\"),\n\t\t);\n\tif (assistantEntry?.type !== \"message\" || assistantEntry.message.role !== \"assistant\") return null;\n\n\tconst toolCalls = assistantEntry.message.content.filter(\n\t\t(content): content is AgentToolCall => content.type === \"toolCall\",\n\t);\n\tconst starts = new Map<number, ToolStartedRecord>();\n\tfor (const record of records) {\n\t\tif (\n\t\t\trecord.type === \"tool_started\" &&\n\t\t\trecord.runId === operationId &&\n\t\t\trecord.assistantEntryId === assistantEntry.id\n\t\t) {\n\t\t\tstarts.set(record.toolIndex, record);\n\t\t}\n\t}\n\n\tconst calls = toolCalls.map((toolCall, toolIndex) => {\n\t\tconst started = starts.get(toolIndex);\n\t\tconst startedResult = started ? entriesById.get(started.resultEntryId) : undefined;\n\t\tconst blockedResult = ownEntries.find(\n\t\t\t(entry) =>\n\t\t\t\tentry.seq > assistantEntry.seq &&\n\t\t\t\t!deferredWriteIds.has(entry.id) &&\n\t\t\t\tentry.type === \"message\" &&\n\t\t\t\tentry.message.role === \"toolResult\" &&\n\t\t\t\tentry.message.toolCallId === toolCall.id,\n\t\t);\n\t\tconst result = startedResult ?? blockedResult;\n\t\treturn {\n\t\t\ttoolIndex,\n\t\t\ttoolCall: clone(toolCall),\n\t\t\t...(started ? { started: clone(started) } : {}),\n\t\t\tresultExists: result !== undefined,\n\t\t\t...(result?.type === \"message\" && result.terminate === true ? { terminate: true } : {}),\n\t\t};\n\t});\n\n\treturn {\n\t\tassistantEntryId: assistantEntry.id,\n\t\tcalls,\n\t\ttruncated: assistantEntry.message.stopReason === \"length\",\n\t\tunresolved: calls.some((call) => !call.resultExists),\n\t};\n}\n\n/** Purely reconstructs one lane's orchestration state from its bounded recovery inputs. */\nexport function reduceLaneState(input: LaneReductionInput): LaneReductionResult {\n\tvalidateRecordLog(input);\n\n\tconst records = bySequence(input.records);\n\tconst ownEntries = bySequence(input.ownEntries);\n\tconst entriesById = new Map<string, Entry>();\n\tfor (const entry of [...input.entries, ...ownEntries]) entriesById.set(entry.id, entry);\n\tconst cancelledQueueIds = new Set(\n\t\trecords.filter((record) => record.type === \"queue_cancelled\").map((record) => record.entryId),\n\t);\n\tconst pendingQueueRecords = records.filter(\n\t\t(record): record is QueueEnqueuedRecord =>\n\t\t\trecord.type === \"queue_enqueued\" &&\n\t\t\t!entriesById.has(record.target.id) &&\n\t\t\t!cancelledQueueIds.has(record.target.id),\n\t);\n\tconst started = input.openOperations[0];\n\tconst capturedInitialMessageIds = new Set(\n\t\tstarted?.intent.kind === \"run\" ? started.intent.initialMessages.map((target) => target.id) : [],\n\t);\n\tconst pendingNextRun = pendingQueueRecords\n\t\t.filter((record) => record.queue === \"nextRun\" && !capturedInitialMessageIds.has(record.target.id))\n\t\t.map((record) => clone(record.target));\n\tconst effectiveConfiguration = deriveEffectiveConfiguration(input);\n\n\tif (!started) {\n\t\treturn {\n\t\t\tlaneState: { lane: input.lane, leafId: input.leafId, operation: null, pendingNextRun },\n\t\t\teffectiveConfiguration,\n\t\t\tterminalFailure: null,\n\t\t};\n\t}\n\n\tconst operationRecords = records.filter((record) =>\n\t\trecord.type === \"operation_started\" ? record.id === started.id : \"runId\" in record && record.runId === started.id,\n\t);\n\tconst aborting = operationRecords.some((record) => record.type === \"abort_requested\");\n\tconst pendingSteer = aborting\n\t\t? []\n\t\t: pendingQueueRecords\n\t\t\t\t.filter((record) => record.queue === \"steer\" && record.runId === started.id)\n\t\t\t\t.map((record) => clone(record.target));\n\tconst pendingFollowUp = aborting\n\t\t? []\n\t\t: pendingQueueRecords\n\t\t\t\t.filter((record) => record.queue === \"followUp\" && record.runId === started.id)\n\t\t\t\t.map((record) => clone(record.target));\n\tconst pendingWrites = operationRecords\n\t\t.filter(\n\t\t\t(record): record is WriteDeferredRecord =>\n\t\t\t\trecord.type === \"write_deferred\" && !entriesById.has(record.target.id),\n\t\t)\n\t\t.map((record) => clone(record.target));\n\tconst missingInitialMessages =\n\t\tstarted.intent.kind === \"run\"\n\t\t\t? started.intent.initialMessages.filter((target) => !entriesById.has(target.id)).map(clone)\n\t\t\t: [];\n\n\tconst newestAttempt = operationRecords.filter((record) => record.type === \"step_attempt\").at(-1);\n\tconst step =\n\t\tnewestAttempt && !entriesById.has(newestAttempt.resultEntryId)\n\t\t\t? {\n\t\t\t\t\tkind: newestAttempt.step,\n\t\t\t\t\tattempts: newestAttempt.attempt,\n\t\t\t\t\tresultEntryId: newestAttempt.resultEntryId,\n\t\t\t\t\t...(newestAttempt.step === \"compaction\" ? { compactionReason: newestAttempt.compactionReason } : {}),\n\t\t\t\t}\n\t\t\t: null;\n\n\tconst consumedInputIds = new Set<string>();\n\tif (started.intent.kind === \"run\") {\n\t\tfor (const target of started.intent.initialMessages) consumedInputIds.add(target.id);\n\t}\n\tfor (const record of operationRecords) {\n\t\tif (record.type === \"queue_enqueued\" && record.queue !== \"nextRun\") consumedInputIds.add(record.target.id);\n\t}\n\tlet newestConsumedInputSequence = Number.NEGATIVE_INFINITY;\n\tfor (const id of consumedInputIds) {\n\t\tconst entry = entriesById.get(id);\n\t\tif (entry?.type === \"message\") newestConsumedInputSequence = Math.max(newestConsumedInputSequence, entry.seq);\n\t}\n\tconst overflowRecoveryUsed = operationRecords.some(\n\t\t(record) =>\n\t\t\trecord.type === \"step_attempt\" &&\n\t\t\trecord.step === \"compaction\" &&\n\t\t\trecord.compactionReason === \"overflow\" &&\n\t\t\trecord.seq > newestConsumedInputSequence,\n\t);\n\n\tconst newestOwnEntry = ownEntries.at(-1);\n\tconst newestOwn = deriveNewestOwn(newestOwnEntry);\n\tconst deferred =\n\t\tnewestOwnEntry?.type === \"message\" &&\n\t\tnewestOwnEntry.message.role === \"assistant\" &&\n\t\tnewestOwnEntry.message.stopReason === \"deferred\" &&\n\t\tnewestOwnEntry.message.deferred\n\t\t\t? clone(newestOwnEntry.message.deferred)\n\t\t\t: null;\n\tconst targets: { result?: boolean; summary?: boolean } = {};\n\tif (started.intent.kind === \"compaction\") {\n\t\ttargets.result = entriesById.has(started.intent.resultEntryId);\n\t} else if (started.intent.kind === \"navigation\" && started.intent.summaryEntryId) {\n\t\ttargets.summary = entriesById.has(started.intent.summaryEntryId);\n\t}\n\n\tconst deferredWriteIds = new Set(\n\t\toperationRecords.filter((record) => record.type === \"write_deferred\").map((record) => record.target.id),\n\t);\n\tlet terminalFailure: TerminalFailureState | null = null;\n\tif (\n\t\tnewestOwnEntry?.type === \"message\" &&\n\t\tnewestOwnEntry.message.role === \"assistant\" &&\n\t\tnewestOwnEntry.message.stopReason === \"error\" &&\n\t\t!deferredWriteIds.has(newestOwnEntry.id)\n\t) {\n\t\tconst producedByStep = operationRecords.some(\n\t\t\t(record) => record.type === \"step_attempt\" && record.resultEntryId === newestOwnEntry.id,\n\t\t);\n\t\tconst previousOwnEntry = ownEntries.at(-2);\n\t\tconst producedByDeferredFetch =\n\t\t\toperationRecords.some(\n\t\t\t\t(record) =>\n\t\t\t\t\trecord.type === \"usage\" && record.cause === \"deferred_fetch\" && record.entryId === newestOwnEntry.id,\n\t\t\t) ||\n\t\t\t(previousOwnEntry?.type === \"message\" &&\n\t\t\t\tpreviousOwnEntry.message.role === \"assistant\" &&\n\t\t\t\tpreviousOwnEntry.message.stopReason === \"deferred\");\n\t\tif (producedByStep || producedByDeferredFetch) {\n\t\t\tterminalFailure = {\n\t\t\t\tentryId: newestOwnEntry.id,\n\t\t\t\tsource: producedByStep ? \"step\" : \"deferred_fetch\",\n\t\t\t\tmessage: clone(newestOwnEntry.message),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\tlaneState: {\n\t\t\tlane: input.lane,\n\t\t\tleafId: input.leafId,\n\t\t\toperation: {\n\t\t\t\tid: started.id,\n\t\t\t\tkind: started.intent.kind,\n\t\t\t\tintent: clone(started.intent),\n\t\t\t\taborting,\n\t\t\t\tstep,\n\t\t\t\ttoolBatch: deriveToolBatch(started.id, operationRecords, ownEntries, entriesById, deferredWriteIds),\n\t\t\t\tmissingInitialMessages,\n\t\t\t\tpendingSteer,\n\t\t\t\tpendingFollowUp,\n\t\t\t\tpendingWrites,\n\t\t\t\tdeferred,\n\t\t\t\toverflowRecoveryUsed,\n\t\t\t\tnewestOwn,\n\t\t\t\ttargets,\n\t\t\t},\n\t\t\tpendingNextRun,\n\t\t},\n\t\teffectiveConfiguration,\n\t\tterminalFailure,\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../src/harness/reducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAkCtC,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAG7C,YAAY,MAAiC,EAAE,OAAe;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;CACD;AAuFD,SAAS,OAAO,CAAC,MAAiC,EAAE,OAAe;IAClE,MAAM,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,MAAkB;IACnC,OAAO,OAAO,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC9D,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAY,EAAE,MAAwB;IACtE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,CAAC;IACpF,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,6BAA6B,CAAC,WAAuC,EAAE,MAAwB;IACvG,M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C7B,QAAQ;gBACR,IAAI;gBACJ,SAAS,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,CAAC;gBACnG,sBAAsB;gBACtB,YAAY;gBACZ,eAAe;gBACf,aAAa;gBACb,QAAQ;gBACR,oBAAoB;gBACpB,SAAS;gBACT,OAAO;aACP;YACD,cAAc;SACd;QACD,sBAAsB;QACtB,eAAe;KACf,CAAC;AACH,CAAC","sourcesContent":["import type { AssistantMessage, DeferredHandle, StopReason } from \"@earendil-works/pi-ai\";\nimport { Guard } from \"typebox/guard\";\nimport type { AgentMessage, AgentToolCall, ThinkingLevel } from \"../types.ts\";\nimport type {\n\tEntry,\n\tLaneRecord,\n\tOperationStartedRecord,\n\tProvisionedEntry,\n\tQueueEnqueuedRecord,\n\tStepAttemptRecord,\n\tToolStartedRecord,\n\tWriteDeferredRecord,\n} from \"./session/types.ts\";\n\n/**\n * Machine-readable category for a contradiction in a lane's durable recovery\n * slice. These indicate states the single-writer record protocol cannot\n * produce, not ordinary operation failures or incomplete-but-recoverable\n * intent/result prefixes. Restore must reject such states rather than repair or\n * continue it; the accompanying error message supplies human-readable detail.\n */\nexport type RecordLogCorruptionReason =\n\t| \"multiple_open_operations\"\n\t| \"unknown_operation\"\n\t| \"record_after_finish\"\n\t| \"non_consecutive_attempt\"\n\t| \"invalid_compaction_reason\"\n\t| \"queue_after_abort\"\n\t| \"invalid_queue_cancellation\"\n\t| \"inconsistent_step\"\n\t| \"tool_call_mismatch\"\n\t| \"duplicate_tool_invocation\"\n\t| \"provisioned_entry_mismatch\"\n\t| \"invalid_deferred_handle\";\n\nexport class RecordLogCorruption extends Error {\n\treadonly reason: RecordLogCorruptionReason;\n\n\tconstructor(reason: RecordLogCorruptionReason, message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"RecordLogCorruption\";\n\t\tthis.reason = reason;\n\t}\n}\n\nexport interface RecordLogSlice {\n\tlane: string;\n\topenOperations: readonly OperationStartedRecord[];\n\trecords: readonly LaneRecord[];\n\t/** Operation-owned entries plus entries fetched directly by provisioned or referenced ids. */\n\tentries: readonly Entry[];\n}\n\nexport interface EffectiveLaneConfiguration {\n\tmodel: { provider: string; modelId: string };\n\tthinkingLevel: ThinkingLevel;\n\tactiveToolNames: string[];\n}\n\nexport interface TerminalFailureState {\n\tentryId: string;\n\tsource: \"step\" | \"deferred_fetch\";\n\tmessage: AssistantMessage;\n}\n\nexport interface ToolBatchState {\n\tassistantEntryId: string;\n\tcalls: {\n\t\ttoolIndex: number;\n\t\ttoolCall: AgentToolCall;\n\t\tstarted?: ToolStartedRecord;\n\t\tresultExists: boolean;\n\t\tterminate?: boolean;\n\t}[];\n\ttruncated: boolean;\n\tunresolved: boolean;\n}\n\nexport interface LaneState {\n\tlane: string;\n\tleafId: string | null;\n\toperation: null | {\n\t\tid: string;\n\t\tkind: \"run\" | \"compaction\" | \"navigation\";\n\t\tintent: OperationStartedRecord[\"intent\"];\n\t\taborting: boolean;\n\t\tstep: null | {\n\t\t\tkind: \"assistant\" | \"compaction\" | \"branch_summary\";\n\t\t\tattempts: number;\n\t\t\tresultEntryId: string;\n\t\t\tcompactionReason?: \"manual\" | \"threshold\" | \"overflow\";\n\t\t};\n\t\ttoolBatch: ToolBatchState | null;\n\t\tmissingInitialMessages: ProvisionedEntry[];\n\t\tpendingSteer: ProvisionedEntry[];\n\t\tpendingFollowUp: ProvisionedEntry[];\n\t\tpendingWrites: ProvisionedEntry[];\n\t\tdeferred: DeferredHandle | null;\n\t\toverflowRecoveryUsed: boolean;\n\t\tnewestOwn: null | {\n\t\t\tentryId: string;\n\t\t\ttype: Entry[\"type\"];\n\t\t\trole?: AgentMessage[\"role\"];\n\t\t\tstopReason?: StopReason;\n\t\t};\n\t\ttargets: { result?: boolean; summary?: boolean };\n\t};\n\tpendingNextRun: ProvisionedEntry[];\n}\n\nexport interface LaneReductionInput extends RecordLogSlice {\n\tleafId: string | null;\n\t/** Entries appended by the open operation, oldest first. Empty when idle. */\n\townEntries: readonly Entry[];\n\t/** Bounded effective-state lookups at the operation anchor or idle leaf, oldest first. */\n\tconfigurationEntries: readonly Entry[];\n\t/** Harness option fallbacks used when no persisted value exists. */\n\tdefaults: EffectiveLaneConfiguration;\n}\n\nexport interface LaneReductionResult {\n\tlaneState: LaneState;\n\teffectiveConfiguration: EffectiveLaneConfiguration;\n\tterminalFailure: TerminalFailureState | null;\n}\n\ninterface AttemptSeries {\n\trecord: StepAttemptRecord;\n}\n\nfunction corrupt(reason: RecordLogCorruptionReason, message: string): never {\n\tthrow new RecordLogCorruption(reason, message);\n}\n\nfunction hasRunId(record: LaneRecord): record is Exclude<LaneRecord, OperationStartedRecord> & { runId: string } {\n\treturn \"runId\" in record && typeof record.runId === \"string\";\n}\n\nfunction matchesProvisionedEntry(entry: Entry, target: ProvisionedEntry): boolean {\n\tconst { parentId: _parentId, seq: _seq, timestamp: _timestamp, ...payload } = entry;\n\treturn Guard.IsDeepEqual(payload, target);\n}\n\nfunction validateExactProvisionedEntry(entriesById: ReadonlyMap<string, Entry>, target: ProvisionedEntry): void {\n\tconst entry = entriesById.get(target.id);\n\tif (entry && !matchesProvisionedEntry(entry, target)) {\n\t\tcorrupt(\n\t\t\t\"provisioned_entry_mismatch\",\n\t\t\t`Provisioned entry ${target.id} exists with content different from its intent`,\n\t\t);\n\t}\n}\n\nfunction validateResultEntry(\n\tentriesById: ReadonlyMap<string, Entry>,\n\tresultEntryId: string,\n\tmatches: (entry: Entry) => boolean,\n\tdescription: string,\n): void {\n\tconst entry = entriesById.get(resultEntryId);\n\tif (entry && !matches(entry)) {\n\t\tcorrupt(\n\t\t\t\"provisioned_entry_mismatch\",\n\t\t\t`Provisioned ${description} entry ${resultEntryId} exists with different content`,\n\t\t);\n\t}\n}\n\nfunction validateAttemptReason(record: StepAttemptRecord): void {\n\tconst reason = (record as { compactionReason?: unknown }).compactionReason;\n\tif (record.step === \"compaction\") {\n\t\tif (reason !== \"manual\" && reason !== \"threshold\" && reason !== \"overflow\") {\n\t\t\tcorrupt(\"invalid_compaction_reason\", `Compaction attempt ${record.id} has no valid compaction reason`);\n\t\t}\n\t} else if (reason !== undefined) {\n\t\tcorrupt(\"invalid_compaction_reason\", `${record.step} attempt ${record.id} has a compaction reason`);\n\t}\n}\n\nfunction validateAttemptSequence(\n\trecord: StepAttemptRecord,\n\tprevious: AttemptSeries | undefined,\n\tentriesById: ReadonlyMap<string, Entry>,\n): void {\n\tconst previousRecord = previous?.record;\n\tconst previousResult = previousRecord ? entriesById.get(previousRecord.resultEntryId) : undefined;\n\tconst continuesSeries =\n\t\tpreviousRecord !== undefined &&\n\t\tpreviousRecord.step === record.step &&\n\t\t(previousResult === undefined || previousResult.seq >= record.seq);\n\tconst expectedAttempt = continuesSeries ? previousRecord.attempt + 1 : 1;\n\tif (record.attempt !== expectedAttempt) {\n\t\tcorrupt(\n\t\t\t\"non_consecutive_attempt\",\n\t\t\t`${record.step} attempt ${record.id} is ${record.attempt}; expected ${expectedAttempt}`,\n\t\t);\n\t}\n\tif (!continuesSeries || record.step === \"assistant\" || previousRecord === undefined) return;\n\tif (record.resultEntryId !== previousRecord.resultEntryId) {\n\t\tcorrupt(\"inconsistent_step\", `${record.step} attempts disagree on their result entry id`);\n\t}\n\tif (record.compactionReason !== previousRecord.compactionReason) {\n\t\tcorrupt(\"inconsistent_step\", `${record.step} attempts disagree on their compaction reason`);\n\t}\n}\n\nfunction validateAttemptResult(entriesById: ReadonlyMap<string, Entry>, record: StepAttemptRecord): void {\n\tswitch (record.step) {\n\t\tcase \"assistant\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"message\" && entry.message.role === \"assistant\",\n\t\t\t\t\"assistant result\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"compaction\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"compaction\",\n\t\t\t\t\"compaction result\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"branch_summary\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"branch_summary\",\n\t\t\t\t\"branch-summary result\",\n\t\t\t);\n\t\t\tbreak;\n\t}\n}\n\nfunction validateToolStart(\n\trecord: Extract<LaneRecord, { type: \"tool_started\" }>,\n\tentriesById: ReadonlyMap<string, Entry>,\n\tinvocations: Set<string>,\n): void {\n\tconst invocation = `${record.assistantEntryId}\\u0000${record.toolIndex}`;\n\tif (invocations.has(invocation)) {\n\t\tcorrupt(\n\t\t\t\"duplicate_tool_invocation\",\n\t\t\t`Tool invocation ${record.assistantEntryId}:${record.toolIndex} is duplicated`,\n\t\t);\n\t}\n\tinvocations.add(invocation);\n\n\tconst assistantEntry = entriesById.get(record.assistantEntryId);\n\tif (assistantEntry?.type !== \"message\" || assistantEntry.message.role !== \"assistant\") {\n\t\tcorrupt(\"tool_call_mismatch\", `Tool start ${record.id} does not reference an assistant entry`);\n\t}\n\tconst toolCalls = assistantEntry.message.content.filter((content) => content.type === \"toolCall\");\n\tconst toolCall = toolCalls[record.toolIndex];\n\tif (!toolCall || toolCall.id !== record.toolCallId || toolCall.name !== record.toolName) {\n\t\tcorrupt(\"tool_call_mismatch\", `Tool start ${record.id} does not match its assistant tool-call ordinal`);\n\t}\n\n\tvalidateResultEntry(\n\t\tentriesById,\n\t\trecord.resultEntryId,\n\t\t(entry) =>\n\t\t\tentry.type === \"message\" &&\n\t\t\tentry.message.role === \"toolResult\" &&\n\t\t\tentry.message.toolCallId === record.toolCallId &&\n\t\t\tentry.message.toolName === record.toolName,\n\t\t\"tool result\",\n\t);\n}\n\nfunction validateDeferredHandles(entries: Iterable<Entry>): void {\n\tfor (const entry of entries) {\n\t\tif (\n\t\t\tentry.type === \"message\" &&\n\t\t\tentry.message.role === \"assistant\" &&\n\t\t\tentry.message.stopReason === \"deferred\" &&\n\t\t\t!entry.message.deferred\n\t\t) {\n\t\t\tcorrupt(\"invalid_deferred_handle\", `Deferred assistant entry ${entry.id} does not carry a handle`);\n\t\t}\n\t}\n}\n\nfunction validateOperationResult(entriesById: ReadonlyMap<string, Entry>, record: OperationStartedRecord): void {\n\tswitch (record.intent.kind) {\n\t\tcase \"run\":\n\t\t\tfor (const target of record.intent.initialMessages) validateExactProvisionedEntry(entriesById, target);\n\t\t\tbreak;\n\t\tcase \"compaction\":\n\t\t\tvalidateResultEntry(\n\t\t\t\tentriesById,\n\t\t\t\trecord.intent.resultEntryId,\n\t\t\t\t(entry) => entry.type === \"compaction\",\n\t\t\t\t\"manual compaction\",\n\t\t\t);\n\t\t\tbreak;\n\t\tcase \"navigation\":\n\t\t\tif (record.intent.summaryEntryId) {\n\t\t\t\tvalidateResultEntry(\n\t\t\t\t\tentriesById,\n\t\t\t\t\trecord.intent.summaryEntryId,\n\t\t\t\t\t(entry) => entry.type === \"branch_summary\",\n\t\t\t\t\t\"navigation summary\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tbreak;\n\t}\n}\n\n/** Validates a bounded lane recovery slice without reading or mutating session state. */\nexport function validateRecordLog(input: RecordLogSlice): void {\n\tif (input.openOperations.length > 1) {\n\t\tcorrupt(\"multiple_open_operations\", `Lane ${input.lane} has at least two open operations`);\n\t}\n\n\tconst entriesById = new Map(input.entries.map((entry) => [entry.id, entry]));\n\tvalidateDeferredHandles(entriesById.values());\n\tconst starts = new Map<string, OperationStartedRecord>();\n\tconst finishedAt = new Map<string, number>();\n\tconst abortedAt = new Map<string, number>();\n\tconst queueEnqueues = new Map<string, Extract<LaneRecord, { type: \"queue_enqueued\" }>>();\n\tconst latestAttempt = new Map<string, AttemptSeries>();\n\tconst toolInvocations = new Set<string>();\n\tconst records = [...input.records].sort((left, right) => left.seq - right.seq);\n\n\tfor (const record of records) {\n\t\tif (record.type === \"operation_started\") {\n\t\t\tstarts.set(record.id, record);\n\t\t\tvalidateOperationResult(entriesById, record);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (hasRunId(record)) {\n\t\t\tif (!starts.has(record.runId)) {\n\t\t\t\tcorrupt(\"unknown_operation\", `Record ${record.id} references unknown operation ${record.runId}`);\n\t\t\t}\n\t\t\tconst finishSeq = finishedAt.get(record.runId);\n\t\t\tif (finishSeq !== undefined && record.seq > finishSeq) {\n\t\t\t\tcorrupt(\"record_after_finish\", `Record ${record.id} follows the finish of operation ${record.runId}`);\n\t\t\t}\n\t\t}\n\n\t\tswitch (record.type) {\n\t\t\tcase \"operation_finished\":\n\t\t\t\tfinishedAt.set(record.runId, record.seq);\n\t\t\t\tbreak;\n\t\t\tcase \"abort_requested\":\n\t\t\t\tabortedAt.set(record.runId, record.seq);\n\t\t\t\tbreak;\n\t\t\tcase \"step_attempt\":\n\t\t\t\tvalidateAttemptReason(record);\n\t\t\t\tvalidateAttemptSequence(record, latestAttempt.get(record.runId), entriesById);\n\t\t\t\tvalidateAttemptResult(entriesById, record);\n\t\t\t\tlatestAttempt.set(record.runId, { record });\n\t\t\t\tbreak;\n\t\t\tcase \"tool_started\":\n\t\t\t\tvalidateToolStart(record, entriesById, toolInvocations);\n\t\t\t\tbreak;\n\t\t\tcase \"queue_enqueued\":\n\t\t\t\tif (\n\t\t\t\t\trecord.queue !== \"nextRun\" &&\n\t\t\t\t\tabortedAt.get(record.runId) !== undefined &&\n\t\t\t\t\trecord.seq > abortedAt.get(record.runId)!\n\t\t\t\t) {\n\t\t\t\t\tcorrupt(\"queue_after_abort\", `${record.queue} item ${record.target.id} was enqueued after abort`);\n\t\t\t\t}\n\t\t\t\tqueueEnqueues.set(record.target.id, record);\n\t\t\t\tvalidateExactProvisionedEntry(entriesById, record.target);\n\t\t\t\tbreak;\n\t\t\tcase \"queue_cancelled\": {\n\t\t\t\tconst enqueue = queueEnqueues.get(record.entryId);\n\t\t\t\tif (\n\t\t\t\t\t!enqueue ||\n\t\t\t\t\tenqueue.seq >= record.seq ||\n\t\t\t\t\tenqueue.runId !== record.runId ||\n\t\t\t\t\tentriesById.has(record.entryId)\n\t\t\t\t) {\n\t\t\t\t\tcorrupt(\"invalid_queue_cancellation\", `Queue cancellation ${record.id} has no pending matching enqueue`);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"write_deferred\":\n\t\t\t\tvalidateExactProvisionedEntry(entriesById, record.target);\n\t\t\t\tbreak;\n\t\t\tcase \"usage\":\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nfunction clone<T>(value: T): T {\n\treturn structuredClone(value);\n}\n\nfunction bySequence<T extends { seq: number }>(values: readonly T[]): T[] {\n\treturn [...values].sort((left, right) => left.seq - right.seq);\n}\n\nfunction deriveEffectiveConfiguration(input: LaneReductionInput): EffectiveLaneConfiguration {\n\tlet configuration = clone(input.defaults);\n\tconst entriesById = new Map<string, Entry>();\n\tfor (const entry of [...input.configurationEntries, ...input.ownEntries]) entriesById.set(entry.id, entry);\n\n\tfor (const entry of bySequence([...entriesById.values()])) {\n\t\tswitch (entry.type) {\n\t\t\tcase \"model_change\":\n\t\t\t\tconfiguration = { ...configuration, model: { provider: entry.provider, modelId: entry.modelId } };\n\t\t\t\tbreak;\n\t\t\tcase \"thinking_level_change\":\n\t\t\t\tconfiguration = { ...configuration, thinkingLevel: entry.thinkingLevel as ThinkingLevel };\n\t\t\t\tbreak;\n\t\t\tcase \"configuration_update\":\n\t\t\t\tconfiguration = {\n\t\t\t\t\t...configuration,\n\t\t\t\t\tthinkingLevel: entry.reasoning.effort as ThinkingLevel,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"active_tools_change\":\n\t\t\t\tconfiguration = { ...configuration, activeToolNames: [...entry.activeToolNames] };\n\t\t\t\tbreak;\n\t\t\tcase \"message\":\n\t\t\t\tif (entry.message.role === \"assistant\") {\n\t\t\t\t\tconfiguration = {\n\t\t\t\t\t\t...configuration,\n\t\t\t\t\t\tmodel: { provider: entry.message.provider, modelId: entry.message.model },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn configuration;\n}\n\nfunction deriveNewestOwn(\n\tentry: Entry | undefined,\n): NonNullable<NonNullable<LaneState[\"operation\"]>[\"newestOwn\"]> | null {\n\tif (!entry) return null;\n\tif (entry.type !== \"message\") return { entryId: entry.id, type: entry.type };\n\tif (entry.message.role !== \"assistant\") {\n\t\treturn { entryId: entry.id, type: entry.type, role: entry.message.role };\n\t}\n\treturn {\n\t\tentryId: entry.id,\n\t\ttype: entry.type,\n\t\trole: entry.message.role,\n\t\tstopReason: entry.message.stopReason,\n\t};\n}\n\nfunction deriveToolBatch(\n\toperationId: string,\n\trecords: readonly LaneRecord[],\n\townEntries: readonly Entry[],\n\tentriesById: ReadonlyMap<string, Entry>,\n\tdeferredWriteIds: ReadonlySet<string>,\n): ToolBatchState | null {\n\tconst assistantEntry = [...ownEntries]\n\t\t.reverse()\n\t\t.find(\n\t\t\t(entry) =>\n\t\t\t\tentry.type === \"message\" &&\n\t\t\t\tentry.message.role === \"assistant\" &&\n\t\t\t\tentry.message.content.some((content) => content.type === \"toolCall\"),\n\t\t);\n\tif (assistantEntry?.type !== \"message\" || assistantEntry.message.role !== \"assistant\") return null;\n\n\tconst toolCalls = assistantEntry.message.content.filter(\n\t\t(content): content is AgentToolCall => content.type === \"toolCall\",\n\t);\n\tconst starts = new Map<number, ToolStartedRecord>();\n\tfor (const record of records) {\n\t\tif (\n\t\t\trecord.type === \"tool_started\" &&\n\t\t\trecord.runId === operationId &&\n\t\t\trecord.assistantEntryId === assistantEntry.id\n\t\t) {\n\t\t\tstarts.set(record.toolIndex, record);\n\t\t}\n\t}\n\n\tconst calls = toolCalls.map((toolCall, toolIndex) => {\n\t\tconst started = starts.get(toolIndex);\n\t\tconst startedResult = started ? entriesById.get(started.resultEntryId) : undefined;\n\t\tconst blockedResult = ownEntries.find(\n\t\t\t(entry) =>\n\t\t\t\tentry.seq > assistantEntry.seq &&\n\t\t\t\t!deferredWriteIds.has(entry.id) &&\n\t\t\t\tentry.type === \"message\" &&\n\t\t\t\tentry.message.role === \"toolResult\" &&\n\t\t\t\tentry.message.toolCallId === toolCall.id,\n\t\t);\n\t\tconst result = startedResult ?? blockedResult;\n\t\treturn {\n\t\t\ttoolIndex,\n\t\t\ttoolCall: clone(toolCall),\n\t\t\t...(started ? { started: clone(started) } : {}),\n\t\t\tresultExists: result !== undefined,\n\t\t\t...(result?.type === \"message\" && result.terminate === true ? { terminate: true } : {}),\n\t\t};\n\t});\n\n\treturn {\n\t\tassistantEntryId: assistantEntry.id,\n\t\tcalls,\n\t\ttruncated: assistantEntry.message.stopReason === \"length\",\n\t\tunresolved: calls.some((call) => !call.resultExists),\n\t};\n}\n\n/** Purely reconstructs one lane's orchestration state from its bounded recovery inputs. */\nexport function reduceLaneState(input: LaneReductionInput): LaneReductionResult {\n\tvalidateRecordLog(input);\n\n\tconst records = bySequence(input.records);\n\tconst ownEntries = bySequence(input.ownEntries);\n\tconst entriesById = new Map<string, Entry>();\n\tfor (const entry of [...input.entries, ...ownEntries]) entriesById.set(entry.id, entry);\n\tconst cancelledQueueIds = new Set(\n\t\trecords.filter((record) => record.type === \"queue_cancelled\").map((record) => record.entryId),\n\t);\n\tconst pendingQueueRecords = records.filter(\n\t\t(record): record is QueueEnqueuedRecord =>\n\t\t\trecord.type === \"queue_enqueued\" &&\n\t\t\t!entriesById.has(record.target.id) &&\n\t\t\t!cancelledQueueIds.has(record.target.id),\n\t);\n\tconst started = input.openOperations[0];\n\tconst capturedInitialMessageIds = new Set(\n\t\tstarted?.intent.kind === \"run\" ? started.intent.initialMessages.map((target) => target.id) : [],\n\t);\n\tconst pendingNextRun = pendingQueueRecords\n\t\t.filter((record) => record.queue === \"nextRun\" && !capturedInitialMessageIds.has(record.target.id))\n\t\t.map((record) => clone(record.target));\n\tconst effectiveConfiguration = deriveEffectiveConfiguration(input);\n\n\tif (!started) {\n\t\treturn {\n\t\t\tlaneState: { lane: input.lane, leafId: input.leafId, operation: null, pendingNextRun },\n\t\t\teffectiveConfiguration,\n\t\t\tterminalFailure: null,\n\t\t};\n\t}\n\n\tconst operationRecords = records.filter((record) =>\n\t\trecord.type === \"operation_started\" ? record.id === started.id : \"runId\" in record && record.runId === started.id,\n\t);\n\tconst aborting = operationRecords.some((record) => record.type === \"abort_requested\");\n\tconst pendingSteer = aborting\n\t\t? []\n\t\t: pendingQueueRecords\n\t\t\t\t.filter((record) => record.queue === \"steer\" && record.runId === started.id)\n\t\t\t\t.map((record) => clone(record.target));\n\tconst pendingFollowUp = aborting\n\t\t? []\n\t\t: pendingQueueRecords\n\t\t\t\t.filter((record) => record.queue === \"followUp\" && record.runId === started.id)\n\t\t\t\t.map((record) => clone(record.target));\n\tconst pendingWrites = operationRecords\n\t\t.filter(\n\t\t\t(record): record is WriteDeferredRecord =>\n\t\t\t\trecord.type === \"write_deferred\" && !entriesById.has(record.target.id),\n\t\t)\n\t\t.map((record) => clone(record.target));\n\tconst missingInitialMessages =\n\t\tstarted.intent.kind === \"run\"\n\t\t\t? started.intent.initialMessages.filter((target) => !entriesById.has(target.id)).map(clone)\n\t\t\t: [];\n\n\tconst newestAttempt = operationRecords.filter((record) => record.type === \"step_attempt\").at(-1);\n\tconst step =\n\t\tnewestAttempt && !entriesById.has(newestAttempt.resultEntryId)\n\t\t\t? {\n\t\t\t\t\tkind: newestAttempt.step,\n\t\t\t\t\tattempts: newestAttempt.attempt,\n\t\t\t\t\tresultEntryId: newestAttempt.resultEntryId,\n\t\t\t\t\t...(newestAttempt.step === \"compaction\" ? { compactionReason: newestAttempt.compactionReason } : {}),\n\t\t\t\t}\n\t\t\t: null;\n\n\tconst consumedInputIds = new Set<string>();\n\tif (started.intent.kind === \"run\") {\n\t\tfor (const target of started.intent.initialMessages) consumedInputIds.add(target.id);\n\t}\n\tfor (const record of operationRecords) {\n\t\tif (record.type === \"queue_enqueued\" && record.queue !== \"nextRun\") consumedInputIds.add(record.target.id);\n\t}\n\tlet newestConsumedInputSequence = Number.NEGATIVE_INFINITY;\n\tfor (const id of consumedInputIds) {\n\t\tconst entry = entriesById.get(id);\n\t\tif (entry?.type === \"message\") newestConsumedInputSequence = Math.max(newestConsumedInputSequence, entry.seq);\n\t}\n\tconst overflowRecoveryUsed = operationRecords.some(\n\t\t(record) =>\n\t\t\trecord.type === \"step_attempt\" &&\n\t\t\trecord.step === \"compaction\" &&\n\t\t\trecord.compactionReason === \"overflow\" &&\n\t\t\trecord.seq > newestConsumedInputSequence,\n\t);\n\n\tconst newestOwnEntry = ownEntries.at(-1);\n\tconst newestOwn = deriveNewestOwn(newestOwnEntry);\n\tconst deferred =\n\t\tnewestOwnEntry?.type === \"message\" &&\n\t\tnewestOwnEntry.message.role === \"assistant\" &&\n\t\tnewestOwnEntry.message.stopReason === \"deferred\" &&\n\t\tnewestOwnEntry.message.deferred\n\t\t\t? clone(newestOwnEntry.message.deferred)\n\t\t\t: null;\n\tconst targets: { result?: boolean; summary?: boolean } = {};\n\tif (started.intent.kind === \"compaction\") {\n\t\ttargets.result = entriesById.has(started.intent.resultEntryId);\n\t} else if (started.intent.kind === \"navigation\" && started.intent.summaryEntryId) {\n\t\ttargets.summary = entriesById.has(started.intent.summaryEntryId);\n\t}\n\n\tconst deferredWriteIds = new Set(\n\t\toperationRecords.filter((record) => record.type === \"write_deferred\").map((record) => record.target.id),\n\t);\n\tlet terminalFailure: TerminalFailureState | null = null;\n\tif (\n\t\tnewestOwnEntry?.type === \"message\" &&\n\t\tnewestOwnEntry.message.role === \"assistant\" &&\n\t\tnewestOwnEntry.message.stopReason === \"error\" &&\n\t\t!deferredWriteIds.has(newestOwnEntry.id)\n\t) {\n\t\tconst producedByStep = operationRecords.some(\n\t\t\t(record) => record.type === \"step_attempt\" && record.resultEntryId === newestOwnEntry.id,\n\t\t);\n\t\tconst previousOwnEntry = ownEntries.at(-2);\n\t\tconst producedByDeferredFetch =\n\t\t\toperationRecords.some(\n\t\t\t\t(record) =>\n\t\t\t\t\trecord.type === \"usage\" && record.cause === \"deferred_fetch\" && record.entryId === newestOwnEntry.id,\n\t\t\t) ||\n\t\t\t(previousOwnEntry?.type === \"message\" &&\n\t\t\t\tpreviousOwnEntry.message.role === \"assistant\" &&\n\t\t\t\tpreviousOwnEntry.message.stopReason === \"deferred\");\n\t\tif (producedByStep || producedByDeferredFetch) {\n\t\t\tterminalFailure = {\n\t\t\t\tentryId: newestOwnEntry.id,\n\t\t\t\tsource: producedByStep ? \"step\" : \"deferred_fetch\",\n\t\t\t\tmessage: clone(newestOwnEntry.message),\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\tlaneState: {\n\t\t\tlane: input.lane,\n\t\t\tleafId: input.leafId,\n\t\t\toperation: {\n\t\t\t\tid: started.id,\n\t\t\t\tkind: started.intent.kind,\n\t\t\t\tintent: clone(started.intent),\n\t\t\t\taborting,\n\t\t\t\tstep,\n\t\t\t\ttoolBatch: deriveToolBatch(started.id, operationRecords, ownEntries, entriesById, deferredWriteIds),\n\t\t\t\tmissingInitialMessages,\n\t\t\t\tpendingSteer,\n\t\t\t\tpendingFollowUp,\n\t\t\t\tpendingWrites,\n\t\t\t\tdeferred,\n\t\t\t\toverflowRecoveryUsed,\n\t\t\t\tnewestOwn,\n\t\t\t\ttargets,\n\t\t\t},\n\t\t\tpendingNextRun,\n\t\t},\n\t\teffectiveConfiguration,\n\t\tterminalFailure,\n\t};\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AgentMessage } from "../../types.ts";
|
|
2
|
-
import type { CustomEntry, Entry } from "./types.ts";
|
|
2
|
+
import type { ConfigurationUpdateEntry, CustomEntry, Entry } from "./types.ts";
|
|
3
3
|
export interface SessionContext {
|
|
4
4
|
messages: AgentMessage[];
|
|
5
5
|
thinkingLevel: string;
|
|
6
|
+
configurationUpdate: ConfigurationUpdateEntry["reasoning"] | null;
|
|
6
7
|
model: {
|
|
7
8
|
provider: string;
|
|
8
9
|
modelId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/harness/session/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAmB,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/harness/session/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAmB,wBAAwB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEhG,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,wBAAwB,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAClE,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACpD,eAAe,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,KAAK,SAAS,KAAK,EAAE,CAAC;AAEpF,MAAM,MAAM,kCAAkC,GAAG,CAChD,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS,KAAK,EAAE,KACrB,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;AAEzC,MAAM,WAAW,0BAA0B;IAC1C,eAAe,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACnD,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kCAAkC,CAAC,CAAC,CAAC;CAC/E;AAyBD,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,SAAS,KAAK,EAAE,GAAG,KAAK,EAAE,CAYnF;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,SAAS,KAAK,EAAE,EAAE,OAAO,GAAE,0BAA+B,GAAG,KAAK,EAAE,CAIpH;AAED,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,GAAE,0BAA+B,GACtC,YAAY,EAAE,CAkBhB;AAED,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,SAAS,KAAK,EAAE,EAC7B,OAAO,GAAE,0BAA+B,GACtC,cAAc,CAOhB"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { createBranchSummaryMessage, createCompactionSummaryMessage } from "../messages.js";
|
|
2
2
|
function deriveSessionContextState(pathEntries) {
|
|
3
3
|
let thinkingLevel = "off";
|
|
4
|
+
let configurationUpdate = null;
|
|
4
5
|
let model = null;
|
|
5
6
|
let activeToolNames = null;
|
|
6
7
|
for (const entry of pathEntries) {
|
|
7
8
|
if (entry.type === "thinking_level_change") {
|
|
8
9
|
thinkingLevel = entry.thinkingLevel;
|
|
9
10
|
}
|
|
11
|
+
else if (entry.type === "configuration_update") {
|
|
12
|
+
configurationUpdate = { ...entry.reasoning };
|
|
13
|
+
}
|
|
10
14
|
else if (entry.type === "model_change") {
|
|
11
15
|
model = { provider: entry.provider, modelId: entry.modelId };
|
|
12
16
|
}
|
|
@@ -17,7 +21,7 @@ function deriveSessionContextState(pathEntries) {
|
|
|
17
21
|
activeToolNames = [...entry.activeToolNames];
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
|
-
return { thinkingLevel, model, activeToolNames };
|
|
24
|
+
return { thinkingLevel, configurationUpdate, model, activeToolNames };
|
|
21
25
|
}
|
|
22
26
|
export function defaultContextEntryTransform(pathEntries) {
|
|
23
27
|
let compaction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/harness/session/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/harness/session/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAwB5F,SAAS,yBAAyB,CAAC,WAA6B;IAC/D,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,mBAAmB,GAAiD,IAAI,CAAC;IAC7E,IAAI,KAAK,GAAiD,IAAI,CAAC;IAC/D,IAAI,eAAe,GAAoB,IAAI,CAAC;IAE5C,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QACjC,IAAI,KAAK,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;YAC5C,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACrC,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAsB,EAAE,CAAC;YAClD,mBAAmB,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YAC1C,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC9D,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC3E,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAC5E,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAqB,EAAE,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EAAE,CAAC;AAC/B,CAAC","sourcesContent":["import type { AgentMessage } from \"../../types.ts\";\nimport { createBranchSummaryMessage, createCompactionSummaryMessage } from \"../messages.ts\";\nimport type { CompactionEntry, ConfigurationUpdateEntry, CustomEntry, Entry } from \"./types.ts\";\n\nexport interface SessionContext {\n\tmessages: AgentMessage[];\n\tthinkingLevel: string;\n\tconfigurationUpdate: ConfigurationUpdateEntry[\"reasoning\"] | null;\n\tmodel: { provider: string; modelId: string } | null;\n\tactiveToolNames: string[] | null;\n}\n\nexport type ContextEntryTransform = (entries: readonly Entry[]) => readonly Entry[];\n\nexport type CustomEntryContextMessageProjector = (\n\tentry: CustomEntry,\n\tindex: number,\n\tentries: readonly Entry[],\n) => readonly AgentMessage[] | undefined;\n\nexport interface SessionContextBuildOptions {\n\tentryTransforms?: readonly ContextEntryTransform[];\n\tentryProjectors?: Readonly<Record<string, CustomEntryContextMessageProjector>>;\n}\n\nfunction deriveSessionContextState(pathEntries: readonly Entry[]): Omit<SessionContext, \"messages\"> {\n\tlet thinkingLevel = \"off\";\n\tlet configurationUpdate: ConfigurationUpdateEntry[\"reasoning\"] | null = null;\n\tlet model: { provider: string; modelId: string } | null = null;\n\tlet activeToolNames: string[] | null = null;\n\n\tfor (const entry of pathEntries) {\n\t\tif (entry.type === \"thinking_level_change\") {\n\t\t\tthinkingLevel = entry.thinkingLevel;\n\t\t} else if (entry.type === \"configuration_update\") {\n\t\t\tconfigurationUpdate = { ...entry.reasoning };\n\t\t} else if (entry.type === \"model_change\") {\n\t\t\tmodel = { provider: entry.provider, modelId: entry.modelId };\n\t\t} else if (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tmodel = { provider: entry.message.provider, modelId: entry.message.model };\n\t\t} else if (entry.type === \"active_tools_change\") {\n\t\t\tactiveToolNames = [...entry.activeToolNames];\n\t\t}\n\t}\n\n\treturn { thinkingLevel, configurationUpdate, model, activeToolNames };\n}\n\nexport function defaultContextEntryTransform(pathEntries: readonly Entry[]): Entry[] {\n\tlet compaction: CompactionEntry | undefined;\n\tlet compactionIndex = -1;\n\tfor (let index = pathEntries.length - 1; index >= 0; index--) {\n\t\tconst entry = pathEntries[index]!;\n\t\tif (entry.type === \"compaction\") {\n\t\t\tcompaction = entry;\n\t\t\tcompactionIndex = index;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn compaction === undefined ? [...pathEntries] : [compaction, ...pathEntries.slice(compactionIndex + 1)];\n}\n\nexport function buildContextEntries(pathEntries: readonly Entry[], options: SessionContextBuildOptions = {}): Entry[] {\n\tlet entries = defaultContextEntryTransform(pathEntries);\n\tfor (const transform of options.entryTransforms ?? []) entries = [...transform(entries)];\n\treturn entries;\n}\n\nexport function sessionEntryToContextMessages(\n\tentry: Entry,\n\tindex: number,\n\tentries: readonly Entry[],\n\toptions: SessionContextBuildOptions = {},\n): AgentMessage[] {\n\tif (entry.type === \"message\") {\n\t\tif (entry.message.role === \"assistant\" && entry.message.stopReason === \"deferred\") return [];\n\t\treturn [entry.message];\n\t}\n\tif (entry.type === \"compaction\") {\n\t\treturn [\n\t\t\tcreateCompactionSummaryMessage(entry.summary, entry.tokensBefore, entry.timestamp),\n\t\t\t...entry.retainedTail,\n\t\t];\n\t}\n\tif (entry.type === \"branch_summary\" && entry.summary) {\n\t\treturn [createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp)];\n\t}\n\tif (entry.type === \"custom\") {\n\t\treturn [...(options.entryProjectors?.[entry.customType]?.(entry, index, entries) ?? [])];\n\t}\n\treturn [];\n}\n\nexport function buildSessionContext(\n\tpathEntries: readonly Entry[],\n\toptions: SessionContextBuildOptions = {},\n): SessionContext {\n\tconst state = deriveSessionContextState(pathEntries);\n\tconst contextEntries = buildContextEntries(pathEntries, options);\n\tconst messages = contextEntries.flatMap((entry, index) =>\n\t\tsessionEntryToContextMessages(entry, index, contextEntries, options),\n\t);\n\treturn { ...state, messages };\n}\n"]}
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAkGtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAOjF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAchH;AA2FD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAOrF;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAWhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAA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AC,CAAC;QACtC;YACC,MAAM,IAAI,gBAAgB,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAC;IACpE,CAAC;AACF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACzC,IAAI,CAAC;QACJ,OAAO,EAAE,CAAoC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,gBAAgB;YAAE,OAAO,GAAG,CAAoC,KAAK,CAAC,CAAC;QAC5F,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAyB;IACvD,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,OAAO;YACX,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;QACzF,KAAK,QAAQ;YACZ,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QACtE,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QACxC,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["import { err, ok, type Result } from \"../../types.ts\";\nimport type { SessionMutation } from \"../state.ts\";\nimport type { Entry, LaneRecord } from \"../types.ts\";\nimport { JsonlDecodeError } from \"./errors.ts\";\nimport type { JsonlSessionMetadata, JsonlV4Header } from \"./types.ts\";\n\nconst ENTRY_TYPES = new Set<Entry[\"type\"]>([\n\t\"message\",\n\t\"model_change\",\n\t\"thinking_level_change\",\n\t\"active_tools_change\",\n\t\"compaction\",\n\t\"branch_summary\",\n\t\"custom\",\n]);\nconst RECORD_TYPES = new Set<LaneRecord[\"type\"]>([\n\t\"operation_started\",\n\t\"abort_requested\",\n\t\"operation_finished\",\n\t\"step_attempt\",\n\t\"tool_started\",\n\t\"queue_enqueued\",\n\t\"queue_cancelled\",\n\t\"write_deferred\",\n\t\"usage\",\n]);\nconst OPERATION_KINDS = new Set([\"run\", \"compaction\", \"navigation\"]);\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseObject(line: string): Record<string, unknown> {\n\tlet value: unknown;\n\ttry {\n\t\tvalue = JSON.parse(line);\n\t} catch (error) {\n\t\tthrow new JsonlDecodeError(\"syntax\", \"is not valid JSON\", error instanceof Error ? error : undefined);\n\t}\n\tif (!isObject(value)) throw new JsonlDecodeError(\"schema\", \"is not a JSON object\");\n\treturn value;\n}\n\nfunction requireString(value: unknown, field: string): string {\n\tif (typeof value !== \"string\") throw new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\treturn value;\n}\n\nfunction requireSequence(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) <= 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid seq\");\n\t}\n\treturn value as number;\n}\n\nfunction requireTimestamp(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) < 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid timestamp\");\n\t}\n\treturn value as number;\n}\n\nfunction requireNullableId(value: unknown, field: string): string | null {\n\tif (value !== null && typeof value !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\t}\n\treturn value as string | null;\n}\n\nfunction decodeHeader(line: string): JsonlV4Header {\n\tconst value = parseObject(line);\n\tif (value.kind !== \"header\") throw new JsonlDecodeError(\"schema\", \"is not a header\");\n\tif (value.version !== 4) throw new JsonlDecodeError(\"schema\", \"has unsupported session version\");\n\tconst parentSessionId = value.parentSessionId;\n\tif (parentSessionId !== undefined && typeof parentSessionId !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid parentSessionId\");\n\t}\n\tconst legacyParentSessionPath = value.legacyParentSessionPath;\n\tif (legacyParentSessionPath !== undefined && typeof legacyParentSessionPath !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid legacyParentSessionPath\");\n\t}\n\tif (parentSessionId !== undefined && legacyParentSessionPath !== undefined) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has both parentSessionId and legacyParentSessionPath\");\n\t}\n\tconst metadataValue = value.metadata;\n\tif (metadataValue !== undefined && !isObject(metadataValue)) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid metadata\");\n\t}\n\tconst metadata = metadataValue as JsonlV4Header[\"metadata\"];\n\treturn {\n\t\tkind: \"header\",\n\t\tversion: 4,\n\t\tid: requireString(value.id, \"id\"),\n\t\tcreatedAt: requireTimestamp(value.createdAt),\n\t\tcwd: requireString(value.cwd, \"cwd\"),\n\t\tparentSessionId,\n\t\tlegacyParentSessionPath,\n\t\tmetadata,\n\t};\n}\n\nexport function parseHeader(line: string): Result<JsonlV4Header, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<JsonlV4Header, JsonlDecodeError>(decodeHeader(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<JsonlV4Header, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeHeader(header: JsonlV4Header): string {\n\treturn `${JSON.stringify(header)}\\n`;\n}\n\nexport function metadataFromHeader(header: JsonlV4Header, path: string, modifiedAt: number): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.createdAt,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tmodifiedAt,\n\t\tsourceFormat: 4,\n\t\t...(header.parentSessionId === undefined ? {} : { parentSessionId: header.parentSessionId }),\n\t\t...(header.legacyParentSessionPath === undefined\n\t\t\t? {}\n\t\t\t: { legacyParentSessionPath: header.legacyParentSessionPath }),\n\t\t...(header.metadata === undefined ? {} : { metadata: header.metadata }),\n\t};\n}\n\nfunction parseEntryMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"entry\" }> {\n\tconst lane = value.lane === undefined ? undefined : requireString(value.lane, \"lane\");\n\tconst id = requireString(value.id, \"id\");\n\tconst type = requireString(value.type, \"entry type\");\n\tif (!ENTRY_TYPES.has(type as Entry[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown entry type ${type}`);\n\t}\n\tconst parentId = requireNullableId(value.parentId, \"parentId\");\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"custom\") requireString(value.customType, \"customType\");\n\tconst { kind: _kind, lane: _lane, ...entryFields } = value;\n\tconst entry = { ...entryFields, id, type, parentId, seq, timestamp } as unknown as Entry;\n\treturn lane === undefined ? { kind: \"entry\", entry } : { kind: \"entry\", lane, entry };\n}\n\nfunction parseRecordMutation(\n\tvalue: Record<string, unknown>,\n\tseq: number,\n): Extract<SessionMutation, { kind: \"record\" }> {\n\tconst id = requireString(value.id, \"id\");\n\tconst lane = requireString(value.lane, \"lane\");\n\tconst type = requireString(value.type, \"record type\");\n\tif (!RECORD_TYPES.has(type as LaneRecord[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown record type ${type}`);\n\t}\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"operation_started\") {\n\t\tif (!isObject(value.intent)) throw new JsonlDecodeError(\"schema\", \"has invalid intent\");\n\t\tconst operationKind = requireString(value.intent.kind, \"operation kind\");\n\t\tif (!OPERATION_KINDS.has(operationKind)) {\n\t\t\tthrow new JsonlDecodeError(\"schema\", `has unknown operation kind ${operationKind}`);\n\t\t}\n\t}\n\tif (type === \"operation_finished\") requireString(value.runId, \"runId\");\n\tconst { kind: _kind, ...recordFields } = value;\n\treturn {\n\t\tkind: \"record\",\n\t\trecord: { ...recordFields, id, lane, type, seq, timestamp } as unknown as LaneRecord,\n\t};\n}\n\nfunction parseLaneMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"lane\" }> {\n\treturn {\n\t\tkind: \"lane\",\n\t\tseq,\n\t\tlane: requireString(value.lane, \"lane\"),\n\t\tleafId: requireNullableId(value.leafId, \"leafId\"),\n\t};\n}\n\nfunction parseFactMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"fact\" }> {\n\tif (value.fact === \"name\") {\n\t\tif (value.name !== undefined && typeof value.name !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid name\");\n\t\t}\n\t\treturn { kind: \"fact\", seq, fact: \"name\", name: value.name };\n\t}\n\tif (value.fact === \"label\") {\n\t\tif (value.label !== undefined && typeof value.label !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid label\");\n\t\t}\n\t\treturn {\n\t\t\tkind: \"fact\",\n\t\t\tseq,\n\t\t\tfact: \"label\",\n\t\t\ttargetId: requireString(value.targetId, \"targetId\"),\n\t\t\tlabel: value.label,\n\t\t};\n\t}\n\tthrow new JsonlDecodeError(\"schema\", \"has unknown fact type\");\n}\n\nfunction decodeMutation(line: string): SessionMutation {\n\tconst value = parseObject(line);\n\tconst seq = requireSequence(value.seq);\n\tswitch (value.kind) {\n\t\tcase \"entry\":\n\t\t\treturn parseEntryMutation(value, seq);\n\t\tcase \"record\":\n\t\t\treturn parseRecordMutation(value, seq);\n\t\tcase \"lane\":\n\t\t\treturn parseLaneMutation(value, seq);\n\t\tcase \"fact\":\n\t\t\treturn parseFactMutation(value, seq);\n\t\tdefault:\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has unknown mutation kind\");\n\t}\n}\n\nexport function parseMutation(line: string): Result<SessionMutation, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<SessionMutation, JsonlDecodeError>(decodeMutation(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<SessionMutation, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeMutation(mutation: SessionMutation): string {\n\tswitch (mutation.kind) {\n\t\tcase \"entry\":\n\t\t\treturn `${JSON.stringify({ kind: \"entry\", lane: mutation.lane, ...mutation.entry })}\\n`;\n\t\tcase \"record\":\n\t\t\treturn `${JSON.stringify({ kind: \"record\", ...mutation.record })}\\n`;\n\t\tcase \"lane\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t\tcase \"fact\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAgB;IAC1C,SAAS;IACT,cAAc;IACd,uBAAuB;IACvB,sBAAsB;IACtB,qBAAqB;IACrB,YAAY;IACZ,gBAAgB;IAChB,QAAQ;CACR,CAAC,CAAC;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAqB;IAChD,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,OAAO;CACP,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;AAErE,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAChC,IAAI,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AQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QACtE,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QACxC,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["import { err, ok, type Result } from \"../../types.ts\";\nimport type { SessionMutation } from \"../state.ts\";\nimport type { Entry, LaneRecord } from \"../types.ts\";\nimport { JsonlDecodeError } from \"./errors.ts\";\nimport type { JsonlSessionMetadata, JsonlV4Header } from \"./types.ts\";\n\nconst ENTRY_TYPES = new Set<Entry[\"type\"]>([\n\t\"message\",\n\t\"model_change\",\n\t\"thinking_level_change\",\n\t\"configuration_update\",\n\t\"active_tools_change\",\n\t\"compaction\",\n\t\"branch_summary\",\n\t\"custom\",\n]);\nconst RECORD_TYPES = new Set<LaneRecord[\"type\"]>([\n\t\"operation_started\",\n\t\"abort_requested\",\n\t\"operation_finished\",\n\t\"step_attempt\",\n\t\"tool_started\",\n\t\"queue_enqueued\",\n\t\"queue_cancelled\",\n\t\"write_deferred\",\n\t\"usage\",\n]);\nconst OPERATION_KINDS = new Set([\"run\", \"compaction\", \"navigation\"]);\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseObject(line: string): Record<string, unknown> {\n\tlet value: unknown;\n\ttry {\n\t\tvalue = JSON.parse(line);\n\t} catch (error) {\n\t\tthrow new JsonlDecodeError(\"syntax\", \"is not valid JSON\", error instanceof Error ? error : undefined);\n\t}\n\tif (!isObject(value)) throw new JsonlDecodeError(\"schema\", \"is not a JSON object\");\n\treturn value;\n}\n\nfunction requireString(value: unknown, field: string): string {\n\tif (typeof value !== \"string\") throw new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\treturn value;\n}\n\nfunction requireSequence(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) <= 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid seq\");\n\t}\n\treturn value as number;\n}\n\nfunction requireTimestamp(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) < 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid timestamp\");\n\t}\n\treturn value as number;\n}\n\nfunction requireNullableId(value: unknown, field: string): string | null {\n\tif (value !== null && typeof value !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\t}\n\treturn value as string | null;\n}\n\nfunction decodeHeader(line: string): JsonlV4Header {\n\tconst value = parseObject(line);\n\tif (value.kind !== \"header\") throw new JsonlDecodeError(\"schema\", \"is not a header\");\n\tif (value.version !== 4) throw new JsonlDecodeError(\"schema\", \"has unsupported session version\");\n\tconst parentSessionId = value.parentSessionId;\n\tif (parentSessionId !== undefined && typeof parentSessionId !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid parentSessionId\");\n\t}\n\tconst legacyParentSessionPath = value.legacyParentSessionPath;\n\tif (legacyParentSessionPath !== undefined && typeof legacyParentSessionPath !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid legacyParentSessionPath\");\n\t}\n\tif (parentSessionId !== undefined && legacyParentSessionPath !== undefined) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has both parentSessionId and legacyParentSessionPath\");\n\t}\n\tconst metadataValue = value.metadata;\n\tif (metadataValue !== undefined && !isObject(metadataValue)) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid metadata\");\n\t}\n\tconst metadata = metadataValue as JsonlV4Header[\"metadata\"];\n\treturn {\n\t\tkind: \"header\",\n\t\tversion: 4,\n\t\tid: requireString(value.id, \"id\"),\n\t\tcreatedAt: requireTimestamp(value.createdAt),\n\t\tcwd: requireString(value.cwd, \"cwd\"),\n\t\tparentSessionId,\n\t\tlegacyParentSessionPath,\n\t\tmetadata,\n\t};\n}\n\nexport function parseHeader(line: string): Result<JsonlV4Header, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<JsonlV4Header, JsonlDecodeError>(decodeHeader(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<JsonlV4Header, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeHeader(header: JsonlV4Header): string {\n\treturn `${JSON.stringify(header)}\\n`;\n}\n\nexport function metadataFromHeader(header: JsonlV4Header, path: string, modifiedAt: number): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.createdAt,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tmodifiedAt,\n\t\tsourceFormat: 4,\n\t\t...(header.parentSessionId === undefined ? {} : { parentSessionId: header.parentSessionId }),\n\t\t...(header.legacyParentSessionPath === undefined\n\t\t\t? {}\n\t\t\t: { legacyParentSessionPath: header.legacyParentSessionPath }),\n\t\t...(header.metadata === undefined ? {} : { metadata: header.metadata }),\n\t};\n}\n\nfunction parseEntryMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"entry\" }> {\n\tconst lane = value.lane === undefined ? undefined : requireString(value.lane, \"lane\");\n\tconst id = requireString(value.id, \"id\");\n\tconst type = requireString(value.type, \"entry type\");\n\tif (!ENTRY_TYPES.has(type as Entry[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown entry type ${type}`);\n\t}\n\tconst parentId = requireNullableId(value.parentId, \"parentId\");\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"custom\") requireString(value.customType, \"customType\");\n\tconst { kind: _kind, lane: _lane, ...entryFields } = value;\n\tconst entry = { ...entryFields, id, type, parentId, seq, timestamp } as unknown as Entry;\n\treturn lane === undefined ? { kind: \"entry\", entry } : { kind: \"entry\", lane, entry };\n}\n\nfunction parseRecordMutation(\n\tvalue: Record<string, unknown>,\n\tseq: number,\n): Extract<SessionMutation, { kind: \"record\" }> {\n\tconst id = requireString(value.id, \"id\");\n\tconst lane = requireString(value.lane, \"lane\");\n\tconst type = requireString(value.type, \"record type\");\n\tif (!RECORD_TYPES.has(type as LaneRecord[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown record type ${type}`);\n\t}\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"operation_started\") {\n\t\tif (!isObject(value.intent)) throw new JsonlDecodeError(\"schema\", \"has invalid intent\");\n\t\tconst operationKind = requireString(value.intent.kind, \"operation kind\");\n\t\tif (!OPERATION_KINDS.has(operationKind)) {\n\t\t\tthrow new JsonlDecodeError(\"schema\", `has unknown operation kind ${operationKind}`);\n\t\t}\n\t}\n\tif (type === \"operation_finished\") requireString(value.runId, \"runId\");\n\tconst { kind: _kind, ...recordFields } = value;\n\treturn {\n\t\tkind: \"record\",\n\t\trecord: { ...recordFields, id, lane, type, seq, timestamp } as unknown as LaneRecord,\n\t};\n}\n\nfunction parseLaneMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"lane\" }> {\n\treturn {\n\t\tkind: \"lane\",\n\t\tseq,\n\t\tlane: requireString(value.lane, \"lane\"),\n\t\tleafId: requireNullableId(value.leafId, \"leafId\"),\n\t};\n}\n\nfunction parseFactMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"fact\" }> {\n\tif (value.fact === \"name\") {\n\t\tif (value.name !== undefined && typeof value.name !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid name\");\n\t\t}\n\t\treturn { kind: \"fact\", seq, fact: \"name\", name: value.name };\n\t}\n\tif (value.fact === \"label\") {\n\t\tif (value.label !== undefined && typeof value.label !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid label\");\n\t\t}\n\t\treturn {\n\t\t\tkind: \"fact\",\n\t\t\tseq,\n\t\t\tfact: \"label\",\n\t\t\ttargetId: requireString(value.targetId, \"targetId\"),\n\t\t\tlabel: value.label,\n\t\t};\n\t}\n\tthrow new JsonlDecodeError(\"schema\", \"has unknown fact type\");\n}\n\nfunction decodeMutation(line: string): SessionMutation {\n\tconst value = parseObject(line);\n\tconst seq = requireSequence(value.seq);\n\tswitch (value.kind) {\n\t\tcase \"entry\":\n\t\t\treturn parseEntryMutation(value, seq);\n\t\tcase \"record\":\n\t\t\treturn parseRecordMutation(value, seq);\n\t\tcase \"lane\":\n\t\t\treturn parseLaneMutation(value, seq);\n\t\tcase \"fact\":\n\t\t\treturn parseFactMutation(value, seq);\n\t\tdefault:\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has unknown mutation kind\");\n\t}\n}\n\nexport function parseMutation(line: string): Result<SessionMutation, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<SessionMutation, JsonlDecodeError>(decodeMutation(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<SessionMutation, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeMutation(mutation: SessionMutation): string {\n\tswitch (mutation.kind) {\n\t\tcase \"entry\":\n\t\t\treturn `${JSON.stringify({ kind: \"entry\", lane: mutation.lane, ...mutation.entry })}\\n`;\n\t\tcase \"record\":\n\t\t\treturn `${JSON.stringify({ kind: \"record\", ...mutation.record })}\\n`;\n\t\tcase \"lane\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t\tcase \"fact\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t}\n}\n"]}
|
|
@@ -30,6 +30,12 @@ export interface ThinkingLevelEntry extends EntryBase {
|
|
|
30
30
|
type: "thinking_level_change";
|
|
31
31
|
thinkingLevel: string;
|
|
32
32
|
}
|
|
33
|
+
export interface ConfigurationUpdateEntry extends EntryBase {
|
|
34
|
+
type: "configuration_update";
|
|
35
|
+
reasoning: {
|
|
36
|
+
effort: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
33
39
|
export interface ActiveToolsEntry extends EntryBase {
|
|
34
40
|
type: "active_tools_change";
|
|
35
41
|
activeToolNames: string[];
|
|
@@ -54,7 +60,7 @@ export interface CustomEntry extends EntryBase {
|
|
|
54
60
|
customType: string;
|
|
55
61
|
data?: unknown;
|
|
56
62
|
}
|
|
57
|
-
export type Entry = MessageEntry | ModelChangeEntry | ThinkingLevelEntry | ActiveToolsEntry | CompactionEntry | BranchSummaryEntry | CustomEntry;
|
|
63
|
+
export type Entry = MessageEntry | ModelChangeEntry | ThinkingLevelEntry | ConfigurationUpdateEntry | ActiveToolsEntry | CompactionEntry | BranchSummaryEntry | CustomEntry;
|
|
58
64
|
export type ProvisionedEntry<TEntry extends Entry = Entry> = TEntry extends Entry ? Omit<TEntry, "parentId" | "seq" | "timestamp"> : never;
|
|
59
65
|
export interface RecordBase {
|
|
60
66
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/harness/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtG,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,UAAU,CAAC;AAE5E,MAAM,WAAW,WAAW;IAC3B,IAAI,IAAI,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,CAA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EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAKlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/harness/session/types.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AA+XxB,MAAM,OAAO,YAAa,SAAQ,KAAK;IAGtC,YAAY,IAAsB,EAAE,OAAe,EAAE,KAAa;QACjE,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD","sourcesContent":["import type { StopReason, Usage } from \"@earendil-works/pi-ai\";\nimport \"../messages.ts\";\nimport type { AgentMessage } from \"../../types.ts\";\nimport type { Session } from \"./session.ts\";\n\nexport type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\nexport type SessionStopReason = Exclude<StopReason, \"pending\"> | \"deferred\";\n\nexport interface IdGenerator {\n\tnext(): string;\n}\n\nexport interface EntryBase {\n\ttype: string;\n\tid: string;\n\tseq: number; // shared sequence; read-side, storage-assigned\n\tparentId: string | null; // storage-assigned: the appending lane's leaf\n\ttimestamp: number; // Unix ms, storage-assigned\n}\n\nexport interface MessageEntry extends EntryBase {\n\ttype: \"message\";\n\tmessage: AgentMessage;\n\tterminate?: true;\n}\n\nexport interface ModelChangeEntry extends EntryBase {\n\ttype: \"model_change\";\n\tprovider: string;\n\tmodelId: string;\n}\n\nexport interface ThinkingLevelEntry extends EntryBase {\n\ttype: \"thinking_level_change\";\n\tthinkingLevel: string;\n}\n\nexport interface ActiveToolsEntry extends EntryBase {\n\ttype: \"active_tools_change\";\n\tactiveToolNames: string[];\n}\n\nexport interface CompactionEntry extends EntryBase {\n\ttype: \"compaction\";\n\tsummary: string;\n\tretainedTail: AgentMessage[];\n\ttokensBefore: number;\n\tdetails?: unknown;\n\tusage?: Usage;\n}\n\nexport interface BranchSummaryEntry extends EntryBase {\n\ttype: \"branch_summary\";\n\tfromId: string;\n\tsummary: string;\n\tdetails?: unknown;\n\tusage?: Usage;\n}\n\nexport interface CustomEntry extends EntryBase {\n\ttype: \"custom\";\n\tcustomType: string;\n\tdata?: unknown;\n}\n\nexport type Entry =\n\t| MessageEntry\n\t| ModelChangeEntry\n\t| ThinkingLevelEntry\n\t| ActiveToolsEntry\n\t| CompactionEntry\n\t| BranchSummaryEntry\n\t| CustomEntry;\n\nexport type ProvisionedEntry<TEntry extends Entry = Entry> = TEntry extends Entry\n\t? Omit<TEntry, \"parentId\" | \"seq\" | \"timestamp\">\n\t: never;\n\nexport interface RecordBase {\n\tid: string;\n\tseq: number;\n\tlane: string;\n\ttimestamp: number;\n}\n\nexport interface OperationStartedRecord extends RecordBase {\n\ttype: \"operation_started\";\n\tsourceLeafId: string | null;\n\tintent:\n\t\t| {\n\t\t\t\tkind: \"run\";\n\t\t\t\t/** Normalized caller input before before_run; kept for suspended operations and before_resume. */\n\t\t\t\toriginalPrompt: AgentMessage[];\n\t\t\t\t/** Captured nextRun items, then the prompt, then before_run injections. */\n\t\t\t\tinitialMessages: ProvisionedEntry[];\n\t\t\t\tsystemPromptOverride?: string;\n\t\t\t\tresumeData?: { [extensionId: string]: JsonValue };\n\t\t }\n\t\t| {\n\t\t\t\tkind: \"compaction\";\n\t\t\t\tcustomInstructions?: string;\n\t\t\t\tresultEntryId: string;\n\t\t }\n\t\t| {\n\t\t\t\tkind: \"navigation\";\n\t\t\t\ttargetId: string | null;\n\t\t\t\tsummarize: boolean;\n\t\t\t\tcustomInstructions?: string;\n\t\t\t\tlabel?: string;\n\t\t\t\tsummaryEntryId?: string;\n\t\t };\n}\n\nexport interface AbortRequestedRecord extends RecordBase {\n\ttype: \"abort_requested\";\n\trunId: string;\n}\n\nexport interface OperationFinishedRecord extends RecordBase {\n\ttype: \"operation_finished\";\n\trunId: string;\n\toutcome: \"completed\" | \"aborted\" | \"failed\" | \"declined\";\n\terror?: { code: string; message: string };\n}\n\nexport type CompactionReason = \"manual\" | \"threshold\" | \"overflow\";\n\nexport type StepAttemptRecord = RecordBase &\n\t(\n\t\t| {\n\t\t\t\ttype: \"step_attempt\";\n\t\t\t\trunId: string;\n\t\t\t\tstep: \"assistant\" | \"branch_summary\";\n\t\t\t\tattempt: number;\n\t\t\t\tresultEntryId: string;\n\t\t\t\tcompactionReason?: never;\n\t\t }\n\t\t| {\n\t\t\t\ttype: \"step_attempt\";\n\t\t\t\trunId: string;\n\t\t\t\tstep: \"compaction\";\n\t\t\t\tattempt: number;\n\t\t\t\tresultEntryId: string;\n\t\t\t\t/** Persists why compaction summary generation started so recovery resumes the same work. */\n\t\t\t\tcompactionReason: CompactionReason;\n\t\t }\n\t);\n\nexport interface ToolStartedRecord extends RecordBase {\n\ttype: \"tool_started\";\n\trunId: string;\n\tassistantEntryId: string;\n\ttoolIndex: number;\n\ttoolCallId: string;\n\ttoolName: string;\n\teffectiveArgs: { [key: string]: unknown };\n\tresultEntryId: string;\n\treplay: \"never\" | \"safe\";\n}\n\nexport type QueueEnqueuedRecord = RecordBase &\n\t(\n\t\t| {\n\t\t\t\ttype: \"queue_enqueued\";\n\t\t\t\tqueue: \"steer\" | \"followUp\";\n\t\t\t\trunId: string;\n\t\t\t\ttarget: ProvisionedEntry;\n\t\t }\n\t\t| {\n\t\t\t\ttype: \"queue_enqueued\";\n\t\t\t\tqueue: \"nextRun\";\n\t\t\t\trunId?: never;\n\t\t\t\ttarget: ProvisionedEntry;\n\t\t }\n\t);\n\nexport interface QueueCancelledRecord extends RecordBase {\n\ttype: \"queue_cancelled\";\n\trunId?: string;\n\tentryId: string;\n}\n\nexport interface WriteDeferredRecord extends RecordBase {\n\ttype: \"write_deferred\";\n\trunId: string;\n\ttarget: ProvisionedEntry;\n}\n\nexport type UsageRecord = RecordBase & { type: \"usage\"; usage: Usage } & (\n\t\t| {\n\t\t\t\tcause: \"assistant\" | \"compaction\" | \"branch_summary\" | \"deferred_fetch\";\n\t\t\t\trunId: string;\n\t\t\t\tentryId: string;\n\t\t\t\tattempt: number;\n\t\t\t\tstopReason: SessionStopReason;\n\t\t }\n\t\t| { cause: \"tool\"; runId: string; entryId: string; toolCallId: string }\n\t\t| { cause: \"hook\"; runId: string; entryId: string }\n\t\t| { cause: \"adjustment\"; runId?: string; entryId?: string; details?: JsonValue }\n\t);\n\nexport type LaneRecord =\n\t| OperationStartedRecord\n\t| AbortRequestedRecord\n\t| OperationFinishedRecord\n\t| StepAttemptRecord\n\t| ToolStartedRecord\n\t| QueueEnqueuedRecord\n\t| QueueCancelledRecord\n\t| WriteDeferredRecord\n\t| UsageRecord;\nexport type NewRecord<TRecord extends LaneRecord = LaneRecord> = TRecord extends LaneRecord\n\t? Omit<TRecord, \"seq\" | \"timestamp\">\n\t: never;\n\nexport type EntryOrder = \"newestFirst\" | \"oldestFirst\";\n\nexport interface EntryCursor {\n\tafterSeq: number;\n}\n\nexport interface EntryQuery {\n\ttype?: Entry[\"type\"];\n\tcustomType?: string; // for type \"custom\"\n\torder?: EntryOrder; // default newestFirst\n\tlimit?: number;\n\tcursor?: EntryCursor;\n}\n\n/** Bounds of a branch scan. Default: the whole path, leaf to root. */\nexport interface BranchBounds {\n\tstart?: string; // default: the view's lane leaf\n\tstopAtType?: Entry[\"type\"]; // scan ends after the first match, inclusive\n\tstopAtId?: string;\n}\n\nexport interface RecordQuery {\n\t/** Exact lane match. Omit to query every lane. */\n\tlane?: string;\n\t/** Exact record discriminant match. Omit to query every record type. */\n\ttype?: LaneRecord[\"type\"];\n\t/**\n\t * Operation identity. Matches OperationStartedRecord.id and the runId\n\t * property of operation-owned records. Records without an operation\n\t * identity do not match.\n\t */\n\trunId?: string;\n\t/** Exact operation intent kind. Valid only with type \"operation_started\". */\n\toperationKind?: OperationStartedRecord[\"intent\"][\"kind\"];\n\t/** Exclusive chronological lower bound: seq > afterSeq, regardless of order. */\n\tafterSeq?: number;\n\t/** Sequence order. Default: \"newestFirst\". */\n\torder?: EntryOrder;\n\t/** Positive maximum number of matching records. */\n\tlimit?: number;\n}\n\nexport interface SessionMetadata {\n\tid: string;\n\tcreatedAt: number;\n\tparentSessionId?: string;\n}\n\nexport interface SessionStats {\n\tmessageCount: number;\n\tcachedTokens: number;\n\tuncachedTokens: number;\n\ttotalTokens: number;\n\tcostTotal: number;\n}\n\nexport interface LanePointer {\n\tlane: string;\n\tleafId: string | null;\n}\n\nexport type LogItem =\n\t| { kind: \"entry\"; seq: number; entry: Entry }\n\t| { kind: \"record\"; seq: number; record: LaneRecord }\n\t| { kind: \"lane\"; seq: number; lane: string; leafId: string | null }\n\t| { kind: \"fact\"; seq: number; fact: \"name\"; name: string | undefined }\n\t| { kind: \"fact\"; seq: number; fact: \"label\"; targetId: string; label: string | undefined };\n\nexport interface LogOptions {\n\tafterSeq?: number;\n\tlimit?: number;\n}\n\nexport interface SessionStorage<TMetadata extends SessionMetadata = SessionMetadata> {\n\tgetMetadata(): Promise<TMetadata>;\n\n\t// Lanes\n\tgetLanes(): Promise<{ lane: string; leafId: string | null }[]>;\n\tcreateLane(lane: string, at: string | null): Promise<void>;\n\tmoveLane(lane: string, to: string | null): Promise<void>;\n\n\t// Entries and Records\n\tappendEntry<TEntry extends Entry>(entry: ProvisionedEntry<TEntry>, lane: string): Promise<TEntry>;\n\tappendRecord<TRecord extends LaneRecord>(record: NewRecord<TRecord>): Promise<TRecord>;\n\n\t// Reads\n\tgetEntry(id: string): Promise<Entry | undefined>;\n\tfindEntries(query?: EntryQuery): Promise<Entry[]>;\n\t/** start is mandatory here (as opposed to SessionTree's findEntriesOnBranch); defaulting to a lane's leaf is view sugar. */\n\tfindEntriesOnBranch(query: EntryQuery & BranchBounds & { start: string }): Promise<Entry[]>;\n\tfindRecords<K extends LaneRecord[\"type\"]>(\n\t\tquery: RecordQuery & { type: K },\n\t): Promise<Extract<LaneRecord, { type: K }>[]>;\n\tfindRecords(query?: RecordQuery): Promise<LaneRecord[]>;\n\t/**\n\t * Returns unfinished operation starts newest first. Recovery uses `limit: 2`:\n\t * zero results mean the lane is idle, one means it is suspended, and two\n\t * mean at least two operations are open, which is corruption. Further\n\t * results provide no additional recovery state.\n\t */\n\tfindOpenOperations(lane: string, options?: { limit?: number }): Promise<OperationStartedRecord[]>;\n\tgetLog(options?: { afterSeq?: number; limit?: number }): Promise<LogItem[]>;\n\n\t// Global facts\n\tgetName(): Promise<string | undefined>;\n\tsetName(name: string | undefined): Promise<void>;\n\tgetLabel(id: string): Promise<string | undefined>;\n\tsetLabel(id: string, label: string | undefined): Promise<void>;\n\tgetStats(): Promise<SessionStats>;\n}\n\nexport interface SessionTree {\n\tgetLeafId(): Promise<string | null>;\n\tgetEntry(id: string): Promise<Entry | undefined>;\n\tgetStats(): Promise<SessionStats>;\n\n\t// Global facts. Latest wins; not branch-scoped. \"set\", not \"append\":\n\t// append vocabulary is reserved for tree writes.\n\tgetName(): Promise<string | undefined>;\n\tsetName(name: string | undefined): Promise<void>;\n\tgetLabel(targetId: string): Promise<string | undefined>;\n\tsetLabel(targetId: string, label: string | undefined): Promise<void>;\n\n\t/** Session-wide, all branches, sequence order. */\n\tfindEntries(query?: EntryQuery): Promise<Entry[]>;\n\tfindEntry(query?: EntryQuery): Promise<Entry | undefined>;\n\n\t/** Branch-scoped: the path from start toward root. */\n\tfindEntriesOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry[]>;\n\tfindEntryOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry | undefined>;\n\n\t// Writes. Resolve on durable acceptance; the returned id is the entry's\n\t// id (provisioned when the write defers).\n\tappendMessage(message: AgentMessage): Promise<string>;\n\tappendCustomEntry(customType: string, data?: unknown): Promise<string>;\n}\n\nexport interface SessionCreateOptions {\n\tid?: string;\n\tparentSessionId?: string;\n}\n\nexport type ForkOptions = { scope?: \"branch\"; entryId?: string; position?: \"before\" | \"at\" } | { scope: \"tree\" };\n\nexport interface SessionRepo<\n\tTMetadata extends SessionMetadata = SessionMetadata,\n\tTCreateOptions extends SessionCreateOptions = SessionCreateOptions,\n\tTListOptions = void,\n> {\n\tcreate(options: TCreateOptions): Promise<Session<TMetadata>>;\n\t/** Opens the session for writing and acquires any backend writer claim. */\n\topen(metadata: TMetadata): Promise<Session<TMetadata>>;\n\t/** Lists session metadata without opening sessions or acquiring writer claims. */\n\tlist(options?: TListOptions): Promise<TMetadata[]>;\n\tdelete(metadata: TMetadata): Promise<void>;\n\tfork(source: TMetadata, options: ForkOptions & TCreateOptions): Promise<Session<TMetadata>>;\n}\n\nexport type SessionErrorCode =\n\t| \"not_found\"\n\t| \"already_exists\"\n\t| \"invalid_entry\"\n\t| \"invalid_payload\"\n\t| \"invalid_lane\"\n\t| \"invalid_query\"\n\t| \"invalid_fork_target\"\n\t| \"storage\";\n\nexport class SessionError extends Error {\n\treadonly code: SessionErrorCode;\n\n\tconstructor(code: SessionErrorCode, message: string, cause?: Error) {\n\t\tsuper(message, cause === undefined ? undefined : { cause });\n\t\tthis.name = \"SessionError\";\n\t\tthis.code = code;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/harness/session/types.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAqYxB,MAAM,OAAO,YAAa,SAAQ,KAAK;IAGtC,YAAY,IAAsB,EAAE,OAAe,EAAE,KAAa;QACjE,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD","sourcesContent":["import type { StopReason, Usage } from \"@earendil-works/pi-ai\";\nimport \"../messages.ts\";\nimport type { AgentMessage } from \"../../types.ts\";\nimport type { Session } from \"./session.ts\";\n\nexport type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\n\nexport type SessionStopReason = Exclude<StopReason, \"pending\"> | \"deferred\";\n\nexport interface IdGenerator {\n\tnext(): string;\n}\n\nexport interface EntryBase {\n\ttype: string;\n\tid: string;\n\tseq: number; // shared sequence; read-side, storage-assigned\n\tparentId: string | null; // storage-assigned: the appending lane's leaf\n\ttimestamp: number; // Unix ms, storage-assigned\n}\n\nexport interface MessageEntry extends EntryBase {\n\ttype: \"message\";\n\tmessage: AgentMessage;\n\tterminate?: true;\n}\n\nexport interface ModelChangeEntry extends EntryBase {\n\ttype: \"model_change\";\n\tprovider: string;\n\tmodelId: string;\n}\n\nexport interface ThinkingLevelEntry extends EntryBase {\n\ttype: \"thinking_level_change\";\n\tthinkingLevel: string;\n}\n\nexport interface ConfigurationUpdateEntry extends EntryBase {\n\ttype: \"configuration_update\";\n\treasoning: { effort: string };\n}\n\nexport interface ActiveToolsEntry extends EntryBase {\n\ttype: \"active_tools_change\";\n\tactiveToolNames: string[];\n}\n\nexport interface CompactionEntry extends EntryBase {\n\ttype: \"compaction\";\n\tsummary: string;\n\tretainedTail: AgentMessage[];\n\ttokensBefore: number;\n\tdetails?: unknown;\n\tusage?: Usage;\n}\n\nexport interface BranchSummaryEntry extends EntryBase {\n\ttype: \"branch_summary\";\n\tfromId: string;\n\tsummary: string;\n\tdetails?: unknown;\n\tusage?: Usage;\n}\n\nexport interface CustomEntry extends EntryBase {\n\ttype: \"custom\";\n\tcustomType: string;\n\tdata?: unknown;\n}\n\nexport type Entry =\n\t| MessageEntry\n\t| ModelChangeEntry\n\t| ThinkingLevelEntry\n\t| ConfigurationUpdateEntry\n\t| ActiveToolsEntry\n\t| CompactionEntry\n\t| BranchSummaryEntry\n\t| CustomEntry;\n\nexport type ProvisionedEntry<TEntry extends Entry = Entry> = TEntry extends Entry\n\t? Omit<TEntry, \"parentId\" | \"seq\" | \"timestamp\">\n\t: never;\n\nexport interface RecordBase {\n\tid: string;\n\tseq: number;\n\tlane: string;\n\ttimestamp: number;\n}\n\nexport interface OperationStartedRecord extends RecordBase {\n\ttype: \"operation_started\";\n\tsourceLeafId: string | null;\n\tintent:\n\t\t| {\n\t\t\t\tkind: \"run\";\n\t\t\t\t/** Normalized caller input before before_run; kept for suspended operations and before_resume. */\n\t\t\t\toriginalPrompt: AgentMessage[];\n\t\t\t\t/** Captured nextRun items, then the prompt, then before_run injections. */\n\t\t\t\tinitialMessages: ProvisionedEntry[];\n\t\t\t\tsystemPromptOverride?: string;\n\t\t\t\tresumeData?: { [extensionId: string]: JsonValue };\n\t\t }\n\t\t| {\n\t\t\t\tkind: \"compaction\";\n\t\t\t\tcustomInstructions?: string;\n\t\t\t\tresultEntryId: string;\n\t\t }\n\t\t| {\n\t\t\t\tkind: \"navigation\";\n\t\t\t\ttargetId: string | null;\n\t\t\t\tsummarize: boolean;\n\t\t\t\tcustomInstructions?: string;\n\t\t\t\tlabel?: string;\n\t\t\t\tsummaryEntryId?: string;\n\t\t };\n}\n\nexport interface AbortRequestedRecord extends RecordBase {\n\ttype: \"abort_requested\";\n\trunId: string;\n}\n\nexport interface OperationFinishedRecord extends RecordBase {\n\ttype: \"operation_finished\";\n\trunId: string;\n\toutcome: \"completed\" | \"aborted\" | \"failed\" | \"declined\";\n\terror?: { code: string; message: string };\n}\n\nexport type CompactionReason = \"manual\" | \"threshold\" | \"overflow\";\n\nexport type StepAttemptRecord = RecordBase &\n\t(\n\t\t| {\n\t\t\t\ttype: \"step_attempt\";\n\t\t\t\trunId: string;\n\t\t\t\tstep: \"assistant\" | \"branch_summary\";\n\t\t\t\tattempt: number;\n\t\t\t\tresultEntryId: string;\n\t\t\t\tcompactionReason?: never;\n\t\t }\n\t\t| {\n\t\t\t\ttype: \"step_attempt\";\n\t\t\t\trunId: string;\n\t\t\t\tstep: \"compaction\";\n\t\t\t\tattempt: number;\n\t\t\t\tresultEntryId: string;\n\t\t\t\t/** Persists why compaction summary generation started so recovery resumes the same work. */\n\t\t\t\tcompactionReason: CompactionReason;\n\t\t }\n\t);\n\nexport interface ToolStartedRecord extends RecordBase {\n\ttype: \"tool_started\";\n\trunId: string;\n\tassistantEntryId: string;\n\ttoolIndex: number;\n\ttoolCallId: string;\n\ttoolName: string;\n\teffectiveArgs: { [key: string]: unknown };\n\tresultEntryId: string;\n\treplay: \"never\" | \"safe\";\n}\n\nexport type QueueEnqueuedRecord = RecordBase &\n\t(\n\t\t| {\n\t\t\t\ttype: \"queue_enqueued\";\n\t\t\t\tqueue: \"steer\" | \"followUp\";\n\t\t\t\trunId: string;\n\t\t\t\ttarget: ProvisionedEntry;\n\t\t }\n\t\t| {\n\t\t\t\ttype: \"queue_enqueued\";\n\t\t\t\tqueue: \"nextRun\";\n\t\t\t\trunId?: never;\n\t\t\t\ttarget: ProvisionedEntry;\n\t\t }\n\t);\n\nexport interface QueueCancelledRecord extends RecordBase {\n\ttype: \"queue_cancelled\";\n\trunId?: string;\n\tentryId: string;\n}\n\nexport interface WriteDeferredRecord extends RecordBase {\n\ttype: \"write_deferred\";\n\trunId: string;\n\ttarget: ProvisionedEntry;\n}\n\nexport type UsageRecord = RecordBase & { type: \"usage\"; usage: Usage } & (\n\t\t| {\n\t\t\t\tcause: \"assistant\" | \"compaction\" | \"branch_summary\" | \"deferred_fetch\";\n\t\t\t\trunId: string;\n\t\t\t\tentryId: string;\n\t\t\t\tattempt: number;\n\t\t\t\tstopReason: SessionStopReason;\n\t\t }\n\t\t| { cause: \"tool\"; runId: string; entryId: string; toolCallId: string }\n\t\t| { cause: \"hook\"; runId: string; entryId: string }\n\t\t| { cause: \"adjustment\"; runId?: string; entryId?: string; details?: JsonValue }\n\t);\n\nexport type LaneRecord =\n\t| OperationStartedRecord\n\t| AbortRequestedRecord\n\t| OperationFinishedRecord\n\t| StepAttemptRecord\n\t| ToolStartedRecord\n\t| QueueEnqueuedRecord\n\t| QueueCancelledRecord\n\t| WriteDeferredRecord\n\t| UsageRecord;\nexport type NewRecord<TRecord extends LaneRecord = LaneRecord> = TRecord extends LaneRecord\n\t? Omit<TRecord, \"seq\" | \"timestamp\">\n\t: never;\n\nexport type EntryOrder = \"newestFirst\" | \"oldestFirst\";\n\nexport interface EntryCursor {\n\tafterSeq: number;\n}\n\nexport interface EntryQuery {\n\ttype?: Entry[\"type\"];\n\tcustomType?: string; // for type \"custom\"\n\torder?: EntryOrder; // default newestFirst\n\tlimit?: number;\n\tcursor?: EntryCursor;\n}\n\n/** Bounds of a branch scan. Default: the whole path, leaf to root. */\nexport interface BranchBounds {\n\tstart?: string; // default: the view's lane leaf\n\tstopAtType?: Entry[\"type\"]; // scan ends after the first match, inclusive\n\tstopAtId?: string;\n}\n\nexport interface RecordQuery {\n\t/** Exact lane match. Omit to query every lane. */\n\tlane?: string;\n\t/** Exact record discriminant match. Omit to query every record type. */\n\ttype?: LaneRecord[\"type\"];\n\t/**\n\t * Operation identity. Matches OperationStartedRecord.id and the runId\n\t * property of operation-owned records. Records without an operation\n\t * identity do not match.\n\t */\n\trunId?: string;\n\t/** Exact operation intent kind. Valid only with type \"operation_started\". */\n\toperationKind?: OperationStartedRecord[\"intent\"][\"kind\"];\n\t/** Exclusive chronological lower bound: seq > afterSeq, regardless of order. */\n\tafterSeq?: number;\n\t/** Sequence order. Default: \"newestFirst\". */\n\torder?: EntryOrder;\n\t/** Positive maximum number of matching records. */\n\tlimit?: number;\n}\n\nexport interface SessionMetadata {\n\tid: string;\n\tcreatedAt: number;\n\tparentSessionId?: string;\n}\n\nexport interface SessionStats {\n\tmessageCount: number;\n\tcachedTokens: number;\n\tuncachedTokens: number;\n\ttotalTokens: number;\n\tcostTotal: number;\n}\n\nexport interface LanePointer {\n\tlane: string;\n\tleafId: string | null;\n}\n\nexport type LogItem =\n\t| { kind: \"entry\"; seq: number; entry: Entry }\n\t| { kind: \"record\"; seq: number; record: LaneRecord }\n\t| { kind: \"lane\"; seq: number; lane: string; leafId: string | null }\n\t| { kind: \"fact\"; seq: number; fact: \"name\"; name: string | undefined }\n\t| { kind: \"fact\"; seq: number; fact: \"label\"; targetId: string; label: string | undefined };\n\nexport interface LogOptions {\n\tafterSeq?: number;\n\tlimit?: number;\n}\n\nexport interface SessionStorage<TMetadata extends SessionMetadata = SessionMetadata> {\n\tgetMetadata(): Promise<TMetadata>;\n\n\t// Lanes\n\tgetLanes(): Promise<{ lane: string; leafId: string | null }[]>;\n\tcreateLane(lane: string, at: string | null): Promise<void>;\n\tmoveLane(lane: string, to: string | null): Promise<void>;\n\n\t// Entries and Records\n\tappendEntry<TEntry extends Entry>(entry: ProvisionedEntry<TEntry>, lane: string): Promise<TEntry>;\n\tappendRecord<TRecord extends LaneRecord>(record: NewRecord<TRecord>): Promise<TRecord>;\n\n\t// Reads\n\tgetEntry(id: string): Promise<Entry | undefined>;\n\tfindEntries(query?: EntryQuery): Promise<Entry[]>;\n\t/** start is mandatory here (as opposed to SessionTree's findEntriesOnBranch); defaulting to a lane's leaf is view sugar. */\n\tfindEntriesOnBranch(query: EntryQuery & BranchBounds & { start: string }): Promise<Entry[]>;\n\tfindRecords<K extends LaneRecord[\"type\"]>(\n\t\tquery: RecordQuery & { type: K },\n\t): Promise<Extract<LaneRecord, { type: K }>[]>;\n\tfindRecords(query?: RecordQuery): Promise<LaneRecord[]>;\n\t/**\n\t * Returns unfinished operation starts newest first. Recovery uses `limit: 2`:\n\t * zero results mean the lane is idle, one means it is suspended, and two\n\t * mean at least two operations are open, which is corruption. Further\n\t * results provide no additional recovery state.\n\t */\n\tfindOpenOperations(lane: string, options?: { limit?: number }): Promise<OperationStartedRecord[]>;\n\tgetLog(options?: { afterSeq?: number; limit?: number }): Promise<LogItem[]>;\n\n\t// Global facts\n\tgetName(): Promise<string | undefined>;\n\tsetName(name: string | undefined): Promise<void>;\n\tgetLabel(id: string): Promise<string | undefined>;\n\tsetLabel(id: string, label: string | undefined): Promise<void>;\n\tgetStats(): Promise<SessionStats>;\n}\n\nexport interface SessionTree {\n\tgetLeafId(): Promise<string | null>;\n\tgetEntry(id: string): Promise<Entry | undefined>;\n\tgetStats(): Promise<SessionStats>;\n\n\t// Global facts. Latest wins; not branch-scoped. \"set\", not \"append\":\n\t// append vocabulary is reserved for tree writes.\n\tgetName(): Promise<string | undefined>;\n\tsetName(name: string | undefined): Promise<void>;\n\tgetLabel(targetId: string): Promise<string | undefined>;\n\tsetLabel(targetId: string, label: string | undefined): Promise<void>;\n\n\t/** Session-wide, all branches, sequence order. */\n\tfindEntries(query?: EntryQuery): Promise<Entry[]>;\n\tfindEntry(query?: EntryQuery): Promise<Entry | undefined>;\n\n\t/** Branch-scoped: the path from start toward root. */\n\tfindEntriesOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry[]>;\n\tfindEntryOnBranch(query?: EntryQuery & BranchBounds): Promise<Entry | undefined>;\n\n\t// Writes. Resolve on durable acceptance; the returned id is the entry's\n\t// id (provisioned when the write defers).\n\tappendMessage(message: AgentMessage): Promise<string>;\n\tappendCustomEntry(customType: string, data?: unknown): Promise<string>;\n}\n\nexport interface SessionCreateOptions {\n\tid?: string;\n\tparentSessionId?: string;\n}\n\nexport type ForkOptions = { scope?: \"branch\"; entryId?: string; position?: \"before\" | \"at\" } | { scope: \"tree\" };\n\nexport interface SessionRepo<\n\tTMetadata extends SessionMetadata = SessionMetadata,\n\tTCreateOptions extends SessionCreateOptions = SessionCreateOptions,\n\tTListOptions = void,\n> {\n\tcreate(options: TCreateOptions): Promise<Session<TMetadata>>;\n\t/** Opens the session for writing and acquires any backend writer claim. */\n\topen(metadata: TMetadata): Promise<Session<TMetadata>>;\n\t/** Lists session metadata without opening sessions or acquiring writer claims. */\n\tlist(options?: TListOptions): Promise<TMetadata[]>;\n\tdelete(metadata: TMetadata): Promise<void>;\n\tfork(source: TMetadata, options: ForkOptions & TCreateOptions): Promise<Session<TMetadata>>;\n}\n\nexport type SessionErrorCode =\n\t| \"not_found\"\n\t| \"already_exists\"\n\t| \"invalid_entry\"\n\t| \"invalid_payload\"\n\t| \"invalid_lane\"\n\t| \"invalid_query\"\n\t| \"invalid_fork_target\"\n\t| \"storage\";\n\nexport class SessionError extends Error {\n\treadonly code: SessionErrorCode;\n\n\tconstructor(code: SessionErrorCode, message: string, cause?: Error) {\n\t\tsuper(message, cause === undefined ? undefined : { cause });\n\t\tthis.name = \"SessionError\";\n\t\tthis.code = code;\n\t}\n}\n"]}
|
|
@@ -24,7 +24,7 @@ export function createWriteTool() {
|
|
|
24
24
|
const outcome = await runPostMutate(postMutate, { tool: "write", path: absolutePath, signal });
|
|
25
25
|
if (signal?.aborted)
|
|
26
26
|
throw new Error("Operation aborted");
|
|
27
|
-
const text = appendPostMutateNote(`Successfully wrote
|
|
27
|
+
const text = appendPostMutateNote(`Successfully wrote to ${path}`, outcome.note);
|
|
28
28
|
return {
|
|
29
29
|
content: [{ type: "text", text }],
|
|
30
30
|
details: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/harness/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGvE,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;IACtF,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;CACrE,CAAC,CAAC;AAIH,MAAM,UAAU,eAAe;IAK9B,OAAO;QACN,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO;QACd,WAAW,EACV,iIAAiI;QAClI,UAAU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EAAE,IAAI,EAAE,CAAC;oBACjC,OAAO,EAAE,SAAS;iBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport type { AgentHarnessTool } from \"../types.ts\";\nimport { getOrThrow } from \"../types.ts\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.ts\";\nimport { resolveToolPath } from \"./path-utils.ts\";\nimport { appendPostMutateNote, runPostMutate } from \"./post-mutate.ts\";\nimport type { ExecutionToolContext } from \"./tool-context.ts\";\n\nconst writeSchema = Type.Object({\n\tpath: Type.String({ description: \"Path to the file to write (relative or absolute)\" }),\n\tcontent: Type.String({ description: \"Content to write to the file\" }),\n});\n\nexport type WriteToolInput = Static<typeof writeSchema>;\n\nexport function createWriteTool<TContext extends ExecutionToolContext = ExecutionToolContext>(): AgentHarnessTool<\n\tTContext,\n\ttypeof writeSchema,\n\tundefined\n> {\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription:\n\t\t\t\"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.\",\n\t\tparameters: writeSchema,\n\t\tasync execute(_toolCallId, { path, content }, signal, _onUpdate, { env, postMutate }) {\n\t\t\tconst absolutePath = await resolveToolPath(env, path, signal);\n\t\t\treturn withFileMutationQueue(env, absolutePath, async () => {\n\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\tgetOrThrow(await env.writeFile(absolutePath, content, signal));\n\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\tconst outcome = await runPostMutate(postMutate, { tool: \"write\", path: absolutePath, signal });\n\t\t\t\tif (signal?.aborted) throw new Error(\"Operation aborted\");\n\t\t\t\tconst text = appendPostMutateNote(`Successfully wrote to ${path}`, outcome.note);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text }],\n\t\t\t\t\tdetails: undefined,\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t};\n}\n"]}
|