@code-yeongyu/senpi 2026.8.14 → 2026.8.17
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 +128 -0
- package/README.md +1 -0
- package/dist/bun/cli.js +1 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-cursor-agent.d.ts +2 -0
- package/dist/bun/register-cursor-agent.d.ts.map +1 -0
- package/dist/bun/register-cursor-agent.js +4 -0
- package/dist/bun/register-cursor-agent.js.map +1 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +14 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +5 -4
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/core/agent-session-services.js +2 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +127 -13
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +420 -82
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +19 -8
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cursor-exec-bridge-session.d.ts +11 -0
- package/dist/core/cursor-exec-bridge-session.d.ts.map +1 -0
- package/dist/core/cursor-exec-bridge-session.js +17 -0
- package/dist/core/cursor-exec-bridge-session.js.map +1 -0
- package/dist/core/cursor-exec-bridge.d.ts +52 -0
- package/dist/core/cursor-exec-bridge.d.ts.map +1 -0
- package/dist/core/cursor-exec-bridge.js +196 -0
- package/dist/core/cursor-exec-bridge.js.map +1 -0
- package/dist/core/experimental.d.ts +4 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/experimental.js +4 -0
- package/dist/core/experimental.js.map +1 -1
- package/dist/core/export-html/template.js +31 -9
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.d.ts +4 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.js +30 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-environment.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js +13 -47
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts +18 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js +64 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.d.ts +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.js +27 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/config-dir-credentials.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts +15 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js +45 -11
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +17 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +48 -6
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.d.ts +1 -1
- package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js +2 -0
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/overflow-retry.js +38 -4
- package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +2 -1
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/summarization-turn-order.d.ts +33 -0
- package/dist/core/extensions/builtin/compaction/summarization-turn-order.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/summarization-turn-order.js +67 -0
- package/dist/core/extensions/builtin/compaction/summarization-turn-order.js.map +1 -0
- package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.js +31 -8
- package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +11 -12
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts +28 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +278 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +38 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js +75 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts +24 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js +64 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts +139 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js +362 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts +19 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js +122 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts +30 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js +117 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts +39 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js +155 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts +89 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js +147 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts +20 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js +99 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts +25 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.js +67 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts +27 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +242 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts +73 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js +330 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts +94 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js +248 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts +35 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +186 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts +11 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js +17 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts +104 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js +301 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts +26 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js +587 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts +43 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js +196 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts +9 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js +18 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js.map +1 -0
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +10 -9
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js +16 -0
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +9 -2
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.js +21 -3
- package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/escalation.d.ts +24 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.js +77 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/index.js +98 -3
- package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts +9 -0
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.js +17 -0
- package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts +4 -0
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/policy.js +4 -0
- package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +2 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.js +11 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.js +3 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/process-tree.js +6 -1
- package/dist/core/extensions/builtin/mcp/process-tree.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +6 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js +10 -0
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js +14 -0
- package/dist/core/extensions/builtin/prompt-preset/glm-5-3.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js +91 -0
- package/dist/core/extensions/builtin/prompt-preset/grok-4.6.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/index.js +22 -2
- package/dist/core/extensions/builtin/prompt-preset/index.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 +25 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +2 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/reasoning/index.d.ts +3 -0
- package/dist/core/extensions/builtin/reasoning/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/reasoning/index.js +211 -0
- package/dist/core/extensions/builtin/reasoning/index.js.map +1 -0
- package/dist/core/extensions/builtin/service-tier.d.ts +44 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +176 -24
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -4
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +12 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +24 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/lockfile-policy.d.ts +15 -0
- package/dist/core/lockfile-policy.d.ts.map +1 -0
- package/dist/core/lockfile-policy.js +15 -0
- package/dist/core/lockfile-policy.js.map +1 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +1 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +34 -7
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +116 -28
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +7 -2
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +19 -5
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +5 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +8 -9
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-api-key-auth.d.ts.map +1 -1
- package/dist/core/provider-api-key-auth.js +45 -2
- package/dist/core/provider-api-key-auth.js.map +1 -1
- package/dist/core/provider-composer.d.ts +12 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +2 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +13 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +15 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts +1 -1
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +5 -3
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/sdk.d.ts +5 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +20 -8
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +20 -4
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +50 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +258 -15
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/thinking-levels.d.ts +22 -0
- package/dist/core/thinking-levels.d.ts.map +1 -1
- package/dist/core/thinking-levels.js +29 -0
- package/dist/core/thinking-levels.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +2 -0
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +2 -0
- 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 +2 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +18 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/model-favorites.d.ts +2 -1
- package/dist/modes/interactive/components/model-favorites.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-favorites.js +72 -6
- package/dist/modes/interactive/components/model-favorites.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +5 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +10 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +10 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +22 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/editor-paste-transfer.d.ts +10 -0
- package/dist/modes/interactive/editor-paste-transfer.d.ts.map +1 -1
- package/dist/modes/interactive/editor-paste-transfer.js +16 -0
- package/dist/modes/interactive/editor-paste-transfer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +14 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +111 -52
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +7 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -0
- package/dist/modes/interactive/model-catalog-refresh.js +36 -0
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +2 -0
- package/dist/modes/interactive/theme/grok-day.json +2 -0
- package/dist/modes/interactive/theme/grok-night.json +2 -0
- package/dist/modes/interactive/theme/light.json +2 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts +10 -2
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +23 -10
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.json +9 -1
- package/dist/modes/interactive/theme/theme.d.ts +5 -3
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +12 -2
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +4 -1
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +5 -2
- package/dist/modes/json-event.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts +10 -0
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +119 -46
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +6 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +47 -14
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +29 -7
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +26 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +25 -2
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-command-invocation.d.ts +5 -0
- package/dist/modes/rpc/rpc-command-invocation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-invocation.js +2 -0
- package/dist/modes/rpc/rpc-command-invocation.js.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts +49 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.js +40 -0
- package/dist/modes/rpc/rpc-command-surface.js.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts +4 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.js +20 -0
- package/dist/modes/rpc/rpc-input-validation.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +12 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +72 -12
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +2 -14
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +29 -10
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +229 -50
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/server/create-harness.d.ts.map +1 -1
- package/dist/server/create-harness.js +2 -0
- package/dist/server/create-harness.js.map +1 -1
- package/dist/utils/shell.d.ts +27 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +79 -13
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +10 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +14 -19
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/compaction.md +3 -3
- package/docs/custom-provider.md +1 -1
- package/docs/environment-variables.md +8 -2
- package/docs/extensions.md +4 -0
- package/docs/json.md +6 -4
- package/docs/keybindings.md +8 -2
- package/docs/providers.md +56 -0
- package/docs/rpc.md +206 -12
- package/docs/sdk.md +9 -0
- package/docs/settings.md +93 -1
- package/docs/skills.md +14 -3
- package/docs/terminal-setup.md +23 -2
- package/docs/themes.md +24 -3
- package/docs/tui.md +2 -2
- package/docs/usage.md +24 -4
- package/examples/extensions/subagent/agents.ts +40 -9
- package/examples/extensions/subagent/index.ts +26 -3
- package/node_modules/@bufbuild/protobuf/README.md +44 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +244 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.js +58 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +74 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +259 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.js +209 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.js +168 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.js +45 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +247 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +739 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.js +55 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.js +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.js +131 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.js +78 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.js +115 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.js +110 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.js +376 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +268 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.js +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +546 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.js +129 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +149 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +945 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +199 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +391 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.js +684 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.js +47 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.js +481 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.js +358 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.js +220 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +156 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +268 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +530 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +34 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.js +191 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +61 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.js +199 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +322 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +75 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.js +892 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.js +126 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.js +106 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.js +242 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +40 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +101 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.js +256 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.js +206 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +159 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +241 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +731 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +128 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +109 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js +369 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +262 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +541 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +124 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +939 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +386 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.js +680 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.js +44 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.js +477 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.js +355 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.js +214 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +152 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +268 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +525 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +186 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +313 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +888 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +123 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +103 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +61 -0
- package/node_modules/@bufbuild/protobuf/package.json +147 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +28 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +5 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +14 -1
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/call-capture.ts +64 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +45 -61
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +8 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-execution-event.ts +201 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +22 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +43 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +59 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +25 -0
- 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 +77 -12
- 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 +43 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +67 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +4 -2
- 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 +127 -88
- 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 +5 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +9 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +12 -3
- 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 +88 -45
- 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 +1 -1
- 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 +28 -19
- 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 +1 -1
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +1 -1
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -1
- 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 +7 -2
- 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 +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +19 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +18 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +1 -1
- 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 +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts +4 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +21 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -0
- 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 +12 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/README.md +3 -0
- 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 +40 -14
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js +16 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.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/constrained-sampling.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js +125 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/constrained-sampling.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts +79 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js +360 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts +16797 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js +3828 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js +76 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +191 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +3316 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts +29 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -9
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +208 -42
- 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 +13 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +10 -7
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts +1 -0
- 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 +31 -7
- 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 +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/cursor.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/cursor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/cursor.js +234 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/cursor.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js +6 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +44 -9
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +6 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +65 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/alibaba-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.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/cerebras.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.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/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/kimi-coding.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/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.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai-coding-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/zai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +17 -4
- 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/block-symbols.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -0
- 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 +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.js +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/pi-user-agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +34 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +26 -0
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +121 -0
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +6 -1
- 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 +23 -7
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts +9 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js +82 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +4 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +7 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +30 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +24 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- 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 -2
- package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +8 -2
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +6 -2
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +18 -1
- 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 +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +243 -5
- 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 +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +33 -8
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +11 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search.d.ts +0 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search.js +0 -41
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface RunStartEvent {
|
|
2
|
+
type: "run_start";
|
|
3
|
+
lane: string;
|
|
4
|
+
runId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RunEndEvent {
|
|
7
|
+
type: "run_end";
|
|
8
|
+
lane: string;
|
|
9
|
+
runId: string;
|
|
10
|
+
outcome: "completed" | "aborted" | "failed";
|
|
11
|
+
leafId: string;
|
|
12
|
+
}
|
|
13
|
+
export type HarnessEvent = RunStartEvent | RunEndEvent;
|
|
14
|
+
export type HarnessEventType = HarnessEvent["type"];
|
|
15
|
+
export type HarnessEventOfType<TType extends HarnessEventType> = Extract<HarnessEvent, {
|
|
16
|
+
type: TType;
|
|
17
|
+
}>;
|
|
18
|
+
export type HarnessEventListener<TEvent extends HarnessEvent = HarnessEvent> = (event: TEvent) => void | Promise<void>;
|
|
19
|
+
export interface Events {
|
|
20
|
+
/**
|
|
21
|
+
* Register a passive listener for future events and return its unsubscribe function.
|
|
22
|
+
* Earlier events are not replayed and no current-state snapshot is provided; use a lane or session watch for both.
|
|
23
|
+
*/
|
|
24
|
+
on<TType extends HarnessEventType>(type: TType, listener: HarnessEventListener<HarnessEventOfType<TType>>): () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface WatchHandle<TSnapshot> {
|
|
27
|
+
snapshot: TSnapshot;
|
|
28
|
+
start(listener: HarnessEventListener): void;
|
|
29
|
+
unsubscribe(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare class HarnessEventBus implements Events {
|
|
32
|
+
private readonly listeners;
|
|
33
|
+
private readonly watchListeners;
|
|
34
|
+
/**
|
|
35
|
+
* Register a listener for future events of one type and return its unsubscribe function.
|
|
36
|
+
* Earlier events are not replayed, and no snapshot or event buffer is provided.
|
|
37
|
+
*/
|
|
38
|
+
on<TType extends HarnessEventType>(type: TType, listener: HarnessEventListener<HarnessEventOfType<TType>>): () => void;
|
|
39
|
+
/** Publish an event to current event subscriptions and watch subscriptions. */
|
|
40
|
+
emit(event: HarnessEvent): void;
|
|
41
|
+
watch<TSnapshot>(captureSnapshot: () => TSnapshot): WatchHandle<TSnapshot>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/harness/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AACpD,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,gBAAgB,IAAI,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AACxG,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,YAAY,GAAG,YAAY,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvH,MAAM,WAAW,MAAM;IACtB;;;OAGG;IACH,EAAE,CAAC,KAAK,SAAS,gBAAgB,EAChC,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GACvD,MAAM,IAAI,CAAC;CACd;AAED,MAAM,WAAW,WAAW,CAAC,SAAS;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,WAAW,IAAI,IAAI,CAAC;CACpB;AAED,qBAAa,eAAgB,YAAW,MAAM;IAC7C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0D;IACpF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA4C;IAE3E;;;OAGG;IACH,EAAE,CAAC,KAAK,SAAS,gBAAgB,EAChC,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GACvD,MAAM,IAAI;IAiBb,+EAA+E;IAC/E,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAS/B,KAAK,CAAC,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;CA2B1E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export class HarnessEventBus {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.listeners = new Map();
|
|
4
|
+
this.watchListeners = new Set();
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Register a listener for future events of one type and return its unsubscribe function.
|
|
8
|
+
* Earlier events are not replayed, and no snapshot or event buffer is provided.
|
|
9
|
+
*/
|
|
10
|
+
on(type, listener) {
|
|
11
|
+
// Reuse this event type's listener set, or create its first set.
|
|
12
|
+
const listeners = this.listeners.get(type) ?? new Set();
|
|
13
|
+
this.listeners.set(type, listeners);
|
|
14
|
+
// Wrap this event-specific callback so it can be stored as a general HarnessEvent listener.
|
|
15
|
+
// Keep the wrapper reference so unsubscribe can remove that exact function from the set.
|
|
16
|
+
const receive = (event) => {
|
|
17
|
+
if (event.type === type)
|
|
18
|
+
return listener(event);
|
|
19
|
+
};
|
|
20
|
+
listeners.add(receive);
|
|
21
|
+
return () => {
|
|
22
|
+
listeners.delete(receive);
|
|
23
|
+
if (listeners.size === 0)
|
|
24
|
+
this.listeners.delete(type);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Publish an event to current event subscriptions and watch subscriptions. */
|
|
28
|
+
emit(event) {
|
|
29
|
+
// Deliver only to direct listeners registered for this event type.
|
|
30
|
+
// Async results are not awaited because emit() is synchronous.
|
|
31
|
+
for (const listener of this.listeners.get(event.type) ?? [])
|
|
32
|
+
void listener(event);
|
|
33
|
+
// Deliver every event to each watcher; watch() handles buffering until start().
|
|
34
|
+
for (const listener of this.watchListeners)
|
|
35
|
+
listener(event);
|
|
36
|
+
}
|
|
37
|
+
watch(captureSnapshot) {
|
|
38
|
+
let listener;
|
|
39
|
+
let buffered = [];
|
|
40
|
+
const receive = (event) => {
|
|
41
|
+
if (listener)
|
|
42
|
+
void listener(event);
|
|
43
|
+
else
|
|
44
|
+
buffered.push(event);
|
|
45
|
+
};
|
|
46
|
+
this.watchListeners.add(receive);
|
|
47
|
+
const snapshot = captureSnapshot();
|
|
48
|
+
return {
|
|
49
|
+
snapshot,
|
|
50
|
+
start: (nextListener) => {
|
|
51
|
+
// Stay in buffering mode while flushing so reentrant emissions preserve order.
|
|
52
|
+
while (buffered.length > 0) {
|
|
53
|
+
const pending = buffered;
|
|
54
|
+
buffered = [];
|
|
55
|
+
for (const event of pending)
|
|
56
|
+
void nextListener(event);
|
|
57
|
+
}
|
|
58
|
+
listener = nextListener;
|
|
59
|
+
},
|
|
60
|
+
unsubscribe: () => {
|
|
61
|
+
this.watchListeners.delete(receive);
|
|
62
|
+
buffered = [];
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/harness/events.ts"],"names":[],"mappings":"AAoCA,MAAM,OAAO,eAAe;IAA5B;QACkB,cAAS,GAAG,IAAI,G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C7C,IAAI,QAAQ;gBAAE,KAAK,QAAQ,CAAC,KAAK,CAAC,CAAC;;gBAC9B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;QAEnC,OAAO;YACN,QAAQ;YACR,KAAK,EAAE,CAAC,YAAY,EAAE,EAAE;gBACvB,+EAA+E;gBAC/E,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,MAAM,OAAO,GAAG,QAAQ,CAAC;oBACzB,QAAQ,GAAG,EAAE,CAAC;oBACd,KAAK,MAAM,KAAK,IAAI,OAAO;wBAAE,KAAK,YAAY,CAAC,KAAK,CAAC,CAAC;gBACvD,CAAC;gBACD,QAAQ,GAAG,YAAY,CAAC;YACzB,CAAC;YACD,WAAW,EAAE,GAAG,EAAE;gBACjB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACpC,QAAQ,GAAG,EAAE,CAAC;YACf,CAAC;SACD,CAAC;IACH,CAAC;CACD","sourcesContent":["export interface RunStartEvent {\n\ttype: \"run_start\";\n\tlane: string;\n\trunId: string;\n}\n\nexport interface RunEndEvent {\n\ttype: \"run_end\";\n\tlane: string;\n\trunId: string;\n\toutcome: \"completed\" | \"aborted\" | \"failed\";\n\tleafId: string;\n}\n\nexport type HarnessEvent = RunStartEvent | RunEndEvent;\nexport type HarnessEventType = HarnessEvent[\"type\"];\nexport type HarnessEventOfType<TType extends HarnessEventType> = Extract<HarnessEvent, { type: TType }>;\nexport type HarnessEventListener<TEvent extends HarnessEvent = HarnessEvent> = (event: TEvent) => void | Promise<void>;\n\nexport interface Events {\n\t/**\n\t * Register a passive listener for future events and return its unsubscribe function.\n\t * Earlier events are not replayed and no current-state snapshot is provided; use a lane or session watch for both.\n\t */\n\ton<TType extends HarnessEventType>(\n\t\ttype: TType,\n\t\tlistener: HarnessEventListener<HarnessEventOfType<TType>>,\n\t): () => void;\n}\n\nexport interface WatchHandle<TSnapshot> {\n\tsnapshot: TSnapshot;\n\tstart(listener: HarnessEventListener): void;\n\tunsubscribe(): void;\n}\n\nexport class HarnessEventBus implements Events {\n\tprivate readonly listeners = new Map<HarnessEventType, Set<HarnessEventListener>>();\n\tprivate readonly watchListeners = new Set<(event: HarnessEvent) => void>();\n\n\t/**\n\t * Register a listener for future events of one type and return its unsubscribe function.\n\t * Earlier events are not replayed, and no snapshot or event buffer is provided.\n\t */\n\ton<TType extends HarnessEventType>(\n\t\ttype: TType,\n\t\tlistener: HarnessEventListener<HarnessEventOfType<TType>>,\n\t): () => void {\n\t\t// Reuse this event type's listener set, or create its first set.\n\t\tconst listeners = this.listeners.get(type) ?? new Set<HarnessEventListener>();\n\t\tthis.listeners.set(type, listeners);\n\n\t\t// Wrap this event-specific callback so it can be stored as a general HarnessEvent listener.\n\t\t// Keep the wrapper reference so unsubscribe can remove that exact function from the set.\n\t\tconst receive: HarnessEventListener = (event) => {\n\t\t\tif (event.type === type) return listener(event as HarnessEventOfType<TType>);\n\t\t};\n\t\tlisteners.add(receive);\n\t\treturn () => {\n\t\t\tlisteners.delete(receive);\n\t\t\tif (listeners.size === 0) this.listeners.delete(type);\n\t\t};\n\t}\n\n\t/** Publish an event to current event subscriptions and watch subscriptions. */\n\temit(event: HarnessEvent): void {\n\t\t// Deliver only to direct listeners registered for this event type.\n\t\t// Async results are not awaited because emit() is synchronous.\n\t\tfor (const listener of this.listeners.get(event.type) ?? []) void listener(event);\n\n\t\t// Deliver every event to each watcher; watch() handles buffering until start().\n\t\tfor (const listener of this.watchListeners) listener(event);\n\t}\n\n\twatch<TSnapshot>(captureSnapshot: () => TSnapshot): WatchHandle<TSnapshot> {\n\t\tlet listener: HarnessEventListener | undefined;\n\t\tlet buffered: HarnessEvent[] = [];\n\t\tconst receive = (event: HarnessEvent): void => {\n\t\t\tif (listener) void listener(event);\n\t\t\telse buffered.push(event);\n\t\t};\n\t\tthis.watchListeners.add(receive);\n\t\tconst snapshot = captureSnapshot();\n\n\t\treturn {\n\t\t\tsnapshot,\n\t\t\tstart: (nextListener) => {\n\t\t\t\t// Stay in buffering mode while flushing so reentrant emissions preserve order.\n\t\t\t\twhile (buffered.length > 0) {\n\t\t\t\t\tconst pending = buffered;\n\t\t\t\t\tbuffered = [];\n\t\t\t\t\tfor (const event of pending) void nextListener(event);\n\t\t\t\t}\n\t\t\t\tlistener = nextListener;\n\t\t\t},\n\t\t\tunsubscribe: () => {\n\t\t\t\tthis.watchListeners.delete(receive);\n\t\t\t\tbuffered = [];\n\t\t\t},\n\t\t};\n\t}\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type Result } from "../../types.ts";
|
|
1
2
|
import type { SessionMutation } from "../state.ts";
|
|
3
|
+
import { JsonlDecodeError } from "./errors.ts";
|
|
2
4
|
import type { JsonlSessionMetadata, JsonlV4Header } from "./types.ts";
|
|
3
|
-
export declare function parseHeader(line: string
|
|
5
|
+
export declare function parseHeader(line: string): Result<JsonlV4Header, JsonlDecodeError>;
|
|
4
6
|
export declare function encodeHeader(header: JsonlV4Header): string;
|
|
5
7
|
export declare function metadataFromHeader(header: JsonlV4Header, path: string, modifiedAt: number): JsonlSessionMetadata;
|
|
6
|
-
export declare function parseMutation(line: string
|
|
8
|
+
export declare function parseMutation(line: string): Result<SessionMutation, JsonlDecodeError>;
|
|
7
9
|
export declare function encodeMutation(mutation: SessionMutation): string;
|
|
8
10
|
//# sourceMappingURL=codec.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiGtE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAOjF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,oBAAoB,CAchH;AA2FD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAOrF;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAWhE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { err, ok } from "../../types.js";
|
|
2
|
+
import { JsonlDecodeError } from "./errors.js";
|
|
2
3
|
const ENTRY_TYPES = new Set([
|
|
3
4
|
"message",
|
|
4
5
|
"model_change",
|
|
@@ -23,71 +24,84 @@ const OPERATION_KINDS = new Set(["run", "compaction", "navigation"]);
|
|
|
23
24
|
function isObject(value) {
|
|
24
25
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25
26
|
}
|
|
26
|
-
function parseObject(line
|
|
27
|
+
function parseObject(line) {
|
|
27
28
|
let value;
|
|
28
29
|
try {
|
|
29
30
|
value = JSON.parse(line);
|
|
30
31
|
}
|
|
31
32
|
catch (error) {
|
|
32
|
-
throw
|
|
33
|
+
throw new JsonlDecodeError("syntax", "is not valid JSON", error instanceof Error ? error : undefined);
|
|
33
34
|
}
|
|
34
35
|
if (!isObject(value))
|
|
35
|
-
throw
|
|
36
|
+
throw new JsonlDecodeError("schema", "is not a JSON object");
|
|
36
37
|
return value;
|
|
37
38
|
}
|
|
38
|
-
function requireString(value,
|
|
39
|
+
function requireString(value, field) {
|
|
39
40
|
if (typeof value !== "string")
|
|
40
|
-
throw
|
|
41
|
+
throw new JsonlDecodeError("schema", `has invalid ${field}`);
|
|
41
42
|
return value;
|
|
42
43
|
}
|
|
43
|
-
function requireSequence(value
|
|
44
|
-
if (!Number.isSafeInteger(value) || value <= 0)
|
|
45
|
-
throw
|
|
44
|
+
function requireSequence(value) {
|
|
45
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
46
|
+
throw new JsonlDecodeError("schema", "has invalid seq");
|
|
47
|
+
}
|
|
46
48
|
return value;
|
|
47
49
|
}
|
|
48
|
-
function requireTimestamp(value
|
|
49
|
-
if (!Number.isSafeInteger(value) || value < 0)
|
|
50
|
-
throw
|
|
50
|
+
function requireTimestamp(value) {
|
|
51
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
52
|
+
throw new JsonlDecodeError("schema", "has invalid timestamp");
|
|
53
|
+
}
|
|
51
54
|
return value;
|
|
52
55
|
}
|
|
53
|
-
function requireNullableId(value,
|
|
56
|
+
function requireNullableId(value, field) {
|
|
54
57
|
if (value !== null && typeof value !== "string") {
|
|
55
|
-
throw
|
|
58
|
+
throw new JsonlDecodeError("schema", `has invalid ${field}`);
|
|
56
59
|
}
|
|
57
60
|
return value;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
const value = parseObject(line
|
|
62
|
+
function decodeHeader(line) {
|
|
63
|
+
const value = parseObject(line);
|
|
61
64
|
if (value.kind !== "header")
|
|
62
|
-
throw
|
|
65
|
+
throw new JsonlDecodeError("schema", "is not a header");
|
|
63
66
|
if (value.version !== 4)
|
|
64
|
-
throw
|
|
67
|
+
throw new JsonlDecodeError("schema", "has unsupported session version");
|
|
65
68
|
const parentSessionId = value.parentSessionId;
|
|
66
69
|
if (parentSessionId !== undefined && typeof parentSessionId !== "string") {
|
|
67
|
-
throw
|
|
70
|
+
throw new JsonlDecodeError("schema", "has invalid parentSessionId");
|
|
68
71
|
}
|
|
69
72
|
const legacyParentSessionPath = value.legacyParentSessionPath;
|
|
70
73
|
if (legacyParentSessionPath !== undefined && typeof legacyParentSessionPath !== "string") {
|
|
71
|
-
throw
|
|
74
|
+
throw new JsonlDecodeError("schema", "has invalid legacyParentSessionPath");
|
|
72
75
|
}
|
|
73
76
|
if (parentSessionId !== undefined && legacyParentSessionPath !== undefined) {
|
|
74
|
-
throw
|
|
77
|
+
throw new JsonlDecodeError("schema", "has both parentSessionId and legacyParentSessionPath");
|
|
75
78
|
}
|
|
76
79
|
const metadataValue = value.metadata;
|
|
77
|
-
if (metadataValue !== undefined && !isObject(metadataValue))
|
|
78
|
-
throw
|
|
80
|
+
if (metadataValue !== undefined && !isObject(metadataValue)) {
|
|
81
|
+
throw new JsonlDecodeError("schema", "has invalid metadata");
|
|
82
|
+
}
|
|
79
83
|
const metadata = metadataValue;
|
|
80
84
|
return {
|
|
81
85
|
kind: "header",
|
|
82
86
|
version: 4,
|
|
83
|
-
id: requireString(value.id,
|
|
84
|
-
createdAt: requireTimestamp(value.createdAt
|
|
85
|
-
cwd: requireString(value.cwd,
|
|
87
|
+
id: requireString(value.id, "id"),
|
|
88
|
+
createdAt: requireTimestamp(value.createdAt),
|
|
89
|
+
cwd: requireString(value.cwd, "cwd"),
|
|
86
90
|
parentSessionId,
|
|
87
91
|
legacyParentSessionPath,
|
|
88
92
|
metadata,
|
|
89
93
|
};
|
|
90
94
|
}
|
|
95
|
+
export function parseHeader(line) {
|
|
96
|
+
try {
|
|
97
|
+
return ok(decodeHeader(line));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error instanceof JsonlDecodeError)
|
|
101
|
+
return err(error);
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
91
105
|
export function encodeHeader(header) {
|
|
92
106
|
return `${JSON.stringify(header)}\n`;
|
|
93
107
|
}
|
|
@@ -106,73 +120,98 @@ export function metadataFromHeader(header, path, modifiedAt) {
|
|
|
106
120
|
...(header.metadata === undefined ? {} : { metadata: header.metadata }),
|
|
107
121
|
};
|
|
108
122
|
}
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
function parseEntryMutation(value, seq) {
|
|
124
|
+
const lane = value.lane === undefined ? undefined : requireString(value.lane, "lane");
|
|
125
|
+
const id = requireString(value.id, "id");
|
|
126
|
+
const type = requireString(value.type, "entry type");
|
|
127
|
+
if (!ENTRY_TYPES.has(type)) {
|
|
128
|
+
throw new JsonlDecodeError("schema", `has unknown entry type ${type}`);
|
|
129
|
+
}
|
|
130
|
+
const parentId = requireNullableId(value.parentId, "parentId");
|
|
131
|
+
const timestamp = requireTimestamp(value.timestamp);
|
|
132
|
+
if (type === "custom")
|
|
133
|
+
requireString(value.customType, "customType");
|
|
134
|
+
const { kind: _kind, lane: _lane, ...entryFields } = value;
|
|
135
|
+
const entry = { ...entryFields, id, type, parentId, seq, timestamp };
|
|
136
|
+
return lane === undefined ? { kind: "entry", entry } : { kind: "entry", lane, entry };
|
|
137
|
+
}
|
|
138
|
+
function parseRecordMutation(value, seq) {
|
|
139
|
+
const id = requireString(value.id, "id");
|
|
140
|
+
const lane = requireString(value.lane, "lane");
|
|
141
|
+
const type = requireString(value.type, "record type");
|
|
142
|
+
if (!RECORD_TYPES.has(type)) {
|
|
143
|
+
throw new JsonlDecodeError("schema", `has unknown record type ${type}`);
|
|
144
|
+
}
|
|
145
|
+
const timestamp = requireTimestamp(value.timestamp);
|
|
146
|
+
if (type === "operation_started") {
|
|
147
|
+
if (!isObject(value.intent))
|
|
148
|
+
throw new JsonlDecodeError("schema", "has invalid intent");
|
|
149
|
+
const operationKind = requireString(value.intent.kind, "operation kind");
|
|
150
|
+
if (!OPERATION_KINDS.has(operationKind)) {
|
|
151
|
+
throw new JsonlDecodeError("schema", `has unknown operation kind ${operationKind}`);
|
|
126
152
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
}
|
|
154
|
+
if (type === "operation_finished")
|
|
155
|
+
requireString(value.runId, "runId");
|
|
156
|
+
const { kind: _kind, ...recordFields } = value;
|
|
157
|
+
return {
|
|
158
|
+
kind: "record",
|
|
159
|
+
record: { ...recordFields, id, lane, type, seq, timestamp },
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function parseLaneMutation(value, seq) {
|
|
163
|
+
return {
|
|
164
|
+
kind: "lane",
|
|
165
|
+
seq,
|
|
166
|
+
lane: requireString(value.lane, "lane"),
|
|
167
|
+
leafId: requireNullableId(value.leafId, "leafId"),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function parseFactMutation(value, seq) {
|
|
171
|
+
if (value.fact === "name") {
|
|
172
|
+
if (value.name !== undefined && typeof value.name !== "string") {
|
|
173
|
+
throw new JsonlDecodeError("schema", "has invalid name");
|
|
174
|
+
}
|
|
175
|
+
return { kind: "fact", seq, fact: "name", name: value.name };
|
|
176
|
+
}
|
|
177
|
+
if (value.fact === "label") {
|
|
178
|
+
if (value.label !== undefined && typeof value.label !== "string") {
|
|
179
|
+
throw new JsonlDecodeError("schema", "has invalid label");
|
|
149
180
|
}
|
|
181
|
+
return {
|
|
182
|
+
kind: "fact",
|
|
183
|
+
seq,
|
|
184
|
+
fact: "label",
|
|
185
|
+
targetId: requireString(value.targetId, "targetId"),
|
|
186
|
+
label: value.label,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
throw new JsonlDecodeError("schema", "has unknown fact type");
|
|
190
|
+
}
|
|
191
|
+
function decodeMutation(line) {
|
|
192
|
+
const value = parseObject(line);
|
|
193
|
+
const seq = requireSequence(value.seq);
|
|
194
|
+
switch (value.kind) {
|
|
195
|
+
case "entry":
|
|
196
|
+
return parseEntryMutation(value, seq);
|
|
197
|
+
case "record":
|
|
198
|
+
return parseRecordMutation(value, seq);
|
|
150
199
|
case "lane":
|
|
151
|
-
return
|
|
152
|
-
kind: "lane",
|
|
153
|
-
seq,
|
|
154
|
-
lane: requireString(value.lane, path, lineNumber, "lane"),
|
|
155
|
-
leafId: requireNullableId(value.leafId, path, lineNumber, "leafId"),
|
|
156
|
-
};
|
|
200
|
+
return parseLaneMutation(value, seq);
|
|
157
201
|
case "fact":
|
|
158
|
-
|
|
159
|
-
return { kind: "fact", seq, fact: "name", name: requireString(value.name, path, lineNumber, "name") };
|
|
160
|
-
}
|
|
161
|
-
if (value.fact === "label") {
|
|
162
|
-
if (value.label !== undefined && typeof value.label !== "string") {
|
|
163
|
-
throw invalidFile(path, lineNumber, "has invalid label");
|
|
164
|
-
}
|
|
165
|
-
return {
|
|
166
|
-
kind: "fact",
|
|
167
|
-
seq,
|
|
168
|
-
fact: "label",
|
|
169
|
-
targetId: requireString(value.targetId, path, lineNumber, "targetId"),
|
|
170
|
-
label: value.label,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
throw invalidFile(path, lineNumber, "has unknown fact type");
|
|
202
|
+
return parseFactMutation(value, seq);
|
|
174
203
|
default:
|
|
175
|
-
throw
|
|
204
|
+
throw new JsonlDecodeError("schema", "has unknown mutation kind");
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
export function parseMutation(line) {
|
|
208
|
+
try {
|
|
209
|
+
return ok(decodeMutation(line));
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
if (error instanceof JsonlDecodeError)
|
|
213
|
+
return err(error);
|
|
214
|
+
throw error;
|
|
176
215
|
}
|
|
177
216
|
}
|
|
178
217
|
export function encodeMutation(mutation) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAgB;IAC1C,SAAS;IACT,cAAc;IACd,uBAAuB;IACvB,qBAAqB;IACrB,YAAY;IACZ,gBAAgB;IAChB,QAAQ;CACR,CAAC,CAAC;AACH,MAAM,YAAY,GAAG,IAAI,GAAG,CAAqB;IAChD,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,OAAO;CACP,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;AAErE,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,IAAY,EAAE,UAAkB;IAClE,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACJ,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,KAA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,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC;oBACrE,KAAK,EAAE,KAAK,CAAC,KAAK;iBAClB,CAAC;YACH,CAAC;YACD,MAAM,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC;QAC9D;YACC,MAAM,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;IACnE,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAyB;IACvD,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,OAAO;YACX,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;QACzF,KAAK,QAAQ;YACZ,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QACtE,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QACxC,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["import type { SessionMutation } from \"../state.ts\";\nimport type { Entry, LaneRecord } from \"../types.ts\";\nimport { invalidFile } from \"./errors.ts\";\nimport type { JsonlSessionMetadata, JsonlV4Header } from \"./types.ts\";\n\nconst ENTRY_TYPES = new Set<Entry[\"type\"]>([\n\t\"message\",\n\t\"model_change\",\n\t\"thinking_level_change\",\n\t\"active_tools_change\",\n\t\"compaction\",\n\t\"branch_summary\",\n\t\"custom\",\n]);\nconst RECORD_TYPES = new Set<LaneRecord[\"type\"]>([\n\t\"operation_started\",\n\t\"abort_requested\",\n\t\"operation_finished\",\n\t\"step_attempt\",\n\t\"tool_started\",\n\t\"queue_enqueued\",\n\t\"queue_cancelled\",\n\t\"write_deferred\",\n\t\"usage\",\n]);\nconst OPERATION_KINDS = new Set([\"run\", \"compaction\", \"navigation\"]);\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseObject(line: string, path: string, lineNumber: number): Record<string, unknown> {\n\tlet value: unknown;\n\ttry {\n\t\tvalue = JSON.parse(line);\n\t} catch (error) {\n\t\tthrow invalidFile(path, lineNumber, \"is not valid JSON\", error instanceof Error ? error : undefined);\n\t}\n\tif (!isObject(value)) throw invalidFile(path, lineNumber, \"is not a JSON object\");\n\treturn value;\n}\n\nfunction requireString(value: unknown, path: string, line: number, field: string): string {\n\tif (typeof value !== \"string\") throw invalidFile(path, line, `has invalid ${field}`);\n\treturn value;\n}\n\nfunction requireSequence(value: unknown, path: string, line: number): number {\n\tif (!Number.isSafeInteger(value) || (value as number) <= 0) throw invalidFile(path, line, \"has invalid seq\");\n\treturn value as number;\n}\n\nfunction requireTimestamp(value: unknown, path: string, line: number): number {\n\tif (!Number.isSafeInteger(value) || (value as number) < 0) throw invalidFile(path, line, \"has invalid timestamp\");\n\treturn value as number;\n}\n\nfunction requireNullableId(value: unknown, path: string, line: number, field: string): string | null {\n\tif (value !== null && typeof value !== \"string\") {\n\t\tthrow invalidFile(path, line, `has invalid ${field}`);\n\t}\n\treturn value as string | null;\n}\n\nexport function parseHeader(line: string, path: string): JsonlV4Header {\n\tconst value = parseObject(line, path, 1);\n\tif (value.kind !== \"header\") throw invalidFile(path, 1, \"is not a header\");\n\tif (value.version !== 4) throw invalidFile(path, 1, \"has unsupported session version\");\n\tconst parentSessionId = value.parentSessionId;\n\tif (parentSessionId !== undefined && typeof parentSessionId !== \"string\") {\n\t\tthrow invalidFile(path, 1, \"has invalid parentSessionId\");\n\t}\n\tconst legacyParentSessionPath = value.legacyParentSessionPath;\n\tif (legacyParentSessionPath !== undefined && typeof legacyParentSessionPath !== \"string\") {\n\t\tthrow invalidFile(path, 1, \"has invalid legacyParentSessionPath\");\n\t}\n\tif (parentSessionId !== undefined && legacyParentSessionPath !== undefined) {\n\t\tthrow invalidFile(path, 1, \"has both parentSessionId and legacyParentSessionPath\");\n\t}\n\tconst metadataValue = value.metadata;\n\tif (metadataValue !== undefined && !isObject(metadataValue)) throw invalidFile(path, 1, \"has invalid metadata\");\n\tconst metadata = metadataValue as JsonlV4Header[\"metadata\"];\n\treturn {\n\t\tkind: \"header\",\n\t\tversion: 4,\n\t\tid: requireString(value.id, path, 1, \"id\"),\n\t\tcreatedAt: requireTimestamp(value.createdAt, path, 1),\n\t\tcwd: requireString(value.cwd, path, 1, \"cwd\"),\n\t\tparentSessionId,\n\t\tlegacyParentSessionPath,\n\t\tmetadata,\n\t};\n}\n\nexport function encodeHeader(header: JsonlV4Header): string {\n\treturn `${JSON.stringify(header)}\\n`;\n}\n\nexport function metadataFromHeader(header: JsonlV4Header, path: string, modifiedAt: number): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.createdAt,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tmodifiedAt,\n\t\tsourceFormat: 4,\n\t\t...(header.parentSessionId === undefined ? {} : { parentSessionId: header.parentSessionId }),\n\t\t...(header.legacyParentSessionPath === undefined\n\t\t\t? {}\n\t\t\t: { legacyParentSessionPath: header.legacyParentSessionPath }),\n\t\t...(header.metadata === undefined ? {} : { metadata: header.metadata }),\n\t};\n}\n\nexport function parseMutation(line: string, path: string, lineNumber: number): SessionMutation {\n\tconst value = parseObject(line, path, lineNumber);\n\tconst seq = requireSequence(value.seq, path, lineNumber);\n\tswitch (value.kind) {\n\t\tcase \"entry\": {\n\t\t\tconst lane = value.lane === undefined ? undefined : requireString(value.lane, path, lineNumber, \"lane\");\n\t\t\tconst id = requireString(value.id, path, lineNumber, \"id\");\n\t\t\tconst type = requireString(value.type, path, lineNumber, \"entry type\");\n\t\t\tif (!ENTRY_TYPES.has(type as Entry[\"type\"]))\n\t\t\t\tthrow invalidFile(path, lineNumber, `has unknown entry type ${type}`);\n\t\t\tconst parentId = requireNullableId(value.parentId, path, lineNumber, \"parentId\");\n\t\t\tconst timestamp = requireTimestamp(value.timestamp, path, lineNumber);\n\t\t\tif (type === \"custom\") requireString(value.customType, path, lineNumber, \"customType\");\n\t\t\tconst { kind: _kind, lane: _lane, ...entryFields } = value;\n\t\t\tconst entry = { ...entryFields, id, type, parentId, seq, timestamp } as unknown as Entry;\n\t\t\treturn lane === undefined ? { kind: \"entry\", entry } : { kind: \"entry\", lane, entry };\n\t\t}\n\t\tcase \"record\": {\n\t\t\tconst id = requireString(value.id, path, lineNumber, \"id\");\n\t\t\tconst lane = requireString(value.lane, path, lineNumber, \"lane\");\n\t\t\tconst type = requireString(value.type, path, lineNumber, \"record type\");\n\t\t\tif (!RECORD_TYPES.has(type as LaneRecord[\"type\"]))\n\t\t\t\tthrow invalidFile(path, lineNumber, `has unknown record type ${type}`);\n\t\t\tconst timestamp = requireTimestamp(value.timestamp, path, lineNumber);\n\t\t\tif (type === \"operation_started\") {\n\t\t\t\tif (!isObject(value.intent)) throw invalidFile(path, lineNumber, \"has invalid intent\");\n\t\t\t\tconst operationKind = requireString(value.intent.kind, path, lineNumber, \"operation kind\");\n\t\t\t\tif (!OPERATION_KINDS.has(operationKind)) {\n\t\t\t\t\tthrow invalidFile(path, lineNumber, `has unknown operation kind ${operationKind}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (type === \"operation_finished\") requireString(value.runId, path, lineNumber, \"runId\");\n\t\t\tconst { kind: _kind, ...recordFields } = value;\n\t\t\treturn {\n\t\t\t\tkind: \"record\",\n\t\t\t\trecord: { ...recordFields, id, lane, type, seq, timestamp } as unknown as LaneRecord,\n\t\t\t};\n\t\t}\n\t\tcase \"lane\":\n\t\t\treturn {\n\t\t\t\tkind: \"lane\",\n\t\t\t\tseq,\n\t\t\t\tlane: requireString(value.lane, path, lineNumber, \"lane\"),\n\t\t\t\tleafId: requireNullableId(value.leafId, path, lineNumber, \"leafId\"),\n\t\t\t};\n\t\tcase \"fact\":\n\t\t\tif (value.fact === \"name\") {\n\t\t\t\treturn { kind: \"fact\", seq, fact: \"name\", name: requireString(value.name, path, lineNumber, \"name\") };\n\t\t\t}\n\t\t\tif (value.fact === \"label\") {\n\t\t\t\tif (value.label !== undefined && typeof value.label !== \"string\") {\n\t\t\t\t\tthrow invalidFile(path, lineNumber, \"has invalid label\");\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tkind: \"fact\",\n\t\t\t\t\tseq,\n\t\t\t\t\tfact: \"label\",\n\t\t\t\t\ttargetId: requireString(value.targetId, path, lineNumber, \"targetId\"),\n\t\t\t\t\tlabel: value.label,\n\t\t\t\t};\n\t\t\t}\n\t\t\tthrow invalidFile(path, lineNumber, \"has unknown fact type\");\n\t\tdefault:\n\t\t\tthrow invalidFile(path, lineNumber, \"has unknown mutation kind\");\n\t}\n}\n\nexport function encodeMutation(mutation: SessionMutation): string {\n\tswitch (mutation.kind) {\n\t\tcase \"entry\":\n\t\t\treturn `${JSON.stringify({ kind: \"entry\", lane: mutation.lane, ...mutation.entry })}\\n`;\n\t\tcase \"record\":\n\t\t\treturn `${JSON.stringify({ kind: \"record\", ...mutation.record })}\\n`;\n\t\tcase \"lane\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t\tcase \"fact\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,gBAAgB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAgB;IAC1C,SAAS;IAC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AE,CAAoC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,gBAAgB;YAAE,OAAO,GAAG,CAAoC,KAAK,CAAC,CAAC;QAC5F,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAyB;IACvD,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,OAAO;YACX,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC;QACzF,KAAK,QAAQ;YACZ,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QACtE,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;QACxC,KAAK,MAAM;YACV,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["import { err, ok, type Result } from \"../../types.ts\";\nimport type { SessionMutation } from \"../state.ts\";\nimport type { Entry, LaneRecord } from \"../types.ts\";\nimport { JsonlDecodeError } from \"./errors.ts\";\nimport type { JsonlSessionMetadata, JsonlV4Header } from \"./types.ts\";\n\nconst ENTRY_TYPES = new Set<Entry[\"type\"]>([\n\t\"message\",\n\t\"model_change\",\n\t\"thinking_level_change\",\n\t\"active_tools_change\",\n\t\"compaction\",\n\t\"branch_summary\",\n\t\"custom\",\n]);\nconst RECORD_TYPES = new Set<LaneRecord[\"type\"]>([\n\t\"operation_started\",\n\t\"abort_requested\",\n\t\"operation_finished\",\n\t\"step_attempt\",\n\t\"tool_started\",\n\t\"queue_enqueued\",\n\t\"queue_cancelled\",\n\t\"write_deferred\",\n\t\"usage\",\n]);\nconst OPERATION_KINDS = new Set([\"run\", \"compaction\", \"navigation\"]);\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction parseObject(line: string): Record<string, unknown> {\n\tlet value: unknown;\n\ttry {\n\t\tvalue = JSON.parse(line);\n\t} catch (error) {\n\t\tthrow new JsonlDecodeError(\"syntax\", \"is not valid JSON\", error instanceof Error ? error : undefined);\n\t}\n\tif (!isObject(value)) throw new JsonlDecodeError(\"schema\", \"is not a JSON object\");\n\treturn value;\n}\n\nfunction requireString(value: unknown, field: string): string {\n\tif (typeof value !== \"string\") throw new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\treturn value;\n}\n\nfunction requireSequence(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) <= 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid seq\");\n\t}\n\treturn value as number;\n}\n\nfunction requireTimestamp(value: unknown): number {\n\tif (!Number.isSafeInteger(value) || (value as number) < 0) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid timestamp\");\n\t}\n\treturn value as number;\n}\n\nfunction requireNullableId(value: unknown, field: string): string | null {\n\tif (value !== null && typeof value !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", `has invalid ${field}`);\n\t}\n\treturn value as string | null;\n}\n\nfunction decodeHeader(line: string): JsonlV4Header {\n\tconst value = parseObject(line);\n\tif (value.kind !== \"header\") throw new JsonlDecodeError(\"schema\", \"is not a header\");\n\tif (value.version !== 4) throw new JsonlDecodeError(\"schema\", \"has unsupported session version\");\n\tconst parentSessionId = value.parentSessionId;\n\tif (parentSessionId !== undefined && typeof parentSessionId !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid parentSessionId\");\n\t}\n\tconst legacyParentSessionPath = value.legacyParentSessionPath;\n\tif (legacyParentSessionPath !== undefined && typeof legacyParentSessionPath !== \"string\") {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid legacyParentSessionPath\");\n\t}\n\tif (parentSessionId !== undefined && legacyParentSessionPath !== undefined) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has both parentSessionId and legacyParentSessionPath\");\n\t}\n\tconst metadataValue = value.metadata;\n\tif (metadataValue !== undefined && !isObject(metadataValue)) {\n\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid metadata\");\n\t}\n\tconst metadata = metadataValue as JsonlV4Header[\"metadata\"];\n\treturn {\n\t\tkind: \"header\",\n\t\tversion: 4,\n\t\tid: requireString(value.id, \"id\"),\n\t\tcreatedAt: requireTimestamp(value.createdAt),\n\t\tcwd: requireString(value.cwd, \"cwd\"),\n\t\tparentSessionId,\n\t\tlegacyParentSessionPath,\n\t\tmetadata,\n\t};\n}\n\nexport function parseHeader(line: string): Result<JsonlV4Header, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<JsonlV4Header, JsonlDecodeError>(decodeHeader(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<JsonlV4Header, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeHeader(header: JsonlV4Header): string {\n\treturn `${JSON.stringify(header)}\\n`;\n}\n\nexport function metadataFromHeader(header: JsonlV4Header, path: string, modifiedAt: number): JsonlSessionMetadata {\n\treturn {\n\t\tid: header.id,\n\t\tcreatedAt: header.createdAt,\n\t\tcwd: header.cwd,\n\t\tpath,\n\t\tmodifiedAt,\n\t\tsourceFormat: 4,\n\t\t...(header.parentSessionId === undefined ? {} : { parentSessionId: header.parentSessionId }),\n\t\t...(header.legacyParentSessionPath === undefined\n\t\t\t? {}\n\t\t\t: { legacyParentSessionPath: header.legacyParentSessionPath }),\n\t\t...(header.metadata === undefined ? {} : { metadata: header.metadata }),\n\t};\n}\n\nfunction parseEntryMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"entry\" }> {\n\tconst lane = value.lane === undefined ? undefined : requireString(value.lane, \"lane\");\n\tconst id = requireString(value.id, \"id\");\n\tconst type = requireString(value.type, \"entry type\");\n\tif (!ENTRY_TYPES.has(type as Entry[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown entry type ${type}`);\n\t}\n\tconst parentId = requireNullableId(value.parentId, \"parentId\");\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"custom\") requireString(value.customType, \"customType\");\n\tconst { kind: _kind, lane: _lane, ...entryFields } = value;\n\tconst entry = { ...entryFields, id, type, parentId, seq, timestamp } as unknown as Entry;\n\treturn lane === undefined ? { kind: \"entry\", entry } : { kind: \"entry\", lane, entry };\n}\n\nfunction parseRecordMutation(\n\tvalue: Record<string, unknown>,\n\tseq: number,\n): Extract<SessionMutation, { kind: \"record\" }> {\n\tconst id = requireString(value.id, \"id\");\n\tconst lane = requireString(value.lane, \"lane\");\n\tconst type = requireString(value.type, \"record type\");\n\tif (!RECORD_TYPES.has(type as LaneRecord[\"type\"])) {\n\t\tthrow new JsonlDecodeError(\"schema\", `has unknown record type ${type}`);\n\t}\n\tconst timestamp = requireTimestamp(value.timestamp);\n\tif (type === \"operation_started\") {\n\t\tif (!isObject(value.intent)) throw new JsonlDecodeError(\"schema\", \"has invalid intent\");\n\t\tconst operationKind = requireString(value.intent.kind, \"operation kind\");\n\t\tif (!OPERATION_KINDS.has(operationKind)) {\n\t\t\tthrow new JsonlDecodeError(\"schema\", `has unknown operation kind ${operationKind}`);\n\t\t}\n\t}\n\tif (type === \"operation_finished\") requireString(value.runId, \"runId\");\n\tconst { kind: _kind, ...recordFields } = value;\n\treturn {\n\t\tkind: \"record\",\n\t\trecord: { ...recordFields, id, lane, type, seq, timestamp } as unknown as LaneRecord,\n\t};\n}\n\nfunction parseLaneMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"lane\" }> {\n\treturn {\n\t\tkind: \"lane\",\n\t\tseq,\n\t\tlane: requireString(value.lane, \"lane\"),\n\t\tleafId: requireNullableId(value.leafId, \"leafId\"),\n\t};\n}\n\nfunction parseFactMutation(value: Record<string, unknown>, seq: number): Extract<SessionMutation, { kind: \"fact\" }> {\n\tif (value.fact === \"name\") {\n\t\tif (value.name !== undefined && typeof value.name !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid name\");\n\t\t}\n\t\treturn { kind: \"fact\", seq, fact: \"name\", name: value.name };\n\t}\n\tif (value.fact === \"label\") {\n\t\tif (value.label !== undefined && typeof value.label !== \"string\") {\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has invalid label\");\n\t\t}\n\t\treturn {\n\t\t\tkind: \"fact\",\n\t\t\tseq,\n\t\t\tfact: \"label\",\n\t\t\ttargetId: requireString(value.targetId, \"targetId\"),\n\t\t\tlabel: value.label,\n\t\t};\n\t}\n\tthrow new JsonlDecodeError(\"schema\", \"has unknown fact type\");\n}\n\nfunction decodeMutation(line: string): SessionMutation {\n\tconst value = parseObject(line);\n\tconst seq = requireSequence(value.seq);\n\tswitch (value.kind) {\n\t\tcase \"entry\":\n\t\t\treturn parseEntryMutation(value, seq);\n\t\tcase \"record\":\n\t\t\treturn parseRecordMutation(value, seq);\n\t\tcase \"lane\":\n\t\t\treturn parseLaneMutation(value, seq);\n\t\tcase \"fact\":\n\t\t\treturn parseFactMutation(value, seq);\n\t\tdefault:\n\t\t\tthrow new JsonlDecodeError(\"schema\", \"has unknown mutation kind\");\n\t}\n}\n\nexport function parseMutation(line: string): Result<SessionMutation, JsonlDecodeError> {\n\ttry {\n\t\treturn ok<SessionMutation, JsonlDecodeError>(decodeMutation(line));\n\t} catch (error) {\n\t\tif (error instanceof JsonlDecodeError) return err<SessionMutation, JsonlDecodeError>(error);\n\t\tthrow error;\n\t}\n}\n\nexport function encodeMutation(mutation: SessionMutation): string {\n\tswitch (mutation.kind) {\n\t\tcase \"entry\":\n\t\t\treturn `${JSON.stringify({ kind: \"entry\", lane: mutation.lane, ...mutation.entry })}\\n`;\n\t\tcase \"record\":\n\t\t\treturn `${JSON.stringify({ kind: \"record\", ...mutation.record })}\\n`;\n\t\tcase \"lane\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t\tcase \"fact\":\n\t\t\treturn `${JSON.stringify(mutation)}\\n`;\n\t}\n}\n"]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { FileError, Result } from "../../types.ts";
|
|
2
2
|
import { SessionError } from "../types.ts";
|
|
3
|
+
export declare class JsonlDecodeError extends Error {
|
|
4
|
+
readonly kind: "syntax" | "schema";
|
|
5
|
+
constructor(kind: "syntax" | "schema", message: string, cause?: Error);
|
|
6
|
+
}
|
|
3
7
|
export declare function fileResult<T>(result: Result<T, FileError>, message: string): T;
|
|
4
|
-
export declare function invalidFile(path: string, line: number,
|
|
8
|
+
export declare function invalidFile(path: string, line: number, cause: Error): SessionError;
|
|
5
9
|
//# sourceMappingURL=errors.d.ts.map
|
package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAS9E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qBAAa,gBAAiB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;gBAEvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAKrE;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAS9E;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,YAAY,CAElF"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { SessionError } from "../types.js";
|
|
2
|
+
export class JsonlDecodeError extends Error {
|
|
3
|
+
constructor(kind, message, cause) {
|
|
4
|
+
super(message, cause === undefined ? undefined : { cause });
|
|
5
|
+
this.name = "JsonlDecodeError";
|
|
6
|
+
this.kind = kind;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
2
9
|
export function fileResult(result, message) {
|
|
3
10
|
if (!result.ok) {
|
|
4
11
|
throw new SessionError(result.error.code === "not_found" ? "not_found" : "storage", `${message}: ${result.error.message}`, result.error);
|
|
5
12
|
}
|
|
6
13
|
return result.value;
|
|
7
14
|
}
|
|
8
|
-
export function invalidFile(path, line,
|
|
9
|
-
return new SessionError("invalid_entry", `Invalid JSONL v4 session ${path}: line ${line} ${message}`, cause);
|
|
15
|
+
export function invalidFile(path, line, cause) {
|
|
16
|
+
return new SessionError("invalid_entry", `Invalid JSONL v4 session ${path}: line ${line} ${cause.message}`, cause);
|
|
10
17
|
}
|
|
11
18
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,UAAU,CAAI,MAA4B,EAAE,OAAe;IAC1E,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,YAAY,CACrB,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC3D,GAAG,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EACrC,MAAM,CAAC,KAAK,CACZ,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,IAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAG1C,YAAY,IAAyB,EAAE,OAAe,EAAE,KAAa;QACpE,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAED,MAAM,UAAU,UAAU,CAAI,MAA4B,EAAE,OAAe;IAC1E,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,YAAY,CACrB,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAC3D,GAAG,OAAO,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EACrC,MAAM,CAAC,KAAK,CACZ,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,IAAY,EAAE,KAAY;IACnE,OAAO,IAAI,YAAY,CAAC,eAAe,EAAE,4BAA4B,IAAI,UAAU,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;AACpH,CAAC","sourcesContent":["import type { FileError, Result } from \"../../types.ts\";\nimport { SessionError } from \"../types.ts\";\n\nexport class JsonlDecodeError extends Error {\n\treadonly kind: \"syntax\" | \"schema\";\n\n\tconstructor(kind: \"syntax\" | \"schema\", message: string, cause?: Error) {\n\t\tsuper(message, cause === undefined ? undefined : { cause });\n\t\tthis.name = \"JsonlDecodeError\";\n\t\tthis.kind = kind;\n\t}\n}\n\nexport function fileResult<T>(result: Result<T, FileError>, message: string): T {\n\tif (!result.ok) {\n\t\tthrow new SessionError(\n\t\t\tresult.error.code === \"not_found\" ? \"not_found\" : \"storage\",\n\t\t\t`${message}: ${result.error.message}`,\n\t\t\tresult.error,\n\t\t);\n\t}\n\treturn result.value;\n}\n\nexport function invalidFile(path: string, line: number, cause: Error): SessionError {\n\treturn new SessionError(\"invalid_entry\", `Invalid JSONL v4 session ${path}: line ${line} ${cause.message}`, cause);\n}\n"]}
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { Session } from "../session.ts";
|
|
2
2
|
import { type ForkOptions, type SessionRepo } from "../types.ts";
|
|
3
|
+
import { JsonlSessionStorage } from "./storage.ts";
|
|
3
4
|
import type { JsonlSessionCreateOptions, JsonlSessionListOptions, JsonlSessionMetadata, JsonlSessionRepoOptions } from "./types.ts";
|
|
5
|
+
export declare function listJsonlSessionMetadata(options: JsonlSessionRepoOptions, query?: JsonlSessionListOptions): Promise<JsonlSessionMetadata[]>;
|
|
6
|
+
export declare function loadJsonlSessionStorage(options: JsonlSessionRepoOptions, metadata: JsonlSessionMetadata): Promise<JsonlSessionStorage>;
|
|
4
7
|
export declare class JsonlSessionRepo implements SessionRepo<JsonlSessionMetadata, JsonlSessionCreateOptions, JsonlSessionListOptions> {
|
|
5
8
|
private readonly fs;
|
|
6
9
|
private readonly sessionsRootInput;
|
|
10
|
+
private readonly activeCreateDestinations;
|
|
7
11
|
private rootPromise;
|
|
8
12
|
constructor(options: JsonlSessionRepoOptions);
|
|
9
13
|
create(options: JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>>;
|
|
10
14
|
open(metadata: JsonlSessionMetadata): Promise<Session<JsonlSessionMetadata>>;
|
|
11
|
-
list(): Promise<JsonlSessionMetadata[]>;
|
|
12
|
-
list(options: JsonlSessionListOptions): Promise<JsonlSessionMetadata[]>;
|
|
15
|
+
list(options?: JsonlSessionListOptions): Promise<JsonlSessionMetadata[]>;
|
|
13
16
|
delete(metadata: JsonlSessionMetadata): Promise<void>;
|
|
14
17
|
fork(source: JsonlSessionMetadata, options: ForkOptions & JsonlSessionCreateOptions): Promise<Session<JsonlSessionMetadata>>;
|
|
15
18
|
private loadStorage;
|
|
19
|
+
private resolveCreateDestination;
|
|
20
|
+
/**
|
|
21
|
+
* Prevent same-process create/fork races for one logical destination. The durable filename includes a
|
|
22
|
+
* timestamp, so the async filesystem existence check alone can let two concurrent calls both decide the
|
|
23
|
+
* same {cwd, id} is free and publish duplicate sessions.
|
|
24
|
+
*/
|
|
25
|
+
private claimCreateDestination;
|
|
16
26
|
private prepareCreate;
|
|
17
27
|
private listDirect;
|
|
18
28
|
private sessionIdExists;
|
|
19
|
-
private sessionDirectories;
|
|
20
29
|
private sessionDirectory;
|
|
21
30
|
private root;
|
|
22
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../../src/harness/session/jsonl/repo.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,OAAO,EAAE,MAAM,eAAe,CAAC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