@code-yeongyu/senpi 2026.9.12-3 → 2026.9.12
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 +0 -60
- package/README.md +1 -1
- package/dist/bun/cli.d.ts +1 -2
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +8 -5
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-bedrock.d.ts +2 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -0
- package/dist/bun/register-bedrock.js +4 -0
- package/dist/bun/register-bedrock.js.map +1 -0
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -2
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/experimental/auth.d.ts +16 -0
- package/dist/cli/experimental/auth.d.ts.map +1 -0
- package/dist/cli/experimental/auth.js +13 -0
- package/dist/cli/experimental/auth.js.map +1 -0
- package/dist/cli/experimental/cli.d.ts +6 -0
- package/dist/cli/experimental/cli.d.ts.map +1 -0
- package/dist/cli/experimental/cli.js +5 -0
- package/dist/cli/experimental/cli.js.map +1 -0
- package/dist/cli/experimental/command-options.d.ts +17 -0
- package/dist/cli/experimental/command-options.d.ts.map +1 -0
- package/dist/cli/experimental/command-options.js +35 -0
- package/dist/cli/experimental/command-options.js.map +1 -0
- package/dist/cli/experimental/command.d.ts +63 -0
- package/dist/cli/experimental/command.d.ts.map +1 -0
- package/dist/cli/experimental/command.js +127 -0
- package/dist/cli/experimental/command.js.map +1 -0
- package/dist/cli/experimental/commands/client.d.ts +13 -0
- package/dist/cli/experimental/commands/client.d.ts.map +1 -0
- package/dist/cli/experimental/commands/client.js +25 -0
- package/dist/cli/experimental/commands/client.js.map +1 -0
- package/dist/cli/experimental/commands/pi.d.ts +15 -0
- package/dist/cli/experimental/commands/pi.d.ts.map +1 -0
- package/dist/cli/experimental/commands/pi.js +28 -0
- package/dist/cli/experimental/commands/pi.js.map +1 -0
- package/dist/cli/experimental/commands/server.d.ts +13 -0
- package/dist/cli/experimental/commands/server.d.ts.map +1 -0
- package/dist/cli/experimental/commands/server.js +25 -0
- package/dist/cli/experimental/commands/server.js.map +1 -0
- package/dist/cli/experimental/transport-address.d.ts +10 -0
- package/dist/cli/experimental/transport-address.d.ts.map +1 -0
- package/dist/cli/experimental/transport-address.js +38 -0
- package/dist/cli/experimental/transport-address.js.map +1 -0
- package/dist/cli.js +0 -3
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/config.d.ts +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -1
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +6 -18
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +17 -54
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +157 -153
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +4 -6
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction-settings-access.d.ts +2 -18
- package/dist/core/compaction-settings-access.d.ts.map +1 -1
- package/dist/core/compaction-settings-access.js +4 -35
- package/dist/core/compaction-settings-access.js.map +1 -1
- package/dist/core/compaction-settings-resolver.d.ts +2 -2
- package/dist/core/compaction-settings-resolver.d.ts.map +1 -1
- package/dist/core/compaction-settings-resolver.js +3 -6
- package/dist/core/compaction-settings-resolver.js.map +1 -1
- package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/extension.js +0 -11
- package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +1 -2
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +1 -7
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +2 -4
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/keybindings.d.ts +0 -10
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +0 -8
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -5
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +0 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +0 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +0 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -5
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts +0 -2
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -5
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +19 -68
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-write-reservation.d.ts +0 -9
- package/dist/core/session-write-reservation.d.ts.map +1 -1
- package/dist/core/session-write-reservation.js +0 -33
- package/dist/core/session-write-reservation.js.map +1 -1
- package/dist/core/settings-manager.d.ts +5 -12
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +6 -18
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-public-types.d.ts +1 -1
- package/dist/core/settings-public-types.d.ts.map +1 -1
- package/dist/core/settings-public-types.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +2 -6
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +9 -8
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +142 -3
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +12 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +168 -4
- 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 +53 -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 +58 -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 +47 -2
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +4 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +141 -4
- 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 +153 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts +1 -3
- package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
- package/dist/modes/app-server/threads/turns.js +1 -1
- package/dist/modes/app-server/threads/turns.js.map +1 -1
- package/dist/modes/app-server/turn-adapter.js +2 -4
- package/dist/modes/app-server/turn-adapter.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts +12 -17
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js +23 -47
- package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -7
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -26
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.d.ts +0 -4
- package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.js +5 -8
- package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +1 -10
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +1 -37
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +8 -8
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +1 -4
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +2 -14
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +4 -4
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts +1 -4
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.js +10 -23
- package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution-types.d.ts +2 -18
- package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-types.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +0 -5
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +15 -10
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +138 -178
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -2
- package/dist/modes/interactive/theme/grok-day.json +1 -2
- package/dist/modes/interactive/theme/grok-night.json +1 -2
- package/dist/modes/interactive/theme/light.json +1 -2
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +0 -5
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +2 -6
- package/dist/modes/interactive/theme/theme.d.ts +5 -10
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +117 -14
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts +0 -5
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js +0 -5
- package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +2 -8
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +1 -11
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +0 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +1 -3
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts +8 -10
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js +23 -14
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.d.ts +0 -10
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.js +0 -2
- package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
- package/dist/modes/rpc/session-worker.js +16 -12
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts +0 -12
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +24 -51
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/dist/senpi +0 -3
- package/dist/server/create-harness.d.ts +26 -0
- package/dist/server/create-harness.d.ts.map +1 -0
- package/dist/server/create-harness.js +106 -0
- package/dist/server/create-harness.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +69 -52
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +11 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +20 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +126 -49
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +3 -2
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +0 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +19 -41
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/AGENTS.md +67 -0
- package/docs/compaction.md +13 -39
- package/docs/containerization.md +0 -45
- package/docs/development.md +0 -19
- package/docs/docs.json +0 -4
- package/docs/environment-variables.md +0 -2
- package/docs/extensions.md +10 -21
- package/docs/keybindings.md +2 -7
- package/docs/models.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/rpc.md +8 -16
- package/docs/sdk.md +0 -7
- package/docs/session-format.md +38 -52
- package/docs/settings.md +4 -40
- package/docs/skills.md +1 -1
- package/docs/termux.md +1 -0
- package/docs/themes.md +6 -8
- package/docs/tui.md +3 -22
- package/examples/README.md +0 -3
- package/examples/extensions/dynamic-resources/dynamic.json +0 -2
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +0 -5
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +0 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +0 -1
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +0 -1
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +0 -2
- package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +0 -2
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +0 -24
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
- package/node_modules/@earendil-works/pi-agent-core/README.md +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +384 -639
- 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 +250 -5
- 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 +6 -12
- 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 +27 -33
- 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 +8 -30
- 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 +64 -53
- 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/env/nodejs.d.ts +28 -25
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +125 -368
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +38 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +55 -233
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +2 -2
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +2 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +17 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts +100 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +420 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +0 -93
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +0 -39
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +19 -6
- 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 +53 -31
- 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/index.d.ts +5 -9
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +4 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +8 -19
- 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 +219 -34
- 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/jsonl/errors.d.ts +9 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +18 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +24 -27
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +151 -276
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +41 -39
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +196 -175
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +22 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +1 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +40 -44
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +115 -333
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +51 -78
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +207 -327
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts +65 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +320 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +762 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts +2 -9
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +1 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts +7 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +265 -425
- 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 +7 -7
- 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/skills.d.ts +2 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +26 -29
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +43 -64
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +26 -45
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +93 -66
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +13 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts +1 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +5 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts +2 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +5 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +1 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +6 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +8 -12
- 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/harness/types.d.ts +45 -128
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +5 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +192 -65
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +16 -24
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts +29 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +103 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +0 -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 +6 -27
- package/node_modules/@earendil-works/pi-ai/README.md +4 -39
- 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 +1 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +159 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +0 -11
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +0 -18
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +1 -5
- 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 +1 -4
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -6
- 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-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +1 -4
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +3 -13
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +1 -2
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -2
- 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 -2
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +0 -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 +2 -5
- 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 +1 -1
- 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/cloudflare-ai-gateway.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +0 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +1 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.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/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/deepseek.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/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +3 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +4 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +6 -16
- 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/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +5 -25
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +1 -1
- 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 +1 -5
- 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-profile/types.d.ts +1 -10
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +2 -13
- 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 +7 -18
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +31 -36
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +6 -6
- 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 +4 -53
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +1 -21
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +42 -199
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +1 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +0 -28
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +1 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +18 -98
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +1 -12
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +6 -40
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.js +0 -7
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +0 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +8 -20
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +3 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +1 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +1 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +2 -48
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +1 -5
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +5 -54
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -3
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +0 -3
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +1 -3
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout.js +9 -32
- package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +1 -2
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +44 -3
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +20 -2
- 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 +1 -31
- 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 +41 -335
- 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 +5 -83
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +4 -118
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +0 -2
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +0 -9
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +6 -8
- package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +5 -12
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-platform.node → darwin-modifiers.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-platform.node → darwin-modifiers.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +70 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/README.md +7 -18
- package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +4 -7
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +119 -0
- package/node_modules/@earendil-works/pi-tui/package.json +3 -10
- package/node_modules/@google/genai/dist/genai.d.ts +278 -1788
- package/node_modules/@google/genai/dist/index.cjs +299 -319
- package/node_modules/@google/genai/dist/index.mjs +299 -319
- package/node_modules/@google/genai/dist/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/node/index.cjs +300 -320
- package/node_modules/@google/genai/dist/node/index.mjs +300 -320
- package/node_modules/@google/genai/dist/node/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/node/node.d.ts +278 -1788
- package/node_modules/@google/genai/dist/tokenizer/node.cjs +2 -49
- package/node_modules/@google/genai/dist/tokenizer/node.d.ts +3 -43
- package/node_modules/@google/genai/dist/tokenizer/node.mjs +2 -49
- package/node_modules/@google/genai/dist/tokenizer/node.mjs.map +1 -1
- package/node_modules/@google/genai/dist/vertex_internal/index.cjs +3 -39
- package/node_modules/@google/genai/dist/vertex_internal/index.cjs.map +1 -1
- package/node_modules/@google/genai/dist/vertex_internal/index.d.ts +9 -51
- package/node_modules/@google/genai/dist/vertex_internal/index.js +3 -39
- package/node_modules/@google/genai/dist/vertex_internal/index.js.map +1 -1
- package/node_modules/@google/genai/dist/web/index.mjs +299 -319
- package/node_modules/@google/genai/dist/web/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/web/web.d.ts +278 -1788
- package/node_modules/@google/genai/package.json +1 -1
- package/node_modules/@mariozechner/clipboard/.yarnrc.yml +1 -0
- package/node_modules/@mariozechner/clipboard/Cargo.toml +45 -0
- package/node_modules/@mariozechner/clipboard/README.md +60 -0
- package/node_modules/@mariozechner/clipboard/build.rs +5 -0
- package/node_modules/@mariozechner/clipboard/exp.ts +12 -0
- package/node_modules/@mariozechner/clipboard/index.d.ts +37 -0
- package/node_modules/@mariozechner/clipboard/index.js +606 -0
- package/node_modules/@mariozechner/clipboard/package.json +45 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +307 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +93 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +313 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +471 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +252 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +431 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +712 -0
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +916 -0
- package/node_modules/@mariozechner/clipboard/src/lib.rs +194 -0
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +4 -11
- package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +0 -1
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +3 -2
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +1 -8
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/ignore/README.md +0 -52
- package/node_modules/ignore/index.js +129 -785
- package/node_modules/ignore/legacy.js +98 -660
- package/node_modules/ignore/package.json +4 -10
- package/node_modules/marked/README.md +0 -1
- package/node_modules/marked/lib/marked.d.ts +0 -7
- package/node_modules/marked/lib/marked.esm.js +30 -30
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +30 -30
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +2 -2
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +5 -7
- package/node_modules/typebox/build/format/iri.mjs +1 -5
- package/node_modules/typebox/build/guard/emit.mjs +4 -2
- package/node_modules/typebox/build/guard/guard.mjs +18 -6
- package/node_modules/typebox/build/guard/string.mjs +24 -16
- package/node_modules/typebox/build/schema/compile.d.mts +2 -3
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -1
- package/node_modules/typebox/build/schema/engine/_context.mjs +14 -9
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +2 -6
- package/node_modules/typebox/build/schema/engine/_stack.mjs +32 -135
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -16
- package/node_modules/typebox/build/schema/engine/allOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/if.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +3 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +0 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +13 -7
- package/node_modules/typebox/build/schema/parse.d.mts +0 -1
- package/node_modules/typebox/build/schema/parse.mjs +5 -10
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +3 -34
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +73 -198
- package/node_modules/typebox/build/schema/schema.d.mts +0 -1
- package/node_modules/typebox/build/schema/schema.mjs +0 -1
- package/node_modules/typebox/build/value/errors/errors.d.mts +12 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +7 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +5 -9
- package/node_modules/undici/docs/docs/api/Client.md +0 -4
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +2 -3
- package/node_modules/undici/docs/docs/api/EventSource.md +0 -4
- package/node_modules/undici/docs/docs/api/Interceptors.md +3 -7
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -7
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +0 -2
- package/node_modules/undici/lib/dispatcher/agent.js +2 -7
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -7
- package/node_modules/undici/lib/dispatcher/client-h1.js +4 -12
- package/node_modules/undici/lib/dispatcher/client-h2.js +3 -43
- package/node_modules/undici/lib/dispatcher/client.js +2 -3
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -13
- package/node_modules/undici/lib/dispatcher/dispatcher.js +1 -15
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -3
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +3 -10
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +1 -18
- package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -3
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +21 -91
- package/node_modules/undici/lib/handler/cache-handler.js +5 -29
- package/node_modules/undici/lib/handler/decorator-handler.js +1 -7
- package/node_modules/undici/lib/handler/deduplication-handler.js +6 -12
- package/node_modules/undici/lib/handler/redirect-handler.js +4 -21
- package/node_modules/undici/lib/handler/retry-handler.js +30 -148
- package/node_modules/undici/lib/interceptor/cache.js +12 -65
- package/node_modules/undici/lib/interceptor/decompress.js +13 -115
- package/node_modules/undici/lib/interceptor/deduplicate.js +4 -5
- package/node_modules/undici/lib/interceptor/dns.js +0 -7
- package/node_modules/undici/lib/interceptor/dump.js +23 -10
- package/node_modules/undici/lib/mock/mock-agent.js +1 -13
- package/node_modules/undici/lib/mock/mock-utils.js +10 -11
- package/node_modules/undici/lib/util/cache.js +3 -45
- package/node_modules/undici/lib/web/cookies/parse.js +147 -150
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +1 -28
- package/node_modules/undici/lib/web/eventsource/eventsource.js +3 -13
- package/node_modules/undici/lib/web/fetch/index.js +0 -6
- package/node_modules/undici/lib/web/fetch/request.js +3 -2
- package/node_modules/undici/lib/web/fetch/util.js +1 -6
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -5
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +10 -8
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +0 -10
- package/node_modules/undici/types/interceptors.d.ts +0 -2
- package/node_modules/undici/types/mock-agent.d.ts +10 -11
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -2
- package/package.json +49 -70
- package/vendor/pi-client/client.d.ts +15 -20
- package/vendor/pi-client/client.d.ts.map +1 -1
- package/vendor/pi-client/client.js +245 -248
- package/vendor/pi-client/client.js.map +1 -1
- package/vendor/pi-client/connection.d.ts +3 -4
- package/vendor/pi-client/connection.d.ts.map +1 -1
- package/vendor/pi-client/connection.js +9 -13
- package/vendor/pi-client/connection.js.map +1 -1
- package/vendor/pi-client/errors.d.ts +15 -6
- package/vendor/pi-client/errors.d.ts.map +1 -1
- package/vendor/pi-client/errors.js +25 -10
- package/vendor/pi-client/errors.js.map +1 -1
- package/vendor/pi-client/index.d.ts +4 -3
- package/vendor/pi-client/index.d.ts.map +1 -1
- package/vendor/pi-client/index.js +2 -2
- package/vendor/pi-client/index.js.map +1 -1
- package/vendor/pi-client/session-handle.d.ts +54 -0
- package/vendor/pi-client/session-handle.d.ts.map +1 -0
- package/vendor/pi-client/session-handle.js +50 -0
- package/vendor/pi-client/session-handle.js.map +1 -0
- package/vendor/pi-client/state.d.ts +22 -0
- package/vendor/pi-client/state.d.ts.map +1 -0
- package/vendor/pi-client/state.js +145 -0
- package/vendor/pi-client/state.js.map +1 -0
- package/vendor/pi-client/types.d.ts +8 -14
- package/vendor/pi-client/types.d.ts.map +1 -1
- package/vendor/pi-client/types.js.map +1 -1
- package/vendor/pi-client/unix.d.ts +1 -14
- package/vendor/pi-client/unix.d.ts.map +1 -1
- package/vendor/pi-client/unix.js +8 -138
- package/vendor/pi-client/unix.js.map +1 -1
- package/vendor/pi-protocol/codec.d.ts +4 -2
- package/vendor/pi-protocol/codec.d.ts.map +1 -1
- package/vendor/pi-protocol/codec.js +34 -7
- package/vendor/pi-protocol/codec.js.map +1 -1
- package/vendor/pi-protocol/framing.d.ts +2 -0
- package/vendor/pi-protocol/framing.d.ts.map +1 -1
- package/vendor/pi-protocol/framing.js +15 -0
- package/vendor/pi-protocol/framing.js.map +1 -1
- package/vendor/pi-protocol/index.d.ts +1 -1
- package/vendor/pi-protocol/index.d.ts.map +1 -1
- package/vendor/pi-protocol/index.js +1 -1
- package/vendor/pi-protocol/index.js.map +1 -1
- package/vendor/pi-protocol/schemas.d.ts +13739 -0
- package/vendor/pi-protocol/schemas.d.ts.map +1 -0
- package/vendor/pi-protocol/schemas.js +386 -0
- package/vendor/pi-protocol/schemas.js.map +1 -0
- package/dist/bun/runtime-setup.d.ts +0 -2
- package/dist/bun/runtime-setup.d.ts.map +0 -1
- package/dist/bun/runtime-setup.js +0 -9
- package/dist/bun/runtime-setup.js.map +0 -1
- package/dist/bun/sandbox-env-setup.d.ts +0 -2
- package/dist/bun/sandbox-env-setup.d.ts.map +0 -1
- package/dist/bun/sandbox-env-setup.js +0 -4
- package/dist/bun/sandbox-env-setup.js.map +0 -1
- package/dist/cli/setup.d.ts +0 -2
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli/setup.js +0 -12
- package/dist/cli/setup.js.map +0 -1
- package/dist/core/cursor-history-admission.d.ts +0 -50
- package/dist/core/cursor-history-admission.d.ts.map +0 -1
- package/dist/core/cursor-history-admission.js +0 -130
- package/dist/core/cursor-history-admission.js.map +0 -1
- package/dist/core/tools/renderers/bash.d.ts +0 -12
- package/dist/core/tools/renderers/bash.d.ts.map +0 -1
- package/dist/core/tools/renderers/bash.js +0 -156
- package/dist/core/tools/renderers/bash.js.map +0 -1
- package/dist/core/tools/renderers/edit.d.ts +0 -23
- package/dist/core/tools/renderers/edit.d.ts.map +0 -1
- package/dist/core/tools/renderers/edit.js +0 -172
- package/dist/core/tools/renderers/edit.js.map +0 -1
- package/dist/core/tools/renderers/find.d.ts +0 -10
- package/dist/core/tools/renderers/find.d.ts.map +0 -1
- package/dist/core/tools/renderers/find.js +0 -64
- package/dist/core/tools/renderers/find.js.map +0 -1
- package/dist/core/tools/renderers/grep.d.ts +0 -10
- package/dist/core/tools/renderers/grep.d.ts.map +0 -1
- package/dist/core/tools/renderers/grep.js +0 -69
- package/dist/core/tools/renderers/grep.js.map +0 -1
- package/dist/core/tools/renderers/index.d.ts +0 -28
- package/dist/core/tools/renderers/index.d.ts.map +0 -1
- package/dist/core/tools/renderers/index.js +0 -47
- package/dist/core/tools/renderers/index.js.map +0 -1
- package/dist/core/tools/renderers/ls.d.ts +0 -10
- package/dist/core/tools/renderers/ls.d.ts.map +0 -1
- package/dist/core/tools/renderers/ls.js +0 -58
- package/dist/core/tools/renderers/ls.js.map +0 -1
- package/dist/core/tools/renderers/read.d.ts +0 -19
- package/dist/core/tools/renderers/read.d.ts.map +0 -1
- package/dist/core/tools/renderers/read.js +0 -149
- package/dist/core/tools/renderers/read.js.map +0 -1
- package/dist/core/tools/renderers/write.d.ts +0 -10
- package/dist/core/tools/renderers/write.d.ts.map +0 -1
- package/dist/core/tools/renderers/write.js +0 -162
- package/dist/core/tools/renderers/write.js.map +0 -1
- package/dist/modes/interactive/chat-viewport.d.ts +0 -22
- package/dist/modes/interactive/chat-viewport.d.ts.map +0 -1
- package/dist/modes/interactive/chat-viewport.js +0 -29
- package/dist/modes/interactive/chat-viewport.js.map +0 -1
- package/dist/modes/interactive/components/ask-user-answer-key.d.ts +0 -14
- package/dist/modes/interactive/components/ask-user-answer-key.d.ts.map +0 -1
- package/dist/modes/interactive/components/ask-user-answer-key.js +0 -65
- package/dist/modes/interactive/components/ask-user-answer-key.js.map +0 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +0 -84
- package/dist/modes/interactive/theme/theme-json.d.ts.map +0 -1
- package/dist/modes/interactive/theme/theme-json.js +0 -130
- package/dist/modes/interactive/theme/theme-json.js.map +0 -1
- package/dist/modes/interactive/tui-renderer.d.ts +0 -21
- package/dist/modes/interactive/tui-renderer.d.ts.map +0 -1
- package/dist/modes/interactive/tui-renderer.js +0 -67
- package/dist/modes/interactive/tui-renderer.js.map +0 -1
- package/dist/modes/rpc/session-path-reservations.d.ts +0 -30
- package/dist/modes/rpc/session-path-reservations.d.ts.map +0 -1
- package/dist/modes/rpc/session-path-reservations.js +0 -58
- package/dist/modes/rpc/session-path-reservations.js.map +0 -1
- package/dist/modes/rpc/session-worker-credit.d.ts +0 -17
- package/dist/modes/rpc/session-worker-credit.d.ts.map +0 -1
- package/dist/modes/rpc/session-worker-credit.js +0 -39
- package/dist/modes/rpc/session-worker-credit.js.map +0 -1
- package/dist/modes/rpc/session-worker-signals.d.ts +0 -7
- package/dist/modes/rpc/session-worker-signals.d.ts.map +0 -1
- package/dist/modes/rpc/session-worker-signals.js +0 -19
- package/dist/modes/rpc/session-worker-signals.js.map +0 -1
- package/dist/utils/clipboard-command.d.ts +0 -7
- package/dist/utils/clipboard-command.d.ts.map +0 -1
- package/dist/utils/clipboard-command.js +0 -45
- package/dist/utils/clipboard-command.js.map +0 -1
- package/examples/plugins/pi-example-plugin/README.md +0 -38
- package/examples/plugins/pi-example-plugin/package.json +0 -10
- package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/examples/plugins/pi-example-plugin/src/session.ts +0 -23
- package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +0 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +0 -4
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +0 -1
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +0 -201
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +0 -62
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +0 -158
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +0 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +0 -16
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +0 -84
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +0 -8
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +0 -11
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +0 -10
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +0 -4
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +0 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +0 -8
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +0 -8
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +0 -18
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +0 -12
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +0 -9
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +0 -8
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +0 -18
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +0 -3
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +0 -8
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +0 -10
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +0 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +0 -9
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +0 -7
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +0 -3
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +0 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +0 -1
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +0 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +0 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +0 -4
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +0 -5
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +0 -69
- package/node_modules/@earendil-works/chord/README.md +0 -205
- package/node_modules/@earendil-works/chord/dist/api.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/api.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/api.js +0 -72
- package/node_modules/@earendil-works/chord/dist/api.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts +0 -6
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/bundler.js +0 -3
- package/node_modules/@earendil-works/chord/dist/bundler.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts +0 -24
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/context/index.js +0 -97
- package/node_modules/@earendil-works/chord/dist/context/index.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +0 -119
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/delta/index.js +0 -1209
- package/node_modules/@earendil-works/chord/dist/delta/index.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +0 -12
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/host.js +0 -762
- package/node_modules/@earendil-works/chord/dist/facets/host.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +0 -3
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/facets/loader.js +0 -5
- package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/index.d.ts +0 -11
- package/node_modules/@earendil-works/chord/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/index.js +0 -10
- package/node_modules/@earendil-works/chord/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/json.d.ts +0 -4
- package/node_modules/@earendil-works/chord/dist/json.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/json.js +0 -57
- package/node_modules/@earendil-works/chord/dist/json.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +0 -30
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +0 -377
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +0 -26
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/bundle.js +0 -183
- package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +0 -36
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/manifest.js +0 -6
- package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node/package.js +0 -199
- package/node_modules/@earendil-works/chord/dist/node/package.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node.d.ts +0 -5
- package/node_modules/@earendil-works/chord/dist/node.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/node.js +0 -3
- package/node_modules/@earendil-works/chord/dist/node.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +0 -11
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/consumer.js +0 -535
- package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +0 -8
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/errors.js +0 -21
- package/node_modules/@earendil-works/chord/dist/services/errors.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/handle.js +0 -99
- package/node_modules/@earendil-works/chord/dist/services/handle.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +0 -25
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/instances.js +0 -137
- package/node_modules/@earendil-works/chord/dist/services/instances.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +0 -5
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/loopback.js +0 -15
- package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +0 -37
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/provider.js +0 -472
- package/node_modules/@earendil-works/chord/dist/services/provider.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +0 -15
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js +0 -115
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +0 -11
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js +0 -10
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts +0 -23
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/state.js +0 -124
- package/node_modules/@earendil-works/chord/dist/services/state.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +0 -60
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/services/wire.js +0 -173
- package/node_modules/@earendil-works/chord/dist/services/wire.js.map +0 -1
- package/node_modules/@earendil-works/chord/dist/types.d.ts +0 -203
- package/node_modules/@earendil-works/chord/dist/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/chord/dist/types.js +0 -2
- package/node_modules/@earendil-works/chord/dist/types.js.map +0 -1
- package/node_modules/@earendil-works/chord/package.json +0 -73
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts +0 -9
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +0 -35
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +0 -9
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +0 -13
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +0 -82
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +0 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +0 -48
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts +0 -67
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +0 -121
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +0 -38
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +0 -404
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts +0 -28
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +0 -173
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts +0 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +0 -133
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts +0 -15
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +0 -179
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts +0 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +0 -205
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts +0 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +0 -140
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts +0 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +0 -85
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts +0 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +0 -394
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +0 -34
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts +0 -32
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +0 -929
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts +0 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +0 -49
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts +0 -14
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +0 -244
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts +0 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +0 -449
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts +0 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +0 -93
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +0 -59
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +0 -302
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts +0 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +0 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +0 -118
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +0 -1559
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts +0 -15
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +0 -66
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +0 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +0 -240
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts +0 -24
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +0 -117
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts +0 -21
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +0 -72
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +0 -105
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +0 -50
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +0 -53
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +0 -57
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +0 -21
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +0 -55
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +0 -16
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +0 -79
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts +0 -39
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +0 -269
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts +0 -38
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +0 -266
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts +0 -14
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +0 -86
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts +0 -44
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +0 -454
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +0 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +0 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts +0 -12
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +0 -24
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +0 -127
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts +0 -25
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +0 -114
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts +0 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +0 -809
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +0 -600
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts +0 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +0 -103
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts +0 -11
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +0 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts +0 -20
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +0 -40
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +0 -95
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +0 -81
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts +0 -24
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +0 -79
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +0 -31
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +0 -217
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +0 -33
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts +0 -77
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js +0 -72
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +0 -32
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +0 -62
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts +0 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js +0 -22
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +0 -77
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +0 -427
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +0 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +0 -93
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +0 -12
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +0 -19
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +0 -18
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +0 -42
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/native/clipboard.h +0 -170
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +0 -93
- package/node_modules/@earendil-works/pi-tui/native/linux/README.md +0 -23
- package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +0 -65
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +0 -70
- package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +0 -274
- package/node_modules/@earendil-works/pi-tui/native/napi.h +0 -89
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +0 -241
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/LICENSE +0 -201
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/README.md +0 -115
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-cjs/index.js +0 -96
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort-handler.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/auth.js +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/index.js +0 -2
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/checksum.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/client.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/command.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/config.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/manager.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/pool.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/crypto.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/encode.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoint.js +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointParameterInstructions.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/shared.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/eventStream.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/checksum.js +0 -38
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/index.js +0 -2
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/retry.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/feature-ids.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http.js +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/identity.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/index.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/index.js +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/logger.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/metrics.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/middleware.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/pagination.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/profile.js +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/response.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/retry.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/sentinels.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/static-schemas.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/traits.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/serde.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/shapes.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/signature.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/stream.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transfer.js +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/exact.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/mutable.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/no-undefined.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/type-transform.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/uri.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/util.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/waiter.js +0 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort-handler.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort.d.ts +0 -48
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +0 -49
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +0 -20
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/auth.d.ts +0 -59
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/index.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +0 -37
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/checksum.d.ts +0 -61
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/client.d.ts +0 -57
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/command.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/config.d.ts +0 -15
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/index.d.ts +0 -3
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/manager.d.ts +0 -34
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/pool.d.ts +0 -32
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/crypto.d.ts +0 -58
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +0 -24
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/encode.d.ts +0 -31
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoint.d.ts +0 -77
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointParameterInstructions.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +0 -27
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +0 -10
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +0 -16
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +0 -55
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/eventStream.d.ts +0 -137
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +0 -58
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +0 -32
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +0 -9
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/index.d.ts +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +0 -18
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +0 -35
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/feature-ids.d.ts +0 -16
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +0 -142
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http.d.ts +0 -110
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +0 -31
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/identity.d.ts +0 -15
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/index.d.ts +0 -4
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/index.d.ts +0 -52
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/logger.d.ts +0 -13
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/metrics.d.ts +0 -93
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/middleware.d.ts +0 -541
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/pagination.d.ts +0 -33
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/profile.d.ts +0 -30
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/response.d.ts +0 -40
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/retry.d.ts +0 -162
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +0 -143
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema.d.ts +0 -236
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +0 -65
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +0 -99
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/traits.d.ts +0 -46
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/serde.d.ts +0 -114
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/shapes.d.ts +0 -79
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/signature.d.ts +0 -172
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/stream.d.ts +0 -22
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -54
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transfer.d.ts +0 -42
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +0 -26
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +0 -73
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/exact.d.ts +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +0 -68
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +0 -39
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +0 -45
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +0 -49
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +0 -20
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +0 -59
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +0 -37
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +0 -61
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +0 -57
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +0 -15
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +0 -3
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +0 -34
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +0 -32
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +0 -58
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +0 -40
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +0 -31
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +0 -77
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointParameterInstructions.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +0 -27
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +0 -10
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +0 -16
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +0 -5
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +0 -55
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +0 -137
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +0 -58
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +0 -32
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +0 -9
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +0 -18
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +0 -35
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +0 -16
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +0 -142
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +0 -110
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +0 -31
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +0 -15
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +0 -4
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +0 -52
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +0 -13
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +0 -93
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +0 -541
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +0 -33
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +0 -30
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +0 -40
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +0 -162
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +0 -149
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +0 -251
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +0 -65
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +0 -118
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +0 -46
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +0 -114
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +0 -79
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +0 -172
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +0 -22
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +0 -28
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -54
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -41
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +0 -42
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +0 -26
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +0 -77
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +0 -14
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +0 -6
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +0 -88
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +0 -40
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +0 -17
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +0 -192
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +0 -35
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/uri.d.ts +0 -17
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/util.d.ts +0 -176
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/waiter.d.ts +0 -35
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/package.json +0 -50
- package/node_modules/esbuild/LICENSE.md +0 -21
- package/node_modules/esbuild/README.md +0 -3
- package/node_modules/esbuild/bin/esbuild +0 -223
- package/node_modules/esbuild/install.js +0 -300
- package/node_modules/esbuild/lib/main.d.ts +0 -720
- package/node_modules/esbuild/lib/main.js +0 -2536
- package/node_modules/esbuild/package.json +0 -47
- package/node_modules/typebox/build/schema/intern/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/intern/index.mjs +0 -1
- package/node_modules/typebox/build/schema/intern/intern.d.mts +0 -14
- package/node_modules/typebox/build/schema/intern/intern.mjs +0 -259
- package/vendor/pi-protocol/protocol.d.ts +0 -167
- package/vendor/pi-protocol/protocol.d.ts.map +0 -1
- package/vendor/pi-protocol/protocol.js +0 -85
- package/vendor/pi-protocol/protocol.js.map +0 -1
|
@@ -1,297 +1,172 @@
|
|
|
1
|
-
import { uuidv7 } from "@earendil-works/pi-ai
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
createdAt: header.createdAt,
|
|
13
|
-
storageVersion: header.storageVersion,
|
|
14
|
-
cwd: header.cwd,
|
|
15
|
-
path,
|
|
16
|
-
modifiedAt,
|
|
17
|
-
...(header.parentSessionId === undefined ? {} : { parentSessionId: header.parentSessionId }),
|
|
18
|
-
...(header.legacyParentSessionPath === undefined
|
|
19
|
-
? {}
|
|
20
|
-
: { legacyParentSessionPath: header.legacyParentSessionPath }),
|
|
21
|
-
};
|
|
1
|
+
import { uuidv7 } from "@earendil-works/pi-ai";
|
|
2
|
+
import { assertJsonSerializable, Session } from "../session.js";
|
|
3
|
+
import { SessionError } from "../types.js";
|
|
4
|
+
import { metadataFromHeader, parseHeader } from "./codec.js";
|
|
5
|
+
import { fileResult } from "./errors.js";
|
|
6
|
+
import { JsonlSessionStorage } from "./storage.js";
|
|
7
|
+
const SESSION_ID_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;
|
|
8
|
+
function validateSessionId(id) {
|
|
9
|
+
if (!SESSION_ID_PATTERN.test(id)) {
|
|
10
|
+
throw new SessionError("invalid_payload", "Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character");
|
|
11
|
+
}
|
|
22
12
|
}
|
|
23
|
-
function
|
|
13
|
+
function jsonlSessionDirectoryName(cwd) {
|
|
24
14
|
return `--${cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
25
15
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
return `${timestamp}_${encodeURIComponent(id)}.jsonl`;
|
|
16
|
+
async function jsonlSessionsRoot(options) {
|
|
17
|
+
return fileResult(await options.fs.absolutePath(options.sessionsRoot), `Failed to resolve sessions root ${options.sessionsRoot}`);
|
|
29
18
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const header = {
|
|
53
|
-
v: JSONL_FORMAT_VERSION,
|
|
54
|
-
kind: "header",
|
|
55
|
-
id,
|
|
56
|
-
storageVersion: JSONL_STORAGE_VERSION,
|
|
57
|
-
createdAt,
|
|
58
|
-
cwd,
|
|
59
|
-
...(options.parentSessionId === undefined ? {} : { parentSessionId: options.parentSessionId }),
|
|
60
|
-
};
|
|
61
|
-
storage = await JsonlStorage.create({ fileSystem: this.fileSystem, path, now: this.now }, header, [], context);
|
|
62
|
-
const info = fileValue(await this.fileSystem.fileInfo(path, context), `Failed to read session ${path}`);
|
|
63
|
-
return this.publishOpenSession(metadataFromHeader(header, path, info.mtimeMs), storage, key);
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
await storage?.close(context).catch(() => undefined);
|
|
67
|
-
if (path !== undefined)
|
|
68
|
-
await this.fileSystem.remove(path, { force: true }, context);
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
this.pendingCreates.delete(key);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async open(metadata, context) {
|
|
76
|
-
this.assertOpen();
|
|
77
|
-
const key = this.sessionKey(metadata.cwd, metadata.id);
|
|
78
|
-
if (this.openSessions.has(key))
|
|
79
|
-
throw new Error(`Session is already open: ${metadata.id}`);
|
|
80
|
-
let storage;
|
|
81
|
-
try {
|
|
82
|
-
storage = await this.loadStorage(metadata, context);
|
|
83
|
-
return this.publishOpenSession(metadata, storage, key);
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
await storage?.close(context);
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async list(options, context) {
|
|
91
|
-
options ??= {};
|
|
92
|
-
this.assertOpen();
|
|
93
|
-
const cwd = options.cwd === undefined
|
|
94
|
-
? undefined
|
|
95
|
-
: fileValue(await this.fileSystem.absolutePath(options.cwd, context), `Failed to resolve session cwd ${options.cwd}`);
|
|
96
|
-
const root = await this.root(context);
|
|
97
|
-
if (!fileValue(await this.fileSystem.exists(root, context), `Failed to check sessions root ${root}`))
|
|
98
|
-
return [];
|
|
99
|
-
const directories = cwd === undefined ? await this.sessionDirectories(root, context) : [await this.sessionDirectory(cwd, context)];
|
|
100
|
-
const metadata = [];
|
|
101
|
-
for (const directory of directories)
|
|
102
|
-
metadata.push(...(await this.listDirectory(directory, cwd, context)));
|
|
103
|
-
return metadata.sort((left, right) => right.createdAt - left.createdAt || left.id.localeCompare(right.id) || left.cwd.localeCompare(right.cwd));
|
|
104
|
-
}
|
|
105
|
-
async delete(metadata, context) {
|
|
106
|
-
this.assertOpen();
|
|
107
|
-
const key = this.sessionKey(metadata.cwd, metadata.id);
|
|
108
|
-
if (this.openSessions.has(key))
|
|
109
|
-
throw new Error(`Session is open: ${metadata.id}`);
|
|
110
|
-
if (!fileValue(await this.fileSystem.exists(metadata.path, context), `Failed to check session ${metadata.path}`)) {
|
|
111
|
-
throw new Error(`Session file does not exist: ${metadata.path}`);
|
|
112
|
-
}
|
|
113
|
-
fileValue(await this.fileSystem.remove(metadata.path, undefined, context), `Failed to delete session ${metadata.path}`);
|
|
114
|
-
}
|
|
115
|
-
async fork(source, options, context) {
|
|
116
|
-
this.assertOpen();
|
|
117
|
-
const createdAt = this.now();
|
|
118
|
-
const cwd = source.cwd;
|
|
119
|
-
const id = options.id ?? uuidv7(createdAt);
|
|
120
|
-
const destinationKey = this.sessionKey(cwd, id);
|
|
121
|
-
if (this.openSessions.has(destinationKey) || this.pendingCreates.has(destinationKey)) {
|
|
122
|
-
throw new Error(`Session already exists: ${id}`);
|
|
123
|
-
}
|
|
124
|
-
this.pendingCreates.add(destinationKey);
|
|
125
|
-
const sourceStorage = this.openSessions.get(this.sessionKey(source.cwd, source.id));
|
|
126
|
-
let path;
|
|
127
|
-
let storage;
|
|
128
|
-
try {
|
|
129
|
-
const input = await this.resolveForkInput(source, sourceStorage, context);
|
|
130
|
-
path = await this.resolveNewSessionPath(cwd, createdAt, id, context);
|
|
131
|
-
const header = {
|
|
132
|
-
v: JSONL_FORMAT_VERSION,
|
|
133
|
-
kind: "header",
|
|
134
|
-
id,
|
|
135
|
-
storageVersion: JSONL_STORAGE_VERSION,
|
|
136
|
-
createdAt,
|
|
137
|
-
cwd,
|
|
138
|
-
parentSessionId: source.id,
|
|
139
|
-
};
|
|
140
|
-
await runJsonlFork({
|
|
141
|
-
input,
|
|
142
|
-
fileSystem: this.fileSystem,
|
|
143
|
-
destinationPath: path,
|
|
144
|
-
destinationHeader: header,
|
|
145
|
-
fork: options,
|
|
146
|
-
}, context);
|
|
147
|
-
storage = await JsonlStorage.open({ fileSystem: this.fileSystem, path, now: this.now }, context);
|
|
148
|
-
const info = fileValue(await this.fileSystem.fileInfo(path, context), `Failed to read session ${path}`);
|
|
149
|
-
return this.publishOpenSession(metadataFromHeader(header, path, info.mtimeMs), storage, destinationKey);
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
await storage?.close(context).catch(() => undefined);
|
|
153
|
-
if (path !== undefined)
|
|
154
|
-
await this.fileSystem.remove(path, { force: true }, context);
|
|
155
|
-
throw error;
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
this.pendingCreates.delete(destinationKey);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
close(_context) {
|
|
162
|
-
if (this.closePromise !== undefined)
|
|
163
|
-
return this.closePromise;
|
|
164
|
-
this.closed = true;
|
|
165
|
-
// TODO: Define ownership semantics before deciding whether repository close should close session handles.
|
|
166
|
-
this.closePromise = Promise.resolve();
|
|
167
|
-
return this.closePromise;
|
|
168
|
-
}
|
|
169
|
-
async resolveCreateDestination(cwdInput, id, createdAt, context) {
|
|
170
|
-
const destinationId = id ?? uuidv7(createdAt);
|
|
171
|
-
const cwd = fileValue(await this.fileSystem.absolutePath(cwdInput, context), `Failed to resolve session cwd ${cwdInput}`);
|
|
172
|
-
return { cwd, id: destinationId };
|
|
173
|
-
}
|
|
174
|
-
async listDirectory(directory, cwd, context) {
|
|
175
|
-
if (!fileValue(await this.fileSystem.exists(directory, context), `Failed to check sessions directory ${directory}`)) {
|
|
176
|
-
return [];
|
|
177
|
-
}
|
|
178
|
-
const files = fileValue(await this.fileSystem.listDir(directory, context), `Failed to list sessions directory ${directory}`).filter((file) => file.kind !== "directory" && file.name.endsWith(".jsonl"));
|
|
179
|
-
const metadata = [];
|
|
19
|
+
async function jsonlSessionDirectory(fs, sessionsRoot, cwd) {
|
|
20
|
+
return fileResult(await fs.joinPath([sessionsRoot, jsonlSessionDirectoryName(cwd)]), `Failed to resolve sessions directory for ${cwd}`);
|
|
21
|
+
}
|
|
22
|
+
async function jsonlSessionDirectories(options, cwd) {
|
|
23
|
+
const sessionsRoot = await jsonlSessionsRoot(options);
|
|
24
|
+
if (cwd !== undefined) {
|
|
25
|
+
const resolvedCwd = fileResult(await options.fs.absolutePath(cwd), `Failed to resolve session cwd ${cwd}`);
|
|
26
|
+
const directory = await jsonlSessionDirectory(options.fs, sessionsRoot, resolvedCwd);
|
|
27
|
+
return fileResult(await options.fs.exists(directory), `Failed to check sessions directory ${directory}`)
|
|
28
|
+
? [directory]
|
|
29
|
+
: [];
|
|
30
|
+
}
|
|
31
|
+
if (!fileResult(await options.fs.exists(sessionsRoot), `Failed to check sessions directory ${sessionsRoot}`))
|
|
32
|
+
return [];
|
|
33
|
+
return fileResult(await options.fs.listDir(sessionsRoot), `Failed to list sessions directory ${sessionsRoot}`)
|
|
34
|
+
.filter((entry) => entry.kind === "directory" || entry.kind === "symlink")
|
|
35
|
+
.map((entry) => entry.path);
|
|
36
|
+
}
|
|
37
|
+
export async function listJsonlSessionMetadata(options, query = {}) {
|
|
38
|
+
const metadata = [];
|
|
39
|
+
for (const directory of await jsonlSessionDirectories(options, query.cwd)) {
|
|
40
|
+
const files = fileResult(await options.fs.listDir(directory), `Failed to list sessions directory ${directory}`).filter((entry) => entry.kind !== "directory" && entry.name.endsWith(".jsonl"));
|
|
180
41
|
for (const file of files) {
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
42
|
+
const [firstLine] = fileResult(await options.fs.readTextLines(file.path, { maxLines: 1 }), `Failed to read session header ${file.path}`);
|
|
43
|
+
if (!firstLine)
|
|
183
44
|
continue;
|
|
184
|
-
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return metadata;
|
|
189
|
-
}
|
|
190
|
-
async readSessionMetadata(file, context) {
|
|
191
|
-
const lines = fileValue(await this.fileSystem.readTextLines(file.path, { maxLines: 1 }, context), `Failed to read session header ${file.path}`);
|
|
192
|
-
if (lines[0] === undefined)
|
|
193
|
-
return undefined;
|
|
194
|
-
const parsedHeader = parseJsonlSessionHeader(lines[0]);
|
|
195
|
-
if (!parsedHeader.ok)
|
|
196
|
-
return undefined;
|
|
197
|
-
if (parsedHeader.value.format === "v3-legacy") {
|
|
198
|
-
const metadata = await metadataFromLegacyV3Header(this.fileSystem, parsedHeader.value.header, context);
|
|
199
|
-
return { ...metadata, path: file.path, modifiedAt: file.mtimeMs };
|
|
45
|
+
const headerResult = parseHeader(firstLine);
|
|
46
|
+
if (!headerResult.ok)
|
|
47
|
+
continue;
|
|
48
|
+
metadata.push(metadataFromHeader(headerResult.value, file.path, file.mtimeMs));
|
|
200
49
|
}
|
|
201
|
-
return metadataFromHeader(parsedHeader.value.header, file.path, file.mtimeMs);
|
|
202
|
-
}
|
|
203
|
-
async sessionDirectories(root, context) {
|
|
204
|
-
return fileValue(await this.fileSystem.listDir(root, context), `Failed to list sessions root ${root}`)
|
|
205
|
-
.filter((entry) => entry.kind === "directory")
|
|
206
|
-
.map((entry) => entry.path);
|
|
207
|
-
}
|
|
208
|
-
async sessionDirectory(cwd, context) {
|
|
209
|
-
return fileValue(await this.fileSystem.joinPath([await this.root(context), sessionDirectoryName(cwd)], context), `Failed to resolve sessions directory for ${cwd}`);
|
|
210
|
-
}
|
|
211
|
-
async resolveNewSessionPath(cwd, createdAt, id, context) {
|
|
212
|
-
const directory = await this.sessionDirectory(cwd, context);
|
|
213
|
-
await this.assertSessionIdAvailable(directory, id, context);
|
|
214
|
-
fileValue(await this.fileSystem.createDir(directory, undefined, context), `Failed to create sessions directory ${directory}`);
|
|
215
|
-
return fileValue(await this.fileSystem.joinPath([directory, sessionFileName(createdAt, id)], context), `Failed to resolve path for session ${id}`);
|
|
216
50
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (idExists)
|
|
223
|
-
throw new Error(`Session already exists: ${id}`);
|
|
51
|
+
return metadata.sort((left, right) => right.modifiedAt - left.modifiedAt);
|
|
52
|
+
}
|
|
53
|
+
export async function loadJsonlSessionStorage(options, metadata) {
|
|
54
|
+
if (!fileResult(await options.fs.exists(metadata.path), `Failed to check session ${metadata.path}`)) {
|
|
55
|
+
throw new SessionError("not_found", `Session not found: ${metadata.id}`);
|
|
224
56
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
const nextSeq = await storage.captureForkNextSeq(context);
|
|
231
|
-
return { kind: "open", metadata: source, nextSeq };
|
|
232
|
-
}
|
|
233
|
-
if (await this.isLegacyV3ForkSource(source, context)) {
|
|
234
|
-
const normalized = await LegacyV3Source.read(this.fileSystem, source.path, context);
|
|
235
|
-
if (normalized.header.id !== source.id || normalized.header.cwd !== source.cwd) {
|
|
236
|
-
throw new Error(`Session identity does not match header: ${source.id}`);
|
|
237
|
-
}
|
|
238
|
-
return { kind: "legacy-v3", normalized };
|
|
239
|
-
}
|
|
240
|
-
return { kind: "closed", metadata: source };
|
|
57
|
+
const storage = await JsonlSessionStorage.load(options.fs, metadata.path);
|
|
58
|
+
const loadedMetadata = await storage.getMetadata();
|
|
59
|
+
if (loadedMetadata.id !== metadata.id) {
|
|
60
|
+
throw new SessionError("invalid_entry", `Session id does not match header: ${metadata.id}`);
|
|
241
61
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
62
|
+
return storage;
|
|
63
|
+
}
|
|
64
|
+
function sessionFileName(createdAt, id) {
|
|
65
|
+
const timestamp = new Date(createdAt).toISOString().replace(/[:.]/g, "-");
|
|
66
|
+
return `${timestamp}_${id}.jsonl`;
|
|
67
|
+
}
|
|
68
|
+
export class JsonlSessionRepo {
|
|
69
|
+
constructor(options) {
|
|
70
|
+
this.activeCreateDestinations = new Set();
|
|
71
|
+
this.fs = options.fs;
|
|
72
|
+
this.sessionsRootInput = options.sessionsRoot;
|
|
248
73
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (this.openSessions.get(key) === storage)
|
|
255
|
-
this.openSessions.delete(key);
|
|
256
|
-
},
|
|
74
|
+
async create(options) {
|
|
75
|
+
const destination = await this.resolveCreateDestination(options);
|
|
76
|
+
return this.claimCreateDestination(destination, async () => {
|
|
77
|
+
const { header, path } = await this.prepareCreate(destination, options);
|
|
78
|
+
return new Session(await JsonlSessionStorage.create(this.fs, path, header));
|
|
257
79
|
});
|
|
258
|
-
this.openSessions.set(key, storage);
|
|
259
|
-
return session;
|
|
260
80
|
}
|
|
261
|
-
|
|
262
|
-
return
|
|
81
|
+
async open(metadata) {
|
|
82
|
+
return new Session(await this.loadStorage(metadata));
|
|
83
|
+
}
|
|
84
|
+
async list(options = {}) {
|
|
85
|
+
return this.listDirect(options);
|
|
86
|
+
}
|
|
87
|
+
async delete(metadata) {
|
|
88
|
+
fileResult(await this.fs.remove(metadata.path, { force: true }), `Failed to delete session ${metadata.path}`);
|
|
89
|
+
}
|
|
90
|
+
async fork(source, options) {
|
|
91
|
+
const sourceStorage = await this.loadStorage(source);
|
|
92
|
+
const createOptions = {
|
|
93
|
+
...options,
|
|
94
|
+
parentSessionId: options.parentSessionId ?? source.id,
|
|
95
|
+
};
|
|
96
|
+
const destination = await this.resolveCreateDestination(createOptions);
|
|
97
|
+
return this.claimCreateDestination(destination, async () => {
|
|
98
|
+
const { header, path } = await this.prepareCreate(destination, createOptions);
|
|
99
|
+
return new Session(await sourceStorage.fork(path, header, options));
|
|
100
|
+
});
|
|
263
101
|
}
|
|
264
|
-
async loadStorage(metadata
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
102
|
+
async loadStorage(metadata) {
|
|
103
|
+
return loadJsonlSessionStorage({ fs: this.fs, sessionsRoot: this.sessionsRootInput }, metadata);
|
|
104
|
+
}
|
|
105
|
+
async resolveCreateDestination(options) {
|
|
106
|
+
const id = options.id ?? uuidv7();
|
|
107
|
+
validateSessionId(id);
|
|
108
|
+
const cwd = fileResult(await this.fs.absolutePath(options.cwd), `Failed to resolve session cwd ${options.cwd}`);
|
|
109
|
+
return { id, cwd };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Prevent same-process create/fork races for one logical destination. The durable filename includes a
|
|
113
|
+
* timestamp, so the async filesystem existence check alone can let two concurrent calls both decide the
|
|
114
|
+
* same {cwd, id} is free and publish duplicate sessions.
|
|
115
|
+
*/
|
|
116
|
+
async claimCreateDestination(destination, operation) {
|
|
117
|
+
const key = `${destination.cwd}\0${destination.id}`;
|
|
118
|
+
if (this.activeCreateDestinations.has(key)) {
|
|
119
|
+
throw new SessionError("already_exists", `Session already exists: ${destination.id}`);
|
|
120
|
+
}
|
|
121
|
+
this.activeCreateDestinations.add(key);
|
|
273
122
|
try {
|
|
274
|
-
|
|
275
|
-
throw new Error(`Session identity does not match header: ${metadata.id}`);
|
|
276
|
-
}
|
|
277
|
-
if (storage.header.storageVersion !== JSONL_STORAGE_VERSION) {
|
|
278
|
-
throw new Error(`Session ${metadata.id} uses unsupported storage version ${storage.header.storageVersion}`);
|
|
279
|
-
}
|
|
280
|
-
return storage;
|
|
281
|
-
}
|
|
282
|
-
catch (error) {
|
|
283
|
-
await storage.close(context);
|
|
284
|
-
throw error;
|
|
123
|
+
return await operation();
|
|
285
124
|
}
|
|
125
|
+
finally {
|
|
126
|
+
this.activeCreateDestinations.delete(key);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async prepareCreate(destination, options) {
|
|
130
|
+
const { id, cwd } = destination;
|
|
131
|
+
if (await this.sessionIdExists(id, cwd)) {
|
|
132
|
+
throw new SessionError("already_exists", `Session already exists: ${id}`);
|
|
133
|
+
}
|
|
134
|
+
const createdAt = Date.now();
|
|
135
|
+
const sessionDirectory = await this.sessionDirectory(cwd);
|
|
136
|
+
const path = fileResult(await this.fs.joinPath([sessionDirectory, sessionFileName(createdAt, id)]), `Failed to resolve path for session ${id}`);
|
|
137
|
+
if (options.metadata !== undefined)
|
|
138
|
+
assertJsonSerializable(options.metadata);
|
|
139
|
+
const header = {
|
|
140
|
+
kind: "header",
|
|
141
|
+
version: 4,
|
|
142
|
+
id,
|
|
143
|
+
createdAt,
|
|
144
|
+
cwd,
|
|
145
|
+
parentSessionId: options.parentSessionId,
|
|
146
|
+
metadata: options.metadata,
|
|
147
|
+
};
|
|
148
|
+
fileResult(await this.fs.createDir(sessionDirectory, { recursive: true }), `Failed to create sessions directory`);
|
|
149
|
+
return { header, path };
|
|
150
|
+
}
|
|
151
|
+
async listDirect(options) {
|
|
152
|
+
return listJsonlSessionMetadata({ fs: this.fs, sessionsRoot: this.sessionsRootInput }, options);
|
|
153
|
+
}
|
|
154
|
+
async sessionIdExists(id, cwd) {
|
|
155
|
+
const suffix = `_${id}.jsonl`;
|
|
156
|
+
const directory = await this.sessionDirectory(cwd);
|
|
157
|
+
if (!fileResult(await this.fs.exists(directory), `Failed to check sessions directory ${directory}`))
|
|
158
|
+
return false;
|
|
159
|
+
const files = fileResult(await this.fs.listDir(directory), `Failed to list sessions directory ${directory}`);
|
|
160
|
+
return files.some((entry) => entry.kind !== "directory" && entry.name.endsWith(suffix));
|
|
286
161
|
}
|
|
287
|
-
|
|
288
|
-
return this.
|
|
289
|
-
.absolutePath(this.sessionsRootInput, context)
|
|
290
|
-
.then((result) => fileValue(result, `Failed to resolve sessions root ${this.sessionsRootInput}`));
|
|
162
|
+
async sessionDirectory(cwd) {
|
|
163
|
+
return fileResult(await this.fs.joinPath([await this.root(), jsonlSessionDirectoryName(cwd)]), `Failed to resolve sessions directory for ${cwd}`);
|
|
291
164
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
165
|
+
root() {
|
|
166
|
+
this.rootPromise ??= this.fs
|
|
167
|
+
.absolutePath(this.sessionsRootInput)
|
|
168
|
+
.then((result) => fileResult(result, `Failed to resolve sessions root ${this.sessionsRootInput}`));
|
|
169
|
+
return this.rootPromise;
|
|
295
170
|
}
|
|
296
171
|
}
|
|
297
172
|
//# sourceMappingURL=repo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/repo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAuB,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,oBAAoB,EACpB,qBAAqB,GAMrB,MAAM,YAAY,CAAC;AAEpB,SAAS,kBAAkB,CAAC,MAA0B,EAAE,IAAY,EAAE,UAAkB;IACvF,OAAO;QACN,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;Q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D","sourcesContent":["import { uuidv7 } from \"@earendil-works/pi-ai/utils/uuid\";\nimport type { Context } from \"../../context.ts\";\nimport type { FileInfo, FileSystem } from \"../../types.ts\";\nimport { StorageBackedSession } from \"../session.ts\";\nimport type { ForkOptions, Session, SessionRepo } from \"../types.ts\";\nimport { parseJsonlSessionHeader } from \"./codec.ts\";\nimport { type JsonlForkInput, runJsonlFork } from \"./fork.ts\";\nimport { fileValue } from \"./io.ts\";\nimport { LegacyV3Source, metadataFromLegacyV3Header } from \"./legacy-v3.ts\";\nimport { JsonlStorage } from \"./storage.ts\";\nimport {\n\tJSONL_FORMAT_VERSION,\n\tJSONL_STORAGE_VERSION,\n\ttype JsonlSessionCreateOptions,\n\ttype JsonlSessionListOptions,\n\ttype JsonlSessionMetadata,\n\ttype JsonlSessionRepoOptions,\n\ttype JsonlStorageHeader,\n} from \"./types.ts\";\n\nfunction metadataFromHeader(header: JsonlStorageHeader, path: string, modifiedAt: number): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.createdAt,\n\t\tstorageVersion: header.storageVersion,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tmodifiedAt,\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};\n}\n\nfunction sessionDirectoryName(cwd: string): string {\n\treturn `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n}\n\nfunction sessionFileName(createdAt: number, id: string): string {\n\tconst timestamp = new Date(createdAt).toISOString().replace(/[:.]/g, \"-\");\n\treturn `${timestamp}_${encodeURIComponent(id)}.jsonl`;\n}\n\n/** File-backed format-4 session repository lifecycle. */\nexport class JsonlSessionRepo\n\timplements SessionRepo<JsonlSessionMetadata, JsonlSessionCreateOptions, JsonlSessionListOptions>\n{\n\tprivate readonly fileSystem: FileSystem;\n\tprivate readonly sessionsRootInput: string;\n\tprivate readonly now: () => number;\n\tprivate readonly openSessions = new Map<string, JsonlStorage>();\n\tprivate readonly pendingCreates = new Set<string>();\n\tprivate closed = false;\n\tprivate closePromise: Promise<void> | undefined;\n\n\tconstructor(options: JsonlSessionRepoOptions) {\n\t\tthis.fileSystem = options.fileSystem;\n\t\tthis.sessionsRootInput = options.sessionsRoot;\n\t\tthis.now = options.now ?? Date.now;\n\t}\n\n\tasync create(options: JsonlSessionCreateOptions, context: Context): Promise<Session<JsonlSessionMetadata>> {\n\t\tthis.assertOpen();\n\t\tconst createdAt = this.now();\n\t\tconst { cwd, id } = await this.resolveCreateDestination(options.cwd, options.id, createdAt, context);\n\t\tconst key = this.sessionKey(cwd, id);\n\t\tif (this.openSessions.has(key) || this.pendingCreates.has(key)) throw new Error(`Session already exists: ${id}`);\n\t\tthis.pendingCreates.add(key);\n\t\tlet path: string | undefined;\n\t\tlet storage: JsonlStorage | undefined;\n\t\ttry {\n\t\t\tpath = await this.resolveNewSessionPath(cwd, createdAt, id, context);\n\t\t\tconst header: JsonlStorageHeader = {\n\t\t\t\tv: JSONL_FORMAT_VERSION,\n\t\t\t\tkind: \"header\",\n\t\t\t\tid,\n\t\t\t\tstorageVersion: JSONL_STORAGE_VERSION,\n\t\t\t\tcreatedAt,\n\t\t\t\tcwd,\n\t\t\t\t...(options.parentSessionId === undefined ? {} : { parentSessionId: options.parentSessionId }),\n\t\t\t};\n\t\t\tstorage = await JsonlStorage.create({ fileSystem: this.fileSystem, path, now: this.now }, header, [], context);\n\t\t\tconst info = fileValue(await this.fileSystem.fileInfo(path, context), `Failed to read session ${path}`);\n\t\t\treturn this.publishOpenSession(metadataFromHeader(header, path, info.mtimeMs), storage, key);\n\t\t} catch (error) {\n\t\t\tawait storage?.close(context).catch(() => undefined);\n\t\t\tif (path !== undefined) await this.fileSystem.remove(path, { force: true }, context);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis.pendingCreates.delete(key);\n\t\t}\n\t}\n\n\tasync open(metadata: JsonlSessionMetadata, context: Context): Promise<Session<JsonlSessionMetadata>> {\n\t\tthis.assertOpen();\n\t\tconst key = this.sessionKey(metadata.cwd, metadata.id);\n\t\tif (this.openSessions.has(key)) throw new Error(`Session is already open: ${metadata.id}`);\n\t\tlet storage: JsonlStorage | undefined;\n\t\ttry {\n\t\t\tstorage = await this.loadStorage(metadata, context);\n\t\t\treturn this.publishOpenSession(metadata, storage, key);\n\t\t} catch (error) {\n\t\t\tawait storage?.close(context);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync list(options: JsonlSessionListOptions | undefined, context: Context): Promise<JsonlSessionMetadata[]> {\n\t\toptions ??= {};\n\t\tthis.assertOpen();\n\t\tconst cwd =\n\t\t\toptions.cwd === undefined\n\t\t\t\t? undefined\n\t\t\t\t: fileValue(\n\t\t\t\t\t\tawait this.fileSystem.absolutePath(options.cwd, context),\n\t\t\t\t\t\t`Failed to resolve session cwd ${options.cwd}`,\n\t\t\t\t\t);\n\t\tconst root = await this.root(context);\n\t\tif (!fileValue(await this.fileSystem.exists(root, context), `Failed to check sessions root ${root}`)) return [];\n\t\tconst directories =\n\t\t\tcwd === undefined ? await this.sessionDirectories(root, context) : [await this.sessionDirectory(cwd, context)];\n\t\tconst metadata: JsonlSessionMetadata[] = [];\n\t\tfor (const directory of directories) metadata.push(...(await this.listDirectory(directory, cwd, context)));\n\t\treturn metadata.sort(\n\t\t\t(left, right) =>\n\t\t\t\tright.createdAt - left.createdAt || left.id.localeCompare(right.id) || left.cwd.localeCompare(right.cwd),\n\t\t);\n\t}\n\n\tasync delete(metadata: JsonlSessionMetadata, context: Context): Promise<void> {\n\t\tthis.assertOpen();\n\t\tconst key = this.sessionKey(metadata.cwd, metadata.id);\n\t\tif (this.openSessions.has(key)) throw new Error(`Session is open: ${metadata.id}`);\n\t\tif (\n\t\t\t!fileValue(await this.fileSystem.exists(metadata.path, context), `Failed to check session ${metadata.path}`)\n\t\t) {\n\t\t\tthrow new Error(`Session file does not exist: ${metadata.path}`);\n\t\t}\n\t\tfileValue(\n\t\t\tawait this.fileSystem.remove(metadata.path, undefined, context),\n\t\t\t`Failed to delete session ${metadata.path}`,\n\t\t);\n\t}\n\n\tasync fork(\n\t\tsource: JsonlSessionMetadata,\n\t\toptions: ForkOptions,\n\t\tcontext: Context,\n\t): Promise<Session<JsonlSessionMetadata>> {\n\t\tthis.assertOpen();\n\t\tconst createdAt = this.now();\n\t\tconst cwd = source.cwd;\n\t\tconst id = options.id ?? uuidv7(createdAt);\n\t\tconst destinationKey = this.sessionKey(cwd, id);\n\t\tif (this.openSessions.has(destinationKey) || this.pendingCreates.has(destinationKey)) {\n\t\t\tthrow new Error(`Session already exists: ${id}`);\n\t\t}\n\t\tthis.pendingCreates.add(destinationKey);\n\n\t\tconst sourceStorage = this.openSessions.get(this.sessionKey(source.cwd, source.id));\n\t\tlet path: string | undefined;\n\t\tlet storage: JsonlStorage | undefined;\n\t\ttry {\n\t\t\tconst input = await this.resolveForkInput(source, sourceStorage, context);\n\t\t\tpath = await this.resolveNewSessionPath(cwd, createdAt, id, context);\n\t\t\tconst header: Omit<JsonlStorageHeader, \"nextSeq\"> = {\n\t\t\t\tv: JSONL_FORMAT_VERSION,\n\t\t\t\tkind: \"header\",\n\t\t\t\tid,\n\t\t\t\tstorageVersion: JSONL_STORAGE_VERSION,\n\t\t\t\tcreatedAt,\n\t\t\t\tcwd,\n\t\t\t\tparentSessionId: source.id,\n\t\t\t};\n\t\t\tawait runJsonlFork(\n\t\t\t\t{\n\t\t\t\t\tinput,\n\t\t\t\t\tfileSystem: this.fileSystem,\n\t\t\t\t\tdestinationPath: path,\n\t\t\t\t\tdestinationHeader: header,\n\t\t\t\t\tfork: options,\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t);\n\t\t\tstorage = await JsonlStorage.open({ fileSystem: this.fileSystem, path, now: this.now }, context);\n\t\t\tconst info = fileValue(await this.fileSystem.fileInfo(path, context), `Failed to read session ${path}`);\n\t\t\treturn this.publishOpenSession(metadataFromHeader(header, path, info.mtimeMs), storage, destinationKey);\n\t\t} catch (error) {\n\t\t\tawait storage?.close(context).catch(() => undefined);\n\t\t\tif (path !== undefined) await this.fileSystem.remove(path, { force: true }, context);\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis.pendingCreates.delete(destinationKey);\n\t\t}\n\t}\n\n\tclose(_context: Context): Promise<void> {\n\t\tif (this.closePromise !== undefined) return this.closePromise;\n\t\tthis.closed = true;\n\t\t// TODO: Define ownership semantics before deciding whether repository close should close session handles.\n\t\tthis.closePromise = Promise.resolve();\n\t\treturn this.closePromise;\n\t}\n\n\tprivate async resolveCreateDestination(\n\t\tcwdInput: string,\n\t\tid: string | undefined,\n\t\tcreatedAt: number,\n\t\tcontext: Context,\n\t): Promise<{ cwd: string; id: string }> {\n\t\tconst destinationId = id ?? uuidv7(createdAt);\n\t\tconst cwd = fileValue(\n\t\t\tawait this.fileSystem.absolutePath(cwdInput, context),\n\t\t\t`Failed to resolve session cwd ${cwdInput}`,\n\t\t);\n\t\treturn { cwd, id: destinationId };\n\t}\n\n\tprivate async listDirectory(\n\t\tdirectory: string,\n\t\tcwd: string | undefined,\n\t\tcontext: Context,\n\t): Promise<JsonlSessionMetadata[]> {\n\t\tif (\n\t\t\t!fileValue(await this.fileSystem.exists(directory, context), `Failed to check sessions directory ${directory}`)\n\t\t) {\n\t\t\treturn [];\n\t\t}\n\t\tconst files = fileValue(\n\t\t\tawait this.fileSystem.listDir(directory, context),\n\t\t\t`Failed to list sessions directory ${directory}`,\n\t\t).filter((file) => file.kind !== \"directory\" && file.name.endsWith(\".jsonl\"));\n\t\tconst metadata: JsonlSessionMetadata[] = [];\n\t\tfor (const file of files) {\n\t\t\tconst discovered = await this.readSessionMetadata(file, context);\n\t\t\tif (discovered === undefined) continue;\n\t\t\t// Directory encoding is lossy: /a/b and /a-b both map to --a-b--.\n\t\t\tif (cwd === undefined || discovered.cwd === cwd) metadata.push(discovered);\n\t\t}\n\t\treturn metadata;\n\t}\n\n\tprivate async readSessionMetadata(file: FileInfo, context: Context): Promise<JsonlSessionMetadata | undefined> {\n\t\tconst lines = fileValue(\n\t\t\tawait this.fileSystem.readTextLines(file.path, { maxLines: 1 }, context),\n\t\t\t`Failed to read session header ${file.path}`,\n\t\t);\n\t\tif (lines[0] === undefined) return undefined;\n\t\tconst parsedHeader = parseJsonlSessionHeader(lines[0]);\n\t\tif (!parsedHeader.ok) return undefined;\n\t\tif (parsedHeader.value.format === \"v3-legacy\") {\n\t\t\tconst metadata = await metadataFromLegacyV3Header(this.fileSystem, parsedHeader.value.header, context);\n\t\t\treturn { ...metadata, path: file.path, modifiedAt: file.mtimeMs };\n\t\t}\n\t\treturn metadataFromHeader(parsedHeader.value.header, file.path, file.mtimeMs);\n\t}\n\n\tprivate async sessionDirectories(root: string, context: Context): Promise<string[]> {\n\t\treturn fileValue(await this.fileSystem.listDir(root, context), `Failed to list sessions root ${root}`)\n\t\t\t.filter((entry) => entry.kind === \"directory\")\n\t\t\t.map((entry) => entry.path);\n\t}\n\n\tprivate async sessionDirectory(cwd: string, context: Context): Promise<string> {\n\t\treturn fileValue(\n\t\t\tawait this.fileSystem.joinPath([await this.root(context), sessionDirectoryName(cwd)], context),\n\t\t\t`Failed to resolve sessions directory for ${cwd}`,\n\t\t);\n\t}\n\n\tprivate async resolveNewSessionPath(cwd: string, createdAt: number, id: string, context: Context): Promise<string> {\n\t\tconst directory = await this.sessionDirectory(cwd, context);\n\t\tawait this.assertSessionIdAvailable(directory, id, context);\n\t\tfileValue(\n\t\t\tawait this.fileSystem.createDir(directory, undefined, context),\n\t\t\t`Failed to create sessions directory ${directory}`,\n\t\t);\n\t\treturn fileValue(\n\t\t\tawait this.fileSystem.joinPath([directory, sessionFileName(createdAt, id)], context),\n\t\t\t`Failed to resolve path for session ${id}`,\n\t\t);\n\t}\n\n\tprivate async assertSessionIdAvailable(directory: string, id: string, context: Context): Promise<void> {\n\t\tif (\n\t\t\t!fileValue(await this.fileSystem.exists(directory, context), `Failed to check sessions directory ${directory}`)\n\t\t)\n\t\t\treturn;\n\n\t\tconst suffix = `_${encodeURIComponent(id)}.jsonl`;\n\t\tconst idExists = fileValue(\n\t\t\tawait this.fileSystem.listDir(directory, context),\n\t\t\t`Failed to list sessions directory ${directory}`,\n\t\t).some((entry) => entry.kind !== \"directory\" && entry.name.endsWith(suffix));\n\t\tif (idExists) throw new Error(`Session already exists: ${id}`);\n\t}\n\n\tprivate async resolveForkInput(\n\t\tsource: JsonlSessionMetadata,\n\t\tstorage: JsonlStorage | undefined,\n\t\tcontext: Context,\n\t): Promise<JsonlForkInput> {\n\t\tif (storage !== undefined) {\n\t\t\tif (storage.isLegacyV3()) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Cannot fork an open legacy v3 JSONL session; commit a non-empty transaction to upgrade it to format 4 first\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst nextSeq = await storage.captureForkNextSeq(context);\n\t\t\treturn { kind: \"open\", metadata: source, nextSeq };\n\t\t}\n\t\tif (await this.isLegacyV3ForkSource(source, context)) {\n\t\t\tconst normalized = await LegacyV3Source.read(this.fileSystem, source.path, context);\n\t\t\tif (normalized.header.id !== source.id || normalized.header.cwd !== source.cwd) {\n\t\t\t\tthrow new Error(`Session identity does not match header: ${source.id}`);\n\t\t\t}\n\t\t\treturn { kind: \"legacy-v3\", normalized };\n\t\t}\n\t\treturn { kind: \"closed\", metadata: source };\n\t}\n\n\tprivate async isLegacyV3ForkSource(source: JsonlSessionMetadata, context: Context): Promise<boolean> {\n\t\tconst lines = fileValue(\n\t\t\tawait this.fileSystem.readTextLines(source.path, { maxLines: 1 }, context),\n\t\t\t`Failed to read session header ${source.path}`,\n\t\t);\n\t\tif (lines[0] === undefined) return false;\n\t\tconst parsed = parseJsonlSessionHeader(lines[0]);\n\t\treturn parsed.ok && parsed.value.format === \"v3-legacy\";\n\t}\n\n\tprivate publishOpenSession(\n\t\tmetadata: JsonlSessionMetadata,\n\t\tstorage: JsonlStorage,\n\t\tkey: string,\n\t): StorageBackedSession<JsonlSessionMetadata> {\n\t\tif (this.openSessions.has(key)) throw new Error(`Session is already open: ${metadata.id}`);\n\t\tconst session = new StorageBackedSession(metadata, storage, {\n\t\t\tonClose: () => {\n\t\t\t\tif (this.openSessions.get(key) === storage) this.openSessions.delete(key);\n\t\t\t},\n\t\t});\n\t\tthis.openSessions.set(key, storage);\n\t\treturn session;\n\t}\n\n\tprivate sessionKey(cwd: string, id: string): string {\n\t\treturn `${cwd}\\0${id}`;\n\t}\n\n\tprivate async loadStorage(metadata: JsonlSessionMetadata, context: Context): Promise<JsonlStorage> {\n\t\tif (\n\t\t\t!fileValue(await this.fileSystem.exists(metadata.path, context), `Failed to check session ${metadata.path}`)\n\t\t) {\n\t\t\tthrow new Error(`Session file does not exist: ${metadata.path}`);\n\t\t}\n\t\tconst storage = await JsonlStorage.open(\n\t\t\t{\n\t\t\t\tfileSystem: this.fileSystem,\n\t\t\t\tpath: metadata.path,\n\t\t\t\tnow: this.now,\n\t\t\t},\n\t\t\tcontext,\n\t\t);\n\t\ttry {\n\t\t\tif (storage.header.id !== metadata.id || storage.header.cwd !== metadata.cwd) {\n\t\t\t\tthrow new Error(`Session identity does not match header: ${metadata.id}`);\n\t\t\t}\n\t\t\tif (storage.header.storageVersion !== JSONL_STORAGE_VERSION) {\n\t\t\t\tthrow new Error(`Session ${metadata.id} uses unsupported storage version ${storage.header.storageVersion}`);\n\t\t\t}\n\t\t\treturn storage;\n\t\t} catch (error) {\n\t\t\tawait storage.close(context);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate root(context: Context): Promise<string> {\n\t\treturn this.fileSystem\n\t\t\t.absolutePath(this.sessionsRootInput, context)\n\t\t\t.then((result) => fileValue(result, `Failed to resolve sessions root ${this.sessionsRootInput}`));\n\t}\n\n\tprivate assertOpen(): void {\n\t\tif (this.closed) throw new Error(\"JsonlSessionRepo is closed\");\n\t}\n}\n"]}
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G,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,sCAAsC,SAAS,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;QAClH,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,qCAAqC,SAAS,EAAE,CAAC,CAAC;QAC7G,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACzF,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,GAAW;QACzC,OAAO,UAAU,CAChB,MAAM,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,EAC3E,4CAA4C,GAAG,EAAE,CACjD,CAAC;IACH,CAAC;IAEO,IAAI;QACX,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,EAAE;aAC1B,YAAY,CAAC,IAAI,CAAC,iBAAiB,CAAC;aACpC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,mCAAmC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;QACpG,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;CACD","sourcesContent":["import { uuidv7 } from \"@earendil-works/pi-ai\";\nimport { assertJsonSerializable, Session } from \"../session.ts\";\nimport { type ForkOptions, SessionError, type SessionRepo } from \"../types.ts\";\nimport { metadataFromHeader, parseHeader } from \"./codec.ts\";\nimport { fileResult } from \"./errors.ts\";\nimport { JsonlSessionStorage } from \"./storage.ts\";\nimport type {\n\tJsonlSessionCreateOptions,\n\tJsonlSessionListOptions,\n\tJsonlSessionMetadata,\n\tJsonlSessionRepoFileSystem,\n\tJsonlSessionRepoOptions,\n\tJsonlV4Header,\n} from \"./types.ts\";\n\nconst SESSION_ID_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;\n\nfunction validateSessionId(id: string): void {\n\tif (!SESSION_ID_PATTERN.test(id)) {\n\t\tthrow new SessionError(\n\t\t\t\"invalid_payload\",\n\t\t\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\",\n\t\t);\n\t}\n}\n\nfunction jsonlSessionDirectoryName(cwd: string): string {\n\treturn `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n}\n\nasync function jsonlSessionsRoot(options: JsonlSessionRepoOptions): Promise<string> {\n\treturn fileResult(\n\t\tawait options.fs.absolutePath(options.sessionsRoot),\n\t\t`Failed to resolve sessions root ${options.sessionsRoot}`,\n\t);\n}\n\nasync function jsonlSessionDirectory(\n\tfs: JsonlSessionRepoFileSystem,\n\tsessionsRoot: string,\n\tcwd: string,\n): Promise<string> {\n\treturn fileResult(\n\t\tawait fs.joinPath([sessionsRoot, jsonlSessionDirectoryName(cwd)]),\n\t\t`Failed to resolve sessions directory for ${cwd}`,\n\t);\n}\n\nasync function jsonlSessionDirectories(options: JsonlSessionRepoOptions, cwd?: string): Promise<string[]> {\n\tconst sessionsRoot = await jsonlSessionsRoot(options);\n\tif (cwd !== undefined) {\n\t\tconst resolvedCwd = fileResult(await options.fs.absolutePath(cwd), `Failed to resolve session cwd ${cwd}`);\n\t\tconst directory = await jsonlSessionDirectory(options.fs, sessionsRoot, resolvedCwd);\n\t\treturn fileResult(await options.fs.exists(directory), `Failed to check sessions directory ${directory}`)\n\t\t\t? [directory]\n\t\t\t: [];\n\t}\n\tif (!fileResult(await options.fs.exists(sessionsRoot), `Failed to check sessions directory ${sessionsRoot}`))\n\t\treturn [];\n\treturn fileResult(await options.fs.listDir(sessionsRoot), `Failed to list sessions directory ${sessionsRoot}`)\n\t\t.filter((entry) => entry.kind === \"directory\" || entry.kind === \"symlink\")\n\t\t.map((entry) => entry.path);\n}\n\nexport async function listJsonlSessionMetadata(\n\toptions: JsonlSessionRepoOptions,\n\tquery: JsonlSessionListOptions = {},\n): Promise<JsonlSessionMetadata[]> {\n\tconst metadata: JsonlSessionMetadata[] = [];\n\tfor (const directory of await jsonlSessionDirectories(options, query.cwd)) {\n\t\tconst files = fileResult(\n\t\t\tawait options.fs.listDir(directory),\n\t\t\t`Failed to list sessions directory ${directory}`,\n\t\t).filter((entry) => entry.kind !== \"directory\" && entry.name.endsWith(\".jsonl\"));\n\t\tfor (const file of files) {\n\t\t\tconst [firstLine] = fileResult(\n\t\t\t\tawait options.fs.readTextLines(file.path, { maxLines: 1 }),\n\t\t\t\t`Failed to read session header ${file.path}`,\n\t\t\t);\n\t\t\tif (!firstLine) continue;\n\t\t\tconst headerResult = parseHeader(firstLine);\n\t\t\tif (!headerResult.ok) continue;\n\t\t\tmetadata.push(metadataFromHeader(headerResult.value, file.path, file.mtimeMs));\n\t\t}\n\t}\n\treturn metadata.sort((left, right) => right.modifiedAt - left.modifiedAt);\n}\n\nexport async function loadJsonlSessionStorage(\n\toptions: JsonlSessionRepoOptions,\n\tmetadata: JsonlSessionMetadata,\n): Promise<JsonlSessionStorage> {\n\tif (!fileResult(await options.fs.exists(metadata.path), `Failed to check session ${metadata.path}`)) {\n\t\tthrow new SessionError(\"not_found\", `Session not found: ${metadata.id}`);\n\t}\n\tconst storage = await JsonlSessionStorage.load(options.fs, metadata.path);\n\tconst loadedMetadata = await storage.getMetadata();\n\tif (loadedMetadata.id !== metadata.id) {\n\t\tthrow new SessionError(\"invalid_entry\", `Session id does not match header: ${metadata.id}`);\n\t}\n\treturn storage;\n}\n\nfunction sessionFileName(createdAt: number, id: string): string {\n\tconst timestamp = new Date(createdAt).toISOString().replace(/[:.]/g, \"-\");\n\treturn `${timestamp}_${id}.jsonl`;\n}\n\nexport class JsonlSessionRepo\n\timplements SessionRepo<JsonlSessionMetadata, JsonlSessionCreateOptions, JsonlSessionListOptions>\n{\n\tprivate readonly fs: JsonlSessionRepoFileSystem;\n\tprivate readonly sessionsRootInput: string;\n\tprivate readonly activeCreateDestinations = new Set<string>();\n\tprivate rootPromise: Promise<string> | undefined;\n\n\tconstructor(options: JsonlSessionRepoOptions) {\n\t\tthis.fs = options.fs;\n\t\tthis.sessionsRootInput = options.sessionsRoot;\n\t}\n\n\tasync create(options: JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>> {\n\t\tconst destination = await this.resolveCreateDestination(options);\n\t\treturn this.claimCreateDestination(destination, async () => {\n\t\t\tconst { header, path } = await this.prepareCreate(destination, options);\n\t\t\treturn new Session(await JsonlSessionStorage.create(this.fs, path, header));\n\t\t});\n\t}\n\n\tasync open(metadata: JsonlSessionMetadata): Promise<Session<JsonlSessionMetadata>> {\n\t\treturn new Session(await this.loadStorage(metadata));\n\t}\n\n\tasync list(options: JsonlSessionListOptions = {}): Promise<JsonlSessionMetadata[]> {\n\t\treturn this.listDirect(options);\n\t}\n\n\tasync delete(metadata: JsonlSessionMetadata): Promise<void> {\n\t\tfileResult(await this.fs.remove(metadata.path, { force: true }), `Failed to delete session ${metadata.path}`);\n\t}\n\n\tasync fork(\n\t\tsource: JsonlSessionMetadata,\n\t\toptions: ForkOptions & JsonlSessionCreateOptions,\n\t): Promise<Session<JsonlSessionMetadata>> {\n\t\tconst sourceStorage = await this.loadStorage(source);\n\t\tconst createOptions = {\n\t\t\t...options,\n\t\t\tparentSessionId: options.parentSessionId ?? source.id,\n\t\t};\n\t\tconst destination = await this.resolveCreateDestination(createOptions);\n\t\treturn this.claimCreateDestination(destination, async () => {\n\t\t\tconst { header, path } = await this.prepareCreate(destination, createOptions);\n\t\t\treturn new Session(await sourceStorage.fork(path, header, options));\n\t\t});\n\t}\n\n\tprivate async loadStorage(metadata: JsonlSessionMetadata): Promise<JsonlSessionStorage> {\n\t\treturn loadJsonlSessionStorage({ fs: this.fs, sessionsRoot: this.sessionsRootInput }, metadata);\n\t}\n\n\tprivate async resolveCreateDestination(options: JsonlSessionCreateOptions): Promise<{ id: string; cwd: string }> {\n\t\tconst id = options.id ?? uuidv7();\n\t\tvalidateSessionId(id);\n\t\tconst cwd = fileResult(await this.fs.absolutePath(options.cwd), `Failed to resolve session cwd ${options.cwd}`);\n\t\treturn { id, cwd };\n\t}\n\n\t/**\n\t * Prevent same-process create/fork races for one logical destination. The durable filename includes a\n\t * timestamp, so the async filesystem existence check alone can let two concurrent calls both decide the\n\t * same {cwd, id} is free and publish duplicate sessions.\n\t */\n\tprivate async claimCreateDestination<T>(\n\t\tdestination: { id: string; cwd: string },\n\t\toperation: () => Promise<T>,\n\t): Promise<T> {\n\t\tconst key = `${destination.cwd}\\0${destination.id}`;\n\t\tif (this.activeCreateDestinations.has(key)) {\n\t\t\tthrow new SessionError(\"already_exists\", `Session already exists: ${destination.id}`);\n\t\t}\n\t\tthis.activeCreateDestinations.add(key);\n\t\ttry {\n\t\t\treturn await operation();\n\t\t} finally {\n\t\t\tthis.activeCreateDestinations.delete(key);\n\t\t}\n\t}\n\n\tprivate async prepareCreate(\n\t\tdestination: { id: string; cwd: string },\n\t\toptions: JsonlSessionCreateOptions,\n\t): Promise<{\n\t\theader: JsonlV4Header;\n\t\tpath: string;\n\t}> {\n\t\tconst { id, cwd } = destination;\n\t\tif (await this.sessionIdExists(id, cwd)) {\n\t\t\tthrow new SessionError(\"already_exists\", `Session already exists: ${id}`);\n\t\t}\n\n\t\tconst createdAt = Date.now();\n\t\tconst sessionDirectory = await this.sessionDirectory(cwd);\n\t\tconst path = fileResult(\n\t\t\tawait this.fs.joinPath([sessionDirectory, sessionFileName(createdAt, id)]),\n\t\t\t`Failed to resolve path for session ${id}`,\n\t\t);\n\t\tif (options.metadata !== undefined) assertJsonSerializable(options.metadata);\n\t\tconst header: JsonlV4Header = {\n\t\t\tkind: \"header\",\n\t\t\tversion: 4,\n\t\t\tid,\n\t\t\tcreatedAt,\n\t\t\tcwd,\n\t\t\tparentSessionId: options.parentSessionId,\n\t\t\tmetadata: options.metadata,\n\t\t};\n\t\tfileResult(await this.fs.createDir(sessionDirectory, { recursive: true }), `Failed to create sessions directory`);\n\t\treturn { header, path };\n\t}\n\n\tprivate async listDirect(options: JsonlSessionListOptions): Promise<JsonlSessionMetadata[]> {\n\t\treturn listJsonlSessionMetadata({ fs: this.fs, sessionsRoot: this.sessionsRootInput }, options);\n\t}\n\n\tprivate async sessionIdExists(id: string, cwd: string): Promise<boolean> {\n\t\tconst suffix = `_${id}.jsonl`;\n\t\tconst directory = await this.sessionDirectory(cwd);\n\t\tif (!fileResult(await this.fs.exists(directory), `Failed to check sessions directory ${directory}`)) return false;\n\t\tconst files = fileResult(await this.fs.listDir(directory), `Failed to list sessions directory ${directory}`);\n\t\treturn files.some((entry) => entry.kind !== \"directory\" && entry.name.endsWith(suffix));\n\t}\n\n\tprivate async sessionDirectory(cwd: string): Promise<string> {\n\t\treturn fileResult(\n\t\t\tawait this.fs.joinPath([await this.root(), jsonlSessionDirectoryName(cwd)]),\n\t\t\t`Failed to resolve sessions directory for ${cwd}`,\n\t\t);\n\t}\n\n\tprivate root(): Promise<string> {\n\t\tthis.rootPromise ??= this.fs\n\t\t\t.absolutePath(this.sessionsRootInput)\n\t\t\t.then((result) => fileResult(result, `Failed to resolve sessions root ${this.sessionsRootInput}`));\n\t\treturn this.rootPromise;\n\t}\n}\n"]}
|