@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,49 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { SqliteSessionRepo, createNodeSqliteFactory } from "@earendil-works/pi-session-backend-sqlite-node";
|
|
5
|
+
//#region src/services/sqliteSessionStorage/index.ts
|
|
6
|
+
/** Opens the one SQLite container owned by a server session. */
|
|
7
|
+
async function openSqliteSessionStorage(options, context) {
|
|
8
|
+
if (!options.historyOwnership) throw new Error("SQLite sessions require explicit HistoryOwnership");
|
|
9
|
+
if (!options.sessionsRoot && !options.sessionPath) throw new Error("SQLite sessions require a server data directory");
|
|
10
|
+
const id = options.sessionId ?? randomUUID();
|
|
11
|
+
if (!/^[a-zA-Z0-9_-]+$/u.test(id)) throw new Error("Invalid SQLite session id");
|
|
12
|
+
const sessionFile = path.resolve(options.sessionPath ?? path.join(options.sessionsRoot, `${id}.sqlite`));
|
|
13
|
+
const historyLease = await options.historyOwnership.acquire(sessionFile);
|
|
14
|
+
const repository = new SqliteSessionRepo({
|
|
15
|
+
directory: path.dirname(sessionFile),
|
|
16
|
+
databasePath: sessionFile,
|
|
17
|
+
databaseFactory: createNodeSqliteFactory()
|
|
18
|
+
});
|
|
19
|
+
try {
|
|
20
|
+
await historyLease.assertQuiescent();
|
|
21
|
+
const existing = fs.existsSync(sessionFile);
|
|
22
|
+
if (options.sessionPath && !existing) throw new Error(`SQLite session not found: ${sessionFile}`);
|
|
23
|
+
const metadata = existing ? await repository.list(void 0, context) : [];
|
|
24
|
+
if (existing && metadata.length !== 1) throw new Error("Expected exactly one session in the SQLite container");
|
|
25
|
+
if (existing && options.sessionId && metadata[0].id !== options.sessionId) throw new Error("SQLite session id does not match the requested session");
|
|
26
|
+
const session = existing ? await repository.open(metadata[0], context) : await repository.create({
|
|
27
|
+
id,
|
|
28
|
+
...options.parentSessionId ? { parentSessionId: options.parentSessionId } : {}
|
|
29
|
+
}, context);
|
|
30
|
+
if (!existing) fs.chmodSync(sessionFile, 384);
|
|
31
|
+
return {
|
|
32
|
+
session,
|
|
33
|
+
sessionFile,
|
|
34
|
+
repository,
|
|
35
|
+
historyLease
|
|
36
|
+
};
|
|
37
|
+
} catch (error) {
|
|
38
|
+
try {
|
|
39
|
+
await repository.close(context);
|
|
40
|
+
} finally {
|
|
41
|
+
await historyLease.release();
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { openSqliteSessionStorage };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=sqlite-session-storage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-session-storage.mjs","names":[],"sources":["../src/services/sqliteSessionStorage/index.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nimport type { Context } from '@earendil-works/pi-agent-core/harness/context';\nimport { SqliteSessionRepo, createNodeSqliteFactory } from '@earendil-works/pi-session-backend-sqlite-node';\n\nimport type { DirectHarnessRuntimeOptions, SqliteSessionStorage } from '../../types/server/directHarnessRuntime';\n\n/** Opens the one SQLite container owned by a server session. */\nexport async function openSqliteSessionStorage(\n options: Pick<\n DirectHarnessRuntimeOptions,\n 'historyOwnership' | 'sessionsRoot' | 'sessionPath' | 'sessionId' | 'parentSessionId'\n >,\n context: Context,\n): Promise<SqliteSessionStorage> {\n if (!options.historyOwnership) throw new Error('SQLite sessions require explicit HistoryOwnership');\n if (!options.sessionsRoot && !options.sessionPath) throw new Error('SQLite sessions require a server data directory');\n const id = options.sessionId ?? randomUUID();\n if (!/^[a-zA-Z0-9_-]+$/u.test(id)) throw new Error('Invalid SQLite session id');\n const sessionFile = path.resolve(options.sessionPath ?? path.join(options.sessionsRoot!, `${id}.sqlite`));\n const historyLease = await options.historyOwnership.acquire(sessionFile);\n const repository = new SqliteSessionRepo({\n directory: path.dirname(sessionFile),\n databasePath: sessionFile,\n databaseFactory: createNodeSqliteFactory(),\n });\n try {\n await historyLease.assertQuiescent();\n const existing = fs.existsSync(sessionFile);\n if (options.sessionPath && !existing) throw new Error(`SQLite session not found: ${sessionFile}`);\n const metadata = existing ? await repository.list(undefined, context) : [];\n if (existing && metadata.length !== 1) throw new Error('Expected exactly one session in the SQLite container');\n if (existing && options.sessionId && metadata[0]!.id !== options.sessionId)\n throw new Error('SQLite session id does not match the requested session');\n const session = existing\n ? await repository.open(metadata[0]!, context)\n : await repository.create(\n { id, ...(options.parentSessionId ? { parentSessionId: options.parentSessionId } : {}) },\n context,\n );\n if (!existing) fs.chmodSync(sessionFile, 0o600);\n return { session, sessionFile, repository, historyLease };\n } catch (error) {\n try {\n await repository.close(context);\n } finally {\n await historyLease.release();\n }\n throw error;\n }\n}\n"],"mappings":";;;;;;AAUA,eAAsB,yBACpB,SAIA,SAC+B;CAC/B,IAAI,CAAC,QAAQ,kBAAkB,MAAM,IAAI,MAAM,mDAAmD;CAClG,IAAI,CAAC,QAAQ,gBAAgB,CAAC,QAAQ,aAAa,MAAM,IAAI,MAAM,iDAAiD;CACpH,MAAM,KAAK,QAAQ,aAAa,WAAW;CAC3C,IAAI,CAAC,oBAAoB,KAAK,EAAE,GAAG,MAAM,IAAI,MAAM,2BAA2B;CAC9E,MAAM,cAAc,KAAK,QAAQ,QAAQ,eAAe,KAAK,KAAK,QAAQ,cAAe,GAAG,GAAG,QAAQ,CAAC;CACxG,MAAM,eAAe,MAAM,QAAQ,iBAAiB,QAAQ,WAAW;CACvE,MAAM,aAAa,IAAI,kBAAkB;EACvC,WAAW,KAAK,QAAQ,WAAW;EACnC,cAAc;EACd,iBAAiB,wBAAwB;CAC3C,CAAC;CACD,IAAI;EACF,MAAM,aAAa,gBAAgB;EACnC,MAAM,WAAW,GAAG,WAAW,WAAW;EAC1C,IAAI,QAAQ,eAAe,CAAC,UAAU,MAAM,IAAI,MAAM,6BAA6B,aAAa;EAChG,MAAM,WAAW,WAAW,MAAM,WAAW,KAAK,KAAA,GAAW,OAAO,IAAI,CAAC;EACzE,IAAI,YAAY,SAAS,WAAW,GAAG,MAAM,IAAI,MAAM,sDAAsD;EAC7G,IAAI,YAAY,QAAQ,aAAa,SAAS,EAAE,CAAE,OAAO,QAAQ,WAC/D,MAAM,IAAI,MAAM,wDAAwD;EAC1E,MAAM,UAAU,WACZ,MAAM,WAAW,KAAK,SAAS,IAAK,OAAO,IAC3C,MAAM,WAAW,OACf;GAAE;GAAI,GAAI,QAAQ,kBAAkB,EAAE,iBAAiB,QAAQ,gBAAgB,IAAI,CAAC;EAAG,GACvF,OACF;EACJ,IAAI,CAAC,UAAU,GAAG,UAAU,aAAa,GAAK;EAC9C,OAAO;GAAE;GAAS;GAAa;GAAY;EAAa;CAC1D,SAAS,OAAO;EACd,IAAI;GACF,MAAM,WAAW,MAAM,OAAO;EAChC,UAAU;GACR,MAAM,aAAa,QAAQ;EAC7B;EACA,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,209 @@
|
|
|
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
|
+
node_crypto = require_runtime.__toESM(node_crypto, 1);
|
|
9
|
+
let node_os = require("node:os");
|
|
10
|
+
node_os = require_runtime.__toESM(node_os, 1);
|
|
11
|
+
//#region src/services/syncLocation/index.ts
|
|
12
|
+
const PI_DIRECTORY = ".pi";
|
|
13
|
+
const DOOM_CONFIG_DIRECTORY = ".doom";
|
|
14
|
+
const SYNC_DIRECTORY = "sync";
|
|
15
|
+
const WORKTREES_DIRECTORY = "worktrees";
|
|
16
|
+
const GENERATIONS_DIRECTORY = "generations";
|
|
17
|
+
const REGISTRATIONS_DIRECTORY = "registrations";
|
|
18
|
+
const SHARED_CACHE_DIRECTORY = "shared-cache";
|
|
19
|
+
const LEGACY_DOOM_DIRECTORY = "doom";
|
|
20
|
+
const GIT_DIRECTORY = ".git";
|
|
21
|
+
const COMMON_DIRECTORY_FILE = "commondir";
|
|
22
|
+
const IDENTITY_HEX_LENGTH = 32;
|
|
23
|
+
const LABEL_MAX_LENGTH = 48;
|
|
24
|
+
const DEFAULT_REPOSITORY_LABEL = "repo";
|
|
25
|
+
const DEFAULT_WORKTREE_LABEL = "worktree";
|
|
26
|
+
const LOCK_FILE = ".sync.lock";
|
|
27
|
+
const STALE_LOCK_MS = 3e5;
|
|
28
|
+
const LOCK_RETRY_INTERVAL_MS = 100;
|
|
29
|
+
const PRIVATE_DIRECTORY_MODE = 448;
|
|
30
|
+
const PRIVATE_FILE_MODE = 384;
|
|
31
|
+
function canonicalPath(target) {
|
|
32
|
+
const absolute = node_path.default.resolve(target);
|
|
33
|
+
try {
|
|
34
|
+
return node_fs.default.realpathSync.native(absolute);
|
|
35
|
+
} catch {
|
|
36
|
+
return absolute;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function readGitDirectory(repositoryRoot) {
|
|
40
|
+
const gitPath = node_path.default.join(repositoryRoot, GIT_DIRECTORY);
|
|
41
|
+
try {
|
|
42
|
+
const stat = node_fs.default.statSync(gitPath);
|
|
43
|
+
if (stat.isDirectory()) return canonicalPath(gitPath);
|
|
44
|
+
if (!stat.isFile()) return void 0;
|
|
45
|
+
const match = /^gitdir:\s*(.+)$/imu.exec(node_fs.default.readFileSync(gitPath, "utf8").trim());
|
|
46
|
+
return match?.[1] ? canonicalPath(node_path.default.resolve(repositoryRoot, match[1].trim())) : void 0;
|
|
47
|
+
} catch {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function gitCommonDirectory(repositoryRoot) {
|
|
52
|
+
const gitDirectory = readGitDirectory(repositoryRoot);
|
|
53
|
+
if (!gitDirectory) return void 0;
|
|
54
|
+
try {
|
|
55
|
+
const relative = node_fs.default.readFileSync(node_path.default.join(gitDirectory, COMMON_DIRECTORY_FILE), "utf8").trim();
|
|
56
|
+
return relative ? canonicalPath(node_path.default.resolve(gitDirectory, relative)) : gitDirectory;
|
|
57
|
+
} catch {
|
|
58
|
+
return gitDirectory;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function identityHash(value) {
|
|
62
|
+
return node_crypto.default.createHash("sha256").update(value, "utf8").digest("hex").slice(0, IDENTITY_HEX_LENGTH);
|
|
63
|
+
}
|
|
64
|
+
function sanitizeSyncLabel(value, fallback) {
|
|
65
|
+
const normalized = value.normalize("NFKD").replace(/[\u0300-\u036f]/gu, "").replace(/[^A-Za-z0-9._-]+/gu, "-").replace(/^[._-]+|[._-]+$/gu, "").slice(0, LABEL_MAX_LENGTH).replace(/[._-]+$/gu, "");
|
|
66
|
+
return normalized === "" || normalized === "." || normalized === ".." ? fallback : normalized;
|
|
67
|
+
}
|
|
68
|
+
function repositoryLabel(commonDirectory, repositoryRoot) {
|
|
69
|
+
if (!commonDirectory) return sanitizeSyncLabel(node_path.default.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);
|
|
70
|
+
const base = node_path.default.basename(commonDirectory);
|
|
71
|
+
return sanitizeSyncLabel(base === GIT_DIRECTORY ? node_path.default.basename(node_path.default.dirname(commonDirectory)) : base, DEFAULT_REPOSITORY_LABEL);
|
|
72
|
+
}
|
|
73
|
+
function resolveSyncLocation(repositoryRoot, homeDirectory = node_os.default.homedir()) {
|
|
74
|
+
const root = canonicalPath(repositoryRoot);
|
|
75
|
+
const commonDirectory = gitCommonDirectory(root);
|
|
76
|
+
const repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;
|
|
77
|
+
const identity = {
|
|
78
|
+
repositoryId: identityHash(repositoryToken),
|
|
79
|
+
worktreeId: identityHash(`${repositoryToken}\0worktree:${root}`)
|
|
80
|
+
};
|
|
81
|
+
const repoLabel = repositoryLabel(commonDirectory, root);
|
|
82
|
+
const worktreeLabel = sanitizeSyncLabel(node_path.default.basename(root), DEFAULT_WORKTREE_LABEL);
|
|
83
|
+
const generatedRoot = node_path.default.join(node_path.default.resolve(homeDirectory), PI_DIRECTORY, DOOM_CONFIG_DIRECTORY, SYNC_DIRECTORY);
|
|
84
|
+
const registrationsDirectory = node_path.default.join(generatedRoot, REGISTRATIONS_DIRECTORY);
|
|
85
|
+
const repositoryDirectory = node_path.default.join(generatedRoot, `${repoLabel}--${identity.repositoryId}`);
|
|
86
|
+
const directory = node_path.default.join(repositoryDirectory, WORKTREES_DIRECTORY, `${worktreeLabel}--${identity.worktreeId}`);
|
|
87
|
+
const legacyDirectory = node_path.default.join(root, PI_DIRECTORY, LEGACY_DOOM_DIRECTORY);
|
|
88
|
+
return {
|
|
89
|
+
root,
|
|
90
|
+
identity,
|
|
91
|
+
repositoryLabel: repoLabel,
|
|
92
|
+
worktreeLabel,
|
|
93
|
+
generatedRoot,
|
|
94
|
+
registrationsDirectory,
|
|
95
|
+
registrationPath: node_path.default.join(registrationsDirectory, identity.repositoryId, `${identity.worktreeId}.json`),
|
|
96
|
+
repositoryDirectory,
|
|
97
|
+
sharedCacheDirectory: node_path.default.join(repositoryDirectory, SHARED_CACHE_DIRECTORY),
|
|
98
|
+
directory,
|
|
99
|
+
generationsDirectory: node_path.default.join(directory, GENERATIONS_DIRECTORY),
|
|
100
|
+
statePath: node_path.default.join(directory, "state.json"),
|
|
101
|
+
legacyDirectory,
|
|
102
|
+
legacyStatePath: node_path.default.join(legacyDirectory, "state.json")
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const GENERATION_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
106
|
+
/** Resolves one immutable generation below its worktree namespace. */
|
|
107
|
+
function syncGenerationDirectory(location, generation) {
|
|
108
|
+
if (!GENERATION_ID.test(generation) || generation === "." || generation === "..") throw new Error(`Invalid Doom sync generation id: ${generation}`);
|
|
109
|
+
return node_path.default.join(location.generationsDirectory, generation);
|
|
110
|
+
}
|
|
111
|
+
function rejectSymlink(target) {
|
|
112
|
+
try {
|
|
113
|
+
if (node_fs.default.lstatSync(target).isSymbolicLink()) throw new Error(`Doom sync namespace must not contain a symbolic link: ${target}`);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return;
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function readLockRecord(lockPath) {
|
|
120
|
+
try {
|
|
121
|
+
const parsed = JSON.parse(node_fs.default.readFileSync(lockPath, "utf8"));
|
|
122
|
+
return typeof parsed.pid === "number" && typeof parsed.token === "string" ? {
|
|
123
|
+
pid: parsed.pid,
|
|
124
|
+
token: parsed.token
|
|
125
|
+
} : void 0;
|
|
126
|
+
} catch {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function processIsAlive(processId) {
|
|
131
|
+
try {
|
|
132
|
+
process.kill(processId, 0);
|
|
133
|
+
return true;
|
|
134
|
+
} catch (error) {
|
|
135
|
+
return error instanceof Error && "code" in error && error.code === "EPERM";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function removeStaleLock(lockPath) {
|
|
139
|
+
try {
|
|
140
|
+
const stat = node_fs.default.statSync(lockPath);
|
|
141
|
+
const record = readLockRecord(lockPath);
|
|
142
|
+
if (record) {
|
|
143
|
+
if (processIsAlive(record.pid)) return;
|
|
144
|
+
} else if (Date.now() - stat.mtimeMs <= STALE_LOCK_MS) return;
|
|
145
|
+
node_fs.default.rmSync(lockPath, { force: true });
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */
|
|
151
|
+
async function acquireSyncLocationLock(location) {
|
|
152
|
+
assertSyncLocationSafe(location);
|
|
153
|
+
await node_fs.default.promises.mkdir(location.directory, {
|
|
154
|
+
mode: PRIVATE_DIRECTORY_MODE,
|
|
155
|
+
recursive: true
|
|
156
|
+
});
|
|
157
|
+
await node_fs.default.promises.chmod(location.directory, PRIVATE_DIRECTORY_MODE);
|
|
158
|
+
const lockPath = node_path.default.join(location.directory, LOCK_FILE);
|
|
159
|
+
const record = {
|
|
160
|
+
pid: process.pid,
|
|
161
|
+
token: node_crypto.default.randomUUID()
|
|
162
|
+
};
|
|
163
|
+
let handle;
|
|
164
|
+
for (;;) {
|
|
165
|
+
removeStaleLock(lockPath);
|
|
166
|
+
try {
|
|
167
|
+
handle = await node_fs.default.promises.open(lockPath, "wx", PRIVATE_FILE_MODE);
|
|
168
|
+
break;
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (!(error instanceof Error && "code" in error && error.code === "EEXIST")) throw error;
|
|
171
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
await handle.writeFile(`${JSON.stringify(record)}\n`);
|
|
175
|
+
const heartbeat = setInterval(() => {
|
|
176
|
+
if (readLockRecord(lockPath)?.token !== record.token) return;
|
|
177
|
+
const now = /* @__PURE__ */ new Date();
|
|
178
|
+
node_fs.default.utimesSync(lockPath, now, now);
|
|
179
|
+
}, Math.floor(STALE_LOCK_MS / 3));
|
|
180
|
+
heartbeat.unref();
|
|
181
|
+
return async () => {
|
|
182
|
+
clearInterval(heartbeat);
|
|
183
|
+
await handle.close();
|
|
184
|
+
if (readLockRecord(lockPath)?.token === record.token) await node_fs.default.promises.rm(lockPath, { force: true });
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/** Refuses generated namespace redirection before a writer creates or prunes it. */
|
|
188
|
+
function assertSyncLocationSafe(location) {
|
|
189
|
+
const syncRoot = node_path.default.dirname(location.repositoryDirectory);
|
|
190
|
+
const doomRoot = node_path.default.dirname(syncRoot);
|
|
191
|
+
const piRoot = node_path.default.dirname(doomRoot);
|
|
192
|
+
const worktreesRoot = node_path.default.dirname(location.directory);
|
|
193
|
+
for (const target of [
|
|
194
|
+
piRoot,
|
|
195
|
+
doomRoot,
|
|
196
|
+
syncRoot,
|
|
197
|
+
location.repositoryDirectory,
|
|
198
|
+
worktreesRoot,
|
|
199
|
+
location.directory
|
|
200
|
+
]) rejectSymlink(target);
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
exports.acquireSyncLocationLock = acquireSyncLocationLock;
|
|
204
|
+
exports.assertSyncLocationSafe = assertSyncLocationSafe;
|
|
205
|
+
exports.resolveSyncLocation = resolveSyncLocation;
|
|
206
|
+
exports.sanitizeSyncLabel = sanitizeSyncLabel;
|
|
207
|
+
exports.syncGenerationDirectory = syncGenerationDirectory;
|
|
208
|
+
|
|
209
|
+
//# sourceMappingURL=sync-location.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-location.cjs","names":["path","fs","crypto","os"],"sources":["../src/services/syncLocation/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nconst PI_DIRECTORY = '.pi';\nconst DOOM_CONFIG_DIRECTORY = '.doom';\nconst SYNC_DIRECTORY = 'sync';\nconst WORKTREES_DIRECTORY = 'worktrees';\nconst GENERATIONS_DIRECTORY = 'generations';\nconst REGISTRATIONS_DIRECTORY = 'registrations';\nconst SHARED_CACHE_DIRECTORY = 'shared-cache';\nconst LEGACY_DOOM_DIRECTORY = 'doom';\nconst GIT_DIRECTORY = '.git';\nconst COMMON_DIRECTORY_FILE = 'commondir';\nconst IDENTITY_HEX_LENGTH = 32;\nconst LABEL_MAX_LENGTH = 48;\nconst DEFAULT_REPOSITORY_LABEL = 'repo';\nconst DEFAULT_WORKTREE_LABEL = 'worktree';\nconst LOCK_FILE = '.sync.lock';\nconst STALE_LOCK_MS = 5 * 60 * 1000;\nconst LOCK_RETRY_INTERVAL_MS = 100;\nconst PRIVATE_DIRECTORY_MODE = 0o700;\nconst PRIVATE_FILE_MODE = 0o600;\n\nexport interface SyncIdentity {\n repositoryId: string;\n worktreeId: string;\n}\n\nexport interface SyncLocation {\n root: string;\n identity: SyncIdentity;\n repositoryLabel: string;\n worktreeLabel: string;\n generatedRoot: string;\n registrationsDirectory: string;\n registrationPath: string;\n repositoryDirectory: string;\n sharedCacheDirectory: string;\n directory: string;\n generationsDirectory: string;\n statePath: string;\n legacyDirectory: string;\n legacyStatePath: string;\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync.native(absolute);\n } catch {\n return absolute;\n }\n}\n\nfunction readGitDirectory(repositoryRoot: string): string | undefined {\n const gitPath = path.join(repositoryRoot, GIT_DIRECTORY);\n try {\n const stat = fs.statSync(gitPath);\n if (stat.isDirectory()) return canonicalPath(gitPath);\n if (!stat.isFile()) return undefined;\n const match = /^gitdir:\\s*(.+)$/imu.exec(fs.readFileSync(gitPath, 'utf8').trim());\n return match?.[1] ? canonicalPath(path.resolve(repositoryRoot, match[1].trim())) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction gitCommonDirectory(repositoryRoot: string): string | undefined {\n const gitDirectory = readGitDirectory(repositoryRoot);\n if (!gitDirectory) return undefined;\n try {\n const relative = fs.readFileSync(path.join(gitDirectory, COMMON_DIRECTORY_FILE), 'utf8').trim();\n return relative ? canonicalPath(path.resolve(gitDirectory, relative)) : gitDirectory;\n } catch {\n return gitDirectory;\n }\n}\n\nfunction identityHash(value: string): string {\n return crypto.createHash('sha256').update(value, 'utf8').digest('hex').slice(0, IDENTITY_HEX_LENGTH);\n}\n\nexport function sanitizeSyncLabel(value: string, fallback: string): string {\n const normalized = value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/gu, '')\n .replace(/[^A-Za-z0-9._-]+/gu, '-')\n .replace(/^[._-]+|[._-]+$/gu, '')\n .slice(0, LABEL_MAX_LENGTH)\n .replace(/[._-]+$/gu, '');\n return normalized === '' || normalized === '.' || normalized === '..' ? fallback : normalized;\n}\n\nfunction repositoryLabel(commonDirectory: string | undefined, repositoryRoot: string): string {\n if (!commonDirectory) return sanitizeSyncLabel(path.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);\n const base = path.basename(commonDirectory);\n const source = base === GIT_DIRECTORY ? path.basename(path.dirname(commonDirectory)) : base;\n return sanitizeSyncLabel(source, DEFAULT_REPOSITORY_LABEL);\n}\n\nexport function resolveSyncLocation(repositoryRoot: string, homeDirectory: string = os.homedir()): SyncLocation {\n const root = canonicalPath(repositoryRoot);\n const commonDirectory = gitCommonDirectory(root);\n const repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;\n const identity: SyncIdentity = {\n repositoryId: identityHash(repositoryToken),\n worktreeId: identityHash(`${repositoryToken}\\0worktree:${root}`),\n };\n const repoLabel = repositoryLabel(commonDirectory, root);\n const worktreeLabel = sanitizeSyncLabel(path.basename(root), DEFAULT_WORKTREE_LABEL);\n const generatedRoot = path.join(path.resolve(homeDirectory), PI_DIRECTORY, DOOM_CONFIG_DIRECTORY, SYNC_DIRECTORY);\n const registrationsDirectory = path.join(generatedRoot, REGISTRATIONS_DIRECTORY);\n const repositoryDirectory = path.join(generatedRoot, `${repoLabel}--${identity.repositoryId}`);\n const directory = path.join(repositoryDirectory, WORKTREES_DIRECTORY, `${worktreeLabel}--${identity.worktreeId}`);\n const legacyDirectory = path.join(root, PI_DIRECTORY, LEGACY_DOOM_DIRECTORY);\n return {\n root,\n identity,\n repositoryLabel: repoLabel,\n worktreeLabel,\n generatedRoot,\n registrationsDirectory,\n registrationPath: path.join(registrationsDirectory, identity.repositoryId, `${identity.worktreeId}.json`),\n repositoryDirectory,\n sharedCacheDirectory: path.join(repositoryDirectory, SHARED_CACHE_DIRECTORY),\n directory,\n generationsDirectory: path.join(directory, GENERATIONS_DIRECTORY),\n statePath: path.join(directory, 'state.json'),\n legacyDirectory,\n legacyStatePath: path.join(legacyDirectory, 'state.json'),\n };\n}\n\nconst GENERATION_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;\n\n/** Resolves one immutable generation below its worktree namespace. */\nexport function syncGenerationDirectory(location: SyncLocation, generation: string): string {\n if (!GENERATION_ID.test(generation) || generation === '.' || generation === '..') {\n throw new Error(`Invalid Doom sync generation id: ${generation}`);\n }\n return path.join(location.generationsDirectory, generation);\n}\n\nfunction rejectSymlink(target: string): void {\n try {\n if (fs.lstatSync(target).isSymbolicLink()) {\n throw new Error(`Doom sync namespace must not contain a symbolic link: ${target}`);\n }\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return;\n throw error;\n }\n}\n\ninterface SyncLockRecord {\n pid: number;\n token: string;\n}\n\nfunction readLockRecord(lockPath: string): SyncLockRecord | undefined {\n try {\n const parsed = JSON.parse(fs.readFileSync(lockPath, 'utf8')) as { pid?: unknown; token?: unknown };\n return typeof parsed.pid === 'number' && typeof parsed.token === 'string'\n ? { pid: parsed.pid, token: parsed.token }\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction processIsAlive(processId: number): boolean {\n try {\n process.kill(processId, 0);\n return true;\n } catch (error) {\n return error instanceof Error && 'code' in error && error.code === 'EPERM';\n }\n}\n\nfunction removeStaleLock(lockPath: string): void {\n try {\n const stat = fs.statSync(lockPath);\n const record = readLockRecord(lockPath);\n if (record) {\n if (processIsAlive(record.pid)) return;\n } else if (Date.now() - stat.mtimeMs <= STALE_LOCK_MS) {\n // A publisher may have created the file but not written its record yet.\n return;\n }\n fs.rmSync(lockPath, { force: true });\n } catch (error) {\n if (!(error instanceof Error && 'code' in error && error.code === 'ENOENT')) throw error;\n }\n}\n\n/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */\nexport async function acquireSyncLocationLock(location: SyncLocation): Promise<() => Promise<void>> {\n assertSyncLocationSafe(location);\n await fs.promises.mkdir(location.directory, { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n await fs.promises.chmod(location.directory, PRIVATE_DIRECTORY_MODE);\n const lockPath = path.join(location.directory, LOCK_FILE);\n const record: SyncLockRecord = { pid: process.pid, token: crypto.randomUUID() };\n let handle: fs.promises.FileHandle;\n for (;;) {\n removeStaleLock(lockPath);\n try {\n handle = await fs.promises.open(lockPath, 'wx', PRIVATE_FILE_MODE);\n break;\n } catch (error) {\n if (!(error instanceof Error && 'code' in error && error.code === 'EEXIST')) throw error;\n await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));\n }\n }\n await handle.writeFile(`${JSON.stringify(record)}\\n`);\n const heartbeat = setInterval(\n () => {\n if (readLockRecord(lockPath)?.token !== record.token) return;\n const now = new Date();\n fs.utimesSync(lockPath, now, now);\n },\n Math.floor(STALE_LOCK_MS / 3),\n );\n heartbeat.unref();\n return async () => {\n clearInterval(heartbeat);\n await handle.close();\n if (readLockRecord(lockPath)?.token === record.token) {\n await fs.promises.rm(lockPath, { force: true });\n }\n };\n}\n\n/** Refuses generated namespace redirection before a writer creates or prunes it. */\nexport function assertSyncLocationSafe(location: SyncLocation): void {\n const syncRoot = path.dirname(location.repositoryDirectory);\n const doomRoot = path.dirname(syncRoot);\n const piRoot = path.dirname(doomRoot);\n const worktreesRoot = path.dirname(location.directory);\n for (const target of [piRoot, doomRoot, syncRoot, location.repositoryDirectory, worktreesRoot, location.directory]) {\n rejectSymlink(target);\n }\n}\n"],"mappings":";;;;;;;;;;;AAKA,MAAM,eAAe;AACrB,MAAM,wBAAwB;AAC9B,MAAM,iBAAiB;AACvB,MAAM,s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AY,WAAW,SAAS,sBAAsB,CAAC;EAC5E;CACF;CACA,MAAM,OAAO,UAAU,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;CACpD,MAAM,YAAY,kBACV;EACJ,IAAI,eAAe,QAAQ,CAAC,EAAE,UAAU,OAAO,OAAO;EACtD,MAAM,sBAAM,IAAI,KAAK;EACrB,QAAA,QAAG,WAAW,UAAU,KAAK,GAAG;CAClC,GACA,KAAK,MAAM,gBAAgB,CAAC,CAC9B;CACA,UAAU,MAAM;CAChB,OAAO,YAAY;EACjB,cAAc,SAAS;EACvB,MAAM,OAAO,MAAM;EACnB,IAAI,eAAe,QAAQ,CAAC,EAAE,UAAU,OAAO,OAC7C,MAAMA,QAAAA,QAAG,SAAS,GAAG,UAAU,EAAE,OAAO,KAAK,CAAC;CAElD;AACF;;AAGA,SAAgB,uBAAuB,UAA8B;CACnE,MAAM,WAAWD,UAAAA,QAAK,QAAQ,SAAS,mBAAmB;CAC1D,MAAM,WAAWA,UAAAA,QAAK,QAAQ,QAAQ;CACtC,MAAM,SAASA,UAAAA,QAAK,QAAQ,QAAQ;CACpC,MAAM,gBAAgBA,UAAAA,QAAK,QAAQ,SAAS,SAAS;CACrD,KAAK,MAAM,UAAU;EAAC;EAAQ;EAAU;EAAU,SAAS;EAAqB;EAAe,SAAS;CAAS,GAC/G,cAAc,MAAM;AAExB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/services/syncLocation/index.d.ts
|
|
2
|
+
export interface SyncIdentity {
|
|
3
|
+
repositoryId: string;
|
|
4
|
+
worktreeId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SyncLocation {
|
|
7
|
+
root: string;
|
|
8
|
+
identity: SyncIdentity;
|
|
9
|
+
repositoryLabel: string;
|
|
10
|
+
worktreeLabel: string;
|
|
11
|
+
generatedRoot: string;
|
|
12
|
+
registrationsDirectory: string;
|
|
13
|
+
registrationPath: string;
|
|
14
|
+
repositoryDirectory: string;
|
|
15
|
+
sharedCacheDirectory: string;
|
|
16
|
+
directory: string;
|
|
17
|
+
generationsDirectory: string;
|
|
18
|
+
statePath: string;
|
|
19
|
+
legacyDirectory: string;
|
|
20
|
+
legacyStatePath: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function sanitizeSyncLabel(value: string, fallback: string): string;
|
|
23
|
+
export declare function resolveSyncLocation(repositoryRoot: string, homeDirectory?: string): SyncLocation;
|
|
24
|
+
/** Resolves one immutable generation below its worktree namespace. */
|
|
25
|
+
export declare function syncGenerationDirectory(location: SyncLocation, generation: string): string;
|
|
26
|
+
/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */
|
|
27
|
+
export declare function acquireSyncLocationLock(location: SyncLocation): Promise<() => Promise<void>>;
|
|
28
|
+
/** Refuses generated namespace redirection before a writer creates or prunes it. */
|
|
29
|
+
export declare function assertSyncLocationSafe(location: SyncLocation): void;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=sync-location.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-location.d.cts","names":[],"sources":["../src/services/syncLocation/index.ts"],"mappings":";iBAyBiB;EACf;EACA;;iBAGe;EACf;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;wBAwCc,kBAAkB,eAAe;wBAkBjC,oBAAoB,wBAAwB,yBAAuC;;wBAoCnF,wBAAwB,UAAU,cAAc;;wBA4D1C,wBAAwB,UAAU,eAAe,cAAc;;wBAqCrE,uBAAuB,UAAU"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/services/syncLocation/index.d.ts
|
|
2
|
+
export interface SyncIdentity {
|
|
3
|
+
repositoryId: string;
|
|
4
|
+
worktreeId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SyncLocation {
|
|
7
|
+
root: string;
|
|
8
|
+
identity: SyncIdentity;
|
|
9
|
+
repositoryLabel: string;
|
|
10
|
+
worktreeLabel: string;
|
|
11
|
+
generatedRoot: string;
|
|
12
|
+
registrationsDirectory: string;
|
|
13
|
+
registrationPath: string;
|
|
14
|
+
repositoryDirectory: string;
|
|
15
|
+
sharedCacheDirectory: string;
|
|
16
|
+
directory: string;
|
|
17
|
+
generationsDirectory: string;
|
|
18
|
+
statePath: string;
|
|
19
|
+
legacyDirectory: string;
|
|
20
|
+
legacyStatePath: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function sanitizeSyncLabel(value: string, fallback: string): string;
|
|
23
|
+
export declare function resolveSyncLocation(repositoryRoot: string, homeDirectory?: string): SyncLocation;
|
|
24
|
+
/** Resolves one immutable generation below its worktree namespace. */
|
|
25
|
+
export declare function syncGenerationDirectory(location: SyncLocation, generation: string): string;
|
|
26
|
+
/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */
|
|
27
|
+
export declare function acquireSyncLocationLock(location: SyncLocation): Promise<() => Promise<void>>;
|
|
28
|
+
/** Refuses generated namespace redirection before a writer creates or prunes it. */
|
|
29
|
+
export declare function assertSyncLocationSafe(location: SyncLocation): void;
|
|
30
|
+
//#endregion
|
|
31
|
+
//# sourceMappingURL=sync-location.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-location.d.mts","names":[],"sources":["../src/services/syncLocation/index.ts"],"mappings":";iBAyBiB;EACf;EACA;;iBAGe;EACf;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;wBAwCc,kBAAkB,eAAe;wBAkBjC,oBAAoB,wBAAwB,yBAAuC;;wBAoCnF,wBAAwB,UAAU,cAAc;;wBA4D1C,wBAAwB,UAAU,eAAe,cAAc;;wBAqCrE,uBAAuB,UAAU"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import crypto from "node:crypto";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
//#region src/services/syncLocation/index.ts
|
|
6
|
+
const PI_DIRECTORY = ".pi";
|
|
7
|
+
const DOOM_CONFIG_DIRECTORY = ".doom";
|
|
8
|
+
const SYNC_DIRECTORY = "sync";
|
|
9
|
+
const WORKTREES_DIRECTORY = "worktrees";
|
|
10
|
+
const GENERATIONS_DIRECTORY = "generations";
|
|
11
|
+
const REGISTRATIONS_DIRECTORY = "registrations";
|
|
12
|
+
const SHARED_CACHE_DIRECTORY = "shared-cache";
|
|
13
|
+
const LEGACY_DOOM_DIRECTORY = "doom";
|
|
14
|
+
const GIT_DIRECTORY = ".git";
|
|
15
|
+
const COMMON_DIRECTORY_FILE = "commondir";
|
|
16
|
+
const IDENTITY_HEX_LENGTH = 32;
|
|
17
|
+
const LABEL_MAX_LENGTH = 48;
|
|
18
|
+
const DEFAULT_REPOSITORY_LABEL = "repo";
|
|
19
|
+
const DEFAULT_WORKTREE_LABEL = "worktree";
|
|
20
|
+
const LOCK_FILE = ".sync.lock";
|
|
21
|
+
const STALE_LOCK_MS = 3e5;
|
|
22
|
+
const LOCK_RETRY_INTERVAL_MS = 100;
|
|
23
|
+
const PRIVATE_DIRECTORY_MODE = 448;
|
|
24
|
+
const PRIVATE_FILE_MODE = 384;
|
|
25
|
+
function canonicalPath(target) {
|
|
26
|
+
const absolute = path.resolve(target);
|
|
27
|
+
try {
|
|
28
|
+
return fs.realpathSync.native(absolute);
|
|
29
|
+
} catch {
|
|
30
|
+
return absolute;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function readGitDirectory(repositoryRoot) {
|
|
34
|
+
const gitPath = path.join(repositoryRoot, GIT_DIRECTORY);
|
|
35
|
+
try {
|
|
36
|
+
const stat = fs.statSync(gitPath);
|
|
37
|
+
if (stat.isDirectory()) return canonicalPath(gitPath);
|
|
38
|
+
if (!stat.isFile()) return void 0;
|
|
39
|
+
const match = /^gitdir:\s*(.+)$/imu.exec(fs.readFileSync(gitPath, "utf8").trim());
|
|
40
|
+
return match?.[1] ? canonicalPath(path.resolve(repositoryRoot, match[1].trim())) : void 0;
|
|
41
|
+
} catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function gitCommonDirectory(repositoryRoot) {
|
|
46
|
+
const gitDirectory = readGitDirectory(repositoryRoot);
|
|
47
|
+
if (!gitDirectory) return void 0;
|
|
48
|
+
try {
|
|
49
|
+
const relative = fs.readFileSync(path.join(gitDirectory, COMMON_DIRECTORY_FILE), "utf8").trim();
|
|
50
|
+
return relative ? canonicalPath(path.resolve(gitDirectory, relative)) : gitDirectory;
|
|
51
|
+
} catch {
|
|
52
|
+
return gitDirectory;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function identityHash(value) {
|
|
56
|
+
return crypto.createHash("sha256").update(value, "utf8").digest("hex").slice(0, IDENTITY_HEX_LENGTH);
|
|
57
|
+
}
|
|
58
|
+
function sanitizeSyncLabel(value, fallback) {
|
|
59
|
+
const normalized = value.normalize("NFKD").replace(/[\u0300-\u036f]/gu, "").replace(/[^A-Za-z0-9._-]+/gu, "-").replace(/^[._-]+|[._-]+$/gu, "").slice(0, LABEL_MAX_LENGTH).replace(/[._-]+$/gu, "");
|
|
60
|
+
return normalized === "" || normalized === "." || normalized === ".." ? fallback : normalized;
|
|
61
|
+
}
|
|
62
|
+
function repositoryLabel(commonDirectory, repositoryRoot) {
|
|
63
|
+
if (!commonDirectory) return sanitizeSyncLabel(path.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);
|
|
64
|
+
const base = path.basename(commonDirectory);
|
|
65
|
+
return sanitizeSyncLabel(base === GIT_DIRECTORY ? path.basename(path.dirname(commonDirectory)) : base, DEFAULT_REPOSITORY_LABEL);
|
|
66
|
+
}
|
|
67
|
+
function resolveSyncLocation(repositoryRoot, homeDirectory = os.homedir()) {
|
|
68
|
+
const root = canonicalPath(repositoryRoot);
|
|
69
|
+
const commonDirectory = gitCommonDirectory(root);
|
|
70
|
+
const repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;
|
|
71
|
+
const identity = {
|
|
72
|
+
repositoryId: identityHash(repositoryToken),
|
|
73
|
+
worktreeId: identityHash(`${repositoryToken}\0worktree:${root}`)
|
|
74
|
+
};
|
|
75
|
+
const repoLabel = repositoryLabel(commonDirectory, root);
|
|
76
|
+
const worktreeLabel = sanitizeSyncLabel(path.basename(root), DEFAULT_WORKTREE_LABEL);
|
|
77
|
+
const generatedRoot = path.join(path.resolve(homeDirectory), PI_DIRECTORY, DOOM_CONFIG_DIRECTORY, SYNC_DIRECTORY);
|
|
78
|
+
const registrationsDirectory = path.join(generatedRoot, REGISTRATIONS_DIRECTORY);
|
|
79
|
+
const repositoryDirectory = path.join(generatedRoot, `${repoLabel}--${identity.repositoryId}`);
|
|
80
|
+
const directory = path.join(repositoryDirectory, WORKTREES_DIRECTORY, `${worktreeLabel}--${identity.worktreeId}`);
|
|
81
|
+
const legacyDirectory = path.join(root, PI_DIRECTORY, LEGACY_DOOM_DIRECTORY);
|
|
82
|
+
return {
|
|
83
|
+
root,
|
|
84
|
+
identity,
|
|
85
|
+
repositoryLabel: repoLabel,
|
|
86
|
+
worktreeLabel,
|
|
87
|
+
generatedRoot,
|
|
88
|
+
registrationsDirectory,
|
|
89
|
+
registrationPath: path.join(registrationsDirectory, identity.repositoryId, `${identity.worktreeId}.json`),
|
|
90
|
+
repositoryDirectory,
|
|
91
|
+
sharedCacheDirectory: path.join(repositoryDirectory, SHARED_CACHE_DIRECTORY),
|
|
92
|
+
directory,
|
|
93
|
+
generationsDirectory: path.join(directory, GENERATIONS_DIRECTORY),
|
|
94
|
+
statePath: path.join(directory, "state.json"),
|
|
95
|
+
legacyDirectory,
|
|
96
|
+
legacyStatePath: path.join(legacyDirectory, "state.json")
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const GENERATION_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;
|
|
100
|
+
/** Resolves one immutable generation below its worktree namespace. */
|
|
101
|
+
function syncGenerationDirectory(location, generation) {
|
|
102
|
+
if (!GENERATION_ID.test(generation) || generation === "." || generation === "..") throw new Error(`Invalid Doom sync generation id: ${generation}`);
|
|
103
|
+
return path.join(location.generationsDirectory, generation);
|
|
104
|
+
}
|
|
105
|
+
function rejectSymlink(target) {
|
|
106
|
+
try {
|
|
107
|
+
if (fs.lstatSync(target).isSymbolicLink()) throw new Error(`Doom sync namespace must not contain a symbolic link: ${target}`);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return;
|
|
110
|
+
throw error;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function readLockRecord(lockPath) {
|
|
114
|
+
try {
|
|
115
|
+
const parsed = JSON.parse(fs.readFileSync(lockPath, "utf8"));
|
|
116
|
+
return typeof parsed.pid === "number" && typeof parsed.token === "string" ? {
|
|
117
|
+
pid: parsed.pid,
|
|
118
|
+
token: parsed.token
|
|
119
|
+
} : void 0;
|
|
120
|
+
} catch {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function processIsAlive(processId) {
|
|
125
|
+
try {
|
|
126
|
+
process.kill(processId, 0);
|
|
127
|
+
return true;
|
|
128
|
+
} catch (error) {
|
|
129
|
+
return error instanceof Error && "code" in error && error.code === "EPERM";
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function removeStaleLock(lockPath) {
|
|
133
|
+
try {
|
|
134
|
+
const stat = fs.statSync(lockPath);
|
|
135
|
+
const record = readLockRecord(lockPath);
|
|
136
|
+
if (record) {
|
|
137
|
+
if (processIsAlive(record.pid)) return;
|
|
138
|
+
} else if (Date.now() - stat.mtimeMs <= STALE_LOCK_MS) return;
|
|
139
|
+
fs.rmSync(lockPath, { force: true });
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */
|
|
145
|
+
async function acquireSyncLocationLock(location) {
|
|
146
|
+
assertSyncLocationSafe(location);
|
|
147
|
+
await fs.promises.mkdir(location.directory, {
|
|
148
|
+
mode: PRIVATE_DIRECTORY_MODE,
|
|
149
|
+
recursive: true
|
|
150
|
+
});
|
|
151
|
+
await fs.promises.chmod(location.directory, PRIVATE_DIRECTORY_MODE);
|
|
152
|
+
const lockPath = path.join(location.directory, LOCK_FILE);
|
|
153
|
+
const record = {
|
|
154
|
+
pid: process.pid,
|
|
155
|
+
token: crypto.randomUUID()
|
|
156
|
+
};
|
|
157
|
+
let handle;
|
|
158
|
+
for (;;) {
|
|
159
|
+
removeStaleLock(lockPath);
|
|
160
|
+
try {
|
|
161
|
+
handle = await fs.promises.open(lockPath, "wx", PRIVATE_FILE_MODE);
|
|
162
|
+
break;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
if (!(error instanceof Error && "code" in error && error.code === "EEXIST")) throw error;
|
|
165
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
await handle.writeFile(`${JSON.stringify(record)}\n`);
|
|
169
|
+
const heartbeat = setInterval(() => {
|
|
170
|
+
if (readLockRecord(lockPath)?.token !== record.token) return;
|
|
171
|
+
const now = /* @__PURE__ */ new Date();
|
|
172
|
+
fs.utimesSync(lockPath, now, now);
|
|
173
|
+
}, Math.floor(STALE_LOCK_MS / 3));
|
|
174
|
+
heartbeat.unref();
|
|
175
|
+
return async () => {
|
|
176
|
+
clearInterval(heartbeat);
|
|
177
|
+
await handle.close();
|
|
178
|
+
if (readLockRecord(lockPath)?.token === record.token) await fs.promises.rm(lockPath, { force: true });
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/** Refuses generated namespace redirection before a writer creates or prunes it. */
|
|
182
|
+
function assertSyncLocationSafe(location) {
|
|
183
|
+
const syncRoot = path.dirname(location.repositoryDirectory);
|
|
184
|
+
const doomRoot = path.dirname(syncRoot);
|
|
185
|
+
const piRoot = path.dirname(doomRoot);
|
|
186
|
+
const worktreesRoot = path.dirname(location.directory);
|
|
187
|
+
for (const target of [
|
|
188
|
+
piRoot,
|
|
189
|
+
doomRoot,
|
|
190
|
+
syncRoot,
|
|
191
|
+
location.repositoryDirectory,
|
|
192
|
+
worktreesRoot,
|
|
193
|
+
location.directory
|
|
194
|
+
]) rejectSymlink(target);
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
export { acquireSyncLocationLock, assertSyncLocationSafe, resolveSyncLocation, sanitizeSyncLabel, syncGenerationDirectory };
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=sync-location.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-location.mjs","names":[],"sources":["../src/services/syncLocation/index.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nconst PI_DIRECTORY = '.pi';\nconst DOOM_CONFIG_DIRECTORY = '.doom';\nconst SYNC_DIRECTORY = 'sync';\nconst WORKTREES_DIRECTORY = 'worktrees';\nconst GENERATIONS_DIRECTORY = 'generations';\nconst REGISTRATIONS_DIRECTORY = 'registrations';\nconst SHARED_CACHE_DIRECTORY = 'shared-cache';\nconst LEGACY_DOOM_DIRECTORY = 'doom';\nconst GIT_DIRECTORY = '.git';\nconst COMMON_DIRECTORY_FILE = 'commondir';\nconst IDENTITY_HEX_LENGTH = 32;\nconst LABEL_MAX_LENGTH = 48;\nconst DEFAULT_REPOSITORY_LABEL = 'repo';\nconst DEFAULT_WORKTREE_LABEL = 'worktree';\nconst LOCK_FILE = '.sync.lock';\nconst STALE_LOCK_MS = 5 * 60 * 1000;\nconst LOCK_RETRY_INTERVAL_MS = 100;\nconst PRIVATE_DIRECTORY_MODE = 0o700;\nconst PRIVATE_FILE_MODE = 0o600;\n\nexport interface SyncIdentity {\n repositoryId: string;\n worktreeId: string;\n}\n\nexport interface SyncLocation {\n root: string;\n identity: SyncIdentity;\n repositoryLabel: string;\n worktreeLabel: string;\n generatedRoot: string;\n registrationsDirectory: string;\n registrationPath: string;\n repositoryDirectory: string;\n sharedCacheDirectory: string;\n directory: string;\n generationsDirectory: string;\n statePath: string;\n legacyDirectory: string;\n legacyStatePath: string;\n}\n\nfunction canonicalPath(target: string): string {\n const absolute = path.resolve(target);\n try {\n return fs.realpathSync.native(absolute);\n } catch {\n return absolute;\n }\n}\n\nfunction readGitDirectory(repositoryRoot: string): string | undefined {\n const gitPath = path.join(repositoryRoot, GIT_DIRECTORY);\n try {\n const stat = fs.statSync(gitPath);\n if (stat.isDirectory()) return canonicalPath(gitPath);\n if (!stat.isFile()) return undefined;\n const match = /^gitdir:\\s*(.+)$/imu.exec(fs.readFileSync(gitPath, 'utf8').trim());\n return match?.[1] ? canonicalPath(path.resolve(repositoryRoot, match[1].trim())) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction gitCommonDirectory(repositoryRoot: string): string | undefined {\n const gitDirectory = readGitDirectory(repositoryRoot);\n if (!gitDirectory) return undefined;\n try {\n const relative = fs.readFileSync(path.join(gitDirectory, COMMON_DIRECTORY_FILE), 'utf8').trim();\n return relative ? canonicalPath(path.resolve(gitDirectory, relative)) : gitDirectory;\n } catch {\n return gitDirectory;\n }\n}\n\nfunction identityHash(value: string): string {\n return crypto.createHash('sha256').update(value, 'utf8').digest('hex').slice(0, IDENTITY_HEX_LENGTH);\n}\n\nexport function sanitizeSyncLabel(value: string, fallback: string): string {\n const normalized = value\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/gu, '')\n .replace(/[^A-Za-z0-9._-]+/gu, '-')\n .replace(/^[._-]+|[._-]+$/gu, '')\n .slice(0, LABEL_MAX_LENGTH)\n .replace(/[._-]+$/gu, '');\n return normalized === '' || normalized === '.' || normalized === '..' ? fallback : normalized;\n}\n\nfunction repositoryLabel(commonDirectory: string | undefined, repositoryRoot: string): string {\n if (!commonDirectory) return sanitizeSyncLabel(path.basename(repositoryRoot), DEFAULT_REPOSITORY_LABEL);\n const base = path.basename(commonDirectory);\n const source = base === GIT_DIRECTORY ? path.basename(path.dirname(commonDirectory)) : base;\n return sanitizeSyncLabel(source, DEFAULT_REPOSITORY_LABEL);\n}\n\nexport function resolveSyncLocation(repositoryRoot: string, homeDirectory: string = os.homedir()): SyncLocation {\n const root = canonicalPath(repositoryRoot);\n const commonDirectory = gitCommonDirectory(root);\n const repositoryToken = commonDirectory ? `git:${commonDirectory}` : `root:${root}`;\n const identity: SyncIdentity = {\n repositoryId: identityHash(repositoryToken),\n worktreeId: identityHash(`${repositoryToken}\\0worktree:${root}`),\n };\n const repoLabel = repositoryLabel(commonDirectory, root);\n const worktreeLabel = sanitizeSyncLabel(path.basename(root), DEFAULT_WORKTREE_LABEL);\n const generatedRoot = path.join(path.resolve(homeDirectory), PI_DIRECTORY, DOOM_CONFIG_DIRECTORY, SYNC_DIRECTORY);\n const registrationsDirectory = path.join(generatedRoot, REGISTRATIONS_DIRECTORY);\n const repositoryDirectory = path.join(generatedRoot, `${repoLabel}--${identity.repositoryId}`);\n const directory = path.join(repositoryDirectory, WORKTREES_DIRECTORY, `${worktreeLabel}--${identity.worktreeId}`);\n const legacyDirectory = path.join(root, PI_DIRECTORY, LEGACY_DOOM_DIRECTORY);\n return {\n root,\n identity,\n repositoryLabel: repoLabel,\n worktreeLabel,\n generatedRoot,\n registrationsDirectory,\n registrationPath: path.join(registrationsDirectory, identity.repositoryId, `${identity.worktreeId}.json`),\n repositoryDirectory,\n sharedCacheDirectory: path.join(repositoryDirectory, SHARED_CACHE_DIRECTORY),\n directory,\n generationsDirectory: path.join(directory, GENERATIONS_DIRECTORY),\n statePath: path.join(directory, 'state.json'),\n legacyDirectory,\n legacyStatePath: path.join(legacyDirectory, 'state.json'),\n };\n}\n\nconst GENERATION_ID = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u;\n\n/** Resolves one immutable generation below its worktree namespace. */\nexport function syncGenerationDirectory(location: SyncLocation, generation: string): string {\n if (!GENERATION_ID.test(generation) || generation === '.' || generation === '..') {\n throw new Error(`Invalid Doom sync generation id: ${generation}`);\n }\n return path.join(location.generationsDirectory, generation);\n}\n\nfunction rejectSymlink(target: string): void {\n try {\n if (fs.lstatSync(target).isSymbolicLink()) {\n throw new Error(`Doom sync namespace must not contain a symbolic link: ${target}`);\n }\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return;\n throw error;\n }\n}\n\ninterface SyncLockRecord {\n pid: number;\n token: string;\n}\n\nfunction readLockRecord(lockPath: string): SyncLockRecord | undefined {\n try {\n const parsed = JSON.parse(fs.readFileSync(lockPath, 'utf8')) as { pid?: unknown; token?: unknown };\n return typeof parsed.pid === 'number' && typeof parsed.token === 'string'\n ? { pid: parsed.pid, token: parsed.token }\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction processIsAlive(processId: number): boolean {\n try {\n process.kill(processId, 0);\n return true;\n } catch (error) {\n return error instanceof Error && 'code' in error && error.code === 'EPERM';\n }\n}\n\nfunction removeStaleLock(lockPath: string): void {\n try {\n const stat = fs.statSync(lockPath);\n const record = readLockRecord(lockPath);\n if (record) {\n if (processIsAlive(record.pid)) return;\n } else if (Date.now() - stat.mtimeMs <= STALE_LOCK_MS) {\n // A publisher may have created the file but not written its record yet.\n return;\n }\n fs.rmSync(lockPath, { force: true });\n } catch (error) {\n if (!(error instanceof Error && 'code' in error && error.code === 'ENOENT')) throw error;\n }\n}\n\n/** Waits for and acquires the exclusive publisher lock for one worktree namespace. */\nexport async function acquireSyncLocationLock(location: SyncLocation): Promise<() => Promise<void>> {\n assertSyncLocationSafe(location);\n await fs.promises.mkdir(location.directory, { mode: PRIVATE_DIRECTORY_MODE, recursive: true });\n await fs.promises.chmod(location.directory, PRIVATE_DIRECTORY_MODE);\n const lockPath = path.join(location.directory, LOCK_FILE);\n const record: SyncLockRecord = { pid: process.pid, token: crypto.randomUUID() };\n let handle: fs.promises.FileHandle;\n for (;;) {\n removeStaleLock(lockPath);\n try {\n handle = await fs.promises.open(lockPath, 'wx', PRIVATE_FILE_MODE);\n break;\n } catch (error) {\n if (!(error instanceof Error && 'code' in error && error.code === 'EEXIST')) throw error;\n await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));\n }\n }\n await handle.writeFile(`${JSON.stringify(record)}\\n`);\n const heartbeat = setInterval(\n () => {\n if (readLockRecord(lockPath)?.token !== record.token) return;\n const now = new Date();\n fs.utimesSync(lockPath, now, now);\n },\n Math.floor(STALE_LOCK_MS / 3),\n );\n heartbeat.unref();\n return async () => {\n clearInterval(heartbeat);\n await handle.close();\n if (readLockRecord(lockPath)?.token === record.token) {\n await fs.promises.rm(lockPath, { force: true });\n }\n };\n}\n\n/** Refuses generated namespace redirection before a writer creates or prunes it. */\nexport function assertSyncLocationSafe(location: SyncLocation): void {\n const syncRoot = path.dirname(location.repositoryDirectory);\n const doomRoot = path.dirname(syncRoot);\n const piRoot = path.dirname(doomRoot);\n const worktreesRoot = path.dirname(location.directory);\n for (const target of [piRoot, doomRoot, syncRoot, location.repositoryDirectory, worktreesRoot, location.directory]) {\n rejectSymlink(target);\n }\n}\n"],"mappings":";;;;;AAKA,MAAM,eAAe;AACrB,MAAM,wBAAwB;AAC9B,MAAM,iBAAiB;AACvB,MAAM,sBAAsB;AAC5B,MAAM,wBAAwB;AAC9B,MAAM,0BAA0B;AAChC,MAAM,yBAAyB;AAC/B,MAAM,wBAAwB;AAC9B,MAAM,gBAAgB;AACtB,MAAM,wBAAwB;AAC9B,MAAM,sBAAsB;AAC5B,MAAM,mBAAmB;AACzB,MAAM,2BAA2B;AACjC,MAAM,yBAAyB;AAC/B,MAAM,YAAY;AAClB,MAAM,gBAAgB;AACtB,MAAM,yBAAyB;AAC/B,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB;AAwB1B,SAAS,cAAc,QAAwB;CAC7C,MAAM,WAAW,KAAK,QAAQ,MAAM;CACpC,I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