@code-yeongyu/senpi 2026.7.31 → 2026.8.3
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 +270 -0
- package/README.md +1 -0
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +27 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +116 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/remote-session.d.ts +53 -0
- package/dist/client/remote-session.d.ts.map +1 -0
- package/dist/client/remote-session.js +340 -0
- package/dist/client/remote-session.js.map +1 -0
- package/dist/client/transcript.d.ts +12 -0
- package/dist/client/transcript.d.ts.map +1 -0
- package/dist/client/transcript.js +98 -0
- package/dist/client/transcript.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +85 -14
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +445 -78
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +5 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +72 -11
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +4 -0
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/dynamic-prompt/verification.d.ts +2 -2
- package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/verification.js +2 -2
- package/dist/core/dynamic-prompt/verification.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.d.ts +2 -2
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.js +25 -25
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-command.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.d.ts +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.js +2 -2
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-management.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.d.ts +9 -9
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.js +2 -2
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.d.ts +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.js +3 -3
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/affinity.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.d.ts +21 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.js +30 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-attempt.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/auth-lane.d.ts +8 -4
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.d.ts.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/auth-lane.js +34 -25
- package/dist/core/extensions/builtin/claude-sdk-oauth/auth-lane.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts +17 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js +56 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.d.ts +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.js +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/errors.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.js +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts +14 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.d.ts.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/guidance.js +37 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/guidance.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts +4 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/index.js +12 -10
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.d.ts +3 -3
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/oauth-login.js +2 -2
- package/dist/core/extensions/builtin/claude-sdk-oauth/oauth-login.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.d.ts +18 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/options.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/options.js +70 -10
- package/dist/core/extensions/builtin/claude-sdk-oauth/options.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.js +32 -19
- package/dist/core/extensions/builtin/claude-sdk-oauth/prompt-bridge.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.d.ts +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts +32 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +43 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts +18 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js +46 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts +81 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js +127 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-continuity.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts +10 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-entry-annotations.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts +56 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js +174 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-observability.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts +24 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts +34 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +85 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts +19 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js +176 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts +18 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.js +33 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js +76 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-wiring.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts +87 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js +259 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts +19 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +192 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts +20 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js +132 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts +14 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js +42 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-claim.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts +32 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js +8 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts +28 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js +107 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts +16 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js +92 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-events.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts +2 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js +10 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-guidance.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js +208 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.d.ts +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.js +25 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/system-prompt.js.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.d.ts +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.d.ts.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.js +2 -2
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tool-watch.js.map +1 -1
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tools.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -0
- package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/tools.js +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts +18 -1
- package/dist/core/extensions/builtin/compaction/checkpoint-state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/checkpoint-state.js +32 -0
- package/dist/core/extensions/builtin/compaction/checkpoint-state.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts +18 -0
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js +73 -0
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts +21 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.js +24 -0
- package/dist/core/extensions/builtin/compaction/idle-retry.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js +119 -15
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/lane-policy.d.ts +71 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.js +94 -0
- package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/log.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js +1 -0
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts +59 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.js +155 -0
- package/dist/core/extensions/builtin/compaction/overflow-retry.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative.d.ts +4 -1
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/speculative.js +39 -115
- package/dist/core/extensions/builtin/compaction/speculative.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/task-intent.d.ts +2 -6
- package/dist/core/extensions/builtin/compaction/task-intent.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/task-intent.js +10 -9
- package/dist/core/extensions/builtin/compaction/task-intent.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/transient-failure.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/transient-failure.js +3 -0
- package/dist/core/extensions/builtin/compaction/transient-failure.js.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts +6 -0
- package/dist/core/extensions/builtin/goal/continuation-recovery.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/continuation-recovery.js +20 -0
- package/dist/core/extensions/builtin/goal/continuation-recovery.js.map +1 -0
- package/dist/core/extensions/builtin/goal/continuation.d.ts +2 -4
- package/dist/core/extensions/builtin/goal/continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/continuation.js +2 -8
- package/dist/core/extensions/builtin/goal/continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts +19 -0
- package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js +48 -0
- package/dist/core/extensions/builtin/goal/direct-input-lifecycle.js.map +1 -0
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +17 -15
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js +12 -10
- package/dist/core/extensions/builtin/goal/lifecycle-helpers.js.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +5 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +94 -52
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/persistence.d.ts +16 -0
- package/dist/core/extensions/builtin/goal/persistence.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/persistence.js +185 -11
- package/dist/core/extensions/builtin/goal/persistence.js.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/ui.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.js +11 -2
- package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.js +13 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js +15 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/index.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts +1 -0
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js +53 -8
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +5 -2
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts +31 -0
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/detectors.js +152 -0
- package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/index.d.ts +3 -0
- package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/index.js +31 -0
- package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts +5 -0
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/notice.js +42 -0
- package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts +30 -0
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/policy.js +30 -0
- package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +4 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.js +50 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/similarity.d.ts +13 -0
- package/dist/core/extensions/builtin/loop-guard/similarity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/similarity.js +51 -0
- package/dist/core/extensions/builtin/loop-guard/similarity.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +13 -0
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/tracker.js +39 -0
- package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -0
- package/dist/core/extensions/builtin/mcp/health.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/health.js +2 -1
- package/dist/core/extensions/builtin/mcp/health.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +10 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js +10 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash-0731.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js +10 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-flash.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js +11 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-pro.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts +13 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js +60 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +5 -3
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/index.js +8 -4
- package/dist/core/extensions/builtin/prompt-preset/index.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +8 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.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 +42 -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 +3 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/recommended-models/index.js +2 -1
- package/dist/core/extensions/builtin/recommended-models/index.js.map +1 -1
- package/dist/core/extensions/builtin/rules/index.js +4 -3
- package/dist/core/extensions/builtin/rules/index.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/constants.d.ts +11 -0
- package/dist/core/extensions/builtin/rules/rules/constants.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/constants.js +11 -0
- package/dist/core/extensions/builtin/rules/rules/constants.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.js +15 -1
- package/dist/core/extensions/builtin/rules/rules/formatter.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +23 -21
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +21 -7
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.js +42 -5
- package/dist/core/extensions/builtin/terminal/monitor-notify.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts +2 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.js +2 -0
- package/dist/core/extensions/builtin/terminal/monitor-registry.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts +37 -0
- package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js +61 -0
- package/dist/core/extensions/builtin/terminal/monitor-status-ticker.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/monitor-status.d.ts +9 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status.js +35 -2
- package/dist/core/extensions/builtin/terminal/monitor-status.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/context.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js +2 -1
- package/dist/core/extensions/builtin/terminal/tools/monitor.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/commands.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/commands.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/commands.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.js +6 -3
- package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.d.ts +1 -1
- package/dist/core/extensions/builtin/todotools/state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/state.js +1 -1
- package/dist/core/extensions/builtin/todotools/state.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts +19 -0
- package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todotools/todo-widget-component.js +78 -0
- package/dist/core/extensions/builtin/todotools/todo-widget-component.js.map +1 -0
- package/dist/core/extensions/builtin/todotools/todo-widget.d.ts +13 -1
- package/dist/core/extensions/builtin/todotools/todo-widget.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/todo-widget.js +32 -14
- package/dist/core/extensions/builtin/todotools/todo-widget.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts +2 -2
- package/dist/core/extensions/builtin/todotools/tools/todo.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.js +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.js +1 -1
- package/dist/core/extensions/builtin/tool-pair-guard/index.js.map +1 -1
- package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tps.js +5 -2
- package/dist/core/extensions/builtin/tps.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts +4 -0
- package/dist/core/extensions/builtin/ttsr/builtin-rules.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ttsr/builtin-rules.js +20 -0
- package/dist/core/extensions/builtin/ttsr/builtin-rules.js.map +1 -0
- package/dist/core/extensions/builtin/ttsr/commands.js +9 -1
- package/dist/core/extensions/builtin/ttsr/commands.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/index.js +4 -3
- package/dist/core/extensions/builtin/ttsr/index.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/manager.js +1 -1
- package/dist/core/extensions/builtin/ttsr/manager.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/config.js +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/config.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js +16 -5
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/provider-endpoints.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts +4 -1
- package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js +44 -37
- package/dist/core/extensions/builtin/websearch/websearch/providers/anthropic.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts +3 -0
- package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.d.ts.map +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js +12 -0
- package/dist/core/extensions/builtin/websearch/websearch/providers/deepseek.js.map +1 -0
- package/dist/core/extensions/builtin/websearch/websearch/providers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/providers.js +2 -0
- package/dist/core/extensions/builtin/websearch/websearch/providers.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js +3 -3
- package/dist/core/extensions/builtin/websearch/websearch/renderers.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/search.js +1 -3
- package/dist/core/extensions/builtin/websearch/websearch/search.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/tool.js +2 -2
- package/dist/core/extensions/builtin/websearch/websearch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +19 -18
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +5 -2
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +21 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +38 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +24 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/model-registry.d.ts +2 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +3 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts +0 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +18 -34
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts +9 -0
- package/dist/core/pi-manifest.d.ts.map +1 -0
- package/dist/core/pi-manifest.js +25 -0
- package/dist/core/pi-manifest.js.map +1 -0
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +55 -6
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/hint-policy.d.ts +29 -0
- package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -0
- package/dist/core/retry-fallback/hint-policy.js +54 -0
- package/dist/core/retry-fallback/hint-policy.js.map +1 -0
- package/dist/core/retry-fallback/probe-scheduler.d.ts +60 -0
- package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -0
- package/dist/core/retry-fallback/probe-scheduler.js +206 -0
- package/dist/core/retry-fallback/probe-scheduler.js.map +1 -0
- package/dist/core/retry-fallback/settings.d.ts +9 -0
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +14 -0
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/settings-manager.d.ts +10 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +21 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/thinking-levels.d.ts +5 -0
- package/dist/core/thinking-levels.d.ts.map +1 -1
- package/dist/core/thinking-levels.js +9 -39
- package/dist/core/thinking-levels.js.map +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +44 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/server/account.d.ts +1 -1
- package/dist/modes/app-server/server/account.js +1 -1
- package/dist/modes/app-server/server/account.js.map +1 -1
- package/dist/modes/app-server/server/server-core.js +1 -1
- package/dist/modes/app-server/server/server-core.js.map +1 -1
- package/dist/modes/interactive/compaction-queue-transfer.d.ts +2 -0
- package/dist/modes/interactive/compaction-queue-transfer.d.ts.map +1 -1
- package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +5 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +16 -4
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/continuity-notice.d.ts +21 -0
- package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -0
- package/dist/modes/interactive/components/continuity-notice.js +58 -0
- package/dist/modes/interactive/components/continuity-notice.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +9 -5
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +3 -0
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -0
- package/dist/modes/interactive/components/markdown-transform.js +19 -0
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +20 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +3 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +8 -2
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/help-content.d.ts.map +1 -1
- package/dist/modes/interactive/help-content.js +1 -0
- package/dist/modes/interactive/help-content.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +21 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +189 -62
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/risky-main-model-warning.d.ts +1 -1
- package/dist/modes/interactive/risky-main-model-warning.d.ts.map +1 -1
- package/dist/modes/interactive/risky-main-model-warning.js +1 -1
- package/dist/modes/interactive/risky-main-model-warning.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -0
- package/dist/modes/interactive/theme/grok-day.json +1 -0
- package/dist/modes/interactive/theme/grok-night.json +1 -0
- package/dist/modes/interactive/theme/light.json +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +5 -1
- package/dist/modes/interactive/theme/theme.d.ts +2 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +13 -3
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +16 -3
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +22 -2
- package/dist/utils/clipboard.js.map +1 -1
- package/docs/AGENTS.md +1 -6
- package/docs/custom-provider.md +10 -3
- package/docs/development.md +1 -2
- package/docs/extensions.md +34 -1
- package/docs/keybindings.md +13 -0
- package/docs/mcp.md +63 -4
- package/docs/models.md +1 -0
- package/docs/providers.md +41 -5
- package/docs/release-guide.md +7 -5
- package/docs/session-format.md +2 -0
- package/docs/settings.md +3 -1
- package/docs/skills.md +29 -0
- package/docs/themes.md +5 -3
- package/docs/usage.md +5 -0
- package/examples/extensions/custom-compaction.ts +1 -2
- package/examples/extensions/custom-provider-anthropic/index.ts +8 -2
- package/examples/extensions/doom-overlay/wad-finder.ts +7 -3
- package/examples/extensions/handoff.ts +2 -3
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/qna.ts +2 -2
- package/examples/rpc-extension-ui.ts +11 -2
- package/examples/sdk/02-custom-model.ts +1 -2
- package/examples/sdk/12-full-control.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +45 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +6 -3
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status-ticker.ts +79 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/extension/eval-status.ts +36 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +26 -12
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +146 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-handler.ts +21 -119
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +157 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +62 -208
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +98 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +81 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-state.ts +24 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-eval-result.ts +140 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-notification-queue.ts +53 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-request.ts +45 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +45 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +20 -342
- 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 +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +14 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +156 -67
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts +3 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js +70 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/array-session-reader.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts +13 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js +304 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts +17 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js +60 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/keyed-operation-queue.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js +107 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts +28 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js +61 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repository.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/search-backend.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +6 -10
- 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 +154 -77
- 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/types.d.ts +49 -23
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +6 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +6 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
- package/node_modules/@earendil-works/pi-ai/README.md +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +56 -25
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js +134 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-tool-pairs.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js +7 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.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 +64 -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/google-generative-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js +12 -2
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js +13 -6
- 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.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js +12 -2
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +19 -10
- 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/fallback-state.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js +70 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses/fallback-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts +2 -16
- 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 +94 -105
- 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 +19 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js +7 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-prompt-cache.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +11 -1
- 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 +9 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/simple-options.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js +81 -26
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openrouter.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +16 -8
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +2 -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/models.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +95 -19
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/mistral.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/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/providers/faux.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +18 -1
- 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/error-body.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js +23 -4
- package/node_modules/@earendil-works/pi-ai/dist/utils/error-body.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +10 -1
- 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/provider-retry.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js +13 -12
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js +233 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-hint.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/unavailable-tool-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/package.json +10 -6
- package/node_modules/@earendil-works/pi-client/CHANGELOG.md +7 -0
- package/node_modules/@earendil-works/pi-client/README.md +64 -0
- package/node_modules/@earendil-works/pi-client/dist/client.d.ts +25 -0
- package/node_modules/@earendil-works/pi-client/dist/client.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/client.js +386 -0
- package/node_modules/@earendil-works/pi-client/dist/client.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.d.ts +25 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.js +204 -0
- package/node_modules/@earendil-works/pi-client/dist/connection.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.d.ts +23 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.js +42 -0
- package/node_modules/@earendil-works/pi-client/dist/errors.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/index.d.ts +6 -0
- package/node_modules/@earendil-works/pi-client/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/index.js +3 -0
- package/node_modules/@earendil-works/pi-client/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.d.ts +8 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.js +11 -0
- package/node_modules/@earendil-works/pi-client/dist/promise.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts +54 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.js +50 -0
- package/node_modules/@earendil-works/pi-client/dist/session-handle.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/state.d.ts +22 -0
- package/node_modules/@earendil-works/pi-client/dist/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/state.js +149 -0
- package/node_modules/@earendil-works/pi-client/dist/state.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.d.ts +17 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.js +2 -0
- package/node_modules/@earendil-works/pi-client/dist/transport.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/types.d.ts +23 -0
- package/node_modules/@earendil-works/pi-client/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/types.js +2 -0
- package/node_modules/@earendil-works/pi-client/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.d.ts +8 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.js +151 -0
- package/node_modules/@earendil-works/pi-client/dist/unix.js.map +1 -0
- package/node_modules/@earendil-works/pi-client/package.json +56 -0
- package/node_modules/@earendil-works/pi-protocol/README.md +68 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js +163 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/decoder.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js +199 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/encoder.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js +4 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts +26 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/cbor/options.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.js +140 -0
- package/node_modules/@earendil-works/pi-protocol/dist/codec.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts +29 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.js +152 -0
- package/node_modules/@earendil-works/pi-protocol/dist/framing.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts +5 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.js +5 -0
- package/node_modules/@earendil-works/pi-protocol/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts +13818 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.js +382 -0
- package/node_modules/@earendil-works/pi-protocol/dist/schemas.js.map +1 -0
- package/node_modules/@earendil-works/pi-protocol/package.json +48 -0
- package/node_modules/@earendil-works/pi-pty/package.json +2 -2
- package/node_modules/@earendil-works/pi-tui/README.md +77 -14
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts +83 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js +687 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiAltScreen.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js +5 -0
- package/node_modules/@earendil-works/pi-tui/dist/TuiMainScreen.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js +36 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts +7 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js +43 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +4 -4
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +3 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +163 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +3 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.js +109 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts +8 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +10 -4
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +10 -4
- 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 +18 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.js +6 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout-node.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +40 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.js +315 -0
- package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/mux.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/mux.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +10 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +61 -3
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js +12 -2
- package/node_modules/@earendil-works/pi-tui/dist/terminal-text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +37 -16
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +89 -21
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +10 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +95 -4
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/typebox/build/compile/validator.d.mts +3 -11
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +5 -9
- package/node_modules/typebox/build/guard/guard.mjs +10 -15
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.mjs +3 -0
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +86 -98
- package/node_modules/typebox/build/type/script/mapping.mjs +95 -92
- package/node_modules/typebox/build/type/script/parser.d.mts +42 -40
- package/node_modules/typebox/build/type/script/parser.mjs +23 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +3 -7
- package/node_modules/typebox/build/typebox.mjs +3 -7
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +33 -33
- package/node_modules/typebox/readme.md +117 -103
- package/package.json +20 -10
- package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/auth-lane.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts +0 -6
- package/dist/core/extensions/builtin/claude-agent-sdk/guidance.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/guidance.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts +0 -4
- package/dist/core/extensions/builtin/claude-agent-sdk/index.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/index.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/oauth-login.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/options.d.ts +0 -16
- package/dist/core/extensions/builtin/claude-agent-sdk/options.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/prompt-bridge.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/sdk-boundary.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts +0 -15
- package/dist/core/extensions/builtin/claude-agent-sdk/settings.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/settings.js +0 -41
- package/dist/core/extensions/builtin/claude-agent-sdk/settings.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/stream.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/stream.js +0 -229
- package/dist/core/extensions/builtin/claude-agent-sdk/stream.js.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/tools.d.ts.map +0 -1
- package/dist/core/extensions/builtin/claude-agent-sdk/tools.js.map +0 -1
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts +0 -3
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.d.ts.map +0 -1
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js +0 -75
- package/dist/core/extensions/builtin/tool-pair-guard/sanitize-anthropic-payload.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js +0 -100
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -42
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js +0 -286
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js +0 -44
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-repo.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts +0 -33
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js +0 -163
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory-storage.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js +0 -39
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo-utils.js.map +0 -1
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/account-events.js +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools-schema.js +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/custom-tools.js +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/executable.js +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/failover.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/prompt-bridge.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/sdk-boundary.js +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.d.ts +0 -0
- /package/dist/core/extensions/builtin/{claude-agent-sdk → claude-sdk-oauth}/stream-protocol.js +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { toError } from "./errors.js";
|
|
2
|
+
export class ClientState {
|
|
3
|
+
#sessionSnapshots = new Map();
|
|
4
|
+
#attachedSessionIds = new Set();
|
|
5
|
+
#snapshotListeners = new Set();
|
|
6
|
+
#eventListeners = new Set();
|
|
7
|
+
#sessionSnapshotListeners = new Map();
|
|
8
|
+
#sessionEventListeners = new Map();
|
|
9
|
+
#onListenerError;
|
|
10
|
+
#snapshot;
|
|
11
|
+
constructor(onListenerError) {
|
|
12
|
+
this.#onListenerError = onListenerError;
|
|
13
|
+
}
|
|
14
|
+
get snapshot() {
|
|
15
|
+
return this.#snapshot;
|
|
16
|
+
}
|
|
17
|
+
reset() {
|
|
18
|
+
this.#snapshot = undefined;
|
|
19
|
+
this.#sessionSnapshots.clear();
|
|
20
|
+
this.#attachedSessionIds.clear();
|
|
21
|
+
}
|
|
22
|
+
clearAttachments() {
|
|
23
|
+
this.#attachedSessionIds.clear();
|
|
24
|
+
}
|
|
25
|
+
dispose() {
|
|
26
|
+
this.reset();
|
|
27
|
+
this.#snapshotListeners.clear();
|
|
28
|
+
this.#eventListeners.clear();
|
|
29
|
+
this.#sessionSnapshotListeners.clear();
|
|
30
|
+
this.#sessionEventListeners.clear();
|
|
31
|
+
}
|
|
32
|
+
getSessionSnapshot(sessionId) {
|
|
33
|
+
return this.#sessionSnapshots.get(sessionId);
|
|
34
|
+
}
|
|
35
|
+
isSessionAttached(sessionId) {
|
|
36
|
+
return this.#attachedSessionIds.has(sessionId);
|
|
37
|
+
}
|
|
38
|
+
forgetSessionSnapshot(sessionId) {
|
|
39
|
+
const previous = this.#sessionSnapshots.get(sessionId);
|
|
40
|
+
this.#sessionSnapshots.delete(sessionId);
|
|
41
|
+
return previous;
|
|
42
|
+
}
|
|
43
|
+
restoreSessionSnapshot(snapshot) {
|
|
44
|
+
if (!this.#sessionSnapshots.has(snapshot.id))
|
|
45
|
+
this.#sessionSnapshots.set(snapshot.id, snapshot);
|
|
46
|
+
}
|
|
47
|
+
subscribe(listener) {
|
|
48
|
+
this.#snapshotListeners.add(listener);
|
|
49
|
+
return () => this.#snapshotListeners.delete(listener);
|
|
50
|
+
}
|
|
51
|
+
onEvent(listener) {
|
|
52
|
+
this.#eventListeners.add(listener);
|
|
53
|
+
return () => this.#eventListeners.delete(listener);
|
|
54
|
+
}
|
|
55
|
+
subscribeSession(sessionId, listener) {
|
|
56
|
+
return addMappedListener(this.#sessionSnapshotListeners, sessionId, listener);
|
|
57
|
+
}
|
|
58
|
+
onSessionEvent(sessionId, listener) {
|
|
59
|
+
return addMappedListener(this.#sessionEventListeners, sessionId, listener);
|
|
60
|
+
}
|
|
61
|
+
applyResult(result) {
|
|
62
|
+
if (result.command === "list")
|
|
63
|
+
return;
|
|
64
|
+
if (result.command === "detach") {
|
|
65
|
+
this.#attachedSessionIds.delete(result.sessionId);
|
|
66
|
+
const snapshot = this.#sessionSnapshots.get(result.sessionId);
|
|
67
|
+
if (snapshot)
|
|
68
|
+
this.#applySessionSnapshot({ ...snapshot, attached: false }, true);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.#applySessionSnapshot(result.session);
|
|
72
|
+
}
|
|
73
|
+
applyEvent(event) {
|
|
74
|
+
if (event.type === "server_snapshot")
|
|
75
|
+
this.applyServerSnapshot(event.snapshot);
|
|
76
|
+
if (event.type === "session_snapshot")
|
|
77
|
+
this.#applySessionSnapshot(event.snapshot);
|
|
78
|
+
if (event.type === "session_removed") {
|
|
79
|
+
this.#sessionSnapshots.delete(event.sessionId);
|
|
80
|
+
this.#attachedSessionIds.delete(event.sessionId);
|
|
81
|
+
}
|
|
82
|
+
this.#notify(this.#eventListeners, event);
|
|
83
|
+
const sessionId = getEventSessionId(event);
|
|
84
|
+
if (sessionId)
|
|
85
|
+
this.#notify(this.#sessionEventListeners.get(sessionId), event);
|
|
86
|
+
}
|
|
87
|
+
applyServerSnapshot(snapshot) {
|
|
88
|
+
if (this.#snapshot && snapshot.revision < this.#snapshot.revision)
|
|
89
|
+
return;
|
|
90
|
+
this.#snapshot = snapshot;
|
|
91
|
+
this.#attachedSessionIds.clear();
|
|
92
|
+
for (const session of snapshot.sessions)
|
|
93
|
+
if (session.attached)
|
|
94
|
+
this.#attachedSessionIds.add(session.id);
|
|
95
|
+
this.#notify(this.#snapshotListeners, snapshot);
|
|
96
|
+
}
|
|
97
|
+
#applySessionSnapshot(snapshot, force = false) {
|
|
98
|
+
const current = this.#sessionSnapshots.get(snapshot.id);
|
|
99
|
+
if (!force && current && snapshot.revision < current.revision)
|
|
100
|
+
return;
|
|
101
|
+
this.#sessionSnapshots.set(snapshot.id, snapshot);
|
|
102
|
+
if (snapshot.attached)
|
|
103
|
+
this.#attachedSessionIds.add(snapshot.id);
|
|
104
|
+
else
|
|
105
|
+
this.#attachedSessionIds.delete(snapshot.id);
|
|
106
|
+
this.#notify(this.#sessionSnapshotListeners.get(snapshot.id), snapshot);
|
|
107
|
+
}
|
|
108
|
+
#notify(listeners, value) {
|
|
109
|
+
for (const listener of listeners ?? []) {
|
|
110
|
+
try {
|
|
111
|
+
listener(value);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
this.#reportListenerError(error);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
#reportListenerError(error) {
|
|
119
|
+
if (!this.#onListenerError)
|
|
120
|
+
return;
|
|
121
|
+
try {
|
|
122
|
+
this.#onListenerError(toError(error));
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// Diagnostics cannot affect client state.
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function addMappedListener(listenersById, id, listener) {
|
|
130
|
+
let listeners = listenersById.get(id);
|
|
131
|
+
if (!listeners) {
|
|
132
|
+
listeners = new Set();
|
|
133
|
+
listenersById.set(id, listeners);
|
|
134
|
+
}
|
|
135
|
+
listeners.add(listener);
|
|
136
|
+
return () => {
|
|
137
|
+
listeners.delete(listener);
|
|
138
|
+
if (listeners.size === 0)
|
|
139
|
+
listenersById.delete(id);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function getEventSessionId(event) {
|
|
143
|
+
if (event.type === "session_snapshot")
|
|
144
|
+
return event.snapshot.id;
|
|
145
|
+
if (event.type === "session_progress" || event.type === "session_removed")
|
|
146
|
+
return event.sessionId;
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,MAAM,OAAO,WAAW;IACd,iBAAiB,GAAG,IAAI,GAAG,EAA2B,CAAC;IACvD,mBAAmB,GAAG,IAAI,GAAG,EAAU,CAAC;IACxC,kBAAkB,GAAG,IAAI,GAAG,EAAsC,CAAC;IACnE,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;IAC1D,yBAAyB,GAAG,IAAI,GAAG,EAAoD,CAAC;IACxF,sBAAsB,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC9E,gBAAgB,CAAmC;IAC5D,SAAS,CAA6B;IAEtC,YAAY,eAAsC;QACjD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,gBAAgB;QACf,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,OA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AC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAkB;IAC5C,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB;QAAE,OAAO,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;IAChE,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB;QAAE,OAAO,KAAK,CAAC,SAAS,CAAC;IAClG,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["import type { CommandResult, ServerEvent, ServerSnapshot, SessionSnapshot } from \"@earendil-works/pi-protocol\";\nimport { toError } from \"./errors.ts\";\nimport type { ListenerErrorHandler, Unsubscribe } from \"./types.ts\";\n\nexport class ClientState {\n\treadonly #sessionSnapshots = new Map<string, SessionSnapshot>();\n\treadonly #attachedSessionIds = new Set<string>();\n\treadonly #snapshotListeners = new Set<(snapshot: ServerSnapshot) => void>();\n\treadonly #eventListeners = new Set<(event: ServerEvent) => void>();\n\treadonly #sessionSnapshotListeners = new Map<string, Set<(snapshot: SessionSnapshot) => void>>();\n\treadonly #sessionEventListeners = new Map<string, Set<(event: ServerEvent) => void>>();\n\treadonly #onListenerError: ListenerErrorHandler | undefined;\n\t#snapshot: ServerSnapshot | undefined;\n\n\tconstructor(onListenerError?: ListenerErrorHandler) {\n\t\tthis.#onListenerError = onListenerError;\n\t}\n\n\tget snapshot(): ServerSnapshot | undefined {\n\t\treturn this.#snapshot;\n\t}\n\n\treset(): void {\n\t\tthis.#snapshot = undefined;\n\t\tthis.#sessionSnapshots.clear();\n\t\tthis.#attachedSessionIds.clear();\n\t}\n\n\tclearAttachments(): void {\n\t\tthis.#attachedSessionIds.clear();\n\t}\n\n\tdispose(): void {\n\t\tthis.reset();\n\t\tthis.#snapshotListeners.clear();\n\t\tthis.#eventListeners.clear();\n\t\tthis.#sessionSnapshotListeners.clear();\n\t\tthis.#sessionEventListeners.clear();\n\t}\n\n\tgetSessionSnapshot(sessionId: string): SessionSnapshot | undefined {\n\t\treturn this.#sessionSnapshots.get(sessionId);\n\t}\n\n\tisSessionAttached(sessionId: string): boolean {\n\t\treturn this.#attachedSessionIds.has(sessionId);\n\t}\n\n\tforgetSessionSnapshot(sessionId: string): SessionSnapshot | undefined {\n\t\tconst previous = this.#sessionSnapshots.get(sessionId);\n\t\tthis.#sessionSnapshots.delete(sessionId);\n\t\treturn previous;\n\t}\n\n\trestoreSessionSnapshot(snapshot: SessionSnapshot): void {\n\t\tif (!this.#sessionSnapshots.has(snapshot.id)) this.#sessionSnapshots.set(snapshot.id, snapshot);\n\t}\n\n\tsubscribe(listener: (snapshot: ServerSnapshot) => void): Unsubscribe {\n\t\tthis.#snapshotListeners.add(listener);\n\t\treturn () => this.#snapshotListeners.delete(listener);\n\t}\n\n\tonEvent(listener: (event: ServerEvent) => void): Unsubscribe {\n\t\tthis.#eventListeners.add(listener);\n\t\treturn () => this.#eventListeners.delete(listener);\n\t}\n\n\tsubscribeSession(sessionId: string, listener: (snapshot: SessionSnapshot) => void): Unsubscribe {\n\t\treturn addMappedListener(this.#sessionSnapshotListeners, sessionId, listener);\n\t}\n\n\tonSessionEvent(sessionId: string, listener: (event: ServerEvent) => void): Unsubscribe {\n\t\treturn addMappedListener(this.#sessionEventListeners, sessionId, listener);\n\t}\n\n\tapplyResult(result: CommandResult): void {\n\t\tif (result.command === \"list\") return;\n\t\tif (result.command === \"detach\") {\n\t\t\tthis.#attachedSessionIds.delete(result.sessionId);\n\t\t\tconst snapshot = this.#sessionSnapshots.get(result.sessionId);\n\t\t\tif (snapshot) this.#applySessionSnapshot({ ...snapshot, attached: false }, true);\n\t\t\treturn;\n\t\t}\n\t\tthis.#applySessionSnapshot(result.session);\n\t}\n\n\tapplyEvent(event: ServerEvent): void {\n\t\tif (event.type === \"server_snapshot\") this.applyServerSnapshot(event.snapshot);\n\t\tif (event.type === \"session_snapshot\") this.#applySessionSnapshot(event.snapshot);\n\t\tif (event.type === \"session_removed\") {\n\t\t\tthis.#sessionSnapshots.delete(event.sessionId);\n\t\t\tthis.#attachedSessionIds.delete(event.sessionId);\n\t\t}\n\t\tthis.#notify(this.#eventListeners, event);\n\t\tconst sessionId = getEventSessionId(event);\n\t\tif (sessionId) this.#notify(this.#sessionEventListeners.get(sessionId), event);\n\t}\n\n\tapplyServerSnapshot(snapshot: ServerSnapshot): void {\n\t\tif (this.#snapshot && snapshot.revision < this.#snapshot.revision) return;\n\t\tthis.#snapshot = snapshot;\n\t\tthis.#attachedSessionIds.clear();\n\t\tfor (const session of snapshot.sessions) if (session.attached) this.#attachedSessionIds.add(session.id);\n\t\tthis.#notify(this.#snapshotListeners, snapshot);\n\t}\n\n\t#applySessionSnapshot(snapshot: SessionSnapshot, force = false): void {\n\t\tconst current = this.#sessionSnapshots.get(snapshot.id);\n\t\tif (!force && current && snapshot.revision < current.revision) return;\n\t\tthis.#sessionSnapshots.set(snapshot.id, snapshot);\n\t\tif (snapshot.attached) this.#attachedSessionIds.add(snapshot.id);\n\t\telse this.#attachedSessionIds.delete(snapshot.id);\n\t\tthis.#notify(this.#sessionSnapshotListeners.get(snapshot.id), snapshot);\n\t}\n\n\t#notify<T>(listeners: Iterable<(value: T) => void> | undefined, value: T): void {\n\t\tfor (const listener of listeners ?? []) {\n\t\t\ttry {\n\t\t\t\tlistener(value);\n\t\t\t} catch (error) {\n\t\t\t\tthis.#reportListenerError(error);\n\t\t\t}\n\t\t}\n\t}\n\n\t#reportListenerError(error: unknown): void {\n\t\tif (!this.#onListenerError) return;\n\t\ttry {\n\t\t\tthis.#onListenerError(toError(error));\n\t\t} catch {\n\t\t\t// Diagnostics cannot affect client state.\n\t\t}\n\t}\n}\n\nfunction addMappedListener<T>(\n\tlistenersById: Map<string, Set<(value: T) => void>>,\n\tid: string,\n\tlistener: (value: T) => void,\n): Unsubscribe {\n\tlet listeners = listenersById.get(id);\n\tif (!listeners) {\n\t\tlisteners = new Set();\n\t\tlistenersById.set(id, listeners);\n\t}\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t\tif (listeners.size === 0) listenersById.delete(id);\n\t};\n}\n\nfunction getEventSessionId(event: ServerEvent): string | undefined {\n\tif (event.type === \"session_snapshot\") return event.snapshot.id;\n\tif (event.type === \"session_progress\" || event.type === \"session_removed\") return event.sessionId;\n\treturn undefined;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ByteTransport {
|
|
2
|
+
/** Sends one byte chunk. Calls must be delivered in invocation order. */
|
|
3
|
+
send(chunk: Uint8Array): Promise<void>;
|
|
4
|
+
/** Closes the transport. Implementations must make repeated calls harmless. */
|
|
5
|
+
close(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface ByteTransportHandlers {
|
|
8
|
+
/** Delivers an arbitrary inbound byte chunk. */
|
|
9
|
+
onData(chunk: Uint8Array): void;
|
|
10
|
+
/** Reports an orderly terminal close. */
|
|
11
|
+
onClose(): void;
|
|
12
|
+
/** Reports a terminal transport failure. */
|
|
13
|
+
onError(error: Error): void;
|
|
14
|
+
}
|
|
15
|
+
/** Creates a fresh connected transport for each PiClient connection attempt. Exactly one terminal handler is expected. */
|
|
16
|
+
export type ByteTransportFactory = (handlers: ByteTransportHandlers) => ByteTransport | Promise<ByteTransport>;
|
|
17
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,yEAAyE;IACzE,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,+EAA+E;IAC/E,KAAK,IAAI,IAAI,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACrC,gDAAgD;IAChD,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAChC,yCAAyC;IACzC,OAAO,IAAI,IAAI,CAAC;IAChB,4CAA4C;IAC5C,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC5B;AAED,0HAA0H;AAC1H,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,qBAAqB,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"","sourcesContent":["export interface ByteTransport {\n\t/** Sends one byte chunk. Calls must be delivered in invocation order. */\n\tsend(chunk: Uint8Array): Promise<void>;\n\t/** Closes the transport. Implementations must make repeated calls harmless. */\n\tclose(): void;\n}\n\nexport interface ByteTransportHandlers {\n\t/** Delivers an arbitrary inbound byte chunk. */\n\tonData(chunk: Uint8Array): void;\n\t/** Reports an orderly terminal close. */\n\tonClose(): void;\n\t/** Reports a terminal transport failure. */\n\tonError(error: Error): void;\n}\n\n/** Creates a fresh connected transport for each PiClient connection attempt. Exactly one terminal handler is expected. */\nexport type ByteTransportFactory = (handlers: ByteTransportHandlers) => ByteTransport | Promise<ByteTransport>;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModelRef, ThinkingLevel } from "@earendil-works/pi-protocol";
|
|
2
|
+
import type { ByteTransportFactory } from "./transport.ts";
|
|
3
|
+
export type ConnectionState = "disconnected" | "connecting" | "connected";
|
|
4
|
+
export interface ConnectionStateChange {
|
|
5
|
+
state: ConnectionState;
|
|
6
|
+
error?: Error;
|
|
7
|
+
}
|
|
8
|
+
export type Unsubscribe = () => void;
|
|
9
|
+
export type ListenerErrorHandler = (error: Error) => void;
|
|
10
|
+
export interface PiClientOptions {
|
|
11
|
+
token: string;
|
|
12
|
+
transportFactory: ByteTransportFactory;
|
|
13
|
+
maxFrameLength?: number;
|
|
14
|
+
/** Reports subscriber failures without allowing them to corrupt client state. */
|
|
15
|
+
onListenerError?: ListenerErrorHandler;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateSessionOptions {
|
|
18
|
+
cwd?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
model?: ModelRef;
|
|
21
|
+
thinkingLevel?: ThinkingLevel;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,CAAC;AAE1E,MAAM,WAAW,qBAAqB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AACrC,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModelRef, ThinkingLevel } from \"@earendil-works/pi-protocol\";\nimport type { ByteTransportFactory } from \"./transport.ts\";\n\nexport type ConnectionState = \"disconnected\" | \"connecting\" | \"connected\";\n\nexport interface ConnectionStateChange {\n\tstate: ConnectionState;\n\terror?: Error;\n}\n\nexport type Unsubscribe = () => void;\nexport type ListenerErrorHandler = (error: Error) => void;\n\nexport interface PiClientOptions {\n\ttoken: string;\n\ttransportFactory: ByteTransportFactory;\n\tmaxFrameLength?: number;\n\t/** Reports subscriber failures without allowing them to corrupt client state. */\n\tonListenerError?: ListenerErrorHandler;\n}\n\nexport interface CreateSessionOptions {\n\tcwd?: string;\n\tname?: string;\n\tmodel?: ModelRef;\n\tthinkingLevel?: ThinkingLevel;\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ByteTransportFactory } from "./transport.ts";
|
|
2
|
+
export interface UnixTransportOptions {
|
|
3
|
+
path: string;
|
|
4
|
+
maxPendingBytes?: number;
|
|
5
|
+
}
|
|
6
|
+
/** Creates fresh Unix-domain socket transports for PiClient connection attempts in Node-compatible runtimes. */
|
|
7
|
+
export declare function createUnixTransportFactory(options: UnixTransportOptions): ByteTransportFactory;
|
|
8
|
+
//# sourceMappingURL=unix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unix.d.ts","sourceRoot":"","sources":["../src/unix.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,oBAAoB,EAAyB,MAAM,gBAAgB,CAAC;AAIjG,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,gHAAgH;AAChH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,oBAAoB,CAW9F"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { createConnection } from "node:net";
|
|
2
|
+
import { DEFAULT_MAX_FRAME_LENGTH } from "@earendil-works/pi-protocol";
|
|
3
|
+
const MAX_UNIX_SOCKET_PATH_BYTES = process.platform === "linux" ? 107 : 103;
|
|
4
|
+
/** Creates fresh Unix-domain socket transports for PiClient connection attempts in Node-compatible runtimes. */
|
|
5
|
+
export function createUnixTransportFactory(options) {
|
|
6
|
+
if (options.path.length === 0)
|
|
7
|
+
throw new TypeError("Unix transport path must not be empty");
|
|
8
|
+
if (Buffer.byteLength(options.path) > MAX_UNIX_SOCKET_PATH_BYTES) {
|
|
9
|
+
throw new TypeError(`Unix transport path is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes`);
|
|
10
|
+
}
|
|
11
|
+
const maxPendingBytes = options.maxPendingBytes ?? DEFAULT_MAX_FRAME_LENGTH * 4;
|
|
12
|
+
if (!Number.isSafeInteger(maxPendingBytes) || maxPendingBytes <= 0) {
|
|
13
|
+
throw new TypeError("Unix transport maxPendingBytes must be a positive safe integer");
|
|
14
|
+
}
|
|
15
|
+
if (process.platform === "win32")
|
|
16
|
+
throw new Error("Unix transport is not supported on Windows");
|
|
17
|
+
return (handlers) => connectUnixSocket(options.path, maxPendingBytes, handlers);
|
|
18
|
+
}
|
|
19
|
+
function connectUnixSocket(path, maxPendingBytes, handlers) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const socket = createConnection(path);
|
|
22
|
+
let connected = false;
|
|
23
|
+
let terminal = false;
|
|
24
|
+
const close = () => {
|
|
25
|
+
if (terminal)
|
|
26
|
+
return;
|
|
27
|
+
terminal = true;
|
|
28
|
+
socket.destroy();
|
|
29
|
+
if (connected)
|
|
30
|
+
handlers.onClose();
|
|
31
|
+
else
|
|
32
|
+
reject(new Error("Unix transport closed before connecting"));
|
|
33
|
+
};
|
|
34
|
+
socket.once("connect", () => {
|
|
35
|
+
if (terminal)
|
|
36
|
+
return;
|
|
37
|
+
connected = true;
|
|
38
|
+
resolve(new UnixByteTransport(socket, maxPendingBytes, () => {
|
|
39
|
+
terminal = true;
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
socket.on("data", (chunk) => {
|
|
43
|
+
if (!terminal)
|
|
44
|
+
handlers.onData(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength));
|
|
45
|
+
});
|
|
46
|
+
socket.once("end", close);
|
|
47
|
+
socket.once("close", close);
|
|
48
|
+
socket.once("error", (error) => {
|
|
49
|
+
if (terminal)
|
|
50
|
+
return;
|
|
51
|
+
terminal = true;
|
|
52
|
+
socket.destroy();
|
|
53
|
+
if (connected)
|
|
54
|
+
handlers.onError(error);
|
|
55
|
+
else
|
|
56
|
+
reject(error);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
class UnixByteTransport {
|
|
61
|
+
#socket;
|
|
62
|
+
#maxPendingBytes;
|
|
63
|
+
#markLocalClose;
|
|
64
|
+
#closed = false;
|
|
65
|
+
#pendingBytes = 0;
|
|
66
|
+
#writeTail = Promise.resolve();
|
|
67
|
+
constructor(socket, maxPendingBytes, markLocalClose) {
|
|
68
|
+
this.#socket = socket;
|
|
69
|
+
this.#maxPendingBytes = maxPendingBytes;
|
|
70
|
+
this.#markLocalClose = markLocalClose;
|
|
71
|
+
}
|
|
72
|
+
send(chunk) {
|
|
73
|
+
if (!(chunk instanceof Uint8Array)) {
|
|
74
|
+
return Promise.reject(new TypeError("Unix transport chunks must be Uint8Array"));
|
|
75
|
+
}
|
|
76
|
+
if (this.#closed)
|
|
77
|
+
return Promise.reject(new Error("Unix transport is closed"));
|
|
78
|
+
if (this.#pendingBytes + chunk.byteLength > this.#maxPendingBytes) {
|
|
79
|
+
return Promise.reject(new Error("Unix transport exceeded its pending byte limit"));
|
|
80
|
+
}
|
|
81
|
+
this.#pendingBytes += chunk.byteLength;
|
|
82
|
+
const bytes = chunk.slice();
|
|
83
|
+
const write = this.#writeTail.then(() => this.#write(bytes));
|
|
84
|
+
const tracked = write.finally(() => {
|
|
85
|
+
this.#pendingBytes -= bytes.byteLength;
|
|
86
|
+
});
|
|
87
|
+
this.#writeTail = tracked.catch(() => { });
|
|
88
|
+
return tracked;
|
|
89
|
+
}
|
|
90
|
+
close() {
|
|
91
|
+
if (this.#closed)
|
|
92
|
+
return;
|
|
93
|
+
this.#closed = true;
|
|
94
|
+
this.#markLocalClose();
|
|
95
|
+
this.#socket.destroy();
|
|
96
|
+
}
|
|
97
|
+
#write(chunk) {
|
|
98
|
+
if (this.#closed || !this.#socket.writable)
|
|
99
|
+
return Promise.reject(new Error("Unix transport is closed"));
|
|
100
|
+
return new Promise((resolve, reject) => {
|
|
101
|
+
let callbackComplete = false;
|
|
102
|
+
let drainComplete = false;
|
|
103
|
+
let requiresDrain;
|
|
104
|
+
let settled = false;
|
|
105
|
+
const onDrain = () => {
|
|
106
|
+
drainComplete = true;
|
|
107
|
+
finish();
|
|
108
|
+
};
|
|
109
|
+
const cleanup = () => {
|
|
110
|
+
this.#socket.off("drain", onDrain);
|
|
111
|
+
this.#socket.off("close", onClose);
|
|
112
|
+
};
|
|
113
|
+
const fail = (error) => {
|
|
114
|
+
if (settled)
|
|
115
|
+
return;
|
|
116
|
+
settled = true;
|
|
117
|
+
cleanup();
|
|
118
|
+
reject(error);
|
|
119
|
+
};
|
|
120
|
+
const finish = () => {
|
|
121
|
+
if (settled || !callbackComplete || requiresDrain === undefined)
|
|
122
|
+
return;
|
|
123
|
+
if (requiresDrain && !drainComplete)
|
|
124
|
+
return;
|
|
125
|
+
settled = true;
|
|
126
|
+
cleanup();
|
|
127
|
+
resolve();
|
|
128
|
+
};
|
|
129
|
+
const onClose = () => fail(new Error("Unix transport closed during write"));
|
|
130
|
+
try {
|
|
131
|
+
this.#socket.once("close", onClose);
|
|
132
|
+
const accepted = this.#socket.write(chunk, (error) => {
|
|
133
|
+
if (error) {
|
|
134
|
+
fail(error);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
callbackComplete = true;
|
|
138
|
+
finish();
|
|
139
|
+
});
|
|
140
|
+
requiresDrain = !accepted;
|
|
141
|
+
if (requiresDrain)
|
|
142
|
+
this.#socket.once("drain", onDrain);
|
|
143
|
+
finish();
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
fail(error instanceof Error ? error : new Error(String(error)));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=unix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unix.js","sourceRoot":"","sources":["../src/unix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,MAAM,0BAA0B,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAO5E,gHAAgH;AAChH,MAAM,UAAU,0BAA0B,CAAC,OAA6B;IACvE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IAC5F,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,0BAA0B,EAAE,CAAC;QAClE,MAAM,IAAI,SAAS,CAAC,+CAA+C,0BAA0B,cAAc,CAAC,CAAC;IAC9G,CAAC;IACD,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,wBAAwB,GAAG,CAAC,CAAC;IAChF,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,eAAe,IAAI,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,SAAS,CAAC,gEAAgE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChG,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,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,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjE,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { createConnection, type Socket } from \"node:net\";\nimport { DEFAULT_MAX_FRAME_LENGTH } from \"@earendil-works/pi-protocol\";\nimport type { ByteTransport, ByteTransportFactory, ByteTransportHandlers } from \"./transport.ts\";\n\nconst MAX_UNIX_SOCKET_PATH_BYTES = process.platform === \"linux\" ? 107 : 103;\n\nexport interface UnixTransportOptions {\n\tpath: string;\n\tmaxPendingBytes?: number;\n}\n\n/** Creates fresh Unix-domain socket transports for PiClient connection attempts in Node-compatible runtimes. */\nexport function createUnixTransportFactory(options: UnixTransportOptions): ByteTransportFactory {\n\tif (options.path.length === 0) throw new TypeError(\"Unix transport path must not be empty\");\n\tif (Buffer.byteLength(options.path) > MAX_UNIX_SOCKET_PATH_BYTES) {\n\t\tthrow new TypeError(`Unix transport path is too long; maximum is ${MAX_UNIX_SOCKET_PATH_BYTES} UTF-8 bytes`);\n\t}\n\tconst maxPendingBytes = options.maxPendingBytes ?? DEFAULT_MAX_FRAME_LENGTH * 4;\n\tif (!Number.isSafeInteger(maxPendingBytes) || maxPendingBytes <= 0) {\n\t\tthrow new TypeError(\"Unix transport maxPendingBytes must be a positive safe integer\");\n\t}\n\tif (process.platform === \"win32\") throw new Error(\"Unix transport is not supported on Windows\");\n\treturn (handlers) => connectUnixSocket(options.path, maxPendingBytes, handlers);\n}\n\nfunction connectUnixSocket(\n\tpath: string,\n\tmaxPendingBytes: number,\n\thandlers: ByteTransportHandlers,\n): Promise<ByteTransport> {\n\treturn new Promise<ByteTransport>((resolve, reject) => {\n\t\tconst socket = createConnection(path);\n\t\tlet connected = false;\n\t\tlet terminal = false;\n\n\t\tconst close = (): void => {\n\t\t\tif (terminal) return;\n\t\t\tterminal = true;\n\t\t\tsocket.destroy();\n\t\t\tif (connected) handlers.onClose();\n\t\t\telse reject(new Error(\"Unix transport closed before connecting\"));\n\t\t};\n\n\t\tsocket.once(\"connect\", () => {\n\t\t\tif (terminal) return;\n\t\t\tconnected = true;\n\t\t\tresolve(\n\t\t\t\tnew UnixByteTransport(socket, maxPendingBytes, () => {\n\t\t\t\t\tterminal = true;\n\t\t\t\t}),\n\t\t\t);\n\t\t});\n\t\tsocket.on(\"data\", (chunk: Buffer) => {\n\t\t\tif (!terminal) handlers.onData(new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength));\n\t\t});\n\t\tsocket.once(\"end\", close);\n\t\tsocket.once(\"close\", close);\n\t\tsocket.once(\"error\", (error) => {\n\t\t\tif (terminal) return;\n\t\t\tterminal = true;\n\t\t\tsocket.destroy();\n\t\t\tif (connected) handlers.onError(error);\n\t\t\telse reject(error);\n\t\t});\n\t});\n}\n\nclass UnixByteTransport implements ByteTransport {\n\treadonly #socket: Socket;\n\treadonly #maxPendingBytes: number;\n\treadonly #markLocalClose: () => void;\n\t#closed = false;\n\t#pendingBytes = 0;\n\t#writeTail: Promise<void> = Promise.resolve();\n\n\tconstructor(socket: Socket, maxPendingBytes: number, markLocalClose: () => void) {\n\t\tthis.#socket = socket;\n\t\tthis.#maxPendingBytes = maxPendingBytes;\n\t\tthis.#markLocalClose = markLocalClose;\n\t}\n\n\tsend(chunk: Uint8Array): Promise<void> {\n\t\tif (!(chunk instanceof Uint8Array)) {\n\t\t\treturn Promise.reject(new TypeError(\"Unix transport chunks must be Uint8Array\"));\n\t\t}\n\t\tif (this.#closed) return Promise.reject(new Error(\"Unix transport is closed\"));\n\t\tif (this.#pendingBytes + chunk.byteLength > this.#maxPendingBytes) {\n\t\t\treturn Promise.reject(new Error(\"Unix transport exceeded its pending byte limit\"));\n\t\t}\n\t\tthis.#pendingBytes += chunk.byteLength;\n\t\tconst bytes = chunk.slice();\n\t\tconst write = this.#writeTail.then(() => this.#write(bytes));\n\t\tconst tracked = write.finally(() => {\n\t\t\tthis.#pendingBytes -= bytes.byteLength;\n\t\t});\n\t\tthis.#writeTail = tracked.catch(() => {});\n\t\treturn tracked;\n\t}\n\n\tclose(): void {\n\t\tif (this.#closed) return;\n\t\tthis.#closed = true;\n\t\tthis.#markLocalClose();\n\t\tthis.#socket.destroy();\n\t}\n\n\t#write(chunk: Uint8Array): Promise<void> {\n\t\tif (this.#closed || !this.#socket.writable) return Promise.reject(new Error(\"Unix transport is closed\"));\n\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\tlet callbackComplete = false;\n\t\t\tlet drainComplete = false;\n\t\t\tlet requiresDrain: boolean | undefined;\n\t\t\tlet settled = false;\n\n\t\t\tconst onDrain = (): void => {\n\t\t\t\tdrainComplete = true;\n\t\t\t\tfinish();\n\t\t\t};\n\t\t\tconst cleanup = (): void => {\n\t\t\t\tthis.#socket.off(\"drain\", onDrain);\n\t\t\t\tthis.#socket.off(\"close\", onClose);\n\t\t\t};\n\t\t\tconst fail = (error: Error): void => {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tcleanup();\n\t\t\t\treject(error);\n\t\t\t};\n\t\t\tconst finish = (): void => {\n\t\t\t\tif (settled || !callbackComplete || requiresDrain === undefined) return;\n\t\t\t\tif (requiresDrain && !drainComplete) return;\n\t\t\t\tsettled = true;\n\t\t\t\tcleanup();\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\tconst onClose = (): void => fail(new Error(\"Unix transport closed during write\"));\n\n\t\t\ttry {\n\t\t\t\tthis.#socket.once(\"close\", onClose);\n\t\t\t\tconst accepted = this.#socket.write(chunk, (error) => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\tfail(error);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcallbackComplete = true;\n\t\t\t\t\tfinish();\n\t\t\t\t});\n\t\t\t\trequiresDrain = !accepted;\n\t\t\t\tif (requiresDrain) this.#socket.once(\"drain\", onDrain);\n\t\t\t\tfinish();\n\t\t\t} catch (error) {\n\t\t\t\tfail(error instanceof Error ? error : new Error(String(error)));\n\t\t\t}\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@earendil-works/pi-client",
|
|
3
|
+
"version": "2026.8.3",
|
|
4
|
+
"description": "Transport-neutral client for remote pi sessions over framed CBOR bytes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./unix": {
|
|
14
|
+
"types": "./dist/unix.d.ts",
|
|
15
|
+
"import": "./dist/unix.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md",
|
|
23
|
+
"CHANGELOG.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"clean": "shx rm -rf dist",
|
|
27
|
+
"build": "tsc -p tsconfig.build.json",
|
|
28
|
+
"test": "vitest --run",
|
|
29
|
+
"typecheck": "tsc -p tsconfig.test.json",
|
|
30
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"pi",
|
|
34
|
+
"client",
|
|
35
|
+
"protocol",
|
|
36
|
+
"cbor",
|
|
37
|
+
"binary"
|
|
38
|
+
],
|
|
39
|
+
"author": "Earendil Works",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/earendil-works/pi.git",
|
|
44
|
+
"directory": "packages/client"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22.19.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@earendil-works/pi-protocol": "2026.8.3"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"shx": "0.4.0",
|
|
54
|
+
"vitest": "4.1.9"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @earendil-works/pi-protocol
|
|
2
|
+
|
|
3
|
+
Runtime-neutral schemas, types, CBOR encoding, and byte-stream framing for the experimental pi protocol.
|
|
4
|
+
|
|
5
|
+
Protocol version `2` uses binary messages with this wire layout:
|
|
6
|
+
|
|
7
|
+
1. A four-byte unsigned big-endian payload length.
|
|
8
|
+
2. One definite-length CBOR item containing the message.
|
|
9
|
+
|
|
10
|
+
The first client message is always `hello`, containing `PROTOCOL_VERSION` and a bearer token. Subsequent messages use correlated request/response envelopes and server event envelopes. Session and server snapshots are authoritative. Progress events are transient UI hints and must not be reduced into authoritative state.
|
|
11
|
+
|
|
12
|
+
## Validated message API
|
|
13
|
+
|
|
14
|
+
`encodeClientMessage()` and `encodeServerMessage()` validate a message and return a complete framed `Uint8Array`. The incremental decoders accept arbitrary fragmentation or coalescing, so they work with streams, sockets, and custom byte transports.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import {
|
|
18
|
+
PROTOCOL_VERSION,
|
|
19
|
+
createServerMessageDecoder,
|
|
20
|
+
encodeClientMessage,
|
|
21
|
+
type ClientHello,
|
|
22
|
+
} from "@earendil-works/pi-protocol";
|
|
23
|
+
|
|
24
|
+
const hello: ClientHello = {
|
|
25
|
+
type: "hello",
|
|
26
|
+
version: PROTOCOL_VERSION,
|
|
27
|
+
token: bearerToken,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
transport.send(encodeClientMessage(hello));
|
|
31
|
+
|
|
32
|
+
const decoder = createServerMessageDecoder({ maxFrameLength: 1024 * 1024 });
|
|
33
|
+
for (const message of decoder.push(incomingChunk)) {
|
|
34
|
+
handleServerMessage(message);
|
|
35
|
+
}
|
|
36
|
+
decoder.end(); // Call when the byte stream closes to detect truncation.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`ClientMessageDecoder` and `ServerMessageDecoder` are also available directly. Schema violations, malformed CBOR, and invalid framing throw `ProtocolValidationError`. Validation errors do not retain rejected payloads.
|
|
40
|
+
|
|
41
|
+
`parseClientMessage()` and `parseServerMessage()` only validate already-decoded values. They do not parse JSON strings.
|
|
42
|
+
|
|
43
|
+
## Transport support
|
|
44
|
+
|
|
45
|
+
Every transport carries the same complete bytes: `[uint32-be CBOR length][CBOR payload]`. Transports may split or coalesce those bytes arbitrarily.
|
|
46
|
+
|
|
47
|
+
This package does not bundle a transport. Consumers provide a byte-stream transport that preserves byte order and reports stream closure. Custom transports must handle arbitrary frame fragmentation and coalescing.
|
|
48
|
+
|
|
49
|
+
All transports are untrusted. Configure matching frame limits and enforce the authentication and access controls appropriate for the transport.
|
|
50
|
+
|
|
51
|
+
## Encoding and framing
|
|
52
|
+
|
|
53
|
+
`encodeCbor()` and `decodeCbor()` implement the protocol's strict RFC 8949 subset. `encodeFrame()` and `FrameDecoder` handle framing independently of schemas and CBOR.
|
|
54
|
+
|
|
55
|
+
The CBOR subset supports:
|
|
56
|
+
|
|
57
|
+
- `null` and booleans
|
|
58
|
+
- finite numbers, with integers restricted to JavaScript's safe range and non-integers encoded as float64
|
|
59
|
+
- UTF-8 strings
|
|
60
|
+
- `Uint8Array` byte strings
|
|
61
|
+
- definite-length arrays
|
|
62
|
+
- definite-length maps represented by objects with unique string keys
|
|
63
|
+
|
|
64
|
+
Undefined object properties are omitted. JSON-valued protocol fields reject CBOR byte strings and non-plain objects. Top-level undefined, undefined array entries, sparse arrays, non-finite or unsafe numbers, tags, indefinite-length items, malformed UTF-8, trailing data, excessive nesting, and oversized values are rejected.
|
|
65
|
+
|
|
66
|
+
Default limits are 16 MiB per CBOR payload/frame, 1,000,000 array elements or map entries, and 64 nested item levels. Options can configure these limits. A frame decoder validates the declared length before buffering payload bytes.
|
|
67
|
+
|
|
68
|
+
All schemas reject unknown object properties. The protocol is experimental and has no compatibility guarantees.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/cbor/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,WAAW,EAKhB,MAAM,cAAc,CAAC;AAwJtB,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAO5E"}
|