@agimon-ai/doompi-core 0.0.1-alpha.70
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/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/agent-model.cjs +4 -0
- package/dist/agent-model.d.cts +2 -0
- package/dist/agent-model.d.mts +2 -0
- package/dist/agent-model.mjs +2 -0
- package/dist/api-contracts.cjs +27 -0
- package/dist/api-contracts.d.cts +7 -0
- package/dist/api-contracts.d.mts +7 -0
- package/dist/api-contracts.mjs +7 -0
- package/dist/ask-user.cjs +8 -0
- package/dist/ask-user.d.cts +2 -0
- package/dist/ask-user.d.mts +2 -0
- package/dist/ask-user.mjs +2 -0
- package/dist/author-tools.cjs +5 -0
- package/dist/author-tools.d.cts +2 -0
- package/dist/author-tools.d.mts +2 -0
- package/dist/author-tools.mjs +2 -0
- package/dist/background-work.cjs +7 -0
- package/dist/background-work.d.cts +2 -0
- package/dist/background-work.d.mts +2 -0
- package/dist/background-work.mjs +2 -0
- package/dist/child-process.cjs +15 -0
- package/dist/child-process.d.cts +2 -0
- package/dist/child-process.d.mts +2 -0
- package/dist/child-process.mjs +2 -0
- package/dist/child.cjs +7 -0
- package/dist/child.d.cts +3 -0
- package/dist/child.d.mts +3 -0
- package/dist/child.mjs +3 -0
- package/dist/cockpit-container.cjs +4 -0
- package/dist/cockpit-container.d.cts +2 -0
- package/dist/cockpit-container.d.mts +2 -0
- package/dist/cockpit-container.mjs +2 -0
- package/dist/config.cjs +13 -0
- package/dist/config.d.cts +3 -0
- package/dist/config.d.mts +3 -0
- package/dist/config.mjs +2 -0
- package/dist/constants/authorTools.cjs +10 -0
- package/dist/constants/authorTools.cjs.map +1 -0
- package/dist/constants/authorTools.d.cts +6 -0
- package/dist/constants/authorTools.d.cts.map +1 -0
- package/dist/constants/authorTools.d.mts +6 -0
- package/dist/constants/authorTools.d.mts.map +1 -0
- package/dist/constants/authorTools.mjs +8 -0
- package/dist/constants/authorTools.mjs.map +1 -0
- package/dist/constants/contextApi.cjs +28 -0
- package/dist/constants/contextApi.cjs.map +1 -0
- package/dist/constants/contextApi.d.cts +21 -0
- package/dist/constants/contextApi.d.cts.map +1 -0
- package/dist/constants/contextApi.d.mts +21 -0
- package/dist/constants/contextApi.d.mts.map +1 -0
- package/dist/constants/contextApi.mjs +23 -0
- package/dist/constants/contextApi.mjs.map +1 -0
- package/dist/constants/remote.cjs +81 -0
- package/dist/constants/remote.cjs.map +1 -0
- package/dist/constants/remote.mjs +62 -0
- package/dist/constants/remote.mjs.map +1 -0
- package/dist/constants/voiceReloadHandoff.cjs +12 -0
- package/dist/constants/voiceReloadHandoff.cjs.map +1 -0
- package/dist/constants/voiceReloadHandoff.d.cts +7 -0
- package/dist/constants/voiceReloadHandoff.d.cts.map +1 -0
- package/dist/constants/voiceReloadHandoff.d.mts +7 -0
- package/dist/constants/voiceReloadHandoff.d.mts.map +1 -0
- package/dist/constants/voiceReloadHandoff.mjs +9 -0
- package/dist/constants/voiceReloadHandoff.mjs.map +1 -0
- package/dist/constants/voiceTools.cjs +96 -0
- package/dist/constants/voiceTools.cjs.map +1 -0
- package/dist/constants/voiceTools.d.cts +58 -0
- package/dist/constants/voiceTools.d.cts.map +1 -0
- package/dist/constants/voiceTools.d.mts +58 -0
- package/dist/constants/voiceTools.d.mts.map +1 -0
- package/dist/constants/voiceTools.mjs +60 -0
- package/dist/constants/voiceTools.mjs.map +1 -0
- package/dist/context-api.cjs +10 -0
- package/dist/context-api.d.cts +4 -0
- package/dist/context-api.d.mts +4 -0
- package/dist/context-api.mjs +3 -0
- package/dist/context-contributions.cjs +7 -0
- package/dist/context-contributions.d.cts +3 -0
- package/dist/context-contributions.d.mts +3 -0
- package/dist/context-contributions.mjs +3 -0
- package/dist/context-detail-store.cjs +100 -0
- package/dist/context-detail-store.cjs.map +1 -0
- package/dist/context-detail-store.d.cts +19 -0
- package/dist/context-detail-store.d.cts.map +1 -0
- package/dist/context-detail-store.d.mts +19 -0
- package/dist/context-detail-store.d.mts.map +1 -0
- package/dist/context-detail-store.mjs +91 -0
- package/dist/context-detail-store.mjs.map +1 -0
- package/dist/context-detail.cjs +57 -0
- package/dist/context-detail.cjs.map +1 -0
- package/dist/context-detail.d.cts +13 -0
- package/dist/context-detail.d.cts.map +1 -0
- package/dist/context-detail.d.mts +13 -0
- package/dist/context-detail.d.mts.map +1 -0
- package/dist/context-detail.mjs +56 -0
- package/dist/context-detail.mjs.map +1 -0
- package/dist/context-projection.cjs +120 -0
- package/dist/context-projection.cjs.map +1 -0
- package/dist/context-projection.d.cts +113 -0
- package/dist/context-projection.d.cts.map +1 -0
- package/dist/context-projection.d.mts +113 -0
- package/dist/context-projection.d.mts.map +1 -0
- package/dist/context-projection.mjs +116 -0
- package/dist/context-projection.mjs.map +1 -0
- package/dist/cordis-host.cjs +10 -0
- package/dist/cordis-host.d.cts +2 -0
- package/dist/cordis-host.d.mts +2 -0
- package/dist/cordis-host.mjs +2 -0
- package/dist/delegation.cjs +18 -0
- package/dist/delegation.d.cts +2 -0
- package/dist/delegation.d.mts +2 -0
- package/dist/delegation.mjs +2 -0
- package/dist/doom-package.cjs +61 -0
- package/dist/doom-package.cjs.map +1 -0
- package/dist/doom-package.d.cts +17 -0
- package/dist/doom-package.d.cts.map +1 -0
- package/dist/doom-package.d.mts +17 -0
- package/dist/doom-package.d.mts.map +1 -0
- package/dist/doom-package.mjs +54 -0
- package/dist/doom-package.mjs.map +1 -0
- package/dist/extensions/serverPlugin.cjs +106 -0
- package/dist/extensions/serverPlugin.cjs.map +1 -0
- package/dist/extensions/serverPlugin.d.cts +5 -0
- package/dist/extensions/serverPlugin.d.cts.map +1 -0
- package/dist/extensions/serverPlugin.d.mts +5 -0
- package/dist/extensions/serverPlugin.d.mts.map +1 -0
- package/dist/extensions/serverPlugin.mjs +106 -0
- package/dist/extensions/serverPlugin.mjs.map +1 -0
- package/dist/extensions/webPlugin.cjs +28 -0
- package/dist/extensions/webPlugin.cjs.map +1 -0
- package/dist/extensions/webPlugin.d.cts +19 -0
- package/dist/extensions/webPlugin.d.cts.map +1 -0
- package/dist/extensions/webPlugin.d.mts +19 -0
- package/dist/extensions/webPlugin.d.mts.map +1 -0
- package/dist/extensions/webPlugin.mjs +26 -0
- package/dist/extensions/webPlugin.mjs.map +1 -0
- package/dist/footer.cjs +6 -0
- package/dist/footer.d.cts +2 -0
- package/dist/footer.d.mts +2 -0
- package/dist/footer.mjs +2 -0
- package/dist/headless-hub.cjs +499 -0
- package/dist/headless-hub.cjs.map +1 -0
- package/dist/headless-hub.d.cts +96 -0
- package/dist/headless-hub.d.cts.map +1 -0
- package/dist/headless-hub.d.mts +96 -0
- package/dist/headless-hub.d.mts.map +1 -0
- package/dist/headless-hub.mjs +498 -0
- package/dist/headless-hub.mjs.map +1 -0
- package/dist/headless-server.cjs +492 -0
- package/dist/headless-server.cjs.map +1 -0
- package/dist/headless-server.d.cts +30 -0
- package/dist/headless-server.d.cts.map +1 -0
- package/dist/headless-server.d.mts +30 -0
- package/dist/headless-server.d.mts.map +1 -0
- package/dist/headless-server.mjs +488 -0
- package/dist/headless-server.mjs.map +1 -0
- package/dist/headless-session-host.cjs +0 -0
- package/dist/headless-session-host.d.cts +45 -0
- package/dist/headless-session-host.d.cts.map +1 -0
- package/dist/headless-session-host.d.mts +45 -0
- package/dist/headless-session-host.d.mts.map +1 -0
- package/dist/headless-session-host.mjs +1 -0
- package/dist/headless-session-manager.cjs +51 -0
- package/dist/headless-session-manager.cjs.map +1 -0
- package/dist/headless-session-manager.d.cts +6 -0
- package/dist/headless-session-manager.d.cts.map +1 -0
- package/dist/headless-session-manager.d.mts +6 -0
- package/dist/headless-session-manager.d.mts.map +1 -0
- package/dist/headless-session-manager.mjs +50 -0
- package/dist/headless-session-manager.mjs.map +1 -0
- package/dist/headless.cjs +7 -0
- package/dist/headless.d.cts +2 -0
- package/dist/headless.d.mts +2 -0
- package/dist/headless.mjs +2 -0
- package/dist/help.cjs +21 -0
- package/dist/help.d.cts +2 -0
- package/dist/help.d.mts +2 -0
- package/dist/help.mjs +2 -0
- package/dist/history-import.cjs +553 -0
- package/dist/history-import.cjs.map +1 -0
- package/dist/history-import.d.cts +76 -0
- package/dist/history-import.d.cts.map +1 -0
- package/dist/history-import.d.mts +76 -0
- package/dist/history-import.d.mts.map +1 -0
- package/dist/history-import.mjs +547 -0
- package/dist/history-import.mjs.map +1 -0
- package/dist/history-ownership.cjs +169 -0
- package/dist/history-ownership.cjs.map +1 -0
- package/dist/history-ownership.d.cts +23 -0
- package/dist/history-ownership.d.cts.map +1 -0
- package/dist/history-ownership.d.mts +23 -0
- package/dist/history-ownership.d.mts.map +1 -0
- package/dist/history-ownership.mjs +163 -0
- package/dist/history-ownership.mjs.map +1 -0
- package/dist/history.cjs +13 -0
- package/dist/history.d.cts +6 -0
- package/dist/history.d.mts +6 -0
- package/dist/history.mjs +6 -0
- package/dist/hub-channel.cjs +0 -0
- package/dist/hub-channel.d.cts +2 -0
- package/dist/hub-channel.d.mts +2 -0
- package/dist/hub-channel.mjs +1 -0
- package/dist/index.cjs +44 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +6 -0
- package/dist/json.cjs +6 -0
- package/dist/json.d.cts +2 -0
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +2 -0
- package/dist/jsonl-session-repo.cjs +217 -0
- package/dist/jsonl-session-repo.cjs.map +1 -0
- package/dist/jsonl-session-repo.d.cts +7 -0
- package/dist/jsonl-session-repo.d.cts.map +1 -0
- package/dist/jsonl-session-repo.d.mts +7 -0
- package/dist/jsonl-session-repo.d.mts.map +1 -0
- package/dist/jsonl-session-repo.mjs +212 -0
- package/dist/jsonl-session-repo.mjs.map +1 -0
- package/dist/kernel.cjs +3 -0
- package/dist/kernel.d.cts +3 -0
- package/dist/kernel.d.mts +3 -0
- package/dist/kernel.mjs +2 -0
- package/dist/leader.cjs +9 -0
- package/dist/leader.d.cts +2 -0
- package/dist/leader.d.mts +2 -0
- package/dist/leader.mjs +2 -0
- package/dist/log-sink-telemetry.cjs +5 -0
- package/dist/log-sink-telemetry.d.cts +2 -0
- package/dist/log-sink-telemetry.d.mts +2 -0
- package/dist/log-sink-telemetry.mjs +2 -0
- package/dist/machine-api.cjs +73 -0
- package/dist/machine-api.cjs.map +1 -0
- package/dist/machine-api.d.cts +7 -0
- package/dist/machine-api.d.cts.map +1 -0
- package/dist/machine-api.d.mts +7 -0
- package/dist/machine-api.d.mts.map +1 -0
- package/dist/machine-api.mjs +70 -0
- package/dist/machine-api.mjs.map +1 -0
- package/dist/main.cjs +10 -0
- package/dist/main.d.cts +5 -0
- package/dist/main.d.mts +5 -0
- package/dist/main.mjs +4 -0
- package/dist/mcp-projection.cjs +15 -0
- package/dist/mcp-projection.d.cts +2 -0
- package/dist/mcp-projection.d.mts +2 -0
- package/dist/mcp-projection.mjs +2 -0
- package/dist/mcp-schema-cost.cjs +195 -0
- package/dist/mcp-schema-cost.cjs.map +1 -0
- package/dist/mcp-schema-cost.d.cts +35 -0
- package/dist/mcp-schema-cost.d.cts.map +1 -0
- package/dist/mcp-schema-cost.d.mts +35 -0
- package/dist/mcp-schema-cost.d.mts.map +1 -0
- package/dist/mcp-schema-cost.mjs +190 -0
- package/dist/mcp-schema-cost.mjs.map +1 -0
- package/dist/mcp-session.cjs +9 -0
- package/dist/mcp-session.d.cts +2 -0
- package/dist/mcp-session.d.mts +2 -0
- package/dist/mcp-session.mjs +2 -0
- package/dist/mcp-status.cjs +7 -0
- package/dist/mcp-status.d.cts +2 -0
- package/dist/mcp-status.d.mts +2 -0
- package/dist/mcp-status.mjs +2 -0
- package/dist/mcp-tool-resolver.cjs +5 -0
- package/dist/mcp-tool-resolver.d.cts +2 -0
- package/dist/mcp-tool-resolver.d.mts +2 -0
- package/dist/mcp-tool-resolver.mjs +2 -0
- package/dist/module-resolution.cjs +405 -0
- package/dist/module-resolution.cjs.map +1 -0
- package/dist/module-resolution.d.cts +67 -0
- package/dist/module-resolution.d.cts.map +1 -0
- package/dist/module-resolution.d.mts +67 -0
- package/dist/module-resolution.d.mts.map +1 -0
- package/dist/module-resolution.mjs +389 -0
- package/dist/module-resolution.mjs.map +1 -0
- package/dist/narration.cjs +10 -0
- package/dist/narration.d.cts +2 -0
- package/dist/narration.d.mts +2 -0
- package/dist/narration.mjs +2 -0
- package/dist/notification.cjs +17 -0
- package/dist/notification.d.cts +2 -0
- package/dist/notification.d.mts +2 -0
- package/dist/notification.mjs +2 -0
- package/dist/package-api-server.cjs +161 -0
- package/dist/package-api-server.cjs.map +1 -0
- package/dist/package-api-server.d.cts +47 -0
- package/dist/package-api-server.d.cts.map +1 -0
- package/dist/package-api-server.d.mts +47 -0
- package/dist/package-api-server.d.mts.map +1 -0
- package/dist/package-api-server.mjs +159 -0
- package/dist/package-api-server.mjs.map +1 -0
- package/dist/package-api.cjs +11 -0
- package/dist/package-api.d.cts +2 -0
- package/dist/package-api.d.mts +2 -0
- package/dist/package-api.mjs +2 -0
- package/dist/pi/piSessionRuntime.cjs +520 -0
- package/dist/pi/piSessionRuntime.cjs.map +1 -0
- package/dist/pi/piSessionRuntime.d.cts +43 -0
- package/dist/pi/piSessionRuntime.d.cts.map +1 -0
- package/dist/pi/piSessionRuntime.d.mts +43 -0
- package/dist/pi/piSessionRuntime.d.mts.map +1 -0
- package/dist/pi/piSessionRuntime.mjs +519 -0
- package/dist/pi/piSessionRuntime.mjs.map +1 -0
- package/dist/pi/piWebSocketListener.cjs +115 -0
- package/dist/pi/piWebSocketListener.cjs.map +1 -0
- package/dist/pi/piWebSocketListener.mjs +115 -0
- package/dist/pi/piWebSocketListener.mjs.map +1 -0
- package/dist/pi-extension.cjs +8 -0
- package/dist/pi-extension.d.cts +5 -0
- package/dist/pi-extension.d.mts +5 -0
- package/dist/pi-extension.mjs +4 -0
- package/dist/pi-settings.cjs +11 -0
- package/dist/pi-settings.d.cts +2 -0
- package/dist/pi-settings.d.mts +2 -0
- package/dist/pi-settings.mjs +2 -0
- package/dist/plugin-protocol.cjs +10 -0
- package/dist/plugin-protocol.d.cts +2 -0
- package/dist/plugin-protocol.d.mts +2 -0
- package/dist/plugin-protocol.mjs +2 -0
- package/dist/profile-identity.cjs +6 -0
- package/dist/profile-identity.d.cts +2 -0
- package/dist/profile-identity.d.mts +2 -0
- package/dist/profile-identity.mjs +2 -0
- package/dist/protocol.cjs +10 -0
- package/dist/protocol.d.cts +2 -0
- package/dist/protocol.d.mts +2 -0
- package/dist/protocol.mjs +2 -0
- package/dist/readiness.cjs +8 -0
- package/dist/readiness.d.cts +2 -0
- package/dist/readiness.d.mts +2 -0
- package/dist/readiness.mjs +2 -0
- package/dist/relaunch-handoff.cjs +6 -0
- package/dist/relaunch-handoff.d.cts +2 -0
- package/dist/relaunch-handoff.d.mts +2 -0
- package/dist/relaunch-handoff.mjs +2 -0
- package/dist/remote-api.cjs +42 -0
- package/dist/remote-api.cjs.map +1 -0
- package/dist/remote-api.d.cts +7 -0
- package/dist/remote-api.d.cts.map +1 -0
- package/dist/remote-api.d.mts +7 -0
- package/dist/remote-api.d.mts.map +1 -0
- package/dist/remote-api.mjs +41 -0
- package/dist/remote-api.mjs.map +1 -0
- package/dist/remote-runtime.cjs +394 -0
- package/dist/remote-runtime.cjs.map +1 -0
- package/dist/remote-runtime.d.cts +26 -0
- package/dist/remote-runtime.d.cts.map +1 -0
- package/dist/remote-runtime.d.mts +26 -0
- package/dist/remote-runtime.d.mts.map +1 -0
- package/dist/remote-runtime.mjs +390 -0
- package/dist/remote-runtime.mjs.map +1 -0
- package/dist/runtime-config.cjs +232 -0
- package/dist/runtime-config.cjs.map +1 -0
- package/dist/runtime-config.d.cts +313 -0
- package/dist/runtime-config.d.cts.map +1 -0
- package/dist/runtime-config.d.mts +313 -0
- package/dist/runtime-config.d.mts.map +1 -0
- package/dist/runtime-config.mjs +221 -0
- package/dist/runtime-config.mjs.map +1 -0
- package/dist/runtime-context-api.cjs +64 -0
- package/dist/runtime-context-api.cjs.map +1 -0
- package/dist/runtime-context-api.d.cts +16 -0
- package/dist/runtime-context-api.d.cts.map +1 -0
- package/dist/runtime-context-api.d.mts +16 -0
- package/dist/runtime-context-api.d.mts.map +1 -0
- package/dist/runtime-context-api.mjs +62 -0
- package/dist/runtime-context-api.mjs.map +1 -0
- package/dist/runtime-cordis-host.cjs +191 -0
- package/dist/runtime-cordis-host.cjs.map +1 -0
- package/dist/runtime-cordis-host.d.cts +57 -0
- package/dist/runtime-cordis-host.d.cts.map +1 -0
- package/dist/runtime-cordis-host.d.mts +57 -0
- package/dist/runtime-cordis-host.d.mts.map +1 -0
- package/dist/runtime-cordis-host.mjs +183 -0
- package/dist/runtime-cordis-host.mjs.map +1 -0
- package/dist/runtime-headless-session-manager.cjs +0 -0
- package/dist/runtime-headless-session-manager.d.cts +14 -0
- package/dist/runtime-headless-session-manager.d.cts.map +1 -0
- package/dist/runtime-headless-session-manager.d.mts +14 -0
- package/dist/runtime-headless-session-manager.d.mts.map +1 -0
- package/dist/runtime-headless-session-manager.mjs +1 -0
- package/dist/runtime-identity.cjs +26 -0
- package/dist/runtime-identity.cjs.map +1 -0
- package/dist/runtime-identity.d.cts +7 -0
- package/dist/runtime-identity.d.cts.map +1 -0
- package/dist/runtime-identity.d.mts +7 -0
- package/dist/runtime-identity.d.mts.map +1 -0
- package/dist/runtime-identity.mjs +21 -0
- package/dist/runtime-identity.mjs.map +1 -0
- package/dist/runtime-json.cjs +46 -0
- package/dist/runtime-json.cjs.map +1 -0
- package/dist/runtime-json.d.cts +22 -0
- package/dist/runtime-json.d.cts.map +1 -0
- package/dist/runtime-json.d.mts +22 -0
- package/dist/runtime-json.d.mts.map +1 -0
- package/dist/runtime-json.mjs +39 -0
- package/dist/runtime-json.mjs.map +1 -0
- package/dist/runtime-log-sink-telemetry.cjs +102 -0
- package/dist/runtime-log-sink-telemetry.cjs.map +1 -0
- package/dist/runtime-log-sink-telemetry.d.cts +49 -0
- package/dist/runtime-log-sink-telemetry.d.cts.map +1 -0
- package/dist/runtime-log-sink-telemetry.d.mts +49 -0
- package/dist/runtime-log-sink-telemetry.d.mts.map +1 -0
- package/dist/runtime-log-sink-telemetry.mjs +99 -0
- package/dist/runtime-log-sink-telemetry.mjs.map +1 -0
- package/dist/runtime-pi-extension.cjs +243 -0
- package/dist/runtime-pi-extension.cjs.map +1 -0
- package/dist/runtime-pi-extension.d.cts +102 -0
- package/dist/runtime-pi-extension.d.cts.map +1 -0
- package/dist/runtime-pi-extension.d.mts +102 -0
- package/dist/runtime-pi-extension.d.mts.map +1 -0
- package/dist/runtime-pi-extension.mjs +242 -0
- package/dist/runtime-pi-extension.mjs.map +1 -0
- package/dist/runtime-pi-settings.cjs +104 -0
- package/dist/runtime-pi-settings.cjs.map +1 -0
- package/dist/runtime-pi-settings.d.cts +23 -0
- package/dist/runtime-pi-settings.d.cts.map +1 -0
- package/dist/runtime-pi-settings.d.mts +23 -0
- package/dist/runtime-pi-settings.d.mts.map +1 -0
- package/dist/runtime-pi-settings.mjs +92 -0
- package/dist/runtime-pi-settings.mjs.map +1 -0
- package/dist/runtime-protocol.cjs +223 -0
- package/dist/runtime-protocol.cjs.map +1 -0
- package/dist/runtime-protocol.d.cts +84 -0
- package/dist/runtime-protocol.d.cts.map +1 -0
- package/dist/runtime-protocol.d.mts +84 -0
- package/dist/runtime-protocol.d.mts.map +1 -0
- package/dist/runtime-protocol.mjs +215 -0
- package/dist/runtime-protocol.mjs.map +1 -0
- package/dist/runtime-tool-names.cjs +51 -0
- package/dist/runtime-tool-names.cjs.map +1 -0
- package/dist/runtime-tool-names.d.cts +24 -0
- package/dist/runtime-tool-names.d.cts.map +1 -0
- package/dist/runtime-tool-names.d.mts +24 -0
- package/dist/runtime-tool-names.d.mts.map +1 -0
- package/dist/runtime-tool-names.mjs +49 -0
- package/dist/runtime-tool-names.mjs.map +1 -0
- package/dist/runtime-transition.cjs +27 -0
- package/dist/runtime-transition.cjs.map +1 -0
- package/dist/runtime-transition.d.cts +114 -0
- package/dist/runtime-transition.d.cts.map +1 -0
- package/dist/runtime-transition.d.mts +114 -0
- package/dist/runtime-transition.d.mts.map +1 -0
- package/dist/runtime-transition.mjs +24 -0
- package/dist/runtime-transition.mjs.map +1 -0
- package/dist/sandbox-harness.cjs +6 -0
- package/dist/sandbox-harness.d.cts +2 -0
- package/dist/sandbox-harness.d.mts +2 -0
- package/dist/sandbox-harness.mjs +2 -0
- package/dist/schemas/agentModel.cjs +33 -0
- package/dist/schemas/agentModel.cjs.map +1 -0
- package/dist/schemas/agentModel.d.cts +26 -0
- package/dist/schemas/agentModel.d.cts.map +1 -0
- package/dist/schemas/agentModel.d.mts +26 -0
- package/dist/schemas/agentModel.d.mts.map +1 -0
- package/dist/schemas/agentModel.mjs +32 -0
- package/dist/schemas/agentModel.mjs.map +1 -0
- package/dist/schemas/apiContracts.cjs +145 -0
- package/dist/schemas/apiContracts.cjs.map +1 -0
- package/dist/schemas/apiContracts.d.cts +81 -0
- package/dist/schemas/apiContracts.d.cts.map +1 -0
- package/dist/schemas/apiContracts.d.mts +81 -0
- package/dist/schemas/apiContracts.d.mts.map +1 -0
- package/dist/schemas/apiContracts.mjs +140 -0
- package/dist/schemas/apiContracts.mjs.map +1 -0
- package/dist/schemas/askUser.cjs +42 -0
- package/dist/schemas/askUser.cjs.map +1 -0
- package/dist/schemas/askUser.d.cts +47 -0
- package/dist/schemas/askUser.d.cts.map +1 -0
- package/dist/schemas/askUser.d.mts +47 -0
- package/dist/schemas/askUser.d.mts.map +1 -0
- package/dist/schemas/askUser.mjs +37 -0
- package/dist/schemas/askUser.mjs.map +1 -0
- package/dist/schemas/backgroundWork.cjs +31 -0
- package/dist/schemas/backgroundWork.cjs.map +1 -0
- package/dist/schemas/backgroundWork.d.cts +72 -0
- package/dist/schemas/backgroundWork.d.cts.map +1 -0
- package/dist/schemas/backgroundWork.d.mts +72 -0
- package/dist/schemas/backgroundWork.d.mts.map +1 -0
- package/dist/schemas/backgroundWork.mjs +27 -0
- package/dist/schemas/backgroundWork.mjs.map +1 -0
- package/dist/schemas/builtinApiContracts.cjs +37 -0
- package/dist/schemas/builtinApiContracts.cjs.map +1 -0
- package/dist/schemas/builtinApiContracts.d.cts +51 -0
- package/dist/schemas/builtinApiContracts.d.cts.map +1 -0
- package/dist/schemas/builtinApiContracts.d.mts +51 -0
- package/dist/schemas/builtinApiContracts.d.mts.map +1 -0
- package/dist/schemas/builtinApiContracts.mjs +37 -0
- package/dist/schemas/builtinApiContracts.mjs.map +1 -0
- package/dist/schemas/childProcess.cjs +67 -0
- package/dist/schemas/childProcess.cjs.map +1 -0
- package/dist/schemas/childProcess.d.cts +30 -0
- package/dist/schemas/childProcess.d.cts.map +1 -0
- package/dist/schemas/childProcess.d.mts +30 -0
- package/dist/schemas/childProcess.d.mts.map +1 -0
- package/dist/schemas/childProcess.mjs +55 -0
- package/dist/schemas/childProcess.mjs.map +1 -0
- package/dist/schemas/cockpitContainer.cjs +31 -0
- package/dist/schemas/cockpitContainer.cjs.map +1 -0
- package/dist/schemas/cockpitContainer.d.cts +80 -0
- package/dist/schemas/cockpitContainer.d.cts.map +1 -0
- package/dist/schemas/cockpitContainer.d.mts +80 -0
- package/dist/schemas/cockpitContainer.d.mts.map +1 -0
- package/dist/schemas/cockpitContainer.mjs +30 -0
- package/dist/schemas/cockpitContainer.mjs.map +1 -0
- package/dist/schemas/contextContributions.cjs +17 -0
- package/dist/schemas/contextContributions.cjs.map +1 -0
- package/dist/schemas/contextContributions.d.cts +49 -0
- package/dist/schemas/contextContributions.d.cts.map +1 -0
- package/dist/schemas/contextContributions.d.mts +49 -0
- package/dist/schemas/contextContributions.d.mts.map +1 -0
- package/dist/schemas/contextContributions.mjs +15 -0
- package/dist/schemas/contextContributions.mjs.map +1 -0
- package/dist/schemas/delegation.cjs +91 -0
- package/dist/schemas/delegation.cjs.map +1 -0
- package/dist/schemas/delegation.d.cts +95 -0
- package/dist/schemas/delegation.d.cts.map +1 -0
- package/dist/schemas/delegation.d.mts +95 -0
- package/dist/schemas/delegation.d.mts.map +1 -0
- package/dist/schemas/delegation.mjs +76 -0
- package/dist/schemas/delegation.mjs.map +1 -0
- package/dist/schemas/footer.cjs +48 -0
- package/dist/schemas/footer.cjs.map +1 -0
- package/dist/schemas/footer.d.cts +48 -0
- package/dist/schemas/footer.d.cts.map +1 -0
- package/dist/schemas/footer.d.mts +48 -0
- package/dist/schemas/footer.d.mts.map +1 -0
- package/dist/schemas/footer.mjs +45 -0
- package/dist/schemas/footer.mjs.map +1 -0
- package/dist/schemas/headless.cjs +23 -0
- package/dist/schemas/headless.cjs.map +1 -0
- package/dist/schemas/headless.d.cts +238 -0
- package/dist/schemas/headless.d.cts.map +1 -0
- package/dist/schemas/headless.d.mts +238 -0
- package/dist/schemas/headless.d.mts.map +1 -0
- package/dist/schemas/headless.mjs +19 -0
- package/dist/schemas/headless.mjs.map +1 -0
- package/dist/schemas/help.cjs +249 -0
- package/dist/schemas/help.cjs.map +1 -0
- package/dist/schemas/help.d.cts +106 -0
- package/dist/schemas/help.d.cts.map +1 -0
- package/dist/schemas/help.d.mts +106 -0
- package/dist/schemas/help.d.mts.map +1 -0
- package/dist/schemas/help.mjs +231 -0
- package/dist/schemas/help.mjs.map +1 -0
- package/dist/schemas/httpApiContracts.cjs +388 -0
- package/dist/schemas/httpApiContracts.cjs.map +1 -0
- package/dist/schemas/httpApiContracts.d.cts +14 -0
- package/dist/schemas/httpApiContracts.d.cts.map +1 -0
- package/dist/schemas/httpApiContracts.d.mts +14 -0
- package/dist/schemas/httpApiContracts.d.mts.map +1 -0
- package/dist/schemas/httpApiContracts.mjs +377 -0
- package/dist/schemas/httpApiContracts.mjs.map +1 -0
- package/dist/schemas/hubChannel.d.cts +91 -0
- package/dist/schemas/hubChannel.d.cts.map +1 -0
- package/dist/schemas/hubChannel.d.mts +91 -0
- package/dist/schemas/hubChannel.d.mts.map +1 -0
- package/dist/schemas/leader.cjs +57 -0
- package/dist/schemas/leader.cjs.map +1 -0
- package/dist/schemas/leader.d.cts +107 -0
- package/dist/schemas/leader.d.cts.map +1 -0
- package/dist/schemas/leader.d.mts +107 -0
- package/dist/schemas/leader.d.mts.map +1 -0
- package/dist/schemas/leader.mjs +51 -0
- package/dist/schemas/leader.mjs.map +1 -0
- package/dist/schemas/mcpProjection.cjs +114 -0
- package/dist/schemas/mcpProjection.cjs.map +1 -0
- package/dist/schemas/mcpProjection.d.cts +116 -0
- package/dist/schemas/mcpProjection.d.cts.map +1 -0
- package/dist/schemas/mcpProjection.d.mts +116 -0
- package/dist/schemas/mcpProjection.d.mts.map +1 -0
- package/dist/schemas/mcpProjection.mjs +102 -0
- package/dist/schemas/mcpProjection.mjs.map +1 -0
- package/dist/schemas/mcpSession.cjs +57 -0
- package/dist/schemas/mcpSession.cjs.map +1 -0
- package/dist/schemas/mcpSession.d.cts +57 -0
- package/dist/schemas/mcpSession.d.cts.map +1 -0
- package/dist/schemas/mcpSession.d.mts +57 -0
- package/dist/schemas/mcpSession.d.mts.map +1 -0
- package/dist/schemas/mcpSession.mjs +51 -0
- package/dist/schemas/mcpSession.mjs.map +1 -0
- package/dist/schemas/mcpStatus.cjs +52 -0
- package/dist/schemas/mcpStatus.cjs.map +1 -0
- package/dist/schemas/mcpStatus.d.cts +73 -0
- package/dist/schemas/mcpStatus.d.cts.map +1 -0
- package/dist/schemas/mcpStatus.d.mts +73 -0
- package/dist/schemas/mcpStatus.d.mts.map +1 -0
- package/dist/schemas/mcpStatus.mjs +48 -0
- package/dist/schemas/mcpStatus.mjs.map +1 -0
- package/dist/schemas/mcpToolResolver.cjs +17 -0
- package/dist/schemas/mcpToolResolver.cjs.map +1 -0
- package/dist/schemas/mcpToolResolver.d.cts +24 -0
- package/dist/schemas/mcpToolResolver.d.cts.map +1 -0
- package/dist/schemas/mcpToolResolver.d.mts +24 -0
- package/dist/schemas/mcpToolResolver.d.mts.map +1 -0
- package/dist/schemas/mcpToolResolver.mjs +15 -0
- package/dist/schemas/mcpToolResolver.mjs.map +1 -0
- package/dist/schemas/narration.cjs +54 -0
- package/dist/schemas/narration.cjs.map +1 -0
- package/dist/schemas/narration.d.cts +29 -0
- package/dist/schemas/narration.d.cts.map +1 -0
- package/dist/schemas/narration.d.mts +29 -0
- package/dist/schemas/narration.d.mts.map +1 -0
- package/dist/schemas/narration.mjs +47 -0
- package/dist/schemas/narration.mjs.map +1 -0
- package/dist/schemas/notification.cjs +122 -0
- package/dist/schemas/notification.cjs.map +1 -0
- package/dist/schemas/notification.d.cts +48 -0
- package/dist/schemas/notification.d.cts.map +1 -0
- package/dist/schemas/notification.d.mts +48 -0
- package/dist/schemas/notification.d.mts.map +1 -0
- package/dist/schemas/notification.mjs +108 -0
- package/dist/schemas/notification.mjs.map +1 -0
- package/dist/schemas/packageApi.cjs +52 -0
- package/dist/schemas/packageApi.cjs.map +1 -0
- package/dist/schemas/packageApi.d.cts +149 -0
- package/dist/schemas/packageApi.d.cts.map +1 -0
- package/dist/schemas/packageApi.d.mts +149 -0
- package/dist/schemas/packageApi.d.mts.map +1 -0
- package/dist/schemas/packageApi.mjs +44 -0
- package/dist/schemas/packageApi.mjs.map +1 -0
- package/dist/schemas/piTool.cjs +25 -0
- package/dist/schemas/piTool.cjs.map +1 -0
- package/dist/schemas/piTool.d.cts +12 -0
- package/dist/schemas/piTool.d.cts.map +1 -0
- package/dist/schemas/piTool.d.mts +12 -0
- package/dist/schemas/piTool.d.mts.map +1 -0
- package/dist/schemas/piTool.mjs +25 -0
- package/dist/schemas/piTool.mjs.map +1 -0
- package/dist/schemas/pluginContributions.cjs +19 -0
- package/dist/schemas/pluginContributions.cjs.map +1 -0
- package/dist/schemas/pluginContributions.d.cts +56 -0
- package/dist/schemas/pluginContributions.d.cts.map +1 -0
- package/dist/schemas/pluginContributions.d.mts +56 -0
- package/dist/schemas/pluginContributions.d.mts.map +1 -0
- package/dist/schemas/pluginContributions.mjs +18 -0
- package/dist/schemas/pluginContributions.mjs.map +1 -0
- package/dist/schemas/pluginProtocol.cjs +103 -0
- package/dist/schemas/pluginProtocol.cjs.map +1 -0
- package/dist/schemas/pluginProtocol.d.cts +68 -0
- package/dist/schemas/pluginProtocol.d.cts.map +1 -0
- package/dist/schemas/pluginProtocol.d.mts +68 -0
- package/dist/schemas/pluginProtocol.d.mts.map +1 -0
- package/dist/schemas/pluginProtocol.mjs +96 -0
- package/dist/schemas/pluginProtocol.mjs.map +1 -0
- package/dist/schemas/profileIdentity.cjs +67 -0
- package/dist/schemas/profileIdentity.cjs.map +1 -0
- package/dist/schemas/profileIdentity.d.cts +50 -0
- package/dist/schemas/profileIdentity.d.cts.map +1 -0
- package/dist/schemas/profileIdentity.d.mts +50 -0
- package/dist/schemas/profileIdentity.d.mts.map +1 -0
- package/dist/schemas/profileIdentity.mjs +64 -0
- package/dist/schemas/profileIdentity.mjs.map +1 -0
- package/dist/schemas/readiness.cjs +251 -0
- package/dist/schemas/readiness.cjs.map +1 -0
- package/dist/schemas/readiness.d.cts +84 -0
- package/dist/schemas/readiness.d.cts.map +1 -0
- package/dist/schemas/readiness.d.mts +84 -0
- package/dist/schemas/readiness.d.mts.map +1 -0
- package/dist/schemas/readiness.mjs +246 -0
- package/dist/schemas/readiness.mjs.map +1 -0
- package/dist/schemas/relaunchHandoff.cjs +47 -0
- package/dist/schemas/relaunchHandoff.cjs.map +1 -0
- package/dist/schemas/relaunchHandoff.d.cts +25 -0
- package/dist/schemas/relaunchHandoff.d.cts.map +1 -0
- package/dist/schemas/relaunchHandoff.d.mts +25 -0
- package/dist/schemas/relaunchHandoff.d.mts.map +1 -0
- package/dist/schemas/relaunchHandoff.mjs +44 -0
- package/dist/schemas/relaunchHandoff.mjs.map +1 -0
- package/dist/schemas/remoteApiContracts.cjs +307 -0
- package/dist/schemas/remoteApiContracts.cjs.map +1 -0
- package/dist/schemas/remoteApiContracts.mjs +303 -0
- package/dist/schemas/remoteApiContracts.mjs.map +1 -0
- package/dist/schemas/sandboxHarness.cjs +29 -0
- package/dist/schemas/sandboxHarness.cjs.map +1 -0
- package/dist/schemas/sandboxHarness.d.cts +39 -0
- package/dist/schemas/sandboxHarness.d.cts.map +1 -0
- package/dist/schemas/sandboxHarness.d.mts +39 -0
- package/dist/schemas/sandboxHarness.d.mts.map +1 -0
- package/dist/schemas/sandboxHarness.mjs +26 -0
- package/dist/schemas/sandboxHarness.mjs.map +1 -0
- package/dist/schemas/serverBundle.cjs +79 -0
- package/dist/schemas/serverBundle.cjs.map +1 -0
- package/dist/schemas/serverBundle.d.cts +34 -0
- package/dist/schemas/serverBundle.d.cts.map +1 -0
- package/dist/schemas/serverBundle.d.mts +34 -0
- package/dist/schemas/serverBundle.d.mts.map +1 -0
- package/dist/schemas/serverBundle.mjs +77 -0
- package/dist/schemas/serverBundle.mjs.map +1 -0
- package/dist/schemas/serverFacet.cjs +102 -0
- package/dist/schemas/serverFacet.cjs.map +1 -0
- package/dist/schemas/serverFacet.d.cts +141 -0
- package/dist/schemas/serverFacet.d.cts.map +1 -0
- package/dist/schemas/serverFacet.d.mts +141 -0
- package/dist/schemas/serverFacet.d.mts.map +1 -0
- package/dist/schemas/serverFacet.mjs +93 -0
- package/dist/schemas/serverFacet.mjs.map +1 -0
- package/dist/schemas/sessionApiContracts.cjs +474 -0
- package/dist/schemas/sessionApiContracts.cjs.map +1 -0
- package/dist/schemas/sessionApiContracts.d.cts +563 -0
- package/dist/schemas/sessionApiContracts.d.cts.map +1 -0
- package/dist/schemas/sessionApiContracts.d.mts +563 -0
- package/dist/schemas/sessionApiContracts.d.mts.map +1 -0
- package/dist/schemas/sessionApiContracts.mjs +472 -0
- package/dist/schemas/sessionApiContracts.mjs.map +1 -0
- package/dist/schemas/sessionProtocol.cjs +17 -0
- package/dist/schemas/sessionProtocol.cjs.map +1 -0
- package/dist/schemas/sessionProtocol.d.cts +269 -0
- package/dist/schemas/sessionProtocol.d.cts.map +1 -0
- package/dist/schemas/sessionProtocol.d.mts +269 -0
- package/dist/schemas/sessionProtocol.d.mts.map +1 -0
- package/dist/schemas/sessionProtocol.mjs +12 -0
- package/dist/schemas/sessionProtocol.mjs.map +1 -0
- package/dist/schemas/sessionUpdates.d.cts +34 -0
- package/dist/schemas/sessionUpdates.d.cts.map +1 -0
- package/dist/schemas/sessionUpdates.d.mts +34 -0
- package/dist/schemas/sessionUpdates.d.mts.map +1 -0
- package/dist/schemas/skills.cjs +115 -0
- package/dist/schemas/skills.cjs.map +1 -0
- package/dist/schemas/skills.d.cts +65 -0
- package/dist/schemas/skills.d.cts.map +1 -0
- package/dist/schemas/skills.d.mts +65 -0
- package/dist/schemas/skills.d.mts.map +1 -0
- package/dist/schemas/skills.mjs +109 -0
- package/dist/schemas/skills.mjs.map +1 -0
- package/dist/schemas/toolOverrides.cjs +17 -0
- package/dist/schemas/toolOverrides.cjs.map +1 -0
- package/dist/schemas/toolOverrides.d.cts +29 -0
- package/dist/schemas/toolOverrides.d.cts.map +1 -0
- package/dist/schemas/toolOverrides.d.mts +29 -0
- package/dist/schemas/toolOverrides.d.mts.map +1 -0
- package/dist/schemas/toolOverrides.mjs +15 -0
- package/dist/schemas/toolOverrides.mjs.map +1 -0
- package/dist/schemas/toolSurface.cjs +17 -0
- package/dist/schemas/toolSurface.cjs.map +1 -0
- package/dist/schemas/toolSurface.d.cts +54 -0
- package/dist/schemas/toolSurface.d.cts.map +1 -0
- package/dist/schemas/toolSurface.d.mts +54 -0
- package/dist/schemas/toolSurface.d.mts.map +1 -0
- package/dist/schemas/toolSurface.mjs +15 -0
- package/dist/schemas/toolSurface.mjs.map +1 -0
- package/dist/schemas/transportApiContracts.cjs +248 -0
- package/dist/schemas/transportApiContracts.cjs.map +1 -0
- package/dist/schemas/transportApiContracts.d.cts +205 -0
- package/dist/schemas/transportApiContracts.d.cts.map +1 -0
- package/dist/schemas/transportApiContracts.d.mts +205 -0
- package/dist/schemas/transportApiContracts.d.mts.map +1 -0
- package/dist/schemas/transportApiContracts.mjs +242 -0
- package/dist/schemas/transportApiContracts.mjs.map +1 -0
- package/dist/schemas/uiHub.cjs +17 -0
- package/dist/schemas/uiHub.cjs.map +1 -0
- package/dist/schemas/uiHub.d.cts +23 -0
- package/dist/schemas/uiHub.d.cts.map +1 -0
- package/dist/schemas/uiHub.d.mts +23 -0
- package/dist/schemas/uiHub.d.mts.map +1 -0
- package/dist/schemas/uiHub.mjs +15 -0
- package/dist/schemas/uiHub.mjs.map +1 -0
- package/dist/schemas/voiceReloadHandoff.cjs +78 -0
- package/dist/schemas/voiceReloadHandoff.cjs.map +1 -0
- package/dist/schemas/voiceReloadHandoff.d.cts +31 -0
- package/dist/schemas/voiceReloadHandoff.d.cts.map +1 -0
- package/dist/schemas/voiceReloadHandoff.d.mts +31 -0
- package/dist/schemas/voiceReloadHandoff.d.mts.map +1 -0
- package/dist/schemas/voiceReloadHandoff.mjs +75 -0
- package/dist/schemas/voiceReloadHandoff.mjs.map +1 -0
- package/dist/schemas/voiceTools.cjs +205 -0
- package/dist/schemas/voiceTools.cjs.map +1 -0
- package/dist/schemas/voiceTools.d.cts +120 -0
- package/dist/schemas/voiceTools.d.cts.map +1 -0
- package/dist/schemas/voiceTools.d.mts +120 -0
- package/dist/schemas/voiceTools.d.mts.map +1 -0
- package/dist/schemas/voiceTools.mjs +194 -0
- package/dist/schemas/voiceTools.mjs.map +1 -0
- package/dist/server/directHarnessRuntime.cjs +981 -0
- package/dist/server/directHarnessRuntime.cjs.map +1 -0
- package/dist/server/directHarnessRuntime.d.cts +3 -0
- package/dist/server/directHarnessRuntime.d.mts +3 -0
- package/dist/server/directHarnessRuntime.mjs +976 -0
- package/dist/server/directHarnessRuntime.mjs.map +1 -0
- package/dist/server/headlessProtocol.cjs +233 -0
- package/dist/server/headlessProtocol.cjs.map +1 -0
- package/dist/server/headlessProtocol.mjs +233 -0
- package/dist/server/headlessProtocol.mjs.map +1 -0
- package/dist/server/jsonlTranscriptReader.cjs +85 -0
- package/dist/server/jsonlTranscriptReader.cjs.map +1 -0
- package/dist/server/jsonlTranscriptReader.mjs +83 -0
- package/dist/server/jsonlTranscriptReader.mjs.map +1 -0
- package/dist/server/nativeChildTranscriptReader.cjs +20 -0
- package/dist/server/nativeChildTranscriptReader.cjs.map +1 -0
- package/dist/server/nativeChildTranscriptReader.mjs +18 -0
- package/dist/server/nativeChildTranscriptReader.mjs.map +1 -0
- package/dist/server/remoteRoutes.cjs +386 -0
- package/dist/server/remoteRoutes.cjs.map +1 -0
- package/dist/server/remoteRoutes.mjs +386 -0
- package/dist/server/remoteRoutes.mjs.map +1 -0
- package/dist/server/serverFacetLoader.cjs +220 -0
- package/dist/server/serverFacetLoader.cjs.map +1 -0
- package/dist/server/serverFacetLoader.d.cts +77 -0
- package/dist/server/serverFacetLoader.d.cts.map +1 -0
- package/dist/server/serverFacetLoader.d.mts +77 -0
- package/dist/server/serverFacetLoader.d.mts.map +1 -0
- package/dist/server/serverFacetLoader.mjs +215 -0
- package/dist/server/serverFacetLoader.mjs.map +1 -0
- package/dist/server/threadJournals.cjs +172 -0
- package/dist/server/threadJournals.cjs.map +1 -0
- package/dist/server/threadJournals.mjs +169 -0
- package/dist/server/threadJournals.mjs.map +1 -0
- package/dist/server-facet.cjs +27 -0
- package/dist/server-facet.d.cts +7 -0
- package/dist/server-facet.d.mts +7 -0
- package/dist/server-facet.mjs +7 -0
- package/dist/server-telemetry.cjs +25 -0
- package/dist/server-telemetry.cjs.map +1 -0
- package/dist/server-telemetry.d.cts +12 -0
- package/dist/server-telemetry.d.cts.map +1 -0
- package/dist/server-telemetry.d.mts +12 -0
- package/dist/server-telemetry.d.mts.map +1 -0
- package/dist/server-telemetry.mjs +23 -0
- package/dist/server-telemetry.mjs.map +1 -0
- package/dist/server.cjs +17 -0
- package/dist/server.d.cts +10 -0
- package/dist/server.d.mts +10 -0
- package/dist/server.mjs +7 -0
- package/dist/services/acpSessionUpdates/index.cjs +129 -0
- package/dist/services/acpSessionUpdates/index.cjs.map +1 -0
- package/dist/services/acpSessionUpdates/index.mjs +129 -0
- package/dist/services/acpSessionUpdates/index.mjs.map +1 -0
- package/dist/services/apiContracts/index.cjs +267 -0
- package/dist/services/apiContracts/index.cjs.map +1 -0
- package/dist/services/apiContracts/index.d.cts +42 -0
- package/dist/services/apiContracts/index.d.cts.map +1 -0
- package/dist/services/apiContracts/index.d.mts +42 -0
- package/dist/services/apiContracts/index.d.mts.map +1 -0
- package/dist/services/apiContracts/index.mjs +266 -0
- package/dist/services/apiContracts/index.mjs.map +1 -0
- package/dist/services/bundlePublication/index.cjs +88 -0
- package/dist/services/bundlePublication/index.cjs.map +1 -0
- package/dist/services/bundlePublication/index.mjs +85 -0
- package/dist/services/bundlePublication/index.mjs.map +1 -0
- package/dist/services/contextApiUrls/index.cjs +15 -0
- package/dist/services/contextApiUrls/index.cjs.map +1 -0
- package/dist/services/contextApiUrls/index.d.cts +6 -0
- package/dist/services/contextApiUrls/index.d.cts.map +1 -0
- package/dist/services/contextApiUrls/index.d.mts +6 -0
- package/dist/services/contextApiUrls/index.d.mts.map +1 -0
- package/dist/services/contextApiUrls/index.mjs +15 -0
- package/dist/services/contextApiUrls/index.mjs.map +1 -0
- package/dist/services/contextContributions/index.cjs +79 -0
- package/dist/services/contextContributions/index.cjs.map +1 -0
- package/dist/services/contextContributions/index.d.cts +6 -0
- package/dist/services/contextContributions/index.d.cts.map +1 -0
- package/dist/services/contextContributions/index.d.mts +6 -0
- package/dist/services/contextContributions/index.d.mts.map +1 -0
- package/dist/services/contextContributions/index.mjs +79 -0
- package/dist/services/contextContributions/index.mjs.map +1 -0
- package/dist/services/deviceAuth/index.cjs +125 -0
- package/dist/services/deviceAuth/index.cjs.map +1 -0
- package/dist/services/deviceAuth/index.d.cts +9 -0
- package/dist/services/deviceAuth/index.d.cts.map +1 -0
- package/dist/services/deviceAuth/index.d.mts +9 -0
- package/dist/services/deviceAuth/index.d.mts.map +1 -0
- package/dist/services/deviceAuth/index.mjs +125 -0
- package/dist/services/deviceAuth/index.mjs.map +1 -0
- package/dist/services/deviceSessions/index.cjs +147 -0
- package/dist/services/deviceSessions/index.cjs.map +1 -0
- package/dist/services/deviceSessions/index.d.cts +15 -0
- package/dist/services/deviceSessions/index.d.cts.map +1 -0
- package/dist/services/deviceSessions/index.d.mts +15 -0
- package/dist/services/deviceSessions/index.d.mts.map +1 -0
- package/dist/services/deviceSessions/index.mjs +141 -0
- package/dist/services/deviceSessions/index.mjs.map +1 -0
- package/dist/services/headlessClient/index.cjs +117 -0
- package/dist/services/headlessClient/index.cjs.map +1 -0
- package/dist/services/headlessClient/index.mjs +117 -0
- package/dist/services/headlessClient/index.mjs.map +1 -0
- package/dist/services/historyCreationFileSystem/index.cjs +114 -0
- package/dist/services/historyCreationFileSystem/index.cjs.map +1 -0
- package/dist/services/historyCreationFileSystem/index.mjs +114 -0
- package/dist/services/historyCreationFileSystem/index.mjs.map +1 -0
- package/dist/services/hubChannelHarness/index.cjs +50 -0
- package/dist/services/hubChannelHarness/index.cjs.map +1 -0
- package/dist/services/hubChannelHarness/index.d.cts +17 -0
- package/dist/services/hubChannelHarness/index.d.cts.map +1 -0
- package/dist/services/hubChannelHarness/index.d.mts +17 -0
- package/dist/services/hubChannelHarness/index.d.mts.map +1 -0
- package/dist/services/hubChannelHarness/index.mjs +50 -0
- package/dist/services/hubChannelHarness/index.mjs.map +1 -0
- package/dist/services/kernel/index.cjs +147 -0
- package/dist/services/kernel/index.cjs.map +1 -0
- package/dist/services/kernel/index.d.cts +9 -0
- package/dist/services/kernel/index.d.cts.map +1 -0
- package/dist/services/kernel/index.d.mts +9 -0
- package/dist/services/kernel/index.d.mts.map +1 -0
- package/dist/services/kernel/index.mjs +147 -0
- package/dist/services/kernel/index.mjs.map +1 -0
- package/dist/services/loginFlow/index.cjs +131 -0
- package/dist/services/loginFlow/index.cjs.map +1 -0
- package/dist/services/loginFlow/index.mjs +131 -0
- package/dist/services/loginFlow/index.mjs.map +1 -0
- package/dist/services/packageApiHarness/index.cjs +36 -0
- package/dist/services/packageApiHarness/index.cjs.map +1 -0
- package/dist/services/packageApiHarness/index.d.cts +40 -0
- package/dist/services/packageApiHarness/index.d.cts.map +1 -0
- package/dist/services/packageApiHarness/index.d.mts +40 -0
- package/dist/services/packageApiHarness/index.d.mts.map +1 -0
- package/dist/services/packageApiHarness/index.mjs +36 -0
- package/dist/services/packageApiHarness/index.mjs.map +1 -0
- package/dist/services/pairingFlow/index.cjs +145 -0
- package/dist/services/pairingFlow/index.cjs.map +1 -0
- package/dist/services/pairingFlow/index.d.cts +44 -0
- package/dist/services/pairingFlow/index.d.cts.map +1 -0
- package/dist/services/pairingFlow/index.d.mts +44 -0
- package/dist/services/pairingFlow/index.d.mts.map +1 -0
- package/dist/services/pairingFlow/index.mjs +145 -0
- package/dist/services/pairingFlow/index.mjs.map +1 -0
- package/dist/services/pairingPage/index.cjs +450 -0
- package/dist/services/pairingPage/index.cjs.map +1 -0
- package/dist/services/pairingPage/index.mjs +447 -0
- package/dist/services/pairingPage/index.mjs.map +1 -0
- package/dist/services/pluginLifecycle/index.cjs +71 -0
- package/dist/services/pluginLifecycle/index.cjs.map +1 -0
- package/dist/services/pluginLifecycle/index.d.cts +11 -0
- package/dist/services/pluginLifecycle/index.d.cts.map +1 -0
- package/dist/services/pluginLifecycle/index.d.mts +11 -0
- package/dist/services/pluginLifecycle/index.d.mts.map +1 -0
- package/dist/services/pluginLifecycle/index.mjs +71 -0
- package/dist/services/pluginLifecycle/index.mjs.map +1 -0
- package/dist/services/providerAuth/index.cjs +156 -0
- package/dist/services/providerAuth/index.cjs.map +1 -0
- package/dist/services/providerAuth/index.mjs +154 -0
- package/dist/services/providerAuth/index.mjs.map +1 -0
- package/dist/services/remoteAccess/index.cjs +393 -0
- package/dist/services/remoteAccess/index.cjs.map +1 -0
- package/dist/services/remoteAccess/index.d.cts +79 -0
- package/dist/services/remoteAccess/index.d.cts.map +1 -0
- package/dist/services/remoteAccess/index.d.mts +79 -0
- package/dist/services/remoteAccess/index.d.mts.map +1 -0
- package/dist/services/remoteAccess/index.mjs +393 -0
- package/dist/services/remoteAccess/index.mjs.map +1 -0
- package/dist/services/remoteAccessSettings/index.cjs +151 -0
- package/dist/services/remoteAccessSettings/index.cjs.map +1 -0
- package/dist/services/remoteAccessSettings/index.mjs +149 -0
- package/dist/services/remoteAccessSettings/index.mjs.map +1 -0
- package/dist/services/remoteAccessStore/index.cjs +126 -0
- package/dist/services/remoteAccessStore/index.cjs.map +1 -0
- package/dist/services/remoteAccessStore/index.mjs +121 -0
- package/dist/services/remoteAccessStore/index.mjs.map +1 -0
- package/dist/services/remoteGuardPolicy/index.cjs +190 -0
- package/dist/services/remoteGuardPolicy/index.cjs.map +1 -0
- package/dist/services/remoteGuardPolicy/index.d.cts +7 -0
- package/dist/services/remoteGuardPolicy/index.d.cts.map +1 -0
- package/dist/services/remoteGuardPolicy/index.d.mts +7 -0
- package/dist/services/remoteGuardPolicy/index.d.mts.map +1 -0
- package/dist/services/remoteGuardPolicy/index.mjs +186 -0
- package/dist/services/remoteGuardPolicy/index.mjs.map +1 -0
- package/dist/services/rpcTranscript/index.cjs +590 -0
- package/dist/services/rpcTranscript/index.cjs.map +1 -0
- package/dist/services/rpcTranscript/index.d.cts +50 -0
- package/dist/services/rpcTranscript/index.d.cts.map +1 -0
- package/dist/services/rpcTranscript/index.d.mts +50 -0
- package/dist/services/rpcTranscript/index.d.mts.map +1 -0
- package/dist/services/rpcTranscript/index.mjs +589 -0
- package/dist/services/rpcTranscript/index.mjs.map +1 -0
- package/dist/services/serverFacet/index.cjs +197 -0
- package/dist/services/serverFacet/index.cjs.map +1 -0
- package/dist/services/serverFacet/index.d.cts +31 -0
- package/dist/services/serverFacet/index.d.cts.map +1 -0
- package/dist/services/serverFacet/index.d.mts +31 -0
- package/dist/services/serverFacet/index.d.mts.map +1 -0
- package/dist/services/serverFacet/index.mjs +197 -0
- package/dist/services/serverFacet/index.mjs.map +1 -0
- package/dist/services/sessionPresentation/index.cjs +117 -0
- package/dist/services/sessionPresentation/index.cjs.map +1 -0
- package/dist/services/sessionPresentation/index.mjs +117 -0
- package/dist/services/sessionPresentation/index.mjs.map +1 -0
- package/dist/services/sqliteSessionHistory/index.cjs +59 -0
- package/dist/services/sqliteSessionHistory/index.cjs.map +1 -0
- package/dist/services/sqliteSessionHistory/index.d.cts +13 -0
- package/dist/services/sqliteSessionHistory/index.d.cts.map +1 -0
- package/dist/services/sqliteSessionHistory/index.d.mts +13 -0
- package/dist/services/sqliteSessionHistory/index.d.mts.map +1 -0
- package/dist/services/sqliteSessionHistory/index.mjs +57 -0
- package/dist/services/sqliteSessionHistory/index.mjs.map +1 -0
- package/dist/services/sqliteTranscriptReader/index.cjs +49 -0
- package/dist/services/sqliteTranscriptReader/index.cjs.map +1 -0
- package/dist/services/sqliteTranscriptReader/index.mjs +47 -0
- package/dist/services/sqliteTranscriptReader/index.mjs.map +1 -0
- package/dist/services/toolCost/index.cjs +47 -0
- package/dist/services/toolCost/index.cjs.map +1 -0
- package/dist/services/toolCost/index.d.cts +38 -0
- package/dist/services/toolCost/index.d.cts.map +1 -0
- package/dist/services/toolCost/index.d.mts +38 -0
- package/dist/services/toolCost/index.d.mts.map +1 -0
- package/dist/services/toolCost/index.mjs +46 -0
- package/dist/services/toolCost/index.mjs.map +1 -0
- package/dist/services/toolOverrides/index.cjs +45 -0
- package/dist/services/toolOverrides/index.cjs.map +1 -0
- package/dist/services/toolOverrides/index.d.cts +6 -0
- package/dist/services/toolOverrides/index.d.cts.map +1 -0
- package/dist/services/toolOverrides/index.d.mts +6 -0
- package/dist/services/toolOverrides/index.d.mts.map +1 -0
- package/dist/services/toolOverrides/index.mjs +45 -0
- package/dist/services/toolOverrides/index.mjs.map +1 -0
- package/dist/services/toolSurface/index.cjs +105 -0
- package/dist/services/toolSurface/index.cjs.map +1 -0
- package/dist/services/toolSurface/index.d.cts +19 -0
- package/dist/services/toolSurface/index.d.cts.map +1 -0
- package/dist/services/toolSurface/index.d.mts +19 -0
- package/dist/services/toolSurface/index.d.mts.map +1 -0
- package/dist/services/toolSurface/index.mjs +105 -0
- package/dist/services/toolSurface/index.mjs.map +1 -0
- package/dist/services/traceContext/index.cjs +13 -0
- package/dist/services/traceContext/index.cjs.map +1 -0
- package/dist/services/traceContext/index.mjs +13 -0
- package/dist/services/traceContext/index.mjs.map +1 -0
- package/dist/services/transcriptPages/index.cjs +74 -0
- package/dist/services/transcriptPages/index.cjs.map +1 -0
- package/dist/services/transcriptPages/index.mjs +73 -0
- package/dist/services/transcriptPages/index.mjs.map +1 -0
- package/dist/services/tunnelOutput/index.cjs +58 -0
- package/dist/services/tunnelOutput/index.cjs.map +1 -0
- package/dist/services/tunnelOutput/index.mjs +54 -0
- package/dist/services/tunnelOutput/index.mjs.map +1 -0
- package/dist/services/tunnelProcess/index.cjs +486 -0
- package/dist/services/tunnelProcess/index.cjs.map +1 -0
- package/dist/services/tunnelProcess/index.mjs +480 -0
- package/dist/services/tunnelProcess/index.mjs.map +1 -0
- package/dist/services/voiceReloadHandoff/index.cjs +136 -0
- package/dist/services/voiceReloadHandoff/index.cjs.map +1 -0
- package/dist/services/voiceReloadHandoff/index.d.cts +34 -0
- package/dist/services/voiceReloadHandoff/index.d.cts.map +1 -0
- package/dist/services/voiceReloadHandoff/index.d.mts +34 -0
- package/dist/services/voiceReloadHandoff/index.d.mts.map +1 -0
- package/dist/services/voiceReloadHandoff/index.mjs +135 -0
- package/dist/services/voiceReloadHandoff/index.mjs.map +1 -0
- package/dist/services/voiceToolsContract/index.cjs +26 -0
- package/dist/services/voiceToolsContract/index.cjs.map +1 -0
- package/dist/services/voiceToolsContract/index.d.cts +76 -0
- package/dist/services/voiceToolsContract/index.d.cts.map +1 -0
- package/dist/services/voiceToolsContract/index.d.mts +76 -0
- package/dist/services/voiceToolsContract/index.d.mts.map +1 -0
- package/dist/services/voiceToolsContract/index.mjs +24 -0
- package/dist/services/voiceToolsContract/index.mjs.map +1 -0
- package/dist/services/webauthn/index.cjs +262 -0
- package/dist/services/webauthn/index.cjs.map +1 -0
- package/dist/services/webauthn/index.d.cts +39 -0
- package/dist/services/webauthn/index.d.cts.map +1 -0
- package/dist/services/webauthn/index.d.mts +39 -0
- package/dist/services/webauthn/index.d.mts.map +1 -0
- package/dist/services/webauthn/index.mjs +262 -0
- package/dist/services/webauthn/index.mjs.map +1 -0
- package/dist/services/webauthnPolicy/index.cjs +178 -0
- package/dist/services/webauthnPolicy/index.cjs.map +1 -0
- package/dist/services/webauthnPolicy/index.d.cts +41 -0
- package/dist/services/webauthnPolicy/index.d.cts.map +1 -0
- package/dist/services/webauthnPolicy/index.d.mts +41 -0
- package/dist/services/webauthnPolicy/index.d.mts.map +1 -0
- package/dist/services/webauthnPolicy/index.mjs +171 -0
- package/dist/services/webauthnPolicy/index.mjs.map +1 -0
- package/dist/session-files-api.cjs +61 -0
- package/dist/session-files-api.cjs.map +1 -0
- package/dist/session-files-api.d.cts +7 -0
- package/dist/session-files-api.d.cts.map +1 -0
- package/dist/session-files-api.d.mts +7 -0
- package/dist/session-files-api.d.mts.map +1 -0
- package/dist/session-files-api.mjs +57 -0
- package/dist/session-files-api.mjs.map +1 -0
- package/dist/session-protocol.cjs +8 -0
- package/dist/session-protocol.d.cts +3 -0
- package/dist/session-protocol.d.mts +3 -0
- package/dist/session-protocol.mjs +2 -0
- package/dist/skills.cjs +9 -0
- package/dist/skills.d.cts +2 -0
- package/dist/skills.d.mts +2 -0
- package/dist/skills.mjs +2 -0
- package/dist/sqlite-history-import.cjs +151 -0
- package/dist/sqlite-history-import.cjs.map +1 -0
- package/dist/sqlite-history-import.d.cts +8 -0
- package/dist/sqlite-history-import.d.cts.map +1 -0
- package/dist/sqlite-history-import.d.mts +8 -0
- package/dist/sqlite-history-import.d.mts.map +1 -0
- package/dist/sqlite-history-import.mjs +146 -0
- package/dist/sqlite-history-import.mjs.map +1 -0
- package/dist/sqlite-session-storage.cjs +53 -0
- package/dist/sqlite-session-storage.cjs.map +1 -0
- package/dist/sqlite-session-storage.d.cts +7 -0
- package/dist/sqlite-session-storage.d.cts.map +1 -0
- package/dist/sqlite-session-storage.d.mts +7 -0
- package/dist/sqlite-session-storage.d.mts.map +1 -0
- package/dist/sqlite-session-storage.mjs +49 -0
- package/dist/sqlite-session-storage.mjs.map +1 -0
- package/dist/sync-location.cjs +209 -0
- package/dist/sync-location.cjs.map +1 -0
- package/dist/sync-location.d.cts +31 -0
- package/dist/sync-location.d.cts.map +1 -0
- package/dist/sync-location.d.mts +31 -0
- package/dist/sync-location.d.mts.map +1 -0
- package/dist/sync-location.mjs +199 -0
- package/dist/sync-location.mjs.map +1 -0
- package/dist/sync-registration.cjs +140 -0
- package/dist/sync-registration.cjs.map +1 -0
- package/dist/sync-registration.d.cts +38 -0
- package/dist/sync-registration.d.cts.map +1 -0
- package/dist/sync-registration.d.mts +38 -0
- package/dist/sync-registration.d.mts.map +1 -0
- package/dist/sync-registration.mjs +131 -0
- package/dist/sync-registration.mjs.map +1 -0
- package/dist/sync-state-contract.cjs +19 -0
- package/dist/sync-state-contract.cjs.map +1 -0
- package/dist/sync-state-contract.d.cts +14 -0
- package/dist/sync-state-contract.d.cts.map +1 -0
- package/dist/sync-state-contract.d.mts +14 -0
- package/dist/sync-state-contract.d.mts.map +1 -0
- package/dist/sync-state-contract.mjs +16 -0
- package/dist/sync-state-contract.mjs.map +1 -0
- package/dist/systems/child/adapters/headlessChildSessionService.cjs +210 -0
- package/dist/systems/child/adapters/headlessChildSessionService.cjs.map +1 -0
- package/dist/systems/child/adapters/headlessChildSessionService.d.cts +24 -0
- package/dist/systems/child/adapters/headlessChildSessionService.d.cts.map +1 -0
- package/dist/systems/child/adapters/headlessChildSessionService.d.mts +24 -0
- package/dist/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -0
- package/dist/systems/child/adapters/headlessChildSessionService.mjs +205 -0
- package/dist/systems/child/adapters/headlessChildSessionService.mjs.map +1 -0
- package/dist/systems/child/adapters/nativeChildRuntimes.cjs +28 -0
- package/dist/systems/child/adapters/nativeChildRuntimes.cjs.map +1 -0
- package/dist/systems/child/adapters/nativeChildRuntimes.mjs +25 -0
- package/dist/systems/child/adapters/nativeChildRuntimes.mjs.map +1 -0
- package/dist/systems/child/services/childSession/index.cjs +206 -0
- package/dist/systems/child/services/childSession/index.cjs.map +1 -0
- package/dist/systems/child/services/childSession/index.d.cts +14 -0
- package/dist/systems/child/services/childSession/index.d.cts.map +1 -0
- package/dist/systems/child/services/childSession/index.d.mts +14 -0
- package/dist/systems/child/services/childSession/index.d.mts.map +1 -0
- package/dist/systems/child/services/childSession/index.mjs +206 -0
- package/dist/systems/child/services/childSession/index.mjs.map +1 -0
- package/dist/systems/child/types/childSession.cjs +16 -0
- package/dist/systems/child/types/childSession.cjs.map +1 -0
- package/dist/systems/child/types/childSession.d.cts +135 -0
- package/dist/systems/child/types/childSession.d.cts.map +1 -0
- package/dist/systems/child/types/childSession.d.mts +135 -0
- package/dist/systems/child/types/childSession.d.mts.map +1 -0
- package/dist/systems/child/types/childSession.mjs +14 -0
- package/dist/systems/child/types/childSession.mjs.map +1 -0
- package/dist/systems/main/adapters/headlessHost.cjs +436 -0
- package/dist/systems/main/adapters/headlessHost.cjs.map +1 -0
- package/dist/systems/main/adapters/headlessHost.d.cts +72 -0
- package/dist/systems/main/adapters/headlessHost.d.cts.map +1 -0
- package/dist/systems/main/adapters/headlessHost.d.mts +72 -0
- package/dist/systems/main/adapters/headlessHost.d.mts.map +1 -0
- package/dist/systems/main/adapters/headlessHost.mjs +435 -0
- package/dist/systems/main/adapters/headlessHost.mjs.map +1 -0
- package/dist/systems/main/adapters/headlessSessionHost.cjs +653 -0
- package/dist/systems/main/adapters/headlessSessionHost.cjs.map +1 -0
- package/dist/systems/main/adapters/headlessSessionHost.d.cts +14 -0
- package/dist/systems/main/adapters/headlessSessionHost.d.cts.map +1 -0
- package/dist/systems/main/adapters/headlessSessionHost.d.mts +14 -0
- package/dist/systems/main/adapters/headlessSessionHost.d.mts.map +1 -0
- package/dist/systems/main/adapters/headlessSessionHost.mjs +649 -0
- package/dist/systems/main/adapters/headlessSessionHost.mjs.map +1 -0
- package/dist/systems/main/types/headlessHost.d.cts +36 -0
- package/dist/systems/main/types/headlessHost.d.cts.map +1 -0
- package/dist/systems/main/types/headlessHost.d.mts +36 -0
- package/dist/systems/main/types/headlessHost.d.mts.map +1 -0
- package/dist/terminal-pi-child-session-service.cjs +263 -0
- package/dist/terminal-pi-child-session-service.cjs.map +1 -0
- package/dist/terminal-pi-child-session-service.d.cts +36 -0
- package/dist/terminal-pi-child-session-service.d.cts.map +1 -0
- package/dist/terminal-pi-child-session-service.d.mts +36 -0
- package/dist/terminal-pi-child-session-service.d.mts.map +1 -0
- package/dist/terminal-pi-child-session-service.mjs +256 -0
- package/dist/terminal-pi-child-session-service.mjs.map +1 -0
- package/dist/testing/pi/extensionScenarios.cjs +73 -0
- package/dist/testing/pi/extensionScenarios.cjs.map +1 -0
- package/dist/testing/pi/extensionScenarios.d.cts +41 -0
- package/dist/testing/pi/extensionScenarios.d.cts.map +1 -0
- package/dist/testing/pi/extensionScenarios.d.mts +41 -0
- package/dist/testing/pi/extensionScenarios.d.mts.map +1 -0
- package/dist/testing/pi/extensionScenarios.mjs +73 -0
- package/dist/testing/pi/extensionScenarios.mjs.map +1 -0
- package/dist/testing/pi/testHost.cjs +365 -0
- package/dist/testing/pi/testHost.cjs.map +1 -0
- package/dist/testing/pi/testHost.d.cts +160 -0
- package/dist/testing/pi/testHost.d.cts.map +1 -0
- package/dist/testing/pi/testHost.d.mts +160 -0
- package/dist/testing/pi/testHost.d.mts.map +1 -0
- package/dist/testing/pi/testHost.mjs +365 -0
- package/dist/testing/pi/testHost.mjs.map +1 -0
- package/dist/testing.cjs +9 -0
- package/dist/testing.d.cts +5 -0
- package/dist/testing.d.mts +5 -0
- package/dist/testing.mjs +5 -0
- package/dist/tool-inventory.cjs +136 -0
- package/dist/tool-inventory.cjs.map +1 -0
- package/dist/tool-inventory.d.cts +66 -0
- package/dist/tool-inventory.d.cts.map +1 -0
- package/dist/tool-inventory.d.mts +66 -0
- package/dist/tool-inventory.d.mts.map +1 -0
- package/dist/tool-inventory.mjs +133 -0
- package/dist/tool-inventory.mjs.map +1 -0
- package/dist/tool-names.cjs +4 -0
- package/dist/tool-names.d.cts +2 -0
- package/dist/tool-names.d.mts +2 -0
- package/dist/tool-names.mjs +2 -0
- package/dist/tool-overrides.cjs +7 -0
- package/dist/tool-overrides.d.cts +3 -0
- package/dist/tool-overrides.d.mts +3 -0
- package/dist/tool-overrides.mjs +3 -0
- package/dist/tool-surface.cjs +7 -0
- package/dist/tool-surface.d.cts +3 -0
- package/dist/tool-surface.d.mts +3 -0
- package/dist/tool-surface.mjs +3 -0
- package/dist/transition-classifier.cjs +112 -0
- package/dist/transition-classifier.cjs.map +1 -0
- package/dist/transition-classifier.d.cts +18 -0
- package/dist/transition-classifier.d.cts.map +1 -0
- package/dist/transition-classifier.d.mts +18 -0
- package/dist/transition-classifier.d.mts.map +1 -0
- package/dist/transition-classifier.mjs +111 -0
- package/dist/transition-classifier.mjs.map +1 -0
- package/dist/transition-coordinator.cjs +131 -0
- package/dist/transition-coordinator.cjs.map +1 -0
- package/dist/transition-coordinator.d.cts +16 -0
- package/dist/transition-coordinator.d.cts.map +1 -0
- package/dist/transition-coordinator.d.mts +16 -0
- package/dist/transition-coordinator.d.mts.map +1 -0
- package/dist/transition-coordinator.mjs +130 -0
- package/dist/transition-coordinator.mjs.map +1 -0
- package/dist/transition.cjs +5 -0
- package/dist/transition.d.cts +2 -0
- package/dist/transition.d.mts +2 -0
- package/dist/transition.mjs +2 -0
- package/dist/types/config.d.cts +20 -0
- package/dist/types/config.d.cts.map +1 -0
- package/dist/types/config.d.mts +20 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/kernel.d.cts +69 -0
- package/dist/types/kernel.d.cts.map +1 -0
- package/dist/types/kernel.d.mts +69 -0
- package/dist/types/kernel.d.mts.map +1 -0
- package/dist/types/remote.d.cts +124 -0
- package/dist/types/remote.d.cts.map +1 -0
- package/dist/types/remote.d.mts +124 -0
- package/dist/types/remote.d.mts.map +1 -0
- package/dist/types/server/directHarnessRuntime.d.cts +156 -0
- package/dist/types/server/directHarnessRuntime.d.cts.map +1 -0
- package/dist/types/server/directHarnessRuntime.d.mts +156 -0
- package/dist/types/server/directHarnessRuntime.d.mts.map +1 -0
- package/dist/types/server/session.d.cts +5 -0
- package/dist/types/server/session.d.cts.map +1 -0
- package/dist/types/server/session.d.mts +5 -0
- package/dist/types/server/session.d.mts.map +1 -0
- package/dist/types-context-api.cjs +0 -0
- package/dist/types-context-api.d.cts +48 -0
- package/dist/types-context-api.d.cts.map +1 -0
- package/dist/types-context-api.d.mts +48 -0
- package/dist/types-context-api.d.mts.map +1 -0
- package/dist/types-context-api.mjs +1 -0
- package/dist/ui-hub.cjs +5 -0
- package/dist/ui-hub.d.cts +2 -0
- package/dist/ui-hub.d.mts +2 -0
- package/dist/ui-hub.mjs +2 -0
- package/dist/v3-export.cjs +1004 -0
- package/dist/v3-export.cjs.map +1 -0
- package/dist/v3-export.d.cts +34 -0
- package/dist/v3-export.d.cts.map +1 -0
- package/dist/v3-export.d.mts +34 -0
- package/dist/v3-export.d.mts.map +1 -0
- package/dist/v3-export.mjs +1000 -0
- package/dist/v3-export.mjs.map +1 -0
- package/dist/voice-reload-handoff.cjs +14 -0
- package/dist/voice-reload-handoff.d.cts +4 -0
- package/dist/voice-reload-handoff.d.mts +4 -0
- package/dist/voice-reload-handoff.mjs +4 -0
- package/dist/voice-tools.cjs +56 -0
- package/dist/voice-tools.d.cts +4 -0
- package/dist/voice-tools.d.mts +4 -0
- package/dist/voice-tools.mjs +4 -0
- package/dist/web/models/globalStore.cjs +23 -0
- package/dist/web/models/globalStore.cjs.map +1 -0
- package/dist/web/models/globalStore.d.cts +6 -0
- package/dist/web/models/globalStore.d.cts.map +1 -0
- package/dist/web/models/globalStore.d.mts +6 -0
- package/dist/web/models/globalStore.d.mts.map +1 -0
- package/dist/web/models/globalStore.mjs +23 -0
- package/dist/web/models/globalStore.mjs.map +1 -0
- package/dist/web/models/sessionStore.cjs +56 -0
- package/dist/web/models/sessionStore.cjs.map +1 -0
- package/dist/web/models/sessionStore.d.cts +14 -0
- package/dist/web/models/sessionStore.d.cts.map +1 -0
- package/dist/web/models/sessionStore.d.mts +14 -0
- package/dist/web/models/sessionStore.d.mts.map +1 -0
- package/dist/web/models/sessionStore.mjs +56 -0
- package/dist/web/models/sessionStore.mjs.map +1 -0
- package/dist/web/schemas/bundleAssetPolicy.cjs +20 -0
- package/dist/web/schemas/bundleAssetPolicy.cjs.map +1 -0
- package/dist/web/schemas/bundleAssetPolicy.d.cts +10 -0
- package/dist/web/schemas/bundleAssetPolicy.d.cts.map +1 -0
- package/dist/web/schemas/bundleAssetPolicy.d.mts +10 -0
- package/dist/web/schemas/bundleAssetPolicy.d.mts.map +1 -0
- package/dist/web/schemas/bundleAssetPolicy.mjs +18 -0
- package/dist/web/schemas/bundleAssetPolicy.mjs.map +1 -0
- package/dist/web/services/sessionRegistry/index.cjs +107 -0
- package/dist/web/services/sessionRegistry/index.cjs.map +1 -0
- package/dist/web/services/sessionRegistry/index.d.cts +42 -0
- package/dist/web/services/sessionRegistry/index.d.cts.map +1 -0
- package/dist/web/services/sessionRegistry/index.d.mts +42 -0
- package/dist/web/services/sessionRegistry/index.d.mts.map +1 -0
- package/dist/web/services/sessionRegistry/index.mjs +100 -0
- package/dist/web/services/sessionRegistry/index.mjs.map +1 -0
- package/dist/web/services/testing/channels.cjs +11 -0
- package/dist/web/services/testing/channels.cjs.map +1 -0
- package/dist/web/services/testing/channels.d.cts +8 -0
- package/dist/web/services/testing/channels.d.cts.map +1 -0
- package/dist/web/services/testing/channels.d.mts +8 -0
- package/dist/web/services/testing/channels.d.mts.map +1 -0
- package/dist/web/services/testing/channels.mjs +11 -0
- package/dist/web/services/testing/channels.mjs.map +1 -0
- package/dist/web/services/testing/index.cjs +27 -0
- package/dist/web/services/testing/index.cjs.map +1 -0
- package/dist/web/services/testing/index.d.cts +31 -0
- package/dist/web/services/testing/index.d.cts.map +1 -0
- package/dist/web/services/testing/index.d.mts +31 -0
- package/dist/web/services/testing/index.d.mts.map +1 -0
- package/dist/web/services/testing/index.mjs +27 -0
- package/dist/web/services/testing/index.mjs.map +1 -0
- package/dist/web/services/testing/slotProps.cjs +90 -0
- package/dist/web/services/testing/slotProps.cjs.map +1 -0
- package/dist/web/services/testing/slotProps.d.cts +67 -0
- package/dist/web/services/testing/slotProps.d.cts.map +1 -0
- package/dist/web/services/testing/slotProps.d.mts +67 -0
- package/dist/web/services/testing/slotProps.d.mts.map +1 -0
- package/dist/web/services/testing/slotProps.mjs +89 -0
- package/dist/web/services/testing/slotProps.mjs.map +1 -0
- package/dist/web/services/toolResult/index.cjs +30 -0
- package/dist/web/services/toolResult/index.cjs.map +1 -0
- package/dist/web/services/toolResult/index.d.cts +14 -0
- package/dist/web/services/toolResult/index.d.cts.map +1 -0
- package/dist/web/services/toolResult/index.d.mts +14 -0
- package/dist/web/services/toolResult/index.d.mts.map +1 -0
- package/dist/web/services/toolResult/index.mjs +29 -0
- package/dist/web/services/toolResult/index.mjs.map +1 -0
- package/dist/web/testing.cjs +8 -0
- package/dist/web/testing.d.cts +4 -0
- package/dist/web/testing.d.mts +4 -0
- package/dist/web/testing.mjs +4 -0
- package/dist/web/types/modelContext.d.cts +43 -0
- package/dist/web/types/modelContext.d.cts.map +1 -0
- package/dist/web/types/modelContext.d.mts +43 -0
- package/dist/web/types/modelContext.d.mts.map +1 -0
- package/dist/web/types/sessionRegistry.d.cts +59 -0
- package/dist/web/types/sessionRegistry.d.cts.map +1 -0
- package/dist/web/types/sessionRegistry.d.mts +59 -0
- package/dist/web/types/sessionRegistry.d.mts.map +1 -0
- package/dist/web/types/webPlugin.d.cts +809 -0
- package/dist/web/types/webPlugin.d.cts.map +1 -0
- package/dist/web/types/webPlugin.d.mts +809 -0
- package/dist/web/types/webPlugin.d.mts.map +1 -0
- package/dist/web-compositions.cjs +100 -0
- package/dist/web-compositions.cjs.map +1 -0
- package/dist/web-compositions.d.cts +20 -0
- package/dist/web-compositions.d.cts.map +1 -0
- package/dist/web-compositions.d.mts +20 -0
- package/dist/web-compositions.d.mts.map +1 -0
- package/dist/web-compositions.mjs +95 -0
- package/dist/web-compositions.mjs.map +1 -0
- package/dist/web.cjs +25 -0
- package/dist/web.d.cts +10 -0
- package/dist/web.d.mts +10 -0
- package/dist/web.mjs +7 -0
- package/package.json +587 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-import.mjs","names":[],"sources":["../src/services/historyImport/index.ts"],"sourcesContent":["import { createHash, randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport { writeFileAtomic } from '../json';\nimport { importV3WithPinnedUpstream } from '../jsonlSessionRepo';\n\nexport interface HistoryOwnershipLease {\n assertQuiescent(): void | Promise<void>;\n release(): void | Promise<void>;\n}\n\n/**\n * The caller must establish ownership and stop all managed writers before this\n * adapter reads or publishes a session. A filesystem lock cannot prove that an\n * unmanaged Pi process has stopped, so the boundary stays explicit.\n */\nexport interface HistoryOwnership {\n acquire(sourcePath: string): HistoryOwnershipLease | Promise<HistoryOwnershipLease>;\n}\n\nexport interface HistoryEntryProof {\n sourceId: string;\n importedId: string;\n sourceParentId: string | null;\n importedParentId: string | null;\n sourceContentHash: string;\n importedContentHash: string;\n}\n\nexport interface HistoryBranchProof {\n sourceTipId: string | null;\n importedTipId: string | null;\n branch?: string;\n}\n\nexport interface HistoryImportVerification {\n entries: readonly HistoryEntryProof[];\n branches: readonly HistoryBranchProof[];\n /** Source records projected into upstream values rather than physical entries. */\n projectedSourceIds?: readonly string[];\n}\n\nexport interface HistorySourceIdentity {\n path: string;\n realPath: string;\n device: number;\n inode: number;\n size: number;\n mtimeMs: number;\n sha256: string;\n}\n\nexport interface HistoryStagingImportInput {\n sourcePath: string;\n stagingPath: string;\n originalPath: string;\n sourceIdentity: HistorySourceIdentity;\n}\n\nexport interface HistoryImportOptions {\n sourcePath: string;\n destinationPath: string;\n owner: HistoryOwnership;\n importStaging?: (input: HistoryStagingImportInput) => HistoryImportVerification | Promise<HistoryImportVerification>;\n verifyStaging?: (stagingPath: string, proof: HistoryImportVerification) => Promise<HistoryImportVerification>;\n originalPath?: string;\n statePath?: string;\n}\n\nexport interface ProtectedHistoryImportResult {\n status: 'published' | 'already-published';\n sourceIdentity: HistorySourceIdentity;\n originalPath: string;\n destinationPath: string;\n statePath: string;\n verification: HistoryImportVerification;\n stagedSha256: string;\n}\n\nexport interface RestoreProtectedHistoryOptions {\n sourcePath: string;\n originalPath: string;\n owner: HistoryOwnership;\n}\n\ninterface ImportState {\n version: 1;\n operation: 'protected-history-import';\n phase: 'prepared' | 'staged' | 'verified' | 'published';\n sourcePath: string;\n destinationPath: string;\n originalPath: string;\n stagingPath: string;\n sourceIdentity: HistorySourceIdentity;\n verification?: HistoryImportVerification;\n stagedSha256?: string;\n}\n\nconst IMPORT_STATE_VERSION = 1;\nconst IMPORT_OPERATION = 'protected-history-import';\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction requireString(value: unknown, field: string): string {\n if (typeof value !== 'string' || value.length === 0) throw new Error(`Invalid history import ${field}`);\n return value;\n}\n\nfunction requireNullableString(value: unknown, field: string): string | null {\n if (value !== null && typeof value !== 'string') throw new Error(`Invalid history import ${field}`);\n return value;\n}\n\nfunction requireHash(value: unknown, field: string): string {\n const hash = requireString(value, field);\n if (!/^[a-f0-9]{64}$/.test(hash)) throw new Error(`Invalid history import ${field}`);\n return hash;\n}\n\nfunction sha256(content: Uint8Array): string {\n return createHash('sha256').update(content).digest('hex');\n}\n\nfunction readSource(sourcePath: string): { content: Buffer; identity: HistorySourceIdentity } {\n const before = fs.statSync(sourcePath);\n const content = fs.readFileSync(sourcePath);\n const after = fs.statSync(sourcePath);\n if (\n before.dev !== after.dev ||\n before.ino !== after.ino ||\n before.size !== after.size ||\n before.mtimeMs !== after.mtimeMs ||\n after.size !== content.byteLength\n ) {\n throw new Error('Protected history source changed while it was being read');\n }\n return {\n content,\n identity: {\n path: path.resolve(sourcePath),\n realPath: fs.realpathSync(sourcePath),\n device: after.dev,\n inode: after.ino,\n size: after.size,\n mtimeMs: after.mtimeMs,\n sha256: sha256(content),\n },\n };\n}\n\nfunction sameIdentity(left: HistorySourceIdentity, right: HistorySourceIdentity): boolean {\n return (\n left.path === right.path &&\n left.realPath === right.realPath &&\n left.device === right.device &&\n left.inode === right.inode &&\n left.size === right.size &&\n left.mtimeMs === right.mtimeMs &&\n left.sha256 === right.sha256\n );\n}\n\nfunction ensureOwnerOnly(filePath: string): void {\n fs.chmodSync(filePath, 0o600);\n}\n\nfunction writeExclusive(filePath: string, content: Uint8Array): void {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n let fd: number | undefined;\n try {\n fd = fs.openSync(filePath, 'wx', 0o600);\n fs.writeFileSync(fd, content);\n fs.fsyncSync(fd);\n } catch (error) {\n if (fd !== undefined) {\n fs.closeSync(fd);\n fs.rmSync(filePath, { force: true });\n }\n throw error;\n }\n fs.closeSync(fd);\n ensureOwnerOnly(filePath);\n const directoryFd = fs.openSync(path.dirname(filePath), 'r');\n try {\n fs.fsyncSync(directoryFd);\n } finally {\n fs.closeSync(directoryFd);\n }\n}\n\nfunction ensureOriginal(originalPath: string, content: Uint8Array): void {\n if (fs.existsSync(originalPath)) {\n const stat = fs.lstatSync(originalPath);\n if (!stat.isFile() || stat.nlink !== 1)\n throw new Error(`Protected history original must be an independent file: ${originalPath}`);\n const existing = fs.readFileSync(originalPath);\n if (sha256(existing) !== sha256(content)) throw new Error(`Protected history original differs: ${originalPath}`);\n ensureOwnerOnly(originalPath);\n return;\n }\n try {\n writeExclusive(originalPath, content);\n } catch (error) {\n if (!isFileSystemError(error) || error.code !== 'EEXIST') throw error;\n const stat = fs.lstatSync(originalPath);\n if (!stat.isFile() || stat.nlink !== 1)\n throw new Error(`Protected history original must be an independent file: ${originalPath}`);\n const existing = fs.readFileSync(originalPath);\n if (sha256(existing) !== sha256(content)) throw new Error(`Protected history original differs: ${originalPath}`);\n ensureOwnerOnly(originalPath);\n }\n}\n\n/** Preserve exact bytes before upstream open is allowed to repair a native journal. */\nexport async function preserveHistoryBeforeOpen(sourcePath: string, lease: HistoryOwnershipLease): Promise<string> {\n await lease.assertQuiescent();\n const source = readSource(sourcePath);\n const originalPath = `${source.identity.realPath}.recovery-${source.identity.sha256}.original`;\n ensureOriginal(originalPath, source.content);\n const recordPath = `${originalPath}.json`;\n if (!fs.existsSync(recordPath)) {\n writeExclusive(\n recordPath,\n Buffer.from(`${JSON.stringify({ version: 1, source: source.identity, originalPath })}\\n`),\n );\n } else {\n const record = asRecord(JSON.parse(fs.readFileSync(recordPath, 'utf8')));\n const identity = asRecord(record?.source);\n if (\n record?.originalPath !== originalPath ||\n identity?.sha256 !== source.identity.sha256 ||\n identity.realPath !== source.identity.realPath\n ) {\n throw new Error('Existing recovery provenance does not match the protected journal');\n }\n }\n await lease.assertQuiescent();\n if (!sameIdentity(source.identity, readSource(sourcePath).identity))\n throw new Error('Journal changed during recovery preservation');\n return originalPath;\n}\n\nfunction writeBinaryAtomically(filePath: string, content: Uint8Array): void {\n fs.mkdirSync(path.dirname(filePath), { recursive: true });\n const temporaryPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;\n try {\n writeExclusive(temporaryPath, content);\n fs.renameSync(temporaryPath, filePath);\n } catch (error) {\n fs.rmSync(temporaryPath, { force: true });\n throw error;\n }\n}\n\nfunction publishDistinct(stagingPath: string, destinationPath: string): void {\n if (fs.existsSync(destinationPath)) throw new Error(`Refusing to overwrite derived history: ${destinationPath}`);\n fs.mkdirSync(path.dirname(destinationPath), { recursive: true });\n fs.linkSync(stagingPath, destinationPath);\n fs.unlinkSync(stagingPath);\n}\n\nfunction writeState(statePath: string, state: ImportState): void {\n writeFileAtomic(statePath, `${JSON.stringify(state, null, 2)}\\n`);\n ensureOwnerOnly(statePath);\n}\n\nfunction readState(statePath: string): ImportState | undefined {\n if (!fs.existsSync(statePath)) return undefined;\n ensureOwnerOnly(statePath);\n const value = asRecord(JSON.parse(fs.readFileSync(statePath, 'utf8')));\n if (value?.version !== IMPORT_STATE_VERSION || value.operation !== IMPORT_OPERATION) {\n throw new Error(`Invalid protected history state: ${statePath}`);\n }\n const phase = value.phase;\n if (phase !== 'prepared' && phase !== 'staged' && phase !== 'verified' && phase !== 'published') {\n throw new Error(`Invalid protected history state phase: ${String(phase)}`);\n }\n const sourceIdentity = asRecord(value.sourceIdentity);\n const verification = value.verification === undefined ? undefined : parseVerification(value.verification);\n return {\n version: 1,\n operation: IMPORT_OPERATION,\n phase,\n sourcePath: requireString(value.sourcePath, 'state source path'),\n destinationPath: requireString(value.destinationPath, 'state destination path'),\n originalPath: requireString(value.originalPath, 'state original path'),\n stagingPath: requireString(value.stagingPath, 'state staging path'),\n sourceIdentity: parseSourceIdentity(sourceIdentity),\n verification,\n stagedSha256: value.stagedSha256 === undefined ? undefined : requireHash(value.stagedSha256, 'staged checksum'),\n };\n}\n\nfunction parseSourceIdentity(value: Record<string, unknown> | undefined): HistorySourceIdentity {\n if (value === undefined) throw new Error('Invalid protected history source identity');\n const numeric = (field: string): number => {\n const number = value[field];\n if (typeof number !== 'number' || !Number.isSafeInteger(number) || number < 0)\n throw new Error(`Invalid history import ${field}`);\n return number;\n };\n const mtimeMs = value.mtimeMs;\n if (typeof mtimeMs !== 'number' || !Number.isFinite(mtimeMs) || mtimeMs < 0) {\n throw new Error('Invalid history import mtimeMs');\n }\n return {\n path: requireString(value.path, 'source path'),\n realPath: requireString(value.realPath, 'source real path'),\n device: numeric('device'),\n inode: numeric('inode'),\n size: numeric('size'),\n mtimeMs,\n sha256: requireHash(value.sha256, 'source checksum'),\n };\n}\n\nfunction parseVerification(value: unknown): HistoryImportVerification {\n const record = asRecord(value);\n if (record === undefined || !Array.isArray(record.entries) || !Array.isArray(record.branches)) {\n throw new Error('Invalid protected history verification');\n }\n const entries = record.entries.map((entry, index) => {\n const item = asRecord(entry);\n if (item === undefined) throw new Error(`Invalid history entry proof at index ${index}`);\n return {\n sourceId: requireString(item.sourceId, 'entry source id'),\n importedId: requireString(item.importedId, 'entry imported id'),\n sourceParentId: requireNullableString(item.sourceParentId, 'entry source parent id'),\n importedParentId: requireNullableString(item.importedParentId, 'entry imported parent id'),\n sourceContentHash: requireHash(item.sourceContentHash, 'entry source content hash'),\n importedContentHash: requireHash(item.importedContentHash, 'entry imported content hash'),\n };\n });\n const branches = record.branches.map((branch, index) => {\n const item = asRecord(branch);\n if (item === undefined) throw new Error(`Invalid history branch proof at index ${index}`);\n const name = item.branch === undefined ? undefined : requireString(item.branch, `branch name at index ${index}`);\n return {\n sourceTipId: requireNullableString(item.sourceTipId, `branch source tip id at index ${index}`),\n importedTipId: requireNullableString(item.importedTipId, `branch imported tip id at index ${index}`),\n ...(name === undefined ? {} : { branch: name }),\n };\n });\n const projectedSourceIds = record.projectedSourceIds;\n if (\n projectedSourceIds !== undefined &&\n (!Array.isArray(projectedSourceIds) || projectedSourceIds.some((id) => typeof id !== 'string' || id.length === 0))\n ) {\n throw new Error('Invalid projected protected history source ids');\n }\n const projected = projectedSourceIds as string[] | undefined;\n if (projected !== undefined && new Set(projected).size !== projected.length) {\n throw new Error('Duplicate projected protected history source id');\n }\n return { entries, branches, ...(projected === undefined ? {} : { projectedSourceIds: projected }) };\n}\n\ninterface ParsedHistory {\n header: Record<string, unknown>;\n labels: Map<string, unknown>;\n sessionName: unknown;\n records: Record<string, unknown>[];\n byId: Map<string, Record<string, unknown>>;\n branchTips: Map<string, string | null>;\n}\n\nfunction parseHistory(content: Uint8Array, expected: 'v3' | 'v4' | 'auto'): ParsedHistory {\n const text = Buffer.from(content).toString('utf8');\n if (Buffer.from(text).compare(Buffer.from(content)) !== 0 || !text.endsWith('\\n')) {\n throw new Error('Protected history JSONL is truncated or not valid UTF-8');\n }\n const lines = text.slice(0, -1).split('\\n');\n const first = lines[0];\n if (first === undefined || first.length === 0) throw new Error('Protected history is empty');\n const header = asRecord(JSON.parse(first));\n const actual =\n header?.type === 'session' && header.version === 3\n ? 'v3'\n : header?.kind === 'header' && header.v === 4\n ? 'v4'\n : undefined;\n if (actual === undefined || (expected !== 'auto' && actual !== expected)) {\n throw new Error(expected === 'v3' ? 'Protected history source is not v3' : 'Protected history staging is not v4');\n }\n const records: Record<string, unknown>[] = [];\n const byId = new Map<string, Record<string, unknown>>();\n const branchTips = new Map<string, string | null>();\n const labels = new Map<string, unknown>();\n let sessionName: unknown;\n for (const [index, line] of lines.slice(1).entries()) {\n if (line.length === 0) throw new Error(`Invalid protected history JSONL at line ${index + 2}`);\n let value: unknown;\n try {\n value = JSON.parse(line);\n } catch (error) {\n throw new Error(`Invalid protected history JSONL at line ${index + 2}`, { cause: error });\n }\n const values = actual === 'v4' && Array.isArray(value) ? value : [value];\n for (const item of values) {\n const record = asRecord(item);\n if (record === undefined) throw new Error(`Invalid protected history record at line ${index + 2}`);\n if (actual === 'v4') {\n if (record.kind === 'value' && typeof record.key === 'string') {\n if (record.namespace === 'pi.entry.label') {\n if (record.op === 'delete') labels.delete(record.key);\n else labels.set(record.key, record.value);\n } else if (record.namespace === 'pi.session.name' && record.key === '') {\n sessionName = record.op === 'delete' ? undefined : record.value;\n }\n }\n if (record.kind === 'entry') {\n const entry =\n asRecord(record.entry) ??\n (() => {\n const { kind: _kind, seq: _seq, ...flat } = record;\n return flat;\n })();\n records.push(entry);\n const id = requireString(entry.id, 'imported entry id');\n if (byId.has(id)) throw new Error(`Duplicate protected history entry id: ${id}`);\n byId.set(id, entry);\n } else if (record.kind === 'value' && record.namespace === 'pi.branch.tip' && typeof record.key === 'string') {\n const tip = record.op === 'delete' ? null : requireNullableString(record.value, 'imported branch tip');\n branchTips.set(record.key, tip);\n }\n } else {\n if (record.id === undefined) throw new Error(`Protected history record at line ${index + 2} has no id`);\n const id = requireString(record.id, 'source entry id');\n if (byId.has(id)) throw new Error(`Duplicate protected history entry id: ${id}`);\n records.push(record);\n byId.set(id, record);\n }\n }\n }\n return { header: header!, records, byId, branchTips, labels, sessionName };\n}\n\nfunction stableJson(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(stableJson).join(',')}]`;\n const record = asRecord(value);\n if (record === undefined) return JSON.stringify(value);\n return `{${Object.keys(record)\n .sort()\n .map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`)\n .join(',')}}`;\n}\n\nfunction contentHash(record: Record<string, unknown>): string {\n const { id: _id, parentId: _parentId, timestamp: _timestamp, kind: _kind, seq: _seq, ...content } = record;\n if (content.type === 'custom_message') {\n content.type = 'message';\n content.message = {\n role: 'custom',\n customType: content.customType,\n content: content.content,\n details: content.details,\n display: content.display,\n };\n delete content.customType;\n delete content.content;\n delete content.details;\n delete content.display;\n }\n if (content.type === 'branch_summary' && content.fromId === 'root') content.fromId = null;\n if (content.type === 'compaction') {\n delete content.firstKeptEntryId;\n delete content.retainedTail;\n }\n return sha256(Buffer.from(stableJson(content)));\n}\n\nfunction sourceParentId(record: Record<string, unknown>, field: string): string | null {\n return requireNullableString(record.parentId, field);\n}\n\nfunction resolveMappedParent(\n sourceId: string | null,\n source: ParsedHistory,\n mappings: Map<string, HistoryEntryProof>,\n): string | null {\n const visited = new Set<string>();\n let current = sourceId;\n while (current !== null) {\n if (visited.has(current)) throw new Error(`Cycle in protected history parent chain: ${current}`);\n visited.add(current);\n const mapped = mappings.get(current);\n if (mapped !== undefined) return mapped.importedId;\n const parent = source.byId.get(current);\n if (parent === undefined) throw new Error(`Protected history parent references unknown entry: ${current}`);\n current = sourceParentId(parent, 'source parent id');\n }\n return null;\n}\n\nfunction historyTimestamp(value: unknown): number {\n const timestamp = typeof value === 'number' ? value : typeof value === 'string' ? Date.parse(value) : NaN;\n if (!Number.isFinite(timestamp)) throw new Error('Invalid protected history timestamp');\n return timestamp;\n}\n\nfunction verifyImport(\n sourceContent: Uint8Array,\n importedContent: Uint8Array,\n verification: HistoryImportVerification,\n): HistoryImportVerification {\n const source = parseHistory(sourceContent, 'v3');\n const imported = parseHistory(importedContent, 'v4');\n if (\n imported.header.id !== requireString(source.header.id, 'session identity') ||\n imported.header.cwd !== requireString(source.header.cwd, 'session cwd identity') ||\n historyTimestamp(imported.header.createdAt) !== historyTimestamp(source.header.timestamp)\n ) {\n throw new Error('Imported history session identity mismatch');\n }\n const importedIds = new Set(imported.byId.keys());\n const mappedSourceIds = new Set<string>();\n const mappings = new Map<string, HistoryEntryProof>();\n for (const entry of verification.entries) {\n if (!source.byId.has(entry.sourceId))\n throw new Error(`Imported proof references unknown source entry: ${entry.sourceId}`);\n if (mappedSourceIds.has(entry.sourceId))\n throw new Error(`Duplicate imported source entry proof: ${entry.sourceId}`);\n if (mappings.has(entry.sourceId) || !importedIds.has(entry.importedId))\n throw new Error(`Imported proof references unknown imported entry: ${entry.importedId}`);\n if (entry.sourceContentHash !== entry.importedContentHash)\n throw new Error(`Imported history content mismatch: ${entry.sourceId}`);\n if (entry.sourceContentHash !== contentHash(source.byId.get(entry.sourceId)!))\n throw new Error(`Imported source content proof mismatch: ${entry.sourceId}`);\n if (entry.importedContentHash !== contentHash(imported.byId.get(entry.importedId)!))\n throw new Error(`Imported content proof mismatch: ${entry.importedId}`);\n mappedSourceIds.add(entry.sourceId);\n mappings.set(entry.sourceId, entry);\n }\n const projected = new Set(verification.projectedSourceIds ?? []);\n for (const id of projected) {\n if (!source.byId.has(id)) throw new Error(`Imported proof references unknown projected source entry: ${id}`);\n }\n for (const id of source.byId.keys()) {\n if (!mappedSourceIds.has(id) && !projected.has(id)) throw new Error(`Imported proof omits source entry: ${id}`);\n if (projected.has(id) && mappedSourceIds.has(id))\n throw new Error(`Imported proof maps and projects source entry: ${id}`);\n if (projected.has(id)) {\n const type = source.byId.get(id)?.type;\n if (\n type !== 'model_change' &&\n type !== 'thinking_level_change' &&\n type !== 'active_tools_change' &&\n type !== 'session_info' &&\n type !== 'label'\n ) {\n throw new Error(`Protected history cannot project source entry: ${id}`);\n }\n }\n }\n const importedProofIds = new Set<string>();\n for (const entry of verification.entries) {\n if (importedProofIds.has(entry.importedId)) throw new Error(`Duplicate imported entry proof: ${entry.importedId}`);\n importedProofIds.add(entry.importedId);\n }\n for (const id of imported.byId.keys()) {\n if (!importedProofIds.has(id)) throw new Error(`Imported proof omits imported entry: ${id}`);\n }\n for (const entry of verification.entries) {\n const sourceEntry = source.byId.get(entry.sourceId)!;\n const importedEntry = imported.byId.get(entry.importedId)!;\n if (historyTimestamp(sourceEntry.timestamp) !== historyTimestamp(importedEntry.timestamp)) {\n throw new Error(`Imported history timestamp mismatch: ${entry.sourceId}`);\n }\n if (entry.sourceParentId !== sourceParentId(sourceEntry, 'source parent id')) {\n throw new Error(`Imported source parent proof mismatch: ${entry.sourceId}`);\n }\n const expectedParent = resolveMappedParent(sourceParentId(sourceEntry, 'source parent id'), source, mappings);\n const actualParent = sourceParentId(importedEntry, 'imported parent id');\n if (expectedParent !== actualParent || entry.importedParentId !== actualParent)\n throw new Error(`Imported history parent mismatch: ${entry.sourceId}`);\n }\n const expectedLabels = new Map<string, unknown>();\n for (const record of source.records) {\n if (record.type !== 'label') continue;\n const target = resolveMappedParent(requireString(record.targetId, 'label target'), source, mappings);\n if (target === null) continue;\n if (record.label) expectedLabels.set(target, record.label);\n else expectedLabels.delete(target);\n }\n if (\n expectedLabels.size !== imported.labels.size ||\n [...expectedLabels].some(([id, label]) => imported.labels.get(id) !== label)\n ) {\n throw new Error('Imported history label projection mismatch');\n }\n const expectedName = source.records.findLast((record) => record.type === 'session_info')?.name || undefined;\n if (imported.sessionName !== expectedName) throw new Error('Imported history session name projection mismatch');\n const selectedSourceId = source.records.at(-1)?.id;\n const expectedMainTip = resolveMappedParent(\n selectedSourceId === undefined ? null : requireString(selectedSourceId, 'selected source id'),\n source,\n mappings,\n );\n if (imported.branchTips.get('main') !== expectedMainTip) {\n throw new Error('Imported history selected branch mismatch');\n }\n const seenBranches = new Set<string>();\n for (const branch of verification.branches) {\n const branchKey = branch.branch ?? `#${seenBranches.size}`;\n if (seenBranches.has(branchKey)) throw new Error(`Duplicate imported history branch proof: ${branchKey}`);\n seenBranches.add(branchKey);\n if (branch.sourceTipId === null || branch.importedTipId === null) {\n if (branch.sourceTipId !== branch.importedTipId) throw new Error('Imported history branch root mismatch');\n } else {\n const mapping = mappings.get(branch.sourceTipId);\n if (mapping === undefined || mapping.importedId !== branch.importedTipId)\n throw new Error(`Imported history branch mismatch: ${branch.sourceTipId}`);\n }\n if (branch.branch !== undefined && imported.branchTips.get(branch.branch) !== branch.importedTipId) {\n throw new Error(`Imported history branch tip mismatch: ${branch.branch}`);\n }\n }\n for (const [branch, tip] of imported.branchTips) {\n const proof = verification.branches.find((item) => item.branch === branch);\n if (proof === undefined || proof.importedTipId !== tip) throw new Error(`Imported proof omits branch: ${branch}`);\n }\n return verification;\n}\n\nfunction isFileSystemError(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';\n}\n\nfunction assertPaths(options: HistoryImportOptions, originalPath: string, statePath: string): void {\n const sourcePath = path.resolve(options.sourcePath);\n const destinationPath = path.resolve(options.destinationPath);\n if (sourcePath === destinationPath) throw new Error('Protected history destination must differ from source');\n if (sourcePath === path.resolve(originalPath) || sourcePath === path.resolve(statePath)) {\n throw new Error('Protected history sidecars must differ from source');\n }\n if (destinationPath === path.resolve(originalPath) || destinationPath === path.resolve(statePath)) {\n throw new Error('Protected history destination must differ from sidecars');\n }\n}\n\nexport async function protectAndImportHistory(options: HistoryImportOptions): Promise<ProtectedHistoryImportResult> {\n const sourcePath = path.resolve(options.sourcePath);\n const destinationPath = path.resolve(options.destinationPath);\n const originalPath = path.resolve(options.originalPath ?? `${sourcePath}.original`);\n const statePath = path.resolve(options.statePath ?? `${destinationPath}.import-state.json`);\n assertPaths(options, originalPath, statePath);\n\n const lease = await options.owner.acquire(sourcePath);\n try {\n await lease.assertQuiescent();\n const source = readSource(sourcePath);\n const existingState = readState(statePath);\n if (existingState !== undefined) {\n if (\n existingState.sourcePath !== source.identity.path ||\n existingState.destinationPath !== destinationPath ||\n existingState.originalPath !== originalPath ||\n !sameIdentity(existingState.sourceIdentity, source.identity)\n ) {\n throw new Error('Protected history state does not match current source');\n }\n ensureOriginal(originalPath, source.content);\n if (existingState.phase === 'published') {\n if (!fs.existsSync(destinationPath)) throw new Error('Published protected history is missing its destination');\n if (existingState.stagedSha256 === undefined)\n throw new Error('Published protected history has no destination checksum');\n if (sha256(fs.readFileSync(destinationPath)) !== existingState.stagedSha256) {\n throw new Error('Published protected history destination was modified');\n }\n if (existingState.verification === undefined)\n throw new Error('Published protected history has no verification proof');\n return {\n status: 'already-published',\n sourceIdentity: source.identity,\n originalPath,\n destinationPath,\n statePath,\n verification: existingState.verification,\n stagedSha256: existingState.stagedSha256,\n };\n }\n } else {\n ensureOriginal(originalPath, source.content);\n }\n\n let state: ImportState;\n if (existingState === undefined) {\n state = {\n version: IMPORT_STATE_VERSION,\n operation: IMPORT_OPERATION,\n phase: 'prepared',\n sourcePath: source.identity.path,\n destinationPath,\n originalPath,\n stagingPath: `${destinationPath}.${process.pid}.${randomUUID()}.staging`,\n sourceIdentity: source.identity,\n };\n writeState(statePath, state);\n } else {\n state = existingState;\n }\n\n if (fs.existsSync(destinationPath)) {\n const stagedSha256 = state.stagedSha256;\n if (stagedSha256 !== undefined && sha256(fs.readFileSync(destinationPath)) === stagedSha256) {\n state = { ...state, phase: 'published' };\n writeState(statePath, state);\n return {\n status: 'already-published',\n sourceIdentity: source.identity,\n originalPath,\n destinationPath,\n statePath,\n verification: state.verification ?? { entries: [], branches: [] },\n stagedSha256,\n };\n }\n throw new Error(`Refusing to overwrite derived history: ${destinationPath}`);\n }\n\n if (state.phase === 'prepared') {\n if (fs.existsSync(state.stagingPath)) fs.rmSync(state.stagingPath, { force: true });\n fs.copyFileSync(originalPath, state.stagingPath, fs.constants.COPYFILE_EXCL);\n ensureOwnerOnly(state.stagingPath);\n const importedVerification = await (options.importStaging ?? importV3WithPinnedUpstream)({\n sourcePath,\n stagingPath: state.stagingPath,\n originalPath,\n sourceIdentity: source.identity,\n });\n state = {\n ...state,\n phase: 'staged',\n verification: importedVerification,\n stagedSha256: sha256(fs.readFileSync(state.stagingPath)),\n };\n writeState(statePath, state);\n }\n if (state.verification === undefined) throw new Error('Protected history staging has no verification proof');\n const verification = state.verification;\n if (state.phase === 'staged') {\n state = {\n ...state,\n phase: 'verified',\n verification: options.verifyStaging\n ? await options.verifyStaging(state.stagingPath, verification)\n : verifyImport(source.content, fs.readFileSync(state.stagingPath), verification),\n };\n writeState(statePath, state);\n }\n await lease.assertQuiescent();\n const current = readSource(sourcePath);\n if (!sameIdentity(current.identity, source.identity))\n throw new Error('Protected history source changed during import');\n if (!fs.existsSync(state.stagingPath)) throw new Error('Protected history staging copy is missing');\n if (state.stagedSha256 !== undefined && sha256(fs.readFileSync(state.stagingPath)) !== state.stagedSha256) {\n throw new Error('Protected history staging copy changed during import');\n }\n publishDistinct(state.stagingPath, destinationPath);\n state = { ...state, phase: 'published' };\n writeState(statePath, state);\n return {\n status: 'published',\n sourceIdentity: source.identity,\n originalPath,\n destinationPath,\n statePath,\n verification,\n stagedSha256: state.stagedSha256 ?? sha256(fs.readFileSync(destinationPath)),\n };\n } finally {\n await lease.release();\n }\n}\n\nexport async function restoreProtectedHistory(options: RestoreProtectedHistoryOptions): Promise<void> {\n const sourcePath = path.resolve(options.sourcePath);\n const originalPath = path.resolve(options.originalPath);\n const lease = await options.owner.acquire(sourcePath);\n try {\n await lease.assertQuiescent();\n const original = fs.readFileSync(originalPath);\n const current = fs.existsSync(sourcePath) ? fs.readFileSync(sourcePath) : undefined;\n if (current !== undefined && sha256(current) === sha256(original)) return;\n writeBinaryAtomically(sourcePath, original);\n ensureOwnerOnly(sourcePath);\n } finally {\n await lease.release();\n }\n}\n"],"mappings":";;;;;;AAmGA,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AAEzB,SAAS,SAAS,OAAqD;CACrE,OAAO,OAAO,UAAU,YAAY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AAI,MAAM,gDAAgD;EAClE,IAAI,CAAC,GAAG,WAAW,MAAM,WAAW,GAAG,MAAM,IAAI,MAAM,2CAA2C;EAClG,IAAI,MAAM,iBAAiB,KAAA,KAAa,OAAO,GAAG,aAAa,MAAM,WAAW,CAAC,MAAM,MAAM,cAC3F,MAAM,IAAI,MAAM,sDAAsD;EAExE,gBAAgB,MAAM,aAAa,eAAe;EAClD,QAAQ;GAAE,GAAG;GAAO,OAAO;EAAY;EACvC,WAAW,WAAW,KAAK;EAC3B,OAAO;GACL,QAAQ;GACR,gBAAgB,OAAO;GACvB;GACA;GACA;GACA;GACA,cAAc,MAAM,gBAAgB,OAAO,GAAG,aAAa,eAAe,CAAC;EAC7E;CACF,UAAU;EACR,MAAM,MAAM,QAAQ;CACtB;AACF;AAEA,eAAsB,wBAAwB,SAAwD;CACpG,MAAM,aAAa,KAAK,QAAQ,QAAQ,UAAU;CAClD,MAAM,eAAe,KAAK,QAAQ,QAAQ,YAAY;CACtD,MAAM,QAAQ,MAAM,QAAQ,MAAM,QAAQ,UAAU;CACpD,IAAI;EACF,MAAM,MAAM,gBAAgB;EAC5B,MAAM,WAAW,GAAG,aAAa,YAAY;EAC7C,MAAM,UAAU,GAAG,WAAW,UAAU,IAAI,GAAG,aAAa,UAAU,IAAI,KAAA;EAC1E,IAAI,YAAY,KAAA,KAAa,OAAO,OAAO,MAAM,OAAO,QAAQ,GAAG;EACnE,sBAAsB,YAAY,QAAQ;EAC1C,gBAAgB,UAAU;CAC5B,UAAU;EACR,MAAM,MAAM,QAAQ;CACtB;AACF"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
5
|
+
let node_path = require("node:path");
|
|
6
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
7
|
+
let node_crypto = require("node:crypto");
|
|
8
|
+
//#region src/services/historyOwnership/index.ts
|
|
9
|
+
const LOCK_SUFFIX = ".doompi-v4.lock";
|
|
10
|
+
const LOCK_VERSION = 1;
|
|
11
|
+
const LOCK_FORMAT = "doompi-v4-history-ownership";
|
|
12
|
+
function canonicalSourcePath(sourcePath) {
|
|
13
|
+
const absolute = node_path.default.resolve(sourcePath);
|
|
14
|
+
if (node_fs.default.existsSync(absolute)) return node_fs.default.realpathSync(absolute);
|
|
15
|
+
const segments = [node_path.default.basename(absolute)];
|
|
16
|
+
let parent = node_path.default.dirname(absolute);
|
|
17
|
+
while (!node_fs.default.existsSync(parent)) {
|
|
18
|
+
segments.unshift(node_path.default.basename(parent));
|
|
19
|
+
parent = node_path.default.dirname(parent);
|
|
20
|
+
}
|
|
21
|
+
return node_path.default.join(node_fs.default.realpathSync(parent), ...segments);
|
|
22
|
+
}
|
|
23
|
+
/** Resolve aliases so every writer and exporter contends for the same lock. */
|
|
24
|
+
function historyOwnershipLockPath(sourcePath) {
|
|
25
|
+
return `${canonicalSourcePath(sourcePath)}${LOCK_SUFFIX}`;
|
|
26
|
+
}
|
|
27
|
+
function isHistoryObject(value) {
|
|
28
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29
|
+
}
|
|
30
|
+
function isV4Header(value) {
|
|
31
|
+
return isHistoryObject(value) && value.kind === "header" && value.v === 4;
|
|
32
|
+
}
|
|
33
|
+
function isV3Header(value) {
|
|
34
|
+
return isHistoryObject(value) && value.type === "session" && value.version === 3;
|
|
35
|
+
}
|
|
36
|
+
function readHeader(sourcePath, format) {
|
|
37
|
+
const firstLine = node_fs.default.readFileSync(sourcePath, "utf8").split("\n", 1)[0] ?? "";
|
|
38
|
+
try {
|
|
39
|
+
return JSON.parse(firstLine);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
const message = format === "v4" ? `History ownership source is not canonical v4 JSONL: ${sourcePath}` : `Offline history source is not canonical v3 JSONL: ${sourcePath}`;
|
|
42
|
+
throw new Error(message, { cause: error });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function assertIndependentRegularFile(sourcePath, label) {
|
|
46
|
+
const stat = node_fs.default.statSync(sourcePath);
|
|
47
|
+
if (!stat.isFile() || stat.nlink !== 1) throw new Error(`${label} must be an independent regular file`);
|
|
48
|
+
}
|
|
49
|
+
function assertV4Source(sourcePath) {
|
|
50
|
+
if (!node_fs.default.existsSync(sourcePath)) return;
|
|
51
|
+
assertIndependentRegularFile(sourcePath, "Canonical history");
|
|
52
|
+
if (!isV4Header(readHeader(sourcePath, "v4"))) throw new Error(`History ownership only supports canonical v4 sources: ${sourcePath}`);
|
|
53
|
+
}
|
|
54
|
+
function assertV3Source(sourcePath) {
|
|
55
|
+
if (!node_fs.default.existsSync(sourcePath)) return;
|
|
56
|
+
assertIndependentRegularFile(sourcePath, "Offline v3 history source");
|
|
57
|
+
if (!isV3Header(readHeader(sourcePath, "v3"))) throw new Error(`Offline history import only supports v3 sources: ${sourcePath}`);
|
|
58
|
+
}
|
|
59
|
+
function assertSqliteSource(sourcePath) {
|
|
60
|
+
if (!node_fs.default.existsSync(sourcePath)) return;
|
|
61
|
+
assertIndependentRegularFile(sourcePath, "SQLite history");
|
|
62
|
+
const descriptor = node_fs.default.openSync(sourcePath, "r");
|
|
63
|
+
try {
|
|
64
|
+
const header = Buffer.alloc(16);
|
|
65
|
+
if (node_fs.default.readSync(descriptor, header, 0, header.length, 0) !== header.length || header.toString("utf8") !== "SQLite format 3\0") throw new Error(`History ownership source is not SQLite: ${sourcePath}`);
|
|
66
|
+
} finally {
|
|
67
|
+
node_fs.default.closeSync(descriptor);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function isFileSystemError(error) {
|
|
71
|
+
return error instanceof Error && typeof error.code === "string";
|
|
72
|
+
}
|
|
73
|
+
function readToken(lockPath) {
|
|
74
|
+
try {
|
|
75
|
+
const value = JSON.parse(node_fs.default.readFileSync(lockPath, "utf8"));
|
|
76
|
+
return typeof value.token === "string" ? value.token : void 0;
|
|
77
|
+
} catch {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function releaseLock(lockPath, token, handle) {
|
|
82
|
+
node_fs.default.closeSync(handle);
|
|
83
|
+
if (readToken(lockPath) === token) node_fs.default.rmSync(lockPath, { force: true });
|
|
84
|
+
}
|
|
85
|
+
function createLease(locks, sourcePath, assertQuiescent) {
|
|
86
|
+
let released = false;
|
|
87
|
+
return {
|
|
88
|
+
assertQuiescent: () => {
|
|
89
|
+
if (released) throw new Error("History ownership lease has been released");
|
|
90
|
+
for (const lock of locks) {
|
|
91
|
+
const held = node_fs.default.fstatSync(lock.handle);
|
|
92
|
+
const current = node_fs.default.statSync(lock.lockPath);
|
|
93
|
+
if (held.dev !== current.dev || held.ino !== current.ino || readToken(lock.lockPath) !== lock.token) throw new Error("History ownership lock was replaced");
|
|
94
|
+
}
|
|
95
|
+
return assertQuiescent(sourcePath);
|
|
96
|
+
},
|
|
97
|
+
release: () => {
|
|
98
|
+
if (released) return;
|
|
99
|
+
released = true;
|
|
100
|
+
let firstError;
|
|
101
|
+
for (const lock of [...locks].reverse()) try {
|
|
102
|
+
releaseLock(lock.lockPath, lock.token, lock.handle);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
firstError ??= error;
|
|
105
|
+
}
|
|
106
|
+
if (firstError !== void 0) throw firstError;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates the canonical history owner used by runtime writers, export CLI, and
|
|
112
|
+
* the explicit offline importer. The default source boundary remains v4.
|
|
113
|
+
* Locks are deliberately never reclaimed from dead pids: a stale or malformed
|
|
114
|
+
* sidecar needs explicit operator cleanup because it cannot prove quiescence.
|
|
115
|
+
*/
|
|
116
|
+
function createHistoryOwnership(options = {}) {
|
|
117
|
+
const assertQuiescent = options.assertQuiescent ?? (() => void 0);
|
|
118
|
+
const assertSource = options.sourceFormat === "sqlite" ? assertSqliteSource : options.sourceFormat === "v3" ? assertV3Source : assertV4Source;
|
|
119
|
+
return { async acquire(sourcePath) {
|
|
120
|
+
const absoluteSourcePath = canonicalSourcePath(sourcePath);
|
|
121
|
+
const paths = [absoluteSourcePath, ...options.additionalPaths ?? []].map(canonicalSourcePath);
|
|
122
|
+
const canonicalPaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));
|
|
123
|
+
const locks = [];
|
|
124
|
+
let conflictingLockPath = historyOwnershipLockPath(absoluteSourcePath);
|
|
125
|
+
try {
|
|
126
|
+
for (const lockedPath of canonicalPaths) {
|
|
127
|
+
const lockPath = historyOwnershipLockPath(lockedPath);
|
|
128
|
+
conflictingLockPath = lockPath;
|
|
129
|
+
const token = (0, node_crypto.randomUUID)();
|
|
130
|
+
const record = {
|
|
131
|
+
version: LOCK_VERSION,
|
|
132
|
+
format: LOCK_FORMAT,
|
|
133
|
+
pid: process.pid,
|
|
134
|
+
sourcePath: lockedPath,
|
|
135
|
+
token
|
|
136
|
+
};
|
|
137
|
+
node_fs.default.mkdirSync(node_path.default.dirname(lockPath), {
|
|
138
|
+
recursive: true,
|
|
139
|
+
mode: 448
|
|
140
|
+
});
|
|
141
|
+
const handle = node_fs.default.openSync(lockPath, "wx", 384);
|
|
142
|
+
const lock = {
|
|
143
|
+
lockPath,
|
|
144
|
+
token,
|
|
145
|
+
handle
|
|
146
|
+
};
|
|
147
|
+
locks.push(lock);
|
|
148
|
+
node_fs.default.writeFileSync(handle, `${JSON.stringify(record)}\n`, "utf8");
|
|
149
|
+
node_fs.default.fsyncSync(handle);
|
|
150
|
+
}
|
|
151
|
+
assertSource(absoluteSourcePath);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
for (const lock of [...locks].reverse()) try {
|
|
154
|
+
releaseLock(lock.lockPath, lock.token, lock.handle);
|
|
155
|
+
} catch {}
|
|
156
|
+
if (isFileSystemError(error) && error.code === "EEXIST") throw new Error(`History ownership lock already exists or is ambiguous: ${conflictingLockPath}`, { cause: error });
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
return createLease(locks, absoluteSourcePath, assertQuiescent);
|
|
160
|
+
} };
|
|
161
|
+
}
|
|
162
|
+
/** Explicitly named alias for hosts that want to document the v4 boundary. */
|
|
163
|
+
const createV4HistoryOwnership = createHistoryOwnership;
|
|
164
|
+
//#endregion
|
|
165
|
+
exports.createHistoryOwnership = createHistoryOwnership;
|
|
166
|
+
exports.createV4HistoryOwnership = createV4HistoryOwnership;
|
|
167
|
+
exports.historyOwnershipLockPath = historyOwnershipLockPath;
|
|
168
|
+
|
|
169
|
+
//# sourceMappingURL=history-ownership.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-ownership.cjs","names":["path","fs","randomUUID"],"sources":["../src/services/historyOwnership/index.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { HistoryOwnership, HistoryOwnershipLease } from '../historyImport';\n\nconst LOCK_SUFFIX = '.doompi-v4.lock';\nconst LOCK_VERSION = 1;\nconst LOCK_FORMAT = 'doompi-v4-history-ownership';\n\ninterface HistoryLockRecord {\n version: 1;\n format: 'doompi-v4-history-ownership';\n pid: number;\n sourcePath: string;\n token: string;\n}\n\ninterface HeldHistoryLock {\n lockPath: string;\n token: string;\n handle: number;\n}\n\nexport interface HistoryOwnershipOptions {\n /** Checks managed writers; this cannot account for an unmanaged Pi process. */\n assertQuiescent?: (sourcePath: string) => void | Promise<void>;\n /** The source format admitted by this owner. Defaults to canonical v4. */\n sourceFormat?: 'v3' | 'v4' | 'sqlite';\n /** Additional paths to lock for the lifetime of each acquired source lease. */\n additionalPaths?: readonly string[];\n}\n\nfunction canonicalSourcePath(sourcePath: string): string {\n const absolute = path.resolve(sourcePath);\n if (fs.existsSync(absolute)) return fs.realpathSync(absolute);\n const segments = [path.basename(absolute)];\n let parent = path.dirname(absolute);\n while (!fs.existsSync(parent)) {\n segments.unshift(path.basename(parent));\n parent = path.dirname(parent);\n }\n return path.join(fs.realpathSync(parent), ...segments);\n}\n\n/** Resolve aliases so every writer and exporter contends for the same lock. */\nexport function historyOwnershipLockPath(sourcePath: string): string {\n return `${canonicalSourcePath(sourcePath)}${LOCK_SUFFIX}`;\n}\n\nfunction isHistoryObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isV4Header(value: unknown): boolean {\n return isHistoryObject(value) && value.kind === 'header' && value.v === 4;\n}\n\nfunction isV3Header(value: unknown): boolean {\n return isHistoryObject(value) && value.type === 'session' && value.version === 3;\n}\n\nfunction readHeader(sourcePath: string, format: 'v3' | 'v4'): unknown {\n const firstLine = fs.readFileSync(sourcePath, 'utf8').split('\\n', 1)[0] ?? '';\n try {\n return JSON.parse(firstLine);\n } catch (error) {\n const message =\n format === 'v4'\n ? `History ownership source is not canonical v4 JSONL: ${sourcePath}`\n : `Offline history source is not canonical v3 JSONL: ${sourcePath}`;\n throw new Error(message, { cause: error });\n }\n}\n\nfunction assertIndependentRegularFile(sourcePath: string, label: string): void {\n const stat = fs.statSync(sourcePath);\n if (!stat.isFile() || stat.nlink !== 1) throw new Error(`${label} must be an independent regular file`);\n}\n\nfunction assertV4Source(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'Canonical history');\n if (!isV4Header(readHeader(sourcePath, 'v4')))\n throw new Error(`History ownership only supports canonical v4 sources: ${sourcePath}`);\n}\n\nfunction assertV3Source(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'Offline v3 history source');\n if (!isV3Header(readHeader(sourcePath, 'v3')))\n throw new Error(`Offline history import only supports v3 sources: ${sourcePath}`);\n}\n\nfunction assertSqliteSource(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'SQLite history');\n const descriptor = fs.openSync(sourcePath, 'r');\n try {\n const header = Buffer.alloc(16);\n if (\n fs.readSync(descriptor, header, 0, header.length, 0) !== header.length ||\n header.toString('utf8') !== 'SQLite format 3\\u0000'\n )\n throw new Error(`History ownership source is not SQLite: ${sourcePath}`);\n } finally {\n fs.closeSync(descriptor);\n }\n}\n\nfunction isFileSystemError(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';\n}\n\nfunction readToken(lockPath: string): string | undefined {\n try {\n const value = JSON.parse(fs.readFileSync(lockPath, 'utf8')) as Partial<HistoryLockRecord>;\n return typeof value.token === 'string' ? value.token : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction releaseLock(lockPath: string, token: string, handle: number): void {\n fs.closeSync(handle);\n // An unrecognisable or replaced lock is ambiguous. Never remove it merely\n // because its recorded pid is gone or its contents look stale.\n if (readToken(lockPath) === token) fs.rmSync(lockPath, { force: true });\n}\n\nfunction createLease(\n locks: readonly HeldHistoryLock[],\n sourcePath: string,\n assertQuiescent: (sourcePath: string) => void | Promise<void>,\n): HistoryOwnershipLease {\n let released = false;\n return {\n assertQuiescent: () => {\n if (released) throw new Error('History ownership lease has been released');\n for (const lock of locks) {\n const held = fs.fstatSync(lock.handle);\n const current = fs.statSync(lock.lockPath);\n if (held.dev !== current.dev || held.ino !== current.ino || readToken(lock.lockPath) !== lock.token) {\n throw new Error('History ownership lock was replaced');\n }\n }\n return assertQuiescent(sourcePath);\n },\n release: () => {\n if (released) return;\n released = true;\n let firstError: unknown;\n for (const lock of [...locks].reverse()) {\n try {\n releaseLock(lock.lockPath, lock.token, lock.handle);\n } catch (error) {\n firstError ??= error;\n }\n }\n if (firstError !== undefined) throw firstError;\n },\n };\n}\n\n/**\n * Creates the canonical history owner used by runtime writers, export CLI, and\n * the explicit offline importer. The default source boundary remains v4.\n * Locks are deliberately never reclaimed from dead pids: a stale or malformed\n * sidecar needs explicit operator cleanup because it cannot prove quiescence.\n */\nexport function createHistoryOwnership(options: HistoryOwnershipOptions = {}): HistoryOwnership {\n const assertQuiescent = options.assertQuiescent ?? (() => undefined);\n const assertSource =\n options.sourceFormat === 'sqlite'\n ? assertSqliteSource\n : options.sourceFormat === 'v3'\n ? assertV3Source\n : assertV4Source;\n return {\n async acquire(sourcePath: string): Promise<HistoryOwnershipLease> {\n const absoluteSourcePath = canonicalSourcePath(sourcePath);\n const paths = [absoluteSourcePath, ...(options.additionalPaths ?? [])].map(canonicalSourcePath);\n const canonicalPaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));\n const locks: HeldHistoryLock[] = [];\n let conflictingLockPath = historyOwnershipLockPath(absoluteSourcePath);\n try {\n for (const lockedPath of canonicalPaths) {\n const lockPath = historyOwnershipLockPath(lockedPath);\n conflictingLockPath = lockPath;\n const token = randomUUID();\n const record: HistoryLockRecord = {\n version: LOCK_VERSION,\n format: LOCK_FORMAT,\n pid: process.pid,\n sourcePath: lockedPath,\n token,\n };\n fs.mkdirSync(path.dirname(lockPath), { recursive: true, mode: 0o700 });\n const handle = fs.openSync(lockPath, 'wx', 0o600);\n const lock = { lockPath, token, handle };\n locks.push(lock);\n fs.writeFileSync(handle, `${JSON.stringify(record)}\\n`, 'utf8');\n fs.fsyncSync(handle);\n }\n assertSource(absoluteSourcePath);\n } catch (error) {\n for (const lock of [...locks].reverse()) {\n try {\n releaseLock(lock.lockPath, lock.token, lock.handle);\n } catch {\n // Preserve the acquisition failure and never remove a replaced lock.\n }\n }\n if (isFileSystemError(error) && error.code === 'EEXIST') {\n throw new Error(`History ownership lock already exists or is ambiguous: ${conflictingLockPath}`, {\n cause: error,\n });\n }\n throw error;\n }\n return createLease(locks, absoluteSourcePath, assertQuiescent);\n },\n };\n}\n\n/** Explicitly named alias for hosts that want to document the v4 boundary. */\nexport const createV4HistoryOwnership = createHistoryOwnership;\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,cAAc;AAyBpB,SAAS,oBAAoB,Y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MAAM,QAA2B,CAAC;EAClC,IAAI,sBAAsB,yBAAyB,kBAAkB;EACrE,IAAI;GACF,KAAK,MAAM,cAAc,gBAAgB;IACvC,MAAM,WAAW,yBAAyB,UAAU;IACpD,sBAAsB;IACtB,MAAM,SAAA,GAAQC,YAAAA,WAAAA,CAAW;IACzB,MAAM,SAA4B;KAChC,SAAS;KACT,QAAQ;KACR,KAAK,QAAQ;KACb,YAAY;KACZ;IACF;IACA,QAAA,QAAG,UAAUF,UAAAA,QAAK,QAAQ,QAAQ,GAAG;KAAE,WAAW;KAAM,MAAM;IAAM,CAAC;IACrE,MAAM,SAASC,QAAAA,QAAG,SAAS,UAAU,MAAM,GAAK;IAChD,MAAM,OAAO;KAAE;KAAU;KAAO;IAAO;IACvC,MAAM,KAAK,IAAI;IACf,QAAA,QAAG,cAAc,QAAQ,GAAG,KAAK,UAAU,MAAM,EAAE,KAAK,MAAM;IAC9D,QAAA,QAAG,UAAU,MAAM;GACrB;GACA,aAAa,kBAAkB;EACjC,SAAS,OAAO;GACd,KAAK,MAAM,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,GACpC,IAAI;IACF,YAAY,KAAK,UAAU,KAAK,OAAO,KAAK,MAAM;GACpD,QAAQ,CAER;GAEF,IAAI,kBAAkB,KAAK,KAAK,MAAM,SAAS,UAC7C,MAAM,IAAI,MAAM,0DAA0D,uBAAuB,EAC/F,OAAO,MACT,CAAC;GAEH,MAAM;EACR;EACA,OAAO,YAAY,OAAO,oBAAoB,eAAe;CAC/D,EACF;AACF;;AAGA,MAAa,2BAA2B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HistoryOwnership } from "./history-import.cjs";
|
|
2
|
+
//#region src/services/historyOwnership/index.d.ts
|
|
3
|
+
export interface HistoryOwnershipOptions {
|
|
4
|
+
/** Checks managed writers; this cannot account for an unmanaged Pi process. */
|
|
5
|
+
assertQuiescent?: (sourcePath: string) => void | Promise<void>;
|
|
6
|
+
/** The source format admitted by this owner. Defaults to canonical v4. */
|
|
7
|
+
sourceFormat?: 'v3' | 'v4' | 'sqlite';
|
|
8
|
+
/** Additional paths to lock for the lifetime of each acquired source lease. */
|
|
9
|
+
additionalPaths?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** Resolve aliases so every writer and exporter contends for the same lock. */
|
|
12
|
+
export declare function historyOwnershipLockPath(sourcePath: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates the canonical history owner used by runtime writers, export CLI, and
|
|
15
|
+
* the explicit offline importer. The default source boundary remains v4.
|
|
16
|
+
* Locks are deliberately never reclaimed from dead pids: a stale or malformed
|
|
17
|
+
* sidecar needs explicit operator cleanup because it cannot prove quiescence.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createHistoryOwnership(options?: HistoryOwnershipOptions): HistoryOwnership;
|
|
20
|
+
/** Explicitly named alias for hosts that want to document the v4 boundary. */
|
|
21
|
+
export declare const createV4HistoryOwnership: typeof createHistoryOwnership;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=history-ownership.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-ownership.d.cts","names":[],"sources":["../src/services/historyOwnership/index.ts"],"mappings":";;iBAwBiB;;EAEf,mBAAmB,8BAA8B;;EAEjD;;EAEA;;;wBAgBc,yBAAyB;;;;;;;wBA4HzB,uBAAuB,UAAS,0BAA+B;;qBAwDlE,iCAAwB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HistoryOwnership } from "./history-import.mjs";
|
|
2
|
+
//#region src/services/historyOwnership/index.d.ts
|
|
3
|
+
export interface HistoryOwnershipOptions {
|
|
4
|
+
/** Checks managed writers; this cannot account for an unmanaged Pi process. */
|
|
5
|
+
assertQuiescent?: (sourcePath: string) => void | Promise<void>;
|
|
6
|
+
/** The source format admitted by this owner. Defaults to canonical v4. */
|
|
7
|
+
sourceFormat?: 'v3' | 'v4' | 'sqlite';
|
|
8
|
+
/** Additional paths to lock for the lifetime of each acquired source lease. */
|
|
9
|
+
additionalPaths?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** Resolve aliases so every writer and exporter contends for the same lock. */
|
|
12
|
+
export declare function historyOwnershipLockPath(sourcePath: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates the canonical history owner used by runtime writers, export CLI, and
|
|
15
|
+
* the explicit offline importer. The default source boundary remains v4.
|
|
16
|
+
* Locks are deliberately never reclaimed from dead pids: a stale or malformed
|
|
17
|
+
* sidecar needs explicit operator cleanup because it cannot prove quiescence.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createHistoryOwnership(options?: HistoryOwnershipOptions): HistoryOwnership;
|
|
20
|
+
/** Explicitly named alias for hosts that want to document the v4 boundary. */
|
|
21
|
+
export declare const createV4HistoryOwnership: typeof createHistoryOwnership;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=history-ownership.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-ownership.d.mts","names":[],"sources":["../src/services/historyOwnership/index.ts"],"mappings":";;iBAwBiB;;EAEf,mBAAmB,8BAA8B;;EAEjD;;EAEA;;;wBAgBc,yBAAyB;;;;;;;wBA4HzB,uBAAuB,UAAS,0BAA+B;;qBAwDlE,iCAAwB"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
//#region src/services/historyOwnership/index.ts
|
|
5
|
+
const LOCK_SUFFIX = ".doompi-v4.lock";
|
|
6
|
+
const LOCK_VERSION = 1;
|
|
7
|
+
const LOCK_FORMAT = "doompi-v4-history-ownership";
|
|
8
|
+
function canonicalSourcePath(sourcePath) {
|
|
9
|
+
const absolute = path.resolve(sourcePath);
|
|
10
|
+
if (fs.existsSync(absolute)) return fs.realpathSync(absolute);
|
|
11
|
+
const segments = [path.basename(absolute)];
|
|
12
|
+
let parent = path.dirname(absolute);
|
|
13
|
+
while (!fs.existsSync(parent)) {
|
|
14
|
+
segments.unshift(path.basename(parent));
|
|
15
|
+
parent = path.dirname(parent);
|
|
16
|
+
}
|
|
17
|
+
return path.join(fs.realpathSync(parent), ...segments);
|
|
18
|
+
}
|
|
19
|
+
/** Resolve aliases so every writer and exporter contends for the same lock. */
|
|
20
|
+
function historyOwnershipLockPath(sourcePath) {
|
|
21
|
+
return `${canonicalSourcePath(sourcePath)}${LOCK_SUFFIX}`;
|
|
22
|
+
}
|
|
23
|
+
function isHistoryObject(value) {
|
|
24
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25
|
+
}
|
|
26
|
+
function isV4Header(value) {
|
|
27
|
+
return isHistoryObject(value) && value.kind === "header" && value.v === 4;
|
|
28
|
+
}
|
|
29
|
+
function isV3Header(value) {
|
|
30
|
+
return isHistoryObject(value) && value.type === "session" && value.version === 3;
|
|
31
|
+
}
|
|
32
|
+
function readHeader(sourcePath, format) {
|
|
33
|
+
const firstLine = fs.readFileSync(sourcePath, "utf8").split("\n", 1)[0] ?? "";
|
|
34
|
+
try {
|
|
35
|
+
return JSON.parse(firstLine);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
const message = format === "v4" ? `History ownership source is not canonical v4 JSONL: ${sourcePath}` : `Offline history source is not canonical v3 JSONL: ${sourcePath}`;
|
|
38
|
+
throw new Error(message, { cause: error });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function assertIndependentRegularFile(sourcePath, label) {
|
|
42
|
+
const stat = fs.statSync(sourcePath);
|
|
43
|
+
if (!stat.isFile() || stat.nlink !== 1) throw new Error(`${label} must be an independent regular file`);
|
|
44
|
+
}
|
|
45
|
+
function assertV4Source(sourcePath) {
|
|
46
|
+
if (!fs.existsSync(sourcePath)) return;
|
|
47
|
+
assertIndependentRegularFile(sourcePath, "Canonical history");
|
|
48
|
+
if (!isV4Header(readHeader(sourcePath, "v4"))) throw new Error(`History ownership only supports canonical v4 sources: ${sourcePath}`);
|
|
49
|
+
}
|
|
50
|
+
function assertV3Source(sourcePath) {
|
|
51
|
+
if (!fs.existsSync(sourcePath)) return;
|
|
52
|
+
assertIndependentRegularFile(sourcePath, "Offline v3 history source");
|
|
53
|
+
if (!isV3Header(readHeader(sourcePath, "v3"))) throw new Error(`Offline history import only supports v3 sources: ${sourcePath}`);
|
|
54
|
+
}
|
|
55
|
+
function assertSqliteSource(sourcePath) {
|
|
56
|
+
if (!fs.existsSync(sourcePath)) return;
|
|
57
|
+
assertIndependentRegularFile(sourcePath, "SQLite history");
|
|
58
|
+
const descriptor = fs.openSync(sourcePath, "r");
|
|
59
|
+
try {
|
|
60
|
+
const header = Buffer.alloc(16);
|
|
61
|
+
if (fs.readSync(descriptor, header, 0, header.length, 0) !== header.length || header.toString("utf8") !== "SQLite format 3\0") throw new Error(`History ownership source is not SQLite: ${sourcePath}`);
|
|
62
|
+
} finally {
|
|
63
|
+
fs.closeSync(descriptor);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function isFileSystemError(error) {
|
|
67
|
+
return error instanceof Error && typeof error.code === "string";
|
|
68
|
+
}
|
|
69
|
+
function readToken(lockPath) {
|
|
70
|
+
try {
|
|
71
|
+
const value = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
72
|
+
return typeof value.token === "string" ? value.token : void 0;
|
|
73
|
+
} catch {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function releaseLock(lockPath, token, handle) {
|
|
78
|
+
fs.closeSync(handle);
|
|
79
|
+
if (readToken(lockPath) === token) fs.rmSync(lockPath, { force: true });
|
|
80
|
+
}
|
|
81
|
+
function createLease(locks, sourcePath, assertQuiescent) {
|
|
82
|
+
let released = false;
|
|
83
|
+
return {
|
|
84
|
+
assertQuiescent: () => {
|
|
85
|
+
if (released) throw new Error("History ownership lease has been released");
|
|
86
|
+
for (const lock of locks) {
|
|
87
|
+
const held = fs.fstatSync(lock.handle);
|
|
88
|
+
const current = fs.statSync(lock.lockPath);
|
|
89
|
+
if (held.dev !== current.dev || held.ino !== current.ino || readToken(lock.lockPath) !== lock.token) throw new Error("History ownership lock was replaced");
|
|
90
|
+
}
|
|
91
|
+
return assertQuiescent(sourcePath);
|
|
92
|
+
},
|
|
93
|
+
release: () => {
|
|
94
|
+
if (released) return;
|
|
95
|
+
released = true;
|
|
96
|
+
let firstError;
|
|
97
|
+
for (const lock of [...locks].reverse()) try {
|
|
98
|
+
releaseLock(lock.lockPath, lock.token, lock.handle);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
firstError ??= error;
|
|
101
|
+
}
|
|
102
|
+
if (firstError !== void 0) throw firstError;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates the canonical history owner used by runtime writers, export CLI, and
|
|
108
|
+
* the explicit offline importer. The default source boundary remains v4.
|
|
109
|
+
* Locks are deliberately never reclaimed from dead pids: a stale or malformed
|
|
110
|
+
* sidecar needs explicit operator cleanup because it cannot prove quiescence.
|
|
111
|
+
*/
|
|
112
|
+
function createHistoryOwnership(options = {}) {
|
|
113
|
+
const assertQuiescent = options.assertQuiescent ?? (() => void 0);
|
|
114
|
+
const assertSource = options.sourceFormat === "sqlite" ? assertSqliteSource : options.sourceFormat === "v3" ? assertV3Source : assertV4Source;
|
|
115
|
+
return { async acquire(sourcePath) {
|
|
116
|
+
const absoluteSourcePath = canonicalSourcePath(sourcePath);
|
|
117
|
+
const paths = [absoluteSourcePath, ...options.additionalPaths ?? []].map(canonicalSourcePath);
|
|
118
|
+
const canonicalPaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));
|
|
119
|
+
const locks = [];
|
|
120
|
+
let conflictingLockPath = historyOwnershipLockPath(absoluteSourcePath);
|
|
121
|
+
try {
|
|
122
|
+
for (const lockedPath of canonicalPaths) {
|
|
123
|
+
const lockPath = historyOwnershipLockPath(lockedPath);
|
|
124
|
+
conflictingLockPath = lockPath;
|
|
125
|
+
const token = randomUUID();
|
|
126
|
+
const record = {
|
|
127
|
+
version: LOCK_VERSION,
|
|
128
|
+
format: LOCK_FORMAT,
|
|
129
|
+
pid: process.pid,
|
|
130
|
+
sourcePath: lockedPath,
|
|
131
|
+
token
|
|
132
|
+
};
|
|
133
|
+
fs.mkdirSync(path.dirname(lockPath), {
|
|
134
|
+
recursive: true,
|
|
135
|
+
mode: 448
|
|
136
|
+
});
|
|
137
|
+
const handle = fs.openSync(lockPath, "wx", 384);
|
|
138
|
+
const lock = {
|
|
139
|
+
lockPath,
|
|
140
|
+
token,
|
|
141
|
+
handle
|
|
142
|
+
};
|
|
143
|
+
locks.push(lock);
|
|
144
|
+
fs.writeFileSync(handle, `${JSON.stringify(record)}\n`, "utf8");
|
|
145
|
+
fs.fsyncSync(handle);
|
|
146
|
+
}
|
|
147
|
+
assertSource(absoluteSourcePath);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
for (const lock of [...locks].reverse()) try {
|
|
150
|
+
releaseLock(lock.lockPath, lock.token, lock.handle);
|
|
151
|
+
} catch {}
|
|
152
|
+
if (isFileSystemError(error) && error.code === "EEXIST") throw new Error(`History ownership lock already exists or is ambiguous: ${conflictingLockPath}`, { cause: error });
|
|
153
|
+
throw error;
|
|
154
|
+
}
|
|
155
|
+
return createLease(locks, absoluteSourcePath, assertQuiescent);
|
|
156
|
+
} };
|
|
157
|
+
}
|
|
158
|
+
/** Explicitly named alias for hosts that want to document the v4 boundary. */
|
|
159
|
+
const createV4HistoryOwnership = createHistoryOwnership;
|
|
160
|
+
//#endregion
|
|
161
|
+
export { createHistoryOwnership, createV4HistoryOwnership, historyOwnershipLockPath };
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=history-ownership.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-ownership.mjs","names":[],"sources":["../src/services/historyOwnership/index.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { HistoryOwnership, HistoryOwnershipLease } from '../historyImport';\n\nconst LOCK_SUFFIX = '.doompi-v4.lock';\nconst LOCK_VERSION = 1;\nconst LOCK_FORMAT = 'doompi-v4-history-ownership';\n\ninterface HistoryLockRecord {\n version: 1;\n format: 'doompi-v4-history-ownership';\n pid: number;\n sourcePath: string;\n token: string;\n}\n\ninterface HeldHistoryLock {\n lockPath: string;\n token: string;\n handle: number;\n}\n\nexport interface HistoryOwnershipOptions {\n /** Checks managed writers; this cannot account for an unmanaged Pi process. */\n assertQuiescent?: (sourcePath: string) => void | Promise<void>;\n /** The source format admitted by this owner. Defaults to canonical v4. */\n sourceFormat?: 'v3' | 'v4' | 'sqlite';\n /** Additional paths to lock for the lifetime of each acquired source lease. */\n additionalPaths?: readonly string[];\n}\n\nfunction canonicalSourcePath(sourcePath: string): string {\n const absolute = path.resolve(sourcePath);\n if (fs.existsSync(absolute)) return fs.realpathSync(absolute);\n const segments = [path.basename(absolute)];\n let parent = path.dirname(absolute);\n while (!fs.existsSync(parent)) {\n segments.unshift(path.basename(parent));\n parent = path.dirname(parent);\n }\n return path.join(fs.realpathSync(parent), ...segments);\n}\n\n/** Resolve aliases so every writer and exporter contends for the same lock. */\nexport function historyOwnershipLockPath(sourcePath: string): string {\n return `${canonicalSourcePath(sourcePath)}${LOCK_SUFFIX}`;\n}\n\nfunction isHistoryObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isV4Header(value: unknown): boolean {\n return isHistoryObject(value) && value.kind === 'header' && value.v === 4;\n}\n\nfunction isV3Header(value: unknown): boolean {\n return isHistoryObject(value) && value.type === 'session' && value.version === 3;\n}\n\nfunction readHeader(sourcePath: string, format: 'v3' | 'v4'): unknown {\n const firstLine = fs.readFileSync(sourcePath, 'utf8').split('\\n', 1)[0] ?? '';\n try {\n return JSON.parse(firstLine);\n } catch (error) {\n const message =\n format === 'v4'\n ? `History ownership source is not canonical v4 JSONL: ${sourcePath}`\n : `Offline history source is not canonical v3 JSONL: ${sourcePath}`;\n throw new Error(message, { cause: error });\n }\n}\n\nfunction assertIndependentRegularFile(sourcePath: string, label: string): void {\n const stat = fs.statSync(sourcePath);\n if (!stat.isFile() || stat.nlink !== 1) throw new Error(`${label} must be an independent regular file`);\n}\n\nfunction assertV4Source(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'Canonical history');\n if (!isV4Header(readHeader(sourcePath, 'v4')))\n throw new Error(`History ownership only supports canonical v4 sources: ${sourcePath}`);\n}\n\nfunction assertV3Source(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'Offline v3 history source');\n if (!isV3Header(readHeader(sourcePath, 'v3')))\n throw new Error(`Offline history import only supports v3 sources: ${sourcePath}`);\n}\n\nfunction assertSqliteSource(sourcePath: string): void {\n if (!fs.existsSync(sourcePath)) return;\n assertIndependentRegularFile(sourcePath, 'SQLite history');\n const descriptor = fs.openSync(sourcePath, 'r');\n try {\n const header = Buffer.alloc(16);\n if (\n fs.readSync(descriptor, header, 0, header.length, 0) !== header.length ||\n header.toString('utf8') !== 'SQLite format 3\\u0000'\n )\n throw new Error(`History ownership source is not SQLite: ${sourcePath}`);\n } finally {\n fs.closeSync(descriptor);\n }\n}\n\nfunction isFileSystemError(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';\n}\n\nfunction readToken(lockPath: string): string | undefined {\n try {\n const value = JSON.parse(fs.readFileSync(lockPath, 'utf8')) as Partial<HistoryLockRecord>;\n return typeof value.token === 'string' ? value.token : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction releaseLock(lockPath: string, token: string, handle: number): void {\n fs.closeSync(handle);\n // An unrecognisable or replaced lock is ambiguous. Never remove it merely\n // because its recorded pid is gone or its contents look stale.\n if (readToken(lockPath) === token) fs.rmSync(lockPath, { force: true });\n}\n\nfunction createLease(\n locks: readonly HeldHistoryLock[],\n sourcePath: string,\n assertQuiescent: (sourcePath: string) => void | Promise<void>,\n): HistoryOwnershipLease {\n let released = false;\n return {\n assertQuiescent: () => {\n if (released) throw new Error('History ownership lease has been released');\n for (const lock of locks) {\n const held = fs.fstatSync(lock.handle);\n const current = fs.statSync(lock.lockPath);\n if (held.dev !== current.dev || held.ino !== current.ino || readToken(lock.lockPath) !== lock.token) {\n throw new Error('History ownership lock was replaced');\n }\n }\n return assertQuiescent(sourcePath);\n },\n release: () => {\n if (released) return;\n released = true;\n let firstError: unknown;\n for (const lock of [...locks].reverse()) {\n try {\n releaseLock(lock.lockPath, lock.token, lock.handle);\n } catch (error) {\n firstError ??= error;\n }\n }\n if (firstError !== undefined) throw firstError;\n },\n };\n}\n\n/**\n * Creates the canonical history owner used by runtime writers, export CLI, and\n * the explicit offline importer. The default source boundary remains v4.\n * Locks are deliberately never reclaimed from dead pids: a stale or malformed\n * sidecar needs explicit operator cleanup because it cannot prove quiescence.\n */\nexport function createHistoryOwnership(options: HistoryOwnershipOptions = {}): HistoryOwnership {\n const assertQuiescent = options.assertQuiescent ?? (() => undefined);\n const assertSource =\n options.sourceFormat === 'sqlite'\n ? assertSqliteSource\n : options.sourceFormat === 'v3'\n ? assertV3Source\n : assertV4Source;\n return {\n async acquire(sourcePath: string): Promise<HistoryOwnershipLease> {\n const absoluteSourcePath = canonicalSourcePath(sourcePath);\n const paths = [absoluteSourcePath, ...(options.additionalPaths ?? [])].map(canonicalSourcePath);\n const canonicalPaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));\n const locks: HeldHistoryLock[] = [];\n let conflictingLockPath = historyOwnershipLockPath(absoluteSourcePath);\n try {\n for (const lockedPath of canonicalPaths) {\n const lockPath = historyOwnershipLockPath(lockedPath);\n conflictingLockPath = lockPath;\n const token = randomUUID();\n const record: HistoryLockRecord = {\n version: LOCK_VERSION,\n format: LOCK_FORMAT,\n pid: process.pid,\n sourcePath: lockedPath,\n token,\n };\n fs.mkdirSync(path.dirname(lockPath), { recursive: true, mode: 0o700 });\n const handle = fs.openSync(lockPath, 'wx', 0o600);\n const lock = { lockPath, token, handle };\n locks.push(lock);\n fs.writeFileSync(handle, `${JSON.stringify(record)}\\n`, 'utf8');\n fs.fsyncSync(handle);\n }\n assertSource(absoluteSourcePath);\n } catch (error) {\n for (const lock of [...locks].reverse()) {\n try {\n releaseLock(lock.lockPath, lock.token, lock.handle);\n } catch {\n // Preserve the acquisition failure and never remove a replaced lock.\n }\n }\n if (isFileSystemError(error) && error.code === 'EEXIST') {\n throw new Error(`History ownership lock already exists or is ambiguous: ${conflictingLockPath}`, {\n cause: error,\n });\n }\n throw error;\n }\n return createLease(locks, absoluteSourcePath, assertQuiescent);\n },\n };\n}\n\n/** Explicitly named alias for hosts that want to document the v4 boundary. */\nexport const createV4HistoryOwnership = createHistoryOwnership;\n"],"mappings":";;;;AAMA,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,cAAc;AAyBpB,SAAS,oBAAoB,YAA4B;CACvD,MAAM,WAAW,KAAK,QAAQ,UAAU;CACxC,IAAI,GAAG,WAAW,QAAQ,GAAG,OAAO,GAAG,aAAa,QAAQ;CAC5D,MAAM,WAAW,CAAC,KAAK,SAAS,QAAQ,CAAC;CACzC,IAAI,SAAS,KAAK,QAAQ,QAAQ;CAClC,OAAO,CAAC,GAAG,WAAW,MAAM,GAAG;EAC7B,SAAS,QAAQ,KAAK,SAAS,MAAM,CAAC;EACtC,SAAS,KAAK,QAAQ,MAAM;CAC9B;CACA,OAAO,KAAK,KAAK,GAAG,aAAa,MAAM,GAAG,GAAG,QAAQ;AACvD;;AAGA,SAAgB,yBAAyB,YAA4B;CACnE,OAAO,GAAG,oBAAoB,UAAU,IAAI;AAC9C;AAEA,SAAS,gBAAgB,OAAkD;CACzE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,WAAW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,SAAS,UAC7C,MAAM,IAAI,MAAM,0DAA0D,uBAAuB,EAC/F,OAAO,MACT,CAAC;GAEH,MAAM;EACR;EACA,OAAO,YAAY,OAAO,oBAAoB,eAAe;CAC/D,EACF;AACF;;AAGA,MAAa,2BAA2B"}
|
package/dist/history.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_jsonl_session_repo = require("./jsonl-session-repo.cjs");
|
|
3
|
+
const require_history_import = require("./history-import.cjs");
|
|
4
|
+
const require_history_ownership = require("./history-ownership.cjs");
|
|
5
|
+
const require_v3_export = require("./v3-export.cjs");
|
|
6
|
+
const require_index = require("./services/sqliteSessionHistory/index.cjs");
|
|
7
|
+
exports.createHistoryOwnership = require_history_ownership.createHistoryOwnership;
|
|
8
|
+
exports.createV4HistoryOwnership = require_history_ownership.createV4HistoryOwnership;
|
|
9
|
+
exports.exportV4ToV3 = require_v3_export.exportV4ToV3;
|
|
10
|
+
exports.historyOwnershipLockPath = require_history_ownership.historyOwnershipLockPath;
|
|
11
|
+
exports.importV3WithPinnedUpstream = require_jsonl_session_repo.importV3WithPinnedUpstream;
|
|
12
|
+
exports.listSavedSessions = require_index.listSavedSessions;
|
|
13
|
+
exports.protectAndImportHistory = require_history_import.protectAndImportHistory;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HistoryBranchProof, HistoryEntryProof, HistoryImportOptions, HistoryImportVerification, HistoryOwnership, HistoryOwnershipLease, HistorySourceIdentity, HistoryStagingImportInput, ProtectedHistoryImportResult, protectAndImportHistory } from "./history-import.cjs";
|
|
2
|
+
import { HistoryOwnershipOptions, createHistoryOwnership, createV4HistoryOwnership, historyOwnershipLockPath } from "./history-ownership.cjs";
|
|
3
|
+
import { importV3WithPinnedUpstream } from "./jsonl-session-repo.cjs";
|
|
4
|
+
import { V3ExportLoss, V3ExportLossReport, V3ExportOptions, V3ExportResult, exportV4ToV3 } from "./v3-export.cjs";
|
|
5
|
+
import { SavedSession, listSavedSessions } from "./services/sqliteSessionHistory/index.cjs";
|
|
6
|
+
export { type HistoryBranchProof, type HistoryEntryProof, type HistoryImportOptions, type HistoryImportVerification, type HistoryOwnership, type HistoryOwnershipLease, type HistoryOwnershipOptions, type HistorySourceIdentity, type HistoryStagingImportInput, type ProtectedHistoryImportResult, type SavedSession, type V3ExportLoss, type V3ExportLossReport, type V3ExportOptions, type V3ExportResult, createHistoryOwnership, createV4HistoryOwnership, exportV4ToV3, historyOwnershipLockPath, importV3WithPinnedUpstream, listSavedSessions, protectAndImportHistory };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HistoryBranchProof, HistoryEntryProof, HistoryImportOptions, HistoryImportVerification, HistoryOwnership, HistoryOwnershipLease, HistorySourceIdentity, HistoryStagingImportInput, ProtectedHistoryImportResult, protectAndImportHistory } from "./history-import.mjs";
|
|
2
|
+
import { HistoryOwnershipOptions, createHistoryOwnership, createV4HistoryOwnership, historyOwnershipLockPath } from "./history-ownership.mjs";
|
|
3
|
+
import { importV3WithPinnedUpstream } from "./jsonl-session-repo.mjs";
|
|
4
|
+
import { V3ExportLoss, V3ExportLossReport, V3ExportOptions, V3ExportResult, exportV4ToV3 } from "./v3-export.mjs";
|
|
5
|
+
import { SavedSession, listSavedSessions } from "./services/sqliteSessionHistory/index.mjs";
|
|
6
|
+
export { type HistoryBranchProof, type HistoryEntryProof, type HistoryImportOptions, type HistoryImportVerification, type HistoryOwnership, type HistoryOwnershipLease, type HistoryOwnershipOptions, type HistorySourceIdentity, type HistoryStagingImportInput, type ProtectedHistoryImportResult, type SavedSession, type V3ExportLoss, type V3ExportLossReport, type V3ExportOptions, type V3ExportResult, createHistoryOwnership, createV4HistoryOwnership, exportV4ToV3, historyOwnershipLockPath, importV3WithPinnedUpstream, listSavedSessions, protectAndImportHistory };
|
package/dist/history.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { importV3WithPinnedUpstream } from "./jsonl-session-repo.mjs";
|
|
2
|
+
import { protectAndImportHistory } from "./history-import.mjs";
|
|
3
|
+
import { createHistoryOwnership, createV4HistoryOwnership, historyOwnershipLockPath } from "./history-ownership.mjs";
|
|
4
|
+
import { exportV4ToV3 } from "./v3-export.mjs";
|
|
5
|
+
import { listSavedSessions } from "./services/sqliteSessionHistory/index.mjs";
|
|
6
|
+
export { createHistoryOwnership, createV4HistoryOwnership, exportV4ToV3, historyOwnershipLockPath, importV3WithPinnedUpstream, listSavedSessions, protectAndImportHistory };
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DoomComputerUseHostBinding, DoomComputerUseHostOperation, DoomComputerUseHostRequest, DoomDirectEventBus, DoomDirectEventSubscriptionOptions, DoomHubChannel, DoomHubChannelConnection, DoomHubChannelFrame, DoomHubChannelHost, DoomHubChannelLifecycle, DoomHubChannelSource, DoomHubSessionApiRequest, DoomHubSessionCreateRequest, DoomHubSessionScope, DoomHubSessionService } from "./schemas/hubChannel.cjs";
|
|
2
|
+
export { DoomComputerUseHostBinding, DoomComputerUseHostOperation, DoomComputerUseHostRequest, DoomDirectEventBus, DoomDirectEventSubscriptionOptions, DoomHubChannel, DoomHubChannelConnection, DoomHubChannelFrame, DoomHubChannelHost, DoomHubChannelLifecycle, DoomHubChannelSource, DoomHubSessionApiRequest, DoomHubSessionCreateRequest, DoomHubSessionScope, DoomHubSessionService };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DoomComputerUseHostBinding, DoomComputerUseHostOperation, DoomComputerUseHostRequest, DoomDirectEventBus, DoomDirectEventSubscriptionOptions, DoomHubChannel, DoomHubChannelConnection, DoomHubChannelFrame, DoomHubChannelHost, DoomHubChannelLifecycle, DoomHubChannelSource, DoomHubSessionApiRequest, DoomHubSessionCreateRequest, DoomHubSessionScope, DoomHubSessionService } from "./schemas/hubChannel.mjs";
|
|
2
|
+
export { DoomComputerUseHostBinding, DoomComputerUseHostOperation, DoomComputerUseHostRequest, DoomDirectEventBus, DoomDirectEventSubscriptionOptions, DoomHubChannel, DoomHubChannelConnection, DoomHubChannelFrame, DoomHubChannelHost, DoomHubChannelLifecycle, DoomHubChannelSource, DoomHubSessionApiRequest, DoomHubSessionCreateRequest, DoomHubSessionScope, DoomHubSessionService };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|