@agimon-ai/doompi-core 0.0.1-alpha.100
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/agentModel.cjs +4 -0
- package/dist/agentModel.d.mts +2 -0
- package/dist/agentModel.mjs +2 -0
- package/dist/apiContracts.cjs +2009 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +1018 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +1989 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/askUser.cjs +8 -0
- package/dist/askUser.d.mts +2 -0
- package/dist/askUser.mjs +2 -0
- package/dist/authorTools.cjs +5 -0
- package/dist/authorTools.d.mts +2 -0
- package/dist/authorTools.mjs +2 -0
- package/dist/backgroundWork.cjs +7 -0
- package/dist/backgroundWork.d.mts +2 -0
- package/dist/backgroundWork.mjs +2 -0
- package/dist/bundleAssetPolicy.cjs +5 -0
- package/dist/bundleAssetPolicy.d.mts +2 -0
- package/dist/bundleAssetPolicy.mjs +2 -0
- package/dist/childProcess.cjs +15 -0
- package/dist/childProcess.d.mts +2 -0
- package/dist/childProcess.mjs +2 -0
- package/dist/childSession.cjs +8 -0
- package/dist/childSession.d.mts +3 -0
- package/dist/childSession.mjs +3 -0
- package/dist/cockpitContainer.cjs +4 -0
- package/dist/cockpitContainer.d.mts +2 -0
- package/dist/cockpitContainer.mjs +2 -0
- package/dist/config.cjs +13 -0
- package/dist/config.d.mts +3 -0
- package/dist/config.mjs +2 -0
- package/dist/contextApi.cjs +10 -0
- package/dist/contextApi.d.mts +4 -0
- package/dist/contextApi.mjs +3 -0
- package/dist/contextContributions.cjs +7 -0
- package/dist/contextContributions.d.mts +3 -0
- package/dist/contextContributions.mjs +3 -0
- package/dist/contextDetail.cjs +65 -0
- package/dist/contextDetail.cjs.map +1 -0
- package/dist/contextDetail.d.mts +19 -0
- package/dist/contextDetail.d.mts.map +1 -0
- package/dist/contextDetail.mjs +64 -0
- package/dist/contextDetail.mjs.map +1 -0
- package/dist/contextDetailStore.cjs +100 -0
- package/dist/contextDetailStore.cjs.map +1 -0
- package/dist/contextDetailStore.d.mts +19 -0
- package/dist/contextDetailStore.d.mts.map +1 -0
- package/dist/contextDetailStore.mjs +91 -0
- package/dist/contextDetailStore.mjs.map +1 -0
- package/dist/contextProjection.cjs +121 -0
- package/dist/contextProjection.cjs.map +1 -0
- package/dist/contextProjection.d.mts +130 -0
- package/dist/contextProjection.d.mts.map +1 -0
- package/dist/contextProjection.mjs +117 -0
- package/dist/contextProjection.mjs.map +1 -0
- package/dist/cordisHost.cjs +11 -0
- package/dist/cordisHost.d.mts +2 -0
- package/dist/cordisHost.mjs +2 -0
- package/dist/delegation.cjs +18 -0
- package/dist/delegation.d.mts +2 -0
- package/dist/delegation.mjs +2 -0
- package/dist/doomPackage.cjs +61 -0
- package/dist/doomPackage.cjs.map +1 -0
- package/dist/doomPackage.d.mts +17 -0
- package/dist/doomPackage.d.mts.map +1 -0
- package/dist/doomPackage.mjs +54 -0
- package/dist/doomPackage.mjs.map +1 -0
- package/dist/executionBudget.cjs +231 -0
- package/dist/executionBudget.cjs.map +1 -0
- package/dist/executionBudget.d.mts +11 -0
- package/dist/executionBudget.d.mts.map +1 -0
- package/dist/executionBudget.mjs +225 -0
- package/dist/executionBudget.mjs.map +1 -0
- package/dist/extensionFile.cjs +24 -0
- package/dist/extensionFile.d.mts +3 -0
- package/dist/extensionFile.mjs +2 -0
- package/dist/footer.cjs +6 -0
- package/dist/footer.d.mts +2 -0
- package/dist/footer.mjs +2 -0
- package/dist/headless.cjs +9 -0
- package/dist/headless.d.mts +2 -0
- package/dist/headless.mjs +2 -0
- package/dist/headlessHub.cjs +914 -0
- package/dist/headlessHub.cjs.map +1 -0
- package/dist/headlessHub.d.mts +157 -0
- package/dist/headlessHub.d.mts.map +1 -0
- package/dist/headlessHub.mjs +911 -0
- package/dist/headlessHub.mjs.map +1 -0
- package/dist/headlessServer.cjs +910 -0
- package/dist/headlessServer.cjs.map +1 -0
- package/dist/headlessServer.d.mts +64 -0
- package/dist/headlessServer.d.mts.map +1 -0
- package/dist/headlessServer.mjs +904 -0
- package/dist/headlessServer.mjs.map +1 -0
- package/dist/headlessSessionHost.cjs +0 -0
- package/dist/headlessSessionHost.d.mts +71 -0
- package/dist/headlessSessionHost.d.mts.map +1 -0
- package/dist/headlessSessionHost.mjs +1 -0
- package/dist/headlessSessionManager.cjs +51 -0
- package/dist/headlessSessionManager.cjs.map +1 -0
- package/dist/headlessSessionManager.d.mts +6 -0
- package/dist/headlessSessionManager.d.mts.map +1 -0
- package/dist/headlessSessionManager.mjs +50 -0
- package/dist/headlessSessionManager.mjs.map +1 -0
- package/dist/help.cjs +24 -0
- package/dist/help.d.mts +3 -0
- package/dist/help.mjs +3 -0
- package/dist/history.cjs +25 -0
- package/dist/history.d.mts +10 -0
- package/dist/history.mjs +10 -0
- package/dist/historyImport.cjs +553 -0
- package/dist/historyImport.cjs.map +1 -0
- package/dist/historyImport.d.mts +76 -0
- package/dist/historyImport.d.mts.map +1 -0
- package/dist/historyImport.mjs +547 -0
- package/dist/historyImport.mjs.map +1 -0
- package/dist/historyOwnership.cjs +253 -0
- package/dist/historyOwnership.cjs.map +1 -0
- package/dist/historyOwnership.d.mts +23 -0
- package/dist/historyOwnership.d.mts.map +1 -0
- package/dist/historyOwnership.mjs +247 -0
- package/dist/historyOwnership.mjs.map +1 -0
- package/dist/hubChannel.cjs +4 -0
- package/dist/hubChannel.d.mts +2 -0
- package/dist/hubChannel.mjs +2 -0
- package/dist/index.cjs +44 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +6 -0
- package/dist/json.cjs +6 -0
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +2 -0
- package/dist/jsonlSessionRepo.cjs +217 -0
- package/dist/jsonlSessionRepo.cjs.map +1 -0
- package/dist/jsonlSessionRepo.d.mts +7 -0
- package/dist/jsonlSessionRepo.d.mts.map +1 -0
- package/dist/jsonlSessionRepo.mjs +212 -0
- package/dist/jsonlSessionRepo.mjs.map +1 -0
- package/dist/kernel.cjs +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.mts +2 -0
- package/dist/leader.mjs +2 -0
- package/dist/logSinkTelemetry.cjs +5 -0
- package/dist/logSinkTelemetry.d.mts +2 -0
- package/dist/logSinkTelemetry.mjs +2 -0
- package/dist/machineApi.cjs +92 -0
- package/dist/machineApi.cjs.map +1 -0
- package/dist/machineApi.d.mts +7 -0
- package/dist/machineApi.d.mts.map +1 -0
- package/dist/machineApi.mjs +88 -0
- package/dist/machineApi.mjs.map +1 -0
- package/dist/main.cjs +11 -0
- package/dist/main.d.mts +5 -0
- package/dist/main.mjs +4 -0
- package/dist/mcpFacet.cjs +12 -0
- package/dist/mcpFacet.d.mts +4 -0
- package/dist/mcpFacet.mjs +4 -0
- package/dist/mcpProjection.cjs +16 -0
- package/dist/mcpProjection.d.mts +2 -0
- package/dist/mcpProjection.mjs +2 -0
- package/dist/mcpSchemaCost.cjs +195 -0
- package/dist/mcpSchemaCost.cjs.map +1 -0
- package/dist/mcpSchemaCost.d.mts +35 -0
- package/dist/mcpSchemaCost.d.mts.map +1 -0
- package/dist/mcpSchemaCost.mjs +190 -0
- package/dist/mcpSchemaCost.mjs.map +1 -0
- package/dist/mcpSession.cjs +9 -0
- package/dist/mcpSession.d.mts +2 -0
- package/dist/mcpSession.mjs +2 -0
- package/dist/mcpStatus.cjs +7 -0
- package/dist/mcpStatus.d.mts +2 -0
- package/dist/mcpStatus.mjs +2 -0
- package/dist/mcpToolResolver.cjs +5 -0
- package/dist/mcpToolResolver.d.mts +2 -0
- package/dist/mcpToolResolver.mjs +2 -0
- package/dist/mcpWidget.cjs +0 -0
- package/dist/mcpWidget.d.mts +2 -0
- package/dist/mcpWidget.mjs +1 -0
- package/dist/moduleResolution.cjs +405 -0
- package/dist/moduleResolution.cjs.map +1 -0
- package/dist/moduleResolution.d.mts +67 -0
- package/dist/moduleResolution.d.mts.map +1 -0
- package/dist/moduleResolution.mjs +389 -0
- package/dist/moduleResolution.mjs.map +1 -0
- package/dist/narration.cjs +10 -0
- package/dist/narration.d.mts +2 -0
- package/dist/narration.mjs +2 -0
- package/dist/notification.cjs +17 -0
- package/dist/notification.d.mts +2 -0
- package/dist/notification.mjs +2 -0
- package/dist/packageApi.cjs +16 -0
- package/dist/packageApi.d.mts +3 -0
- package/dist/packageApi.mjs +3 -0
- package/dist/packageApiServer.cjs +191 -0
- package/dist/packageApiServer.cjs.map +1 -0
- package/dist/packageApiServer.d.mts +57 -0
- package/dist/packageApiServer.d.mts.map +1 -0
- package/dist/packageApiServer.mjs +189 -0
- package/dist/packageApiServer.mjs.map +1 -0
- package/dist/piExtension.cjs +13 -0
- package/dist/piExtension.d.mts +5 -0
- package/dist/piExtension.mjs +4 -0
- package/dist/piSettings.cjs +12 -0
- package/dist/piSettings.d.mts +2 -0
- package/dist/piSettings.mjs +2 -0
- package/dist/pluginProtocol.cjs +10 -0
- package/dist/pluginProtocol.d.mts +2 -0
- package/dist/pluginProtocol.mjs +2 -0
- package/dist/profileIdentity.cjs +6 -0
- package/dist/profileIdentity.d.mts +2 -0
- package/dist/profileIdentity.mjs +2 -0
- package/dist/protocol.cjs +10 -0
- package/dist/protocol.d.mts +2 -0
- package/dist/protocol.mjs +2 -0
- package/dist/readiness.cjs +8 -0
- package/dist/readiness.d.mts +2 -0
- package/dist/readiness.mjs +2 -0
- package/dist/relaunchHandoff.cjs +6 -0
- package/dist/relaunchHandoff.d.mts +2 -0
- package/dist/relaunchHandoff.mjs +2 -0
- package/dist/remoteApi.cjs +42 -0
- package/dist/remoteApi.cjs.map +1 -0
- package/dist/remoteApi.d.mts +7 -0
- package/dist/remoteApi.d.mts.map +1 -0
- package/dist/remoteApi.mjs +41 -0
- package/dist/remoteApi.mjs.map +1 -0
- package/dist/remoteRuntime.cjs +460 -0
- package/dist/remoteRuntime.cjs.map +1 -0
- package/dist/remoteRuntime.d.mts +28 -0
- package/dist/remoteRuntime.d.mts.map +1 -0
- package/dist/remoteRuntime.mjs +456 -0
- package/dist/remoteRuntime.mjs.map +1 -0
- package/dist/runtimeConfig.cjs +232 -0
- package/dist/runtimeConfig.cjs.map +1 -0
- package/dist/runtimeConfig.d.mts +313 -0
- package/dist/runtimeConfig.d.mts.map +1 -0
- package/dist/runtimeConfig.mjs +221 -0
- package/dist/runtimeConfig.mjs.map +1 -0
- package/dist/runtimeContextApi.cjs +64 -0
- package/dist/runtimeContextApi.cjs.map +1 -0
- package/dist/runtimeContextApi.d.mts +16 -0
- package/dist/runtimeContextApi.d.mts.map +1 -0
- package/dist/runtimeContextApi.mjs +62 -0
- package/dist/runtimeContextApi.mjs.map +1 -0
- package/dist/runtimeCordisHost.cjs +193 -0
- package/dist/runtimeCordisHost.cjs.map +1 -0
- package/dist/runtimeCordisHost.d.mts +63 -0
- package/dist/runtimeCordisHost.d.mts.map +1 -0
- package/dist/runtimeCordisHost.mjs +184 -0
- package/dist/runtimeCordisHost.mjs.map +1 -0
- package/dist/runtimeHeadlessSessionManager.cjs +0 -0
- package/dist/runtimeHeadlessSessionManager.d.mts +18 -0
- package/dist/runtimeHeadlessSessionManager.d.mts.map +1 -0
- package/dist/runtimeHeadlessSessionManager.mjs +1 -0
- package/dist/runtimeIdentity.cjs +26 -0
- package/dist/runtimeIdentity.cjs.map +1 -0
- package/dist/runtimeIdentity.d.mts +7 -0
- package/dist/runtimeIdentity.d.mts.map +1 -0
- package/dist/runtimeIdentity.mjs +21 -0
- package/dist/runtimeIdentity.mjs.map +1 -0
- package/dist/runtimeJson.cjs +46 -0
- package/dist/runtimeJson.cjs.map +1 -0
- package/dist/runtimeJson.d.mts +22 -0
- package/dist/runtimeJson.d.mts.map +1 -0
- package/dist/runtimeJson.mjs +39 -0
- package/dist/runtimeJson.mjs.map +1 -0
- package/dist/runtimeLogSinkTelemetry.cjs +102 -0
- package/dist/runtimeLogSinkTelemetry.cjs.map +1 -0
- package/dist/runtimeLogSinkTelemetry.d.mts +49 -0
- package/dist/runtimeLogSinkTelemetry.d.mts.map +1 -0
- package/dist/runtimeLogSinkTelemetry.mjs +99 -0
- package/dist/runtimeLogSinkTelemetry.mjs.map +1 -0
- package/dist/runtimePiExtension.cjs +339 -0
- package/dist/runtimePiExtension.cjs.map +1 -0
- package/dist/runtimePiExtension.d.mts +160 -0
- package/dist/runtimePiExtension.d.mts.map +1 -0
- package/dist/runtimePiExtension.mjs +333 -0
- package/dist/runtimePiExtension.mjs.map +1 -0
- package/dist/runtimePiSettings.cjs +116 -0
- package/dist/runtimePiSettings.cjs.map +1 -0
- package/dist/runtimePiSettings.d.mts +29 -0
- package/dist/runtimePiSettings.d.mts.map +1 -0
- package/dist/runtimePiSettings.mjs +103 -0
- package/dist/runtimePiSettings.mjs.map +1 -0
- package/dist/runtimeProtocol.cjs +223 -0
- package/dist/runtimeProtocol.cjs.map +1 -0
- package/dist/runtimeProtocol.d.mts +84 -0
- package/dist/runtimeProtocol.d.mts.map +1 -0
- package/dist/runtimeProtocol.mjs +215 -0
- package/dist/runtimeProtocol.mjs.map +1 -0
- package/dist/runtimeToolNames.cjs +51 -0
- package/dist/runtimeToolNames.cjs.map +1 -0
- package/dist/runtimeToolNames.d.mts +24 -0
- package/dist/runtimeToolNames.d.mts.map +1 -0
- package/dist/runtimeToolNames.mjs +49 -0
- package/dist/runtimeToolNames.mjs.map +1 -0
- package/dist/runtimeTransition.cjs +27 -0
- package/dist/runtimeTransition.cjs.map +1 -0
- package/dist/runtimeTransition.d.mts +114 -0
- package/dist/runtimeTransition.d.mts.map +1 -0
- package/dist/runtimeTransition.mjs +24 -0
- package/dist/runtimeTransition.mjs.map +1 -0
- package/dist/sandboxHarness.cjs +6 -0
- package/dist/sandboxHarness.d.mts +2 -0
- package/dist/sandboxHarness.mjs +2 -0
- package/dist/server.cjs +17 -0
- package/dist/server.d.mts +10 -0
- package/dist/server.mjs +7 -0
- package/dist/serverFacet.cjs +30 -0
- package/dist/serverFacet.d.mts +8 -0
- package/dist/serverFacet.mjs +8 -0
- package/dist/serverTelemetry.cjs +25 -0
- package/dist/serverTelemetry.cjs.map +1 -0
- package/dist/serverTelemetry.d.mts +12 -0
- package/dist/serverTelemetry.d.mts.map +1 -0
- package/dist/serverTelemetry.mjs +23 -0
- package/dist/serverTelemetry.mjs.map +1 -0
- package/dist/sessionFilesApi.cjs +96 -0
- package/dist/sessionFilesApi.cjs.map +1 -0
- package/dist/sessionFilesApi.d.mts +7 -0
- package/dist/sessionFilesApi.d.mts.map +1 -0
- package/dist/sessionFilesApi.mjs +91 -0
- package/dist/sessionFilesApi.mjs.map +1 -0
- package/dist/sessionMcp.cjs +6 -0
- package/dist/sessionMcp.d.mts +5 -0
- package/dist/sessionMcp.mjs +3 -0
- package/dist/sessionProtocol.cjs +8 -0
- package/dist/sessionProtocol.d.mts +3 -0
- package/dist/sessionProtocol.mjs +2 -0
- package/dist/skills.cjs +9 -0
- package/dist/skills.d.mts +2 -0
- package/dist/skills.mjs +2 -0
- package/dist/sqliteHistoryImport.cjs +151 -0
- package/dist/sqliteHistoryImport.cjs.map +1 -0
- package/dist/sqliteHistoryImport.d.mts +8 -0
- package/dist/sqliteHistoryImport.d.mts.map +1 -0
- package/dist/sqliteHistoryImport.mjs +146 -0
- package/dist/sqliteHistoryImport.mjs.map +1 -0
- package/dist/sqliteSessionStorage.cjs +53 -0
- package/dist/sqliteSessionStorage.cjs.map +1 -0
- package/dist/sqliteSessionStorage.d.mts +7 -0
- package/dist/sqliteSessionStorage.d.mts.map +1 -0
- package/dist/sqliteSessionStorage.mjs +49 -0
- package/dist/sqliteSessionStorage.mjs.map +1 -0
- package/dist/src/constants/authorTools.cjs +10 -0
- package/dist/src/constants/authorTools.cjs.map +1 -0
- package/dist/src/constants/authorTools.d.mts +6 -0
- package/dist/src/constants/authorTools.d.mts.map +1 -0
- package/dist/src/constants/authorTools.mjs +8 -0
- package/dist/src/constants/authorTools.mjs.map +1 -0
- package/dist/src/constants/contextApi.cjs +28 -0
- package/dist/src/constants/contextApi.cjs.map +1 -0
- package/dist/src/constants/contextApi.d.mts +21 -0
- package/dist/src/constants/contextApi.d.mts.map +1 -0
- package/dist/src/constants/contextApi.mjs +23 -0
- package/dist/src/constants/contextApi.mjs.map +1 -0
- package/dist/src/constants/remote.cjs +90 -0
- package/dist/src/constants/remote.cjs.map +1 -0
- package/dist/src/constants/remote.mjs +69 -0
- package/dist/src/constants/remote.mjs.map +1 -0
- package/dist/src/constants/voiceReloadHandoff.cjs +12 -0
- package/dist/src/constants/voiceReloadHandoff.cjs.map +1 -0
- package/dist/src/constants/voiceReloadHandoff.d.mts +7 -0
- package/dist/src/constants/voiceReloadHandoff.d.mts.map +1 -0
- package/dist/src/constants/voiceReloadHandoff.mjs +9 -0
- package/dist/src/constants/voiceReloadHandoff.mjs.map +1 -0
- package/dist/src/constants/voiceTools.cjs +96 -0
- package/dist/src/constants/voiceTools.cjs.map +1 -0
- package/dist/src/constants/voiceTools.d.mts +58 -0
- package/dist/src/constants/voiceTools.d.mts.map +1 -0
- package/dist/src/constants/voiceTools.mjs +60 -0
- package/dist/src/constants/voiceTools.mjs.map +1 -0
- package/dist/src/extensions/extensionFile.cjs +165 -0
- package/dist/src/extensions/extensionFile.cjs.map +1 -0
- package/dist/src/extensions/extensionFile.d.mts +79 -0
- package/dist/src/extensions/extensionFile.d.mts.map +1 -0
- package/dist/src/extensions/extensionFile.mjs +144 -0
- package/dist/src/extensions/extensionFile.mjs.map +1 -0
- package/dist/src/extensions/serverPlugin.cjs +106 -0
- package/dist/src/extensions/serverPlugin.cjs.map +1 -0
- package/dist/src/extensions/serverPlugin.d.mts +5 -0
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -0
- package/dist/src/extensions/serverPlugin.mjs +106 -0
- package/dist/src/extensions/serverPlugin.mjs.map +1 -0
- package/dist/src/extensions/webPlugin.cjs +131 -0
- package/dist/src/extensions/webPlugin.cjs.map +1 -0
- package/dist/src/extensions/webPlugin.d.mts +66 -0
- package/dist/src/extensions/webPlugin.d.mts.map +1 -0
- package/dist/src/extensions/webPlugin.mjs +110 -0
- package/dist/src/extensions/webPlugin.mjs.map +1 -0
- package/dist/src/pi/piSessionRuntime.cjs +572 -0
- package/dist/src/pi/piSessionRuntime.cjs.map +1 -0
- package/dist/src/pi/piSessionRuntime.d.mts +43 -0
- package/dist/src/pi/piSessionRuntime.d.mts.map +1 -0
- package/dist/src/pi/piSessionRuntime.mjs +571 -0
- package/dist/src/pi/piSessionRuntime.mjs.map +1 -0
- package/dist/src/pi/piWebSocketListener.cjs +115 -0
- package/dist/src/pi/piWebSocketListener.cjs.map +1 -0
- package/dist/src/pi/piWebSocketListener.mjs +115 -0
- package/dist/src/pi/piWebSocketListener.mjs.map +1 -0
- package/dist/src/schemas/agentModel.cjs +33 -0
- package/dist/src/schemas/agentModel.cjs.map +1 -0
- package/dist/src/schemas/agentModel.d.mts +26 -0
- package/dist/src/schemas/agentModel.d.mts.map +1 -0
- package/dist/src/schemas/agentModel.mjs +32 -0
- package/dist/src/schemas/agentModel.mjs.map +1 -0
- package/dist/src/schemas/apiContracts.d.mts +58 -0
- package/dist/src/schemas/apiContracts.d.mts.map +1 -0
- package/dist/src/schemas/askUser.cjs +42 -0
- package/dist/src/schemas/askUser.cjs.map +1 -0
- package/dist/src/schemas/askUser.d.mts +47 -0
- package/dist/src/schemas/askUser.d.mts.map +1 -0
- package/dist/src/schemas/askUser.mjs +37 -0
- package/dist/src/schemas/askUser.mjs.map +1 -0
- package/dist/src/schemas/backgroundWork.cjs +31 -0
- package/dist/src/schemas/backgroundWork.cjs.map +1 -0
- package/dist/src/schemas/backgroundWork.d.mts +72 -0
- package/dist/src/schemas/backgroundWork.d.mts.map +1 -0
- package/dist/src/schemas/backgroundWork.mjs +27 -0
- package/dist/src/schemas/backgroundWork.mjs.map +1 -0
- package/dist/src/schemas/childProcess.cjs +67 -0
- package/dist/src/schemas/childProcess.cjs.map +1 -0
- package/dist/src/schemas/childProcess.d.mts +30 -0
- package/dist/src/schemas/childProcess.d.mts.map +1 -0
- package/dist/src/schemas/childProcess.mjs +55 -0
- package/dist/src/schemas/childProcess.mjs.map +1 -0
- package/dist/src/schemas/cockpitContainer.cjs +31 -0
- package/dist/src/schemas/cockpitContainer.cjs.map +1 -0
- package/dist/src/schemas/cockpitContainer.d.mts +80 -0
- package/dist/src/schemas/cockpitContainer.d.mts.map +1 -0
- package/dist/src/schemas/cockpitContainer.mjs +30 -0
- package/dist/src/schemas/cockpitContainer.mjs.map +1 -0
- package/dist/src/schemas/contextContributions.cjs +17 -0
- package/dist/src/schemas/contextContributions.cjs.map +1 -0
- package/dist/src/schemas/contextContributions.d.mts +49 -0
- package/dist/src/schemas/contextContributions.d.mts.map +1 -0
- package/dist/src/schemas/contextContributions.mjs +15 -0
- package/dist/src/schemas/contextContributions.mjs.map +1 -0
- package/dist/src/schemas/delegation.cjs +91 -0
- package/dist/src/schemas/delegation.cjs.map +1 -0
- package/dist/src/schemas/delegation.d.mts +95 -0
- package/dist/src/schemas/delegation.d.mts.map +1 -0
- package/dist/src/schemas/delegation.mjs +76 -0
- package/dist/src/schemas/delegation.mjs.map +1 -0
- package/dist/src/schemas/extensionFile.d.mts +136 -0
- package/dist/src/schemas/extensionFile.d.mts.map +1 -0
- package/dist/src/schemas/footer.cjs +48 -0
- package/dist/src/schemas/footer.cjs.map +1 -0
- package/dist/src/schemas/footer.d.mts +48 -0
- package/dist/src/schemas/footer.d.mts.map +1 -0
- package/dist/src/schemas/footer.mjs +45 -0
- package/dist/src/schemas/footer.mjs.map +1 -0
- package/dist/src/schemas/headless.cjs +44 -0
- package/dist/src/schemas/headless.cjs.map +1 -0
- package/dist/src/schemas/headless.d.mts +370 -0
- package/dist/src/schemas/headless.d.mts.map +1 -0
- package/dist/src/schemas/headless.mjs +38 -0
- package/dist/src/schemas/headless.mjs.map +1 -0
- package/dist/src/schemas/help.cjs +281 -0
- package/dist/src/schemas/help.cjs.map +1 -0
- package/dist/src/schemas/help.d.mts +119 -0
- package/dist/src/schemas/help.d.mts.map +1 -0
- package/dist/src/schemas/help.mjs +262 -0
- package/dist/src/schemas/help.mjs.map +1 -0
- package/dist/src/schemas/hubChannel.cjs +20 -0
- package/dist/src/schemas/hubChannel.cjs.map +1 -0
- package/dist/src/schemas/hubChannel.d.mts +236 -0
- package/dist/src/schemas/hubChannel.d.mts.map +1 -0
- package/dist/src/schemas/hubChannel.mjs +19 -0
- package/dist/src/schemas/hubChannel.mjs.map +1 -0
- package/dist/src/schemas/leader.cjs +57 -0
- package/dist/src/schemas/leader.cjs.map +1 -0
- package/dist/src/schemas/leader.d.mts +107 -0
- package/dist/src/schemas/leader.d.mts.map +1 -0
- package/dist/src/schemas/leader.mjs +51 -0
- package/dist/src/schemas/leader.mjs.map +1 -0
- package/dist/src/schemas/mcpBundle.cjs +92 -0
- package/dist/src/schemas/mcpBundle.cjs.map +1 -0
- package/dist/src/schemas/mcpBundle.d.mts +33 -0
- package/dist/src/schemas/mcpBundle.d.mts.map +1 -0
- package/dist/src/schemas/mcpBundle.mjs +90 -0
- package/dist/src/schemas/mcpBundle.mjs.map +1 -0
- package/dist/src/schemas/mcpFacet.cjs +24 -0
- package/dist/src/schemas/mcpFacet.cjs.map +1 -0
- package/dist/src/schemas/mcpFacet.d.mts +91 -0
- package/dist/src/schemas/mcpFacet.d.mts.map +1 -0
- package/dist/src/schemas/mcpFacet.mjs +21 -0
- package/dist/src/schemas/mcpFacet.mjs.map +1 -0
- package/dist/src/schemas/mcpProjection.cjs +117 -0
- package/dist/src/schemas/mcpProjection.cjs.map +1 -0
- package/dist/src/schemas/mcpProjection.d.mts +124 -0
- package/dist/src/schemas/mcpProjection.d.mts.map +1 -0
- package/dist/src/schemas/mcpProjection.mjs +104 -0
- package/dist/src/schemas/mcpProjection.mjs.map +1 -0
- package/dist/src/schemas/mcpSession.cjs +57 -0
- package/dist/src/schemas/mcpSession.cjs.map +1 -0
- package/dist/src/schemas/mcpSession.d.mts +57 -0
- package/dist/src/schemas/mcpSession.d.mts.map +1 -0
- package/dist/src/schemas/mcpSession.mjs +51 -0
- package/dist/src/schemas/mcpSession.mjs.map +1 -0
- package/dist/src/schemas/mcpStatus.cjs +52 -0
- package/dist/src/schemas/mcpStatus.cjs.map +1 -0
- package/dist/src/schemas/mcpStatus.d.mts +73 -0
- package/dist/src/schemas/mcpStatus.d.mts.map +1 -0
- package/dist/src/schemas/mcpStatus.mjs +48 -0
- package/dist/src/schemas/mcpStatus.mjs.map +1 -0
- package/dist/src/schemas/mcpToolResolver.cjs +17 -0
- package/dist/src/schemas/mcpToolResolver.cjs.map +1 -0
- package/dist/src/schemas/mcpToolResolver.d.mts +24 -0
- package/dist/src/schemas/mcpToolResolver.d.mts.map +1 -0
- package/dist/src/schemas/mcpToolResolver.mjs +15 -0
- package/dist/src/schemas/mcpToolResolver.mjs.map +1 -0
- package/dist/src/schemas/narration.cjs +54 -0
- package/dist/src/schemas/narration.cjs.map +1 -0
- package/dist/src/schemas/narration.d.mts +29 -0
- package/dist/src/schemas/narration.d.mts.map +1 -0
- package/dist/src/schemas/narration.mjs +47 -0
- package/dist/src/schemas/narration.mjs.map +1 -0
- package/dist/src/schemas/notification.cjs +122 -0
- package/dist/src/schemas/notification.cjs.map +1 -0
- package/dist/src/schemas/notification.d.mts +48 -0
- package/dist/src/schemas/notification.d.mts.map +1 -0
- package/dist/src/schemas/notification.mjs +108 -0
- package/dist/src/schemas/notification.mjs.map +1 -0
- package/dist/src/schemas/packageApi.cjs +73 -0
- package/dist/src/schemas/packageApi.cjs.map +1 -0
- package/dist/src/schemas/packageApi.d.mts +249 -0
- package/dist/src/schemas/packageApi.d.mts.map +1 -0
- package/dist/src/schemas/packageApi.mjs +64 -0
- package/dist/src/schemas/packageApi.mjs.map +1 -0
- package/dist/src/schemas/piTool.cjs +26 -0
- package/dist/src/schemas/piTool.cjs.map +1 -0
- package/dist/src/schemas/piTool.d.mts +25 -0
- package/dist/src/schemas/piTool.d.mts.map +1 -0
- package/dist/src/schemas/piTool.mjs +26 -0
- package/dist/src/schemas/piTool.mjs.map +1 -0
- package/dist/src/schemas/pluginContributions.cjs +19 -0
- package/dist/src/schemas/pluginContributions.cjs.map +1 -0
- package/dist/src/schemas/pluginContributions.d.mts +56 -0
- package/dist/src/schemas/pluginContributions.d.mts.map +1 -0
- package/dist/src/schemas/pluginContributions.mjs +18 -0
- package/dist/src/schemas/pluginContributions.mjs.map +1 -0
- package/dist/src/schemas/pluginProtocol.cjs +103 -0
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -0
- package/dist/src/schemas/pluginProtocol.d.mts +68 -0
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -0
- package/dist/src/schemas/pluginProtocol.mjs +96 -0
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -0
- package/dist/src/schemas/profileIdentity.cjs +67 -0
- package/dist/src/schemas/profileIdentity.cjs.map +1 -0
- package/dist/src/schemas/profileIdentity.d.mts +50 -0
- package/dist/src/schemas/profileIdentity.d.mts.map +1 -0
- package/dist/src/schemas/profileIdentity.mjs +64 -0
- package/dist/src/schemas/profileIdentity.mjs.map +1 -0
- package/dist/src/schemas/readiness.cjs +251 -0
- package/dist/src/schemas/readiness.cjs.map +1 -0
- package/dist/src/schemas/readiness.d.mts +84 -0
- package/dist/src/schemas/readiness.d.mts.map +1 -0
- package/dist/src/schemas/readiness.mjs +246 -0
- package/dist/src/schemas/readiness.mjs.map +1 -0
- package/dist/src/schemas/relaunchHandoff.cjs +47 -0
- package/dist/src/schemas/relaunchHandoff.cjs.map +1 -0
- package/dist/src/schemas/relaunchHandoff.d.mts +25 -0
- package/dist/src/schemas/relaunchHandoff.d.mts.map +1 -0
- package/dist/src/schemas/relaunchHandoff.mjs +44 -0
- package/dist/src/schemas/relaunchHandoff.mjs.map +1 -0
- package/dist/src/schemas/sandboxHarness.cjs +29 -0
- package/dist/src/schemas/sandboxHarness.cjs.map +1 -0
- package/dist/src/schemas/sandboxHarness.d.mts +39 -0
- package/dist/src/schemas/sandboxHarness.d.mts.map +1 -0
- package/dist/src/schemas/sandboxHarness.mjs +26 -0
- package/dist/src/schemas/sandboxHarness.mjs.map +1 -0
- package/dist/src/schemas/serverBundle.cjs +79 -0
- package/dist/src/schemas/serverBundle.cjs.map +1 -0
- package/dist/src/schemas/serverBundle.d.mts +34 -0
- package/dist/src/schemas/serverBundle.d.mts.map +1 -0
- package/dist/src/schemas/serverBundle.mjs +77 -0
- package/dist/src/schemas/serverBundle.mjs.map +1 -0
- package/dist/src/schemas/serverFacet.cjs +102 -0
- package/dist/src/schemas/serverFacet.cjs.map +1 -0
- package/dist/src/schemas/serverFacet.d.mts +141 -0
- package/dist/src/schemas/serverFacet.d.mts.map +1 -0
- package/dist/src/schemas/serverFacet.mjs +93 -0
- package/dist/src/schemas/serverFacet.mjs.map +1 -0
- package/dist/src/schemas/sessionMcpActivity.d.mts +45 -0
- package/dist/src/schemas/sessionMcpActivity.d.mts.map +1 -0
- package/dist/src/schemas/sessionProtocol.cjs +17 -0
- package/dist/src/schemas/sessionProtocol.cjs.map +1 -0
- package/dist/src/schemas/sessionProtocol.d.mts +308 -0
- package/dist/src/schemas/sessionProtocol.d.mts.map +1 -0
- package/dist/src/schemas/sessionProtocol.mjs +12 -0
- package/dist/src/schemas/sessionProtocol.mjs.map +1 -0
- package/dist/src/schemas/sessionUpdates.d.mts +34 -0
- package/dist/src/schemas/sessionUpdates.d.mts.map +1 -0
- package/dist/src/schemas/skills.cjs +115 -0
- package/dist/src/schemas/skills.cjs.map +1 -0
- package/dist/src/schemas/skills.d.mts +65 -0
- package/dist/src/schemas/skills.d.mts.map +1 -0
- package/dist/src/schemas/skills.mjs +109 -0
- package/dist/src/schemas/skills.mjs.map +1 -0
- package/dist/src/schemas/toolOverrides.cjs +17 -0
- package/dist/src/schemas/toolOverrides.cjs.map +1 -0
- package/dist/src/schemas/toolOverrides.d.mts +29 -0
- package/dist/src/schemas/toolOverrides.d.mts.map +1 -0
- package/dist/src/schemas/toolOverrides.mjs +15 -0
- package/dist/src/schemas/toolOverrides.mjs.map +1 -0
- package/dist/src/schemas/toolSurface.cjs +17 -0
- package/dist/src/schemas/toolSurface.cjs.map +1 -0
- package/dist/src/schemas/toolSurface.d.mts +70 -0
- package/dist/src/schemas/toolSurface.d.mts.map +1 -0
- package/dist/src/schemas/toolSurface.mjs +15 -0
- package/dist/src/schemas/toolSurface.mjs.map +1 -0
- package/dist/src/schemas/uiHub.cjs +17 -0
- package/dist/src/schemas/uiHub.cjs.map +1 -0
- package/dist/src/schemas/uiHub.d.mts +23 -0
- package/dist/src/schemas/uiHub.d.mts.map +1 -0
- package/dist/src/schemas/uiHub.mjs +15 -0
- package/dist/src/schemas/uiHub.mjs.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.cjs +78 -0
- package/dist/src/schemas/voiceReloadHandoff.cjs.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.d.mts +31 -0
- package/dist/src/schemas/voiceReloadHandoff.d.mts.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.mjs +75 -0
- package/dist/src/schemas/voiceReloadHandoff.mjs.map +1 -0
- package/dist/src/schemas/voiceTools.cjs +205 -0
- package/dist/src/schemas/voiceTools.cjs.map +1 -0
- package/dist/src/schemas/voiceTools.d.mts +120 -0
- package/dist/src/schemas/voiceTools.d.mts.map +1 -0
- package/dist/src/schemas/voiceTools.mjs +194 -0
- package/dist/src/schemas/voiceTools.mjs.map +1 -0
- package/dist/src/server/devProxyForward.cjs +141 -0
- package/dist/src/server/devProxyForward.cjs.map +1 -0
- package/dist/src/server/devProxyForward.mjs +139 -0
- package/dist/src/server/devProxyForward.mjs.map +1 -0
- package/dist/src/server/devProxyRoutes.cjs +97 -0
- package/dist/src/server/devProxyRoutes.cjs.map +1 -0
- package/dist/src/server/devProxyRoutes.mjs +97 -0
- package/dist/src/server/devProxyRoutes.mjs.map +1 -0
- package/dist/src/server/devProxySocket.cjs +87 -0
- package/dist/src/server/devProxySocket.cjs.map +1 -0
- package/dist/src/server/devProxySocket.mjs +87 -0
- package/dist/src/server/devProxySocket.mjs.map +1 -0
- package/dist/src/server/directHarnessRuntime.cjs +1964 -0
- package/dist/src/server/directHarnessRuntime.cjs.map +1 -0
- package/dist/src/server/directHarnessRuntime.d.mts +3 -0
- package/dist/src/server/directHarnessRuntime.mjs +1958 -0
- package/dist/src/server/directHarnessRuntime.mjs.map +1 -0
- package/dist/src/server/harnessErrorMessage.cjs +13 -0
- package/dist/src/server/harnessErrorMessage.cjs.map +1 -0
- package/dist/src/server/harnessErrorMessage.mjs +13 -0
- package/dist/src/server/harnessErrorMessage.mjs.map +1 -0
- package/dist/src/server/headlessProtocol.cjs +366 -0
- package/dist/src/server/headlessProtocol.cjs.map +1 -0
- package/dist/src/server/headlessProtocol.mjs +366 -0
- package/dist/src/server/headlessProtocol.mjs.map +1 -0
- package/dist/src/server/jsonlTranscriptReader.cjs +85 -0
- package/dist/src/server/jsonlTranscriptReader.cjs.map +1 -0
- package/dist/src/server/jsonlTranscriptReader.mjs +83 -0
- package/dist/src/server/jsonlTranscriptReader.mjs.map +1 -0
- package/dist/src/server/mcpBundleLoader.cjs +115 -0
- package/dist/src/server/mcpBundleLoader.cjs.map +1 -0
- package/dist/src/server/mcpBundleLoader.d.mts +27 -0
- package/dist/src/server/mcpBundleLoader.d.mts.map +1 -0
- package/dist/src/server/mcpBundleLoader.mjs +111 -0
- package/dist/src/server/mcpBundleLoader.mjs.map +1 -0
- package/dist/src/server/nativeChildTranscriptReader.cjs +20 -0
- package/dist/src/server/nativeChildTranscriptReader.cjs.map +1 -0
- package/dist/src/server/nativeChildTranscriptReader.mjs +18 -0
- package/dist/src/server/nativeChildTranscriptReader.mjs.map +1 -0
- package/dist/src/server/remoteRoutes.cjs +386 -0
- package/dist/src/server/remoteRoutes.cjs.map +1 -0
- package/dist/src/server/remoteRoutes.mjs +386 -0
- package/dist/src/server/remoteRoutes.mjs.map +1 -0
- package/dist/src/server/serverFacetLoader.cjs +220 -0
- package/dist/src/server/serverFacetLoader.cjs.map +1 -0
- package/dist/src/server/serverFacetLoader.d.mts +77 -0
- package/dist/src/server/serverFacetLoader.d.mts.map +1 -0
- package/dist/src/server/serverFacetLoader.mjs +215 -0
- package/dist/src/server/serverFacetLoader.mjs.map +1 -0
- package/dist/src/server/sessionMcpHandler.cjs +494 -0
- package/dist/src/server/sessionMcpHandler.cjs.map +1 -0
- package/dist/src/server/sessionMcpHandler.d.mts +47 -0
- package/dist/src/server/sessionMcpHandler.d.mts.map +1 -0
- package/dist/src/server/sessionMcpHandler.mjs +493 -0
- package/dist/src/server/sessionMcpHandler.mjs.map +1 -0
- package/dist/src/server/sessionMcpRoutes.cjs +780 -0
- package/dist/src/server/sessionMcpRoutes.cjs.map +1 -0
- package/dist/src/server/sessionMcpRoutes.mjs +775 -0
- package/dist/src/server/sessionMcpRoutes.mjs.map +1 -0
- package/dist/src/server/threadJournals.cjs +172 -0
- package/dist/src/server/threadJournals.cjs.map +1 -0
- package/dist/src/server/threadJournals.mjs +169 -0
- package/dist/src/server/threadJournals.mjs.map +1 -0
- package/dist/src/services/acpSessionUpdates/index.cjs +129 -0
- package/dist/src/services/acpSessionUpdates/index.cjs.map +1 -0
- package/dist/src/services/acpSessionUpdates/index.mjs +129 -0
- package/dist/src/services/acpSessionUpdates/index.mjs.map +1 -0
- package/dist/src/services/apiSurfaceAssert/index.cjs +60 -0
- package/dist/src/services/apiSurfaceAssert/index.cjs.map +1 -0
- package/dist/src/services/apiSurfaceAssert/index.d.mts +24 -0
- package/dist/src/services/apiSurfaceAssert/index.d.mts.map +1 -0
- package/dist/src/services/apiSurfaceAssert/index.mjs +60 -0
- package/dist/src/services/apiSurfaceAssert/index.mjs.map +1 -0
- package/dist/src/services/bundlePublication/index.cjs +88 -0
- package/dist/src/services/bundlePublication/index.cjs.map +1 -0
- package/dist/src/services/bundlePublication/index.mjs +85 -0
- package/dist/src/services/bundlePublication/index.mjs.map +1 -0
- package/dist/src/services/contextApiUrls/index.cjs +14 -0
- package/dist/src/services/contextApiUrls/index.cjs.map +1 -0
- package/dist/src/services/contextApiUrls/index.d.mts +6 -0
- package/dist/src/services/contextApiUrls/index.d.mts.map +1 -0
- package/dist/src/services/contextApiUrls/index.mjs +14 -0
- package/dist/src/services/contextApiUrls/index.mjs.map +1 -0
- package/dist/src/services/contextContributions/index.cjs +79 -0
- package/dist/src/services/contextContributions/index.cjs.map +1 -0
- package/dist/src/services/contextContributions/index.d.mts +6 -0
- package/dist/src/services/contextContributions/index.d.mts.map +1 -0
- package/dist/src/services/contextContributions/index.mjs +79 -0
- package/dist/src/services/contextContributions/index.mjs.map +1 -0
- package/dist/src/services/contextUsage/index.cjs +27 -0
- package/dist/src/services/contextUsage/index.cjs.map +1 -0
- package/dist/src/services/contextUsage/index.mjs +25 -0
- package/dist/src/services/contextUsage/index.mjs.map +1 -0
- package/dist/src/services/devProxyPolicy/index.cjs +168 -0
- package/dist/src/services/devProxyPolicy/index.cjs.map +1 -0
- package/dist/src/services/devProxyPolicy/index.mjs +165 -0
- package/dist/src/services/devProxyPolicy/index.mjs.map +1 -0
- package/dist/src/services/devProxyStore/index.cjs +107 -0
- package/dist/src/services/devProxyStore/index.cjs.map +1 -0
- package/dist/src/services/devProxyStore/index.mjs +104 -0
- package/dist/src/services/devProxyStore/index.mjs.map +1 -0
- package/dist/src/services/deviceAuth/index.cjs +125 -0
- package/dist/src/services/deviceAuth/index.cjs.map +1 -0
- package/dist/src/services/deviceAuth/index.d.mts +9 -0
- package/dist/src/services/deviceAuth/index.d.mts.map +1 -0
- package/dist/src/services/deviceAuth/index.mjs +125 -0
- package/dist/src/services/deviceAuth/index.mjs.map +1 -0
- package/dist/src/services/deviceSessions/index.cjs +147 -0
- package/dist/src/services/deviceSessions/index.cjs.map +1 -0
- package/dist/src/services/deviceSessions/index.d.mts +15 -0
- package/dist/src/services/deviceSessions/index.d.mts.map +1 -0
- package/dist/src/services/deviceSessions/index.mjs +141 -0
- package/dist/src/services/deviceSessions/index.mjs.map +1 -0
- package/dist/src/services/headlessClient/index.cjs +125 -0
- package/dist/src/services/headlessClient/index.cjs.map +1 -0
- package/dist/src/services/headlessClient/index.mjs +125 -0
- package/dist/src/services/headlessClient/index.mjs.map +1 -0
- package/dist/src/services/historyCreationFileSystem/index.cjs +115 -0
- package/dist/src/services/historyCreationFileSystem/index.cjs.map +1 -0
- package/dist/src/services/historyCreationFileSystem/index.mjs +115 -0
- package/dist/src/services/historyCreationFileSystem/index.mjs.map +1 -0
- package/dist/src/services/hubChannelHarness/index.cjs +50 -0
- package/dist/src/services/hubChannelHarness/index.cjs.map +1 -0
- package/dist/src/services/hubChannelHarness/index.d.mts +17 -0
- package/dist/src/services/hubChannelHarness/index.d.mts.map +1 -0
- package/dist/src/services/hubChannelHarness/index.mjs +50 -0
- package/dist/src/services/hubChannelHarness/index.mjs.map +1 -0
- package/dist/src/services/kernel/index.cjs +147 -0
- package/dist/src/services/kernel/index.cjs.map +1 -0
- package/dist/src/services/kernel/index.d.mts +9 -0
- package/dist/src/services/kernel/index.d.mts.map +1 -0
- package/dist/src/services/kernel/index.mjs +147 -0
- package/dist/src/services/kernel/index.mjs.map +1 -0
- package/dist/src/services/loginFlow/index.cjs +131 -0
- package/dist/src/services/loginFlow/index.cjs.map +1 -0
- package/dist/src/services/loginFlow/index.mjs +131 -0
- package/dist/src/services/loginFlow/index.mjs.map +1 -0
- package/dist/src/services/loopbackAddress/index.cjs +58 -0
- package/dist/src/services/loopbackAddress/index.cjs.map +1 -0
- package/dist/src/services/loopbackAddress/index.mjs +56 -0
- package/dist/src/services/loopbackAddress/index.mjs.map +1 -0
- package/dist/src/services/openSessionRegistry/index.cjs +144 -0
- package/dist/src/services/openSessionRegistry/index.cjs.map +1 -0
- package/dist/src/services/openSessionRegistry/index.d.mts +40 -0
- package/dist/src/services/openSessionRegistry/index.d.mts.map +1 -0
- package/dist/src/services/openSessionRegistry/index.mjs +141 -0
- package/dist/src/services/openSessionRegistry/index.mjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.cjs +36 -0
- package/dist/src/services/packageApiHarness/index.cjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.d.mts +40 -0
- package/dist/src/services/packageApiHarness/index.d.mts.map +1 -0
- package/dist/src/services/packageApiHarness/index.mjs +36 -0
- package/dist/src/services/packageApiHarness/index.mjs.map +1 -0
- package/dist/src/services/packageResource/index.cjs +54 -0
- package/dist/src/services/packageResource/index.cjs.map +1 -0
- package/dist/src/services/packageResource/index.d.mts +26 -0
- package/dist/src/services/packageResource/index.d.mts.map +1 -0
- package/dist/src/services/packageResource/index.mjs +51 -0
- package/dist/src/services/packageResource/index.mjs.map +1 -0
- package/dist/src/services/pairingFlow/index.cjs +145 -0
- package/dist/src/services/pairingFlow/index.cjs.map +1 -0
- package/dist/src/services/pairingFlow/index.d.mts +44 -0
- package/dist/src/services/pairingFlow/index.d.mts.map +1 -0
- package/dist/src/services/pairingFlow/index.mjs +145 -0
- package/dist/src/services/pairingFlow/index.mjs.map +1 -0
- package/dist/src/services/pairingPage/index.cjs +450 -0
- package/dist/src/services/pairingPage/index.cjs.map +1 -0
- package/dist/src/services/pairingPage/index.mjs +447 -0
- package/dist/src/services/pairingPage/index.mjs.map +1 -0
- package/dist/src/services/piExtensionHost/index.cjs +821 -0
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -0
- package/dist/src/services/piExtensionHost/index.mjs +817 -0
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -0
- package/dist/src/services/piHelpTools/index.cjs +68 -0
- package/dist/src/services/piHelpTools/index.cjs.map +1 -0
- package/dist/src/services/piHelpTools/index.d.mts +10 -0
- package/dist/src/services/piHelpTools/index.d.mts.map +1 -0
- package/dist/src/services/piHelpTools/index.mjs +68 -0
- package/dist/src/services/piHelpTools/index.mjs.map +1 -0
- package/dist/src/services/piSessionEntries/index.cjs +112 -0
- package/dist/src/services/piSessionEntries/index.cjs.map +1 -0
- package/dist/src/services/piSessionEntries/index.mjs +108 -0
- package/dist/src/services/piSessionEntries/index.mjs.map +1 -0
- package/dist/src/services/pluginLifecycle/index.cjs +71 -0
- package/dist/src/services/pluginLifecycle/index.cjs.map +1 -0
- package/dist/src/services/pluginLifecycle/index.d.mts +11 -0
- package/dist/src/services/pluginLifecycle/index.d.mts.map +1 -0
- package/dist/src/services/pluginLifecycle/index.mjs +71 -0
- package/dist/src/services/pluginLifecycle/index.mjs.map +1 -0
- package/dist/src/services/providerAuth/index.cjs +156 -0
- package/dist/src/services/providerAuth/index.cjs.map +1 -0
- package/dist/src/services/providerAuth/index.mjs +154 -0
- package/dist/src/services/providerAuth/index.mjs.map +1 -0
- package/dist/src/services/remoteAccess/index.cjs +396 -0
- package/dist/src/services/remoteAccess/index.cjs.map +1 -0
- package/dist/src/services/remoteAccess/index.d.mts +81 -0
- package/dist/src/services/remoteAccess/index.d.mts.map +1 -0
- package/dist/src/services/remoteAccess/index.mjs +396 -0
- package/dist/src/services/remoteAccess/index.mjs.map +1 -0
- package/dist/src/services/remoteAccessSettings/index.cjs +151 -0
- package/dist/src/services/remoteAccessSettings/index.cjs.map +1 -0
- package/dist/src/services/remoteAccessSettings/index.mjs +149 -0
- package/dist/src/services/remoteAccessSettings/index.mjs.map +1 -0
- package/dist/src/services/remoteAccessStore/index.cjs +126 -0
- package/dist/src/services/remoteAccessStore/index.cjs.map +1 -0
- package/dist/src/services/remoteAccessStore/index.mjs +121 -0
- package/dist/src/services/remoteAccessStore/index.mjs.map +1 -0
- package/dist/src/services/remoteGuardPolicy/index.cjs +190 -0
- package/dist/src/services/remoteGuardPolicy/index.cjs.map +1 -0
- package/dist/src/services/remoteGuardPolicy/index.d.mts +7 -0
- package/dist/src/services/remoteGuardPolicy/index.d.mts.map +1 -0
- package/dist/src/services/remoteGuardPolicy/index.mjs +186 -0
- package/dist/src/services/remoteGuardPolicy/index.mjs.map +1 -0
- package/dist/src/services/requestReceipts/index.cjs +161 -0
- package/dist/src/services/requestReceipts/index.cjs.map +1 -0
- package/dist/src/services/requestReceipts/index.d.mts +11 -0
- package/dist/src/services/requestReceipts/index.d.mts.map +1 -0
- package/dist/src/services/requestReceipts/index.mjs +161 -0
- package/dist/src/services/requestReceipts/index.mjs.map +1 -0
- package/dist/src/services/rpcTranscript/index.cjs +590 -0
- package/dist/src/services/rpcTranscript/index.cjs.map +1 -0
- package/dist/src/services/rpcTranscript/index.d.mts +50 -0
- package/dist/src/services/rpcTranscript/index.d.mts.map +1 -0
- package/dist/src/services/rpcTranscript/index.mjs +589 -0
- package/dist/src/services/rpcTranscript/index.mjs.map +1 -0
- package/dist/src/services/serverFacet/index.cjs +197 -0
- package/dist/src/services/serverFacet/index.cjs.map +1 -0
- package/dist/src/services/serverFacet/index.d.mts +31 -0
- package/dist/src/services/serverFacet/index.d.mts.map +1 -0
- package/dist/src/services/serverFacet/index.mjs +197 -0
- package/dist/src/services/serverFacet/index.mjs.map +1 -0
- package/dist/src/services/sessionGitStatus/index.cjs +46 -0
- package/dist/src/services/sessionGitStatus/index.cjs.map +1 -0
- package/dist/src/services/sessionGitStatus/index.mjs +46 -0
- package/dist/src/services/sessionGitStatus/index.mjs.map +1 -0
- package/dist/src/services/sessionGitStatus/type.d.mts +8 -0
- package/dist/src/services/sessionGitStatus/type.d.mts.map +1 -0
- package/dist/src/services/sessionMcpActivity/index.cjs +115 -0
- package/dist/src/services/sessionMcpActivity/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpActivity/index.mjs +111 -0
- package/dist/src/services/sessionMcpActivity/index.mjs.map +1 -0
- package/dist/src/services/sessionMcpAuthorization/index.cjs +432 -0
- package/dist/src/services/sessionMcpAuthorization/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpAuthorization/index.d.mts +123 -0
- package/dist/src/services/sessionMcpAuthorization/index.d.mts.map +1 -0
- package/dist/src/services/sessionMcpAuthorization/index.mjs +430 -0
- package/dist/src/services/sessionMcpAuthorization/index.mjs.map +1 -0
- package/dist/src/services/sessionMcpConversations/index.cjs +217 -0
- package/dist/src/services/sessionMcpConversations/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpConversations/index.mjs +212 -0
- package/dist/src/services/sessionMcpConversations/index.mjs.map +1 -0
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs +86 -0
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs +83 -0
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs.map +1 -0
- package/dist/src/services/sessionPresentation/index.cjs +119 -0
- package/dist/src/services/sessionPresentation/index.cjs.map +1 -0
- package/dist/src/services/sessionPresentation/index.mjs +119 -0
- package/dist/src/services/sessionPresentation/index.mjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs +105 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.d.mts +29 -0
- package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.mjs +100 -0
- package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -0
- package/dist/src/services/sqliteTranscriptReader/index.cjs +70 -0
- package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -0
- package/dist/src/services/sqliteTranscriptReader/index.d.mts +14 -0
- package/dist/src/services/sqliteTranscriptReader/index.d.mts.map +1 -0
- package/dist/src/services/sqliteTranscriptReader/index.mjs +67 -0
- package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -0
- package/dist/src/services/toolCost/index.cjs +47 -0
- package/dist/src/services/toolCost/index.cjs.map +1 -0
- package/dist/src/services/toolCost/index.d.mts +38 -0
- package/dist/src/services/toolCost/index.d.mts.map +1 -0
- package/dist/src/services/toolCost/index.mjs +46 -0
- package/dist/src/services/toolCost/index.mjs.map +1 -0
- package/dist/src/services/toolOverrides/index.cjs +45 -0
- package/dist/src/services/toolOverrides/index.cjs.map +1 -0
- package/dist/src/services/toolOverrides/index.d.mts +6 -0
- package/dist/src/services/toolOverrides/index.d.mts.map +1 -0
- package/dist/src/services/toolOverrides/index.mjs +45 -0
- package/dist/src/services/toolOverrides/index.mjs.map +1 -0
- package/dist/src/services/toolPrompt/index.cjs +13 -0
- package/dist/src/services/toolPrompt/index.cjs.map +1 -0
- package/dist/src/services/toolPrompt/index.mjs +13 -0
- package/dist/src/services/toolPrompt/index.mjs.map +1 -0
- package/dist/src/services/toolSurface/index.cjs +134 -0
- package/dist/src/services/toolSurface/index.cjs.map +1 -0
- package/dist/src/services/toolSurface/index.d.mts +19 -0
- package/dist/src/services/toolSurface/index.d.mts.map +1 -0
- package/dist/src/services/toolSurface/index.mjs +134 -0
- package/dist/src/services/toolSurface/index.mjs.map +1 -0
- package/dist/src/services/traceContext/index.cjs +13 -0
- package/dist/src/services/traceContext/index.cjs.map +1 -0
- package/dist/src/services/traceContext/index.mjs +13 -0
- package/dist/src/services/traceContext/index.mjs.map +1 -0
- package/dist/src/services/transcriptPages/index.cjs +74 -0
- package/dist/src/services/transcriptPages/index.cjs.map +1 -0
- package/dist/src/services/transcriptPages/index.mjs +73 -0
- package/dist/src/services/transcriptPages/index.mjs.map +1 -0
- package/dist/src/services/tunnelOutput/index.cjs +58 -0
- package/dist/src/services/tunnelOutput/index.cjs.map +1 -0
- package/dist/src/services/tunnelOutput/index.mjs +54 -0
- package/dist/src/services/tunnelOutput/index.mjs.map +1 -0
- package/dist/src/services/tunnelProcess/index.cjs +487 -0
- package/dist/src/services/tunnelProcess/index.cjs.map +1 -0
- package/dist/src/services/tunnelProcess/index.mjs +481 -0
- package/dist/src/services/tunnelProcess/index.mjs.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.cjs +136 -0
- package/dist/src/services/voiceReloadHandoff/index.cjs.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.d.mts +34 -0
- package/dist/src/services/voiceReloadHandoff/index.d.mts.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.mjs +135 -0
- package/dist/src/services/voiceReloadHandoff/index.mjs.map +1 -0
- package/dist/src/services/voiceToolsContract/index.cjs +26 -0
- package/dist/src/services/voiceToolsContract/index.cjs.map +1 -0
- package/dist/src/services/voiceToolsContract/index.d.mts +76 -0
- package/dist/src/services/voiceToolsContract/index.d.mts.map +1 -0
- package/dist/src/services/voiceToolsContract/index.mjs +24 -0
- package/dist/src/services/voiceToolsContract/index.mjs.map +1 -0
- package/dist/src/services/webauthn/index.cjs +262 -0
- package/dist/src/services/webauthn/index.cjs.map +1 -0
- package/dist/src/services/webauthn/index.d.mts +39 -0
- package/dist/src/services/webauthn/index.d.mts.map +1 -0
- package/dist/src/services/webauthn/index.mjs +262 -0
- package/dist/src/services/webauthn/index.mjs.map +1 -0
- package/dist/src/services/webauthnPolicy/index.cjs +163 -0
- package/dist/src/services/webauthnPolicy/index.cjs.map +1 -0
- package/dist/src/services/webauthnPolicy/index.d.mts +41 -0
- package/dist/src/services/webauthnPolicy/index.d.mts.map +1 -0
- package/dist/src/services/webauthnPolicy/index.mjs +156 -0
- package/dist/src/services/webauthnPolicy/index.mjs.map +1 -0
- package/dist/src/services/workspaceRegistry/index.cjs +151 -0
- package/dist/src/services/workspaceRegistry/index.cjs.map +1 -0
- package/dist/src/services/workspaceRegistry/index.d.mts +47 -0
- package/dist/src/services/workspaceRegistry/index.d.mts.map +1 -0
- package/dist/src/services/workspaceRegistry/index.mjs +144 -0
- package/dist/src/services/workspaceRegistry/index.mjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +261 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +32 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +254 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -0
- package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs +28 -0
- package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs.map +1 -0
- package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs +25 -0
- package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs.map +1 -0
- package/dist/src/systems/child/services/childSession/index.cjs +219 -0
- package/dist/src/systems/child/services/childSession/index.cjs.map +1 -0
- package/dist/src/systems/child/services/childSession/index.d.mts +14 -0
- package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -0
- package/dist/src/systems/child/services/childSession/index.mjs +219 -0
- package/dist/src/systems/child/services/childSession/index.mjs.map +1 -0
- package/dist/src/systems/child/types/childSession.cjs +19 -0
- package/dist/src/systems/child/types/childSession.cjs.map +1 -0
- package/dist/src/systems/child/types/childSession.d.mts +148 -0
- package/dist/src/systems/child/types/childSession.d.mts.map +1 -0
- package/dist/src/systems/child/types/childSession.mjs +16 -0
- package/dist/src/systems/child/types/childSession.mjs.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.cjs +554 -0
- package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.d.mts +111 -0
- package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.mjs +552 -0
- package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +1293 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +14 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +1288 -0
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -0
- package/dist/src/systems/main/types/headlessHost.d.mts +36 -0
- package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -0
- package/dist/src/testing/pi/extensionScenarios.cjs +73 -0
- package/dist/src/testing/pi/extensionScenarios.cjs.map +1 -0
- package/dist/src/testing/pi/extensionScenarios.d.mts +41 -0
- package/dist/src/testing/pi/extensionScenarios.d.mts.map +1 -0
- package/dist/src/testing/pi/extensionScenarios.mjs +73 -0
- package/dist/src/testing/pi/extensionScenarios.mjs.map +1 -0
- package/dist/src/testing/pi/testHost.cjs +398 -0
- package/dist/src/testing/pi/testHost.cjs.map +1 -0
- package/dist/src/testing/pi/testHost.d.mts +160 -0
- package/dist/src/testing/pi/testHost.d.mts.map +1 -0
- package/dist/src/testing/pi/testHost.mjs +398 -0
- package/dist/src/testing/pi/testHost.mjs.map +1 -0
- package/dist/src/types/config.d.mts +20 -0
- package/dist/src/types/config.d.mts.map +1 -0
- package/dist/src/types/kernel.d.mts +69 -0
- package/dist/src/types/kernel.d.mts.map +1 -0
- package/dist/src/types/remote.d.mts +124 -0
- package/dist/src/types/remote.d.mts.map +1 -0
- package/dist/src/types/server/directHarnessRuntime.d.mts +209 -0
- package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -0
- package/dist/src/types/server/session.d.mts +5 -0
- package/dist/src/types/server/session.d.mts.map +1 -0
- package/dist/src/types/server/sessionToolSurface.d.mts +44 -0
- package/dist/src/types/server/sessionToolSurface.d.mts.map +1 -0
- package/dist/src/web/models/globalStore.cjs +23 -0
- package/dist/src/web/models/globalStore.cjs.map +1 -0
- package/dist/src/web/models/globalStore.d.mts +6 -0
- package/dist/src/web/models/globalStore.d.mts.map +1 -0
- package/dist/src/web/models/globalStore.mjs +23 -0
- package/dist/src/web/models/globalStore.mjs.map +1 -0
- package/dist/src/web/models/sessionStore.cjs +56 -0
- package/dist/src/web/models/sessionStore.cjs.map +1 -0
- package/dist/src/web/models/sessionStore.d.mts +14 -0
- package/dist/src/web/models/sessionStore.d.mts.map +1 -0
- package/dist/src/web/models/sessionStore.mjs +56 -0
- package/dist/src/web/models/sessionStore.mjs.map +1 -0
- package/dist/src/web/models/workspaceStore.cjs +50 -0
- package/dist/src/web/models/workspaceStore.cjs.map +1 -0
- package/dist/src/web/models/workspaceStore.d.mts +18 -0
- package/dist/src/web/models/workspaceStore.d.mts.map +1 -0
- package/dist/src/web/models/workspaceStore.mjs +50 -0
- package/dist/src/web/models/workspaceStore.mjs.map +1 -0
- package/dist/src/web/schemas/bundleAssetPolicy.cjs +20 -0
- package/dist/src/web/schemas/bundleAssetPolicy.cjs.map +1 -0
- package/dist/src/web/schemas/bundleAssetPolicy.d.mts +10 -0
- package/dist/src/web/schemas/bundleAssetPolicy.d.mts.map +1 -0
- package/dist/src/web/schemas/bundleAssetPolicy.mjs +18 -0
- package/dist/src/web/schemas/bundleAssetPolicy.mjs.map +1 -0
- package/dist/src/web/schemas/template.cjs +15 -0
- package/dist/src/web/schemas/template.cjs.map +1 -0
- package/dist/src/web/schemas/template.d.mts +6 -0
- package/dist/src/web/schemas/template.d.mts.map +1 -0
- package/dist/src/web/schemas/template.mjs +15 -0
- package/dist/src/web/schemas/template.mjs.map +1 -0
- package/dist/src/web/services/apiClient/index.cjs +156 -0
- package/dist/src/web/services/apiClient/index.cjs.map +1 -0
- package/dist/src/web/services/apiClient/index.d.mts +152 -0
- package/dist/src/web/services/apiClient/index.d.mts.map +1 -0
- package/dist/src/web/services/apiClient/index.mjs +154 -0
- package/dist/src/web/services/apiClient/index.mjs.map +1 -0
- package/dist/src/web/services/apiPaths/index.cjs +83 -0
- package/dist/src/web/services/apiPaths/index.cjs.map +1 -0
- package/dist/src/web/services/apiPaths/index.d.mts +81 -0
- package/dist/src/web/services/apiPaths/index.d.mts.map +1 -0
- package/dist/src/web/services/apiPaths/index.mjs +78 -0
- package/dist/src/web/services/apiPaths/index.mjs.map +1 -0
- package/dist/src/web/services/apiRoutes/index.cjs +47 -0
- package/dist/src/web/services/apiRoutes/index.cjs.map +1 -0
- package/dist/src/web/services/apiRoutes/index.d.mts +21 -0
- package/dist/src/web/services/apiRoutes/index.d.mts.map +1 -0
- package/dist/src/web/services/apiRoutes/index.mjs +43 -0
- package/dist/src/web/services/apiRoutes/index.mjs.map +1 -0
- package/dist/src/web/services/mcpWidget.cjs +9 -0
- package/dist/src/web/services/mcpWidget.cjs.map +1 -0
- package/dist/src/web/services/mcpWidget.d.mts +6 -0
- package/dist/src/web/services/mcpWidget.d.mts.map +1 -0
- package/dist/src/web/services/mcpWidget.mjs +9 -0
- package/dist/src/web/services/mcpWidget.mjs.map +1 -0
- package/dist/src/web/services/sessionRegistry/index.cjs +70 -0
- package/dist/src/web/services/sessionRegistry/index.cjs.map +1 -0
- package/dist/src/web/services/sessionRegistry/index.d.mts +29 -0
- package/dist/src/web/services/sessionRegistry/index.d.mts.map +1 -0
- package/dist/src/web/services/sessionRegistry/index.mjs +66 -0
- package/dist/src/web/services/sessionRegistry/index.mjs.map +1 -0
- package/dist/src/web/services/testing/channels.cjs +11 -0
- package/dist/src/web/services/testing/channels.cjs.map +1 -0
- package/dist/src/web/services/testing/channels.d.mts +8 -0
- package/dist/src/web/services/testing/channels.d.mts.map +1 -0
- package/dist/src/web/services/testing/channels.mjs +11 -0
- package/dist/src/web/services/testing/channels.mjs.map +1 -0
- package/dist/src/web/services/testing/index.cjs +27 -0
- package/dist/src/web/services/testing/index.cjs.map +1 -0
- package/dist/src/web/services/testing/index.d.mts +31 -0
- package/dist/src/web/services/testing/index.d.mts.map +1 -0
- package/dist/src/web/services/testing/index.mjs +27 -0
- package/dist/src/web/services/testing/index.mjs.map +1 -0
- package/dist/src/web/services/testing/rpcStub.cjs +58 -0
- package/dist/src/web/services/testing/rpcStub.cjs.map +1 -0
- package/dist/src/web/services/testing/rpcStub.d.mts +37 -0
- package/dist/src/web/services/testing/rpcStub.d.mts.map +1 -0
- package/dist/src/web/services/testing/rpcStub.mjs +58 -0
- package/dist/src/web/services/testing/rpcStub.mjs.map +1 -0
- package/dist/src/web/services/testing/slotProps.cjs +91 -0
- package/dist/src/web/services/testing/slotProps.cjs.map +1 -0
- package/dist/src/web/services/testing/slotProps.d.mts +69 -0
- package/dist/src/web/services/testing/slotProps.d.mts.map +1 -0
- package/dist/src/web/services/testing/slotProps.mjs +90 -0
- package/dist/src/web/services/testing/slotProps.mjs.map +1 -0
- package/dist/src/web/services/testing/templateRail.cjs +128 -0
- package/dist/src/web/services/testing/templateRail.cjs.map +1 -0
- package/dist/src/web/services/testing/templateRail.d.mts +31 -0
- package/dist/src/web/services/testing/templateRail.d.mts.map +1 -0
- package/dist/src/web/services/testing/templateRail.mjs +126 -0
- package/dist/src/web/services/testing/templateRail.mjs.map +1 -0
- package/dist/src/web/services/toolResult/index.cjs +30 -0
- package/dist/src/web/services/toolResult/index.cjs.map +1 -0
- package/dist/src/web/services/toolResult/index.d.mts +14 -0
- package/dist/src/web/services/toolResult/index.d.mts.map +1 -0
- package/dist/src/web/services/toolResult/index.mjs +29 -0
- package/dist/src/web/services/toolResult/index.mjs.map +1 -0
- package/dist/src/web/types/extensionFile.d.mts +59 -0
- package/dist/src/web/types/extensionFile.d.mts.map +1 -0
- package/dist/src/web/types/mcpWidget.d.mts +14 -0
- package/dist/src/web/types/mcpWidget.d.mts.map +1 -0
- package/dist/src/web/types/modelContext.d.mts +43 -0
- package/dist/src/web/types/modelContext.d.mts.map +1 -0
- package/dist/src/web/types/sessionRegistry.d.mts +43 -0
- package/dist/src/web/types/sessionRegistry.d.mts.map +1 -0
- package/dist/src/web/types/template.d.mts +155 -0
- package/dist/src/web/types/template.d.mts.map +1 -0
- package/dist/src/web/types/webPlugin.d.mts +896 -0
- package/dist/src/web/types/webPlugin.d.mts.map +1 -0
- package/dist/syncLocation.cjs +244 -0
- package/dist/syncLocation.cjs.map +1 -0
- package/dist/syncLocation.d.mts +37 -0
- package/dist/syncLocation.d.mts.map +1 -0
- package/dist/syncLocation.mjs +231 -0
- package/dist/syncLocation.mjs.map +1 -0
- package/dist/syncRegistration.cjs +171 -0
- package/dist/syncRegistration.cjs.map +1 -0
- package/dist/syncRegistration.d.mts +48 -0
- package/dist/syncRegistration.d.mts.map +1 -0
- package/dist/syncRegistration.mjs +159 -0
- package/dist/syncRegistration.mjs.map +1 -0
- package/dist/syncStateContract.cjs +19 -0
- package/dist/syncStateContract.cjs.map +1 -0
- package/dist/syncStateContract.d.mts +14 -0
- package/dist/syncStateContract.d.mts.map +1 -0
- package/dist/syncStateContract.mjs +16 -0
- package/dist/syncStateContract.mjs.map +1 -0
- package/dist/terminalPiChildSessionService.cjs +267 -0
- package/dist/terminalPiChildSessionService.cjs.map +1 -0
- package/dist/terminalPiChildSessionService.d.mts +42 -0
- package/dist/terminalPiChildSessionService.d.mts.map +1 -0
- package/dist/terminalPiChildSessionService.mjs +260 -0
- package/dist/terminalPiChildSessionService.mjs.map +1 -0
- package/dist/testing.cjs +11 -0
- package/dist/testing.d.mts +6 -0
- package/dist/testing.mjs +6 -0
- package/dist/toolInventory.cjs +136 -0
- package/dist/toolInventory.cjs.map +1 -0
- package/dist/toolInventory.d.mts +66 -0
- package/dist/toolInventory.d.mts.map +1 -0
- package/dist/toolInventory.mjs +133 -0
- package/dist/toolInventory.mjs.map +1 -0
- package/dist/toolNames.cjs +4 -0
- package/dist/toolNames.d.mts +2 -0
- package/dist/toolNames.mjs +2 -0
- package/dist/toolOverrides.cjs +7 -0
- package/dist/toolOverrides.d.mts +3 -0
- package/dist/toolOverrides.mjs +3 -0
- package/dist/toolSurface.cjs +7 -0
- package/dist/toolSurface.d.mts +3 -0
- package/dist/toolSurface.mjs +3 -0
- package/dist/transition.cjs +5 -0
- package/dist/transition.d.cjs +5 -0
- package/dist/transition.d.mts +2 -0
- package/dist/transition.mjs +2 -0
- package/dist/transitionClassifier.cjs +112 -0
- package/dist/transitionClassifier.cjs.map +1 -0
- package/dist/transitionClassifier.d.mts +18 -0
- package/dist/transitionClassifier.d.mts.map +1 -0
- package/dist/transitionClassifier.mjs +111 -0
- package/dist/transitionClassifier.mjs.map +1 -0
- package/dist/transitionCoordinator.cjs +131 -0
- package/dist/transitionCoordinator.cjs.map +1 -0
- package/dist/transitionCoordinator.d.mts +16 -0
- package/dist/transitionCoordinator.d.mts.map +1 -0
- package/dist/transitionCoordinator.mjs +130 -0
- package/dist/transitionCoordinator.mjs.map +1 -0
- package/dist/typesContextApi.cjs +0 -0
- package/dist/typesContextApi.d.mts +73 -0
- package/dist/typesContextApi.d.mts.map +1 -0
- package/dist/typesContextApi.mjs +1 -0
- package/dist/uiHub.cjs +5 -0
- package/dist/uiHub.d.mts +2 -0
- package/dist/uiHub.mjs +2 -0
- package/dist/v3Export.cjs +1004 -0
- package/dist/v3Export.cjs.map +1 -0
- package/dist/v3Export.d.mts +34 -0
- package/dist/v3Export.d.mts.map +1 -0
- package/dist/v3Export.mjs +1000 -0
- package/dist/v3Export.mjs.map +1 -0
- package/dist/voiceReloadHandoff.cjs +14 -0
- package/dist/voiceReloadHandoff.d.mts +4 -0
- package/dist/voiceReloadHandoff.mjs +4 -0
- package/dist/voiceTools.cjs +56 -0
- package/dist/voiceTools.d.mts +4 -0
- package/dist/voiceTools.mjs +4 -0
- package/dist/web.cjs +64 -0
- package/dist/web.d.mts +19 -0
- package/dist/web.mjs +13 -0
- package/dist/webCompositions.cjs +100 -0
- package/dist/webCompositions.cjs.map +1 -0
- package/dist/webCompositions.d.mts +20 -0
- package/dist/webCompositions.d.mts.map +1 -0
- package/dist/webCompositions.mjs +95 -0
- package/dist/webCompositions.mjs.map +1 -0
- package/dist/webTesting.cjs +14 -0
- package/dist/webTesting.d.mts +6 -0
- package/dist/webTesting.mjs +6 -0
- package/package.json +616 -0
|
@@ -0,0 +1,904 @@
|
|
|
1
|
+
import "./src/constants/contextApi.mjs";
|
|
2
|
+
import { harnessErrorMessage } from "./src/server/harnessErrorMessage.mjs";
|
|
3
|
+
import { readContextDetail } from "./contextDetailStore.mjs";
|
|
4
|
+
import { observe } from "./serverTelemetry.mjs";
|
|
5
|
+
import { DOOM_API_CALLER_HEADERS, DOOM_API_CALLER_LOCALITY_HEADER, DOOM_API_CALLER_STEP_UP_HEADER, parseDoomSocketPath } from "./src/schemas/packageApi.mjs";
|
|
6
|
+
import { createSessionMcpActivityStore } from "./src/services/sessionMcpActivity/index.mjs";
|
|
7
|
+
import { createSessionMcpConversationStore } from "./src/services/sessionMcpConversations/index.mjs";
|
|
8
|
+
import { createSessionMcpRegistrationStore } from "./src/services/sessionMcpRegistrationStore/index.mjs";
|
|
9
|
+
import { createContextApi } from "./runtimeContextApi.mjs";
|
|
10
|
+
import { createHeadlessProtocol } from "./src/server/headlessProtocol.mjs";
|
|
11
|
+
import { createSessionMcpRoutes, isPublicSessionMcpRoute, isSessionMcpHostRoute } from "./src/server/sessionMcpRoutes.mjs";
|
|
12
|
+
import fs from "node:fs";
|
|
13
|
+
import os from "node:os";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
|
|
16
|
+
import { createServer } from "node:http";
|
|
17
|
+
import { Readable } from "node:stream";
|
|
18
|
+
import { pipeline } from "node:stream/promises";
|
|
19
|
+
import { WebSocketServer } from "ws";
|
|
20
|
+
//#region src/server/headlessServer.ts
|
|
21
|
+
/**
|
|
22
|
+
* The canonical public shape of a package API request, as dispatch reads it.
|
|
23
|
+
*
|
|
24
|
+
* Groups: workspace id, session id, plugin base path, and the remainder handed
|
|
25
|
+
* to the package. `settings` is the host's own API and sits beside `plugins`
|
|
26
|
+
* rather than under it.
|
|
27
|
+
*
|
|
28
|
+
* Exported so the browser's URL construction can be pinned against it. The two
|
|
29
|
+
* are written independently, in halves of this package that may not import each
|
|
30
|
+
* other, and a disagreement between them is not a 404 from the route: the
|
|
31
|
+
* service worker answers an unrecognised path out of the signed bundle cache,
|
|
32
|
+
* so the symptom appears nowhere near the cause.
|
|
33
|
+
*/
|
|
34
|
+
const DOOM_PACKAGE_API_PATH_PATTERN = /^\/api(?:\/workspaces\/([^/]+)(?:\/sessions\/([^/]+))?)?\/(?:plugins\/([^/]+)|settings)(?:\/(.*))?$/u;
|
|
35
|
+
const HEALTH_ROLE = "hub";
|
|
36
|
+
const PROTOCOL_VERSION = 1;
|
|
37
|
+
const MAX_BODY_BYTES = 8388608;
|
|
38
|
+
const MAX_SESSION_FILE_BYTES = 26214400;
|
|
39
|
+
const DIRECTORY_SUGGESTION_LIMIT = 12;
|
|
40
|
+
const DIRECTORY_CHILDREN_LIMIT = 500;
|
|
41
|
+
const HOME_PREFIX = "~";
|
|
42
|
+
const WORKSPACE_NAME_MAX_LENGTH = 80;
|
|
43
|
+
const WORKSPACE_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9 ._-]*$/u;
|
|
44
|
+
const SESSION_FILE_CONTENT_TYPES = {
|
|
45
|
+
".avif": "image/avif",
|
|
46
|
+
".bmp": "image/bmp",
|
|
47
|
+
".gif": "image/gif",
|
|
48
|
+
".jpeg": "image/jpeg",
|
|
49
|
+
".jpg": "image/jpeg",
|
|
50
|
+
".png": "image/png",
|
|
51
|
+
".svg": "image/svg+xml",
|
|
52
|
+
".webp": "image/webp",
|
|
53
|
+
".m4v": "video/mp4",
|
|
54
|
+
".mov": "video/quicktime",
|
|
55
|
+
".mp4": "video/mp4",
|
|
56
|
+
".webm": "video/webm",
|
|
57
|
+
".pdf": "application/pdf"
|
|
58
|
+
};
|
|
59
|
+
function sessionView(session) {
|
|
60
|
+
return {
|
|
61
|
+
id: session.id,
|
|
62
|
+
workspaceId: session.workspaceId,
|
|
63
|
+
webComposition: session.webComposition,
|
|
64
|
+
name: session.name,
|
|
65
|
+
cwd: session.cwd,
|
|
66
|
+
createdAt: session.createdAt,
|
|
67
|
+
updatedAt: session.updatedAt ?? session.createdAt,
|
|
68
|
+
phase: session.phase ?? "idle",
|
|
69
|
+
phaseSince: session.phaseSince ?? session.createdAt,
|
|
70
|
+
attach: "attached",
|
|
71
|
+
pendingMessageCount: session.pendingMessageCount ?? 0,
|
|
72
|
+
everPrompted: session.everPrompted ?? false,
|
|
73
|
+
awaitingInput: session.awaitingInput ?? false,
|
|
74
|
+
...session.lastSettledAt === void 0 ? {} : { lastSettledAt: session.lastSettledAt },
|
|
75
|
+
...session.git === void 0 ? {} : { git: { ...session.git } },
|
|
76
|
+
...session.profile === void 0 ? {} : { profile: { ...session.profile } },
|
|
77
|
+
...session.parentSessionId === void 0 ? {} : { parentSessionId: session.parentSessionId },
|
|
78
|
+
...session.sessionProvenance === void 0 ? {} : { sessionProvenance: session.sessionProvenance },
|
|
79
|
+
...session.pendingSetups === void 0 ? {} : { pendingSetups: session.pendingSetups }
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** The dormant counterpart of `sessionView`; same shape, no runtime behind it. */
|
|
83
|
+
function dormantView(record) {
|
|
84
|
+
return {
|
|
85
|
+
id: record.sessionId,
|
|
86
|
+
workspaceId: record.workspaceId,
|
|
87
|
+
name: record.name,
|
|
88
|
+
cwd: record.cwd,
|
|
89
|
+
createdAt: record.createdAt,
|
|
90
|
+
updatedAt: record.createdAt,
|
|
91
|
+
phase: "idle",
|
|
92
|
+
phaseSince: record.createdAt,
|
|
93
|
+
attach: "detached",
|
|
94
|
+
pendingMessageCount: 0,
|
|
95
|
+
everPrompted: false,
|
|
96
|
+
awaitingInput: false,
|
|
97
|
+
dormant: true,
|
|
98
|
+
...record.parentSessionId === void 0 ? {} : { parentSessionId: record.parentSessionId },
|
|
99
|
+
...record.sessionProvenance === void 0 ? {} : { sessionProvenance: record.sessionProvenance }
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function json(response, status, value) {
|
|
103
|
+
const body = JSON.stringify(value);
|
|
104
|
+
response.writeHead(status, {
|
|
105
|
+
"content-type": "application/json; charset=utf-8",
|
|
106
|
+
"content-length": Buffer.byteLength(body)
|
|
107
|
+
});
|
|
108
|
+
response.end(body);
|
|
109
|
+
}
|
|
110
|
+
function authorized(request, token) {
|
|
111
|
+
if (token === void 0) return true;
|
|
112
|
+
const authorization = request.headers.authorization;
|
|
113
|
+
if (authorization?.startsWith("Bearer ") && authorization.slice(7) === token) return true;
|
|
114
|
+
const header = request.headers["x-doompi-token"];
|
|
115
|
+
if (typeof header === "string" && header === token) return true;
|
|
116
|
+
try {
|
|
117
|
+
return new URL(request.url ?? "/", "http://doompi.local").searchParams.get("token") === token;
|
|
118
|
+
} catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function requestPath(request) {
|
|
123
|
+
return new URL(request.url ?? "/", "http://doompi.local");
|
|
124
|
+
}
|
|
125
|
+
function parseTranscriptRequest(url) {
|
|
126
|
+
const request = {};
|
|
127
|
+
const cursor = url.searchParams.get("cursor");
|
|
128
|
+
const direction = url.searchParams.get("direction");
|
|
129
|
+
const limit = url.searchParams.get("limit");
|
|
130
|
+
if (cursor !== null) request.cursor = cursor;
|
|
131
|
+
if (direction !== null) {
|
|
132
|
+
if (direction !== "older" && direction !== "newer") throw new Error("Invalid transcript direction");
|
|
133
|
+
request.direction = direction;
|
|
134
|
+
}
|
|
135
|
+
if (limit !== null) {
|
|
136
|
+
if (!/^\d+$/u.test(limit)) throw new Error("Invalid transcript page limit");
|
|
137
|
+
const parsed = Number(limit);
|
|
138
|
+
if (!Number.isSafeInteger(parsed) || parsed < 1 || parsed > 100) throw new Error("Invalid transcript page limit");
|
|
139
|
+
request.limit = parsed;
|
|
140
|
+
}
|
|
141
|
+
return request;
|
|
142
|
+
}
|
|
143
|
+
async function sessionFile(session, relativePath) {
|
|
144
|
+
if (!relativePath || relativePath.includes("\0") || path.isAbsolute(relativePath)) return Response.json({ error: "Invalid session file path." }, { status: 400 });
|
|
145
|
+
let root;
|
|
146
|
+
let filePath;
|
|
147
|
+
try {
|
|
148
|
+
root = await fs.promises.realpath(session.cwd);
|
|
149
|
+
filePath = await fs.promises.realpath(path.resolve(root, relativePath));
|
|
150
|
+
} catch {
|
|
151
|
+
return Response.json({ error: "Session file not found." }, { status: 404 });
|
|
152
|
+
}
|
|
153
|
+
const contained = path.relative(root, filePath);
|
|
154
|
+
if (contained === ".." || contained.startsWith(`..${path.sep}`) || path.isAbsolute(contained)) return Response.json({ error: "Session file is outside the working directory." }, { status: 403 });
|
|
155
|
+
let handle;
|
|
156
|
+
try {
|
|
157
|
+
handle = await fs.promises.open(filePath, "r");
|
|
158
|
+
} catch {
|
|
159
|
+
return Response.json({ error: "Session file not found." }, { status: 404 });
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const stat = await handle.stat();
|
|
163
|
+
if (!stat.isFile()) return Response.json({ error: "Session file not found." }, { status: 404 });
|
|
164
|
+
if (stat.size > MAX_SESSION_FILE_BYTES) return Response.json({ error: "Session file is too large." }, { status: 413 });
|
|
165
|
+
const bytes = await handle.readFile();
|
|
166
|
+
if (bytes.byteLength > MAX_SESSION_FILE_BYTES) return Response.json({ error: "Session file is too large." }, { status: 413 });
|
|
167
|
+
return new Response(bytes, { headers: {
|
|
168
|
+
"content-type": SESSION_FILE_CONTENT_TYPES[path.extname(filePath).toLowerCase()] ?? "application/octet-stream",
|
|
169
|
+
"content-length": String(bytes.byteLength),
|
|
170
|
+
"cache-control": "no-store",
|
|
171
|
+
"x-content-type-options": "nosniff"
|
|
172
|
+
} });
|
|
173
|
+
} finally {
|
|
174
|
+
await handle.close();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/** Expands a leading `~` the way a shell would, so typed paths match what the user sees in a terminal. */
|
|
178
|
+
function expandHome(value) {
|
|
179
|
+
if (value === HOME_PREFIX) return os.homedir();
|
|
180
|
+
return value.startsWith(`${HOME_PREFIX}${path.sep}`) ? path.join(os.homedir(), value.slice(2)) : value;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Validates an add-workspace request. A name alone asks for a new default folder,
|
|
184
|
+
* so it must be safe to use as one folder name.
|
|
185
|
+
*/
|
|
186
|
+
function parseWorkspaceAdmission(body) {
|
|
187
|
+
if (typeof body !== "object" || body === null) return { error: "A workspace root or name is required." };
|
|
188
|
+
const record = body;
|
|
189
|
+
if (record.root !== void 0 && typeof record.root !== "string") return { error: "The workspace root must be text." };
|
|
190
|
+
if (record.name !== void 0 && typeof record.name !== "string") return { error: "The workspace name must be text." };
|
|
191
|
+
const root = typeof record.root === "string" && record.root.trim() !== "" ? expandHome(record.root.trim()) : void 0;
|
|
192
|
+
const name = typeof record.name === "string" && record.name.trim() !== "" ? record.name.trim() : void 0;
|
|
193
|
+
if (root === void 0 && name === void 0) return { error: "A workspace root or name is required." };
|
|
194
|
+
if (name !== void 0 && (name.length > WORKSPACE_NAME_MAX_LENGTH || !WORKSPACE_NAME_PATTERN.test(name) || name.includes(".."))) return { error: `Workspace names use letters, numbers, spaces, dots, dashes, or underscores (up to ${String(WORKSPACE_NAME_MAX_LENGTH)} characters).` };
|
|
195
|
+
return {
|
|
196
|
+
...root === void 0 ? {} : { root },
|
|
197
|
+
...name === void 0 ? {} : { name }
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
async function directorySuggestions(query, sessions) {
|
|
201
|
+
const typed = expandHome(query.trim());
|
|
202
|
+
if (typed === "") return [];
|
|
203
|
+
const matches = (value) => value.toLowerCase().includes(typed.toLowerCase());
|
|
204
|
+
const known = [.../* @__PURE__ */ new Set([process.cwd(), ...sessions.map((session) => session.cwd)])].filter(matches);
|
|
205
|
+
const candidates = path.isAbsolute(typed) ? [typed] : typed.includes(path.sep) ? [path.resolve(process.cwd(), typed)] : [path.join(path.dirname(process.cwd()), typed), path.join(process.cwd(), typed)];
|
|
206
|
+
const completed = [];
|
|
207
|
+
for (const candidate of candidates) {
|
|
208
|
+
const drilling = typed.endsWith(path.sep);
|
|
209
|
+
const parent = drilling ? candidate : path.dirname(candidate);
|
|
210
|
+
const partial = drilling ? "" : path.basename(candidate).toLowerCase();
|
|
211
|
+
try {
|
|
212
|
+
const entries = await fs.promises.readdir(parent, { withFileTypes: true });
|
|
213
|
+
completed.push(...entries.filter((entry) => entry.isDirectory() && entry.name.toLowerCase().includes(partial)).map((entry) => path.join(parent, entry.name)));
|
|
214
|
+
} catch {}
|
|
215
|
+
}
|
|
216
|
+
return [.../* @__PURE__ */ new Set([...known, ...completed.sort((left, right) => left.localeCompare(right))])].slice(0, DIRECTORY_SUGGESTION_LIMIT);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Lists the visible child directories of one folder for the workspace folder browser.
|
|
220
|
+
* Resolves undefined for a relative, missing, or unreadable path.
|
|
221
|
+
*/
|
|
222
|
+
async function directoryChildren(requested) {
|
|
223
|
+
const directory = requested === null || requested.trim() === "" ? os.homedir() : expandHome(requested.trim());
|
|
224
|
+
if (!path.isAbsolute(directory)) return void 0;
|
|
225
|
+
const resolved = path.resolve(directory);
|
|
226
|
+
let entries;
|
|
227
|
+
try {
|
|
228
|
+
entries = await fs.promises.readdir(resolved, { withFileTypes: true });
|
|
229
|
+
} catch {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => path.join(resolved, entry.name)).sort((left, right) => left.localeCompare(right)).slice(0, DIRECTORY_CHILDREN_LIMIT);
|
|
233
|
+
const parent = path.dirname(resolved);
|
|
234
|
+
return {
|
|
235
|
+
path: resolved,
|
|
236
|
+
...parent === resolved ? {} : { parent },
|
|
237
|
+
directories
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
async function readBody(request) {
|
|
241
|
+
const chunks = [];
|
|
242
|
+
let size = 0;
|
|
243
|
+
for await (const chunk of request) {
|
|
244
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
245
|
+
size += buffer.byteLength;
|
|
246
|
+
if (size > MAX_BODY_BYTES) throw new Error("Request body is too large.");
|
|
247
|
+
chunks.push(buffer);
|
|
248
|
+
}
|
|
249
|
+
return Buffer.concat(chunks);
|
|
250
|
+
}
|
|
251
|
+
function parseJson(body) {
|
|
252
|
+
if (body.byteLength === 0) return {};
|
|
253
|
+
return JSON.parse(Buffer.from(body).toString("utf8"));
|
|
254
|
+
}
|
|
255
|
+
function webRequest(request, url, signal) {
|
|
256
|
+
const headers = new Headers();
|
|
257
|
+
for (const [name, value] of Object.entries(request.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
258
|
+
return new Request(url, {
|
|
259
|
+
method: request.method,
|
|
260
|
+
headers,
|
|
261
|
+
signal,
|
|
262
|
+
...request.method === "GET" || request.method === "HEAD" ? {} : {
|
|
263
|
+
body: Readable.toWeb(request),
|
|
264
|
+
duplex: "half"
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
async function writeResponse(response, result) {
|
|
269
|
+
response.writeHead(result.status, Object.fromEntries(result.headers.entries()));
|
|
270
|
+
if (result.body === null) {
|
|
271
|
+
response.end();
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
await pipeline(Readable.fromWeb(result.body), response);
|
|
275
|
+
}
|
|
276
|
+
function eventFrame(event) {
|
|
277
|
+
switch (event.kind) {
|
|
278
|
+
case "upsert": return {
|
|
279
|
+
type: "session_upsert",
|
|
280
|
+
session: sessionView(event.session)
|
|
281
|
+
};
|
|
282
|
+
case "removed": return {
|
|
283
|
+
type: "session_removed",
|
|
284
|
+
sessionId: event.sessionId
|
|
285
|
+
};
|
|
286
|
+
case "workspace_upsert": return {
|
|
287
|
+
type: "workspace_upsert",
|
|
288
|
+
workspace: event.workspace
|
|
289
|
+
};
|
|
290
|
+
case "workspace_removed": return {
|
|
291
|
+
type: "workspace_removed",
|
|
292
|
+
workspaceId: event.workspaceId
|
|
293
|
+
};
|
|
294
|
+
case "channel": return {
|
|
295
|
+
type: "channel_frame",
|
|
296
|
+
frameType: event.frameType,
|
|
297
|
+
sessionId: event.sessionId,
|
|
298
|
+
payload: event.payload,
|
|
299
|
+
...event.connectionId === void 0 ? {} : { connectionId: event.connectionId }
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function writeSse(response, event, value) {
|
|
304
|
+
response.write(`event: ${event}\ndata: ${JSON.stringify(value)}\n\n`);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Client-neutral HTTP and WebSocket boundary for the process-local headless hub.
|
|
308
|
+
* It deliberately delegates every session operation to HeadlessHub, so transport
|
|
309
|
+
* clients cannot create a second session backend or bypass its lifecycle.
|
|
310
|
+
*/
|
|
311
|
+
async function serveHeadlessServer(options) {
|
|
312
|
+
const clients = /* @__PURE__ */ new Set();
|
|
313
|
+
const scopedProtocols = /* @__PURE__ */ new Set();
|
|
314
|
+
const sse = /* @__PURE__ */ new Map();
|
|
315
|
+
const desktopAuthorized = (request) => {
|
|
316
|
+
const proof = request.headers["x-doompi-desktop"];
|
|
317
|
+
return typeof proof === "string" && options.headlessHub.computerUse?.authorize?.(new Headers({ "x-doompi-desktop": proof })) === true;
|
|
318
|
+
};
|
|
319
|
+
let closed = false;
|
|
320
|
+
const webSockets = new WebSocketServer({ noServer: true });
|
|
321
|
+
/**
|
|
322
|
+
* A recorded session is dormant exactly while the hub has no session for its
|
|
323
|
+
* id, so reviving one needs no bookkeeping beyond the hub itself.
|
|
324
|
+
*/
|
|
325
|
+
const dormant = () => (options.dormantSessions?.() ?? []).filter((record) => options.headlessHub.session(record.sessionId) === void 0);
|
|
326
|
+
const protocol = await createHeadlessProtocol({
|
|
327
|
+
hub: options.headlessHub,
|
|
328
|
+
telemetry: options.telemetry,
|
|
329
|
+
onNotice: options.onNotice,
|
|
330
|
+
dormantSessions: dormant
|
|
331
|
+
});
|
|
332
|
+
const sessionMcpStateDir = options.sessionMcpStateDir ?? fs.mkdtempSync(path.join(os.tmpdir(), "doompi-session-mcp-"));
|
|
333
|
+
const sessionMcp = createSessionMcpRoutes({
|
|
334
|
+
headlessHub: options.headlessHub,
|
|
335
|
+
publicOrigin: options.sessionMcpPublicOrigin ?? (() => void 0),
|
|
336
|
+
publicOriginRevision: options.sessionMcpPublicOriginRevision,
|
|
337
|
+
onNotice: options.onNotice,
|
|
338
|
+
isSessionPersisted: options.isSessionPersisted,
|
|
339
|
+
activityStore: createSessionMcpActivityStore(sessionMcpStateDir),
|
|
340
|
+
conversationStore: createSessionMcpConversationStore(sessionMcpStateDir),
|
|
341
|
+
registrationStore: createSessionMcpRegistrationStore({
|
|
342
|
+
stateDir: sessionMcpStateDir,
|
|
343
|
+
onNotice: options.onNotice
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
/** Sessions being restarted, keyed by id, settled once the reopen succeeds or fails. */
|
|
347
|
+
const restarting = /* @__PURE__ */ new Map();
|
|
348
|
+
const server = createServer((request, response) => {
|
|
349
|
+
handleRequest(request, response).catch((error) => {
|
|
350
|
+
if (response.headersSent) {
|
|
351
|
+
response.destroy();
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
options.onNotice?.(`Headless request failed: ${harnessErrorMessage(error)}`);
|
|
355
|
+
json(response, 500, { error: "Internal server error." });
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
const unsubscribe = options.headlessHub.onEvent((event) => {
|
|
359
|
+
const frame = eventFrame(event);
|
|
360
|
+
const sessionId = event.kind === "upsert" ? event.session.id : "sessionId" in event ? event.sessionId : void 0;
|
|
361
|
+
for (const [response, native] of sse) {
|
|
362
|
+
if (sessionId !== void 0 && options.headlessHub.computerUse?.ownsSession?.(sessionId) || frame.type === "computer_use_state") {
|
|
363
|
+
if (!native()) continue;
|
|
364
|
+
}
|
|
365
|
+
writeSse(response, String(frame.type), frame);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
async function handleRequest(request, response) {
|
|
369
|
+
const url = requestPath(request);
|
|
370
|
+
if (url.pathname === "/api/health" && request.method === "GET") {
|
|
371
|
+
json(response, 200, {
|
|
372
|
+
ok: true,
|
|
373
|
+
role: HEALTH_ROLE,
|
|
374
|
+
protocol: PROTOCOL_VERSION,
|
|
375
|
+
sessions: options.headlessHub.snapshot().length
|
|
376
|
+
});
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const scopedSession = /^\/api\/workspaces\/[^/]+\/sessions\/([^/]+)(?:\/|$)/u.exec(url.pathname)?.[1];
|
|
380
|
+
if (scopedSession && options.headlessHub.computerUse?.ownsSession?.(decodeURIComponent(scopedSession)) && !desktopAuthorized(request)) {
|
|
381
|
+
json(response, 404, { error: "This session belongs to its Desktop instance." });
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (isPublicSessionMcpRoute(request.method ?? "GET", url.pathname)) {
|
|
385
|
+
const sessionMcpAbort = new AbortController();
|
|
386
|
+
const abortSessionMcp = () => {
|
|
387
|
+
if (!response.writableEnded) sessionMcpAbort.abort();
|
|
388
|
+
};
|
|
389
|
+
response.once("close", abortSessionMcp);
|
|
390
|
+
const publicSessionMcp = await sessionMcp.handlePublic(webRequest(request, url, sessionMcpAbort.signal));
|
|
391
|
+
if (publicSessionMcp !== void 0) {
|
|
392
|
+
try {
|
|
393
|
+
await writeResponse(response, publicSessionMcp);
|
|
394
|
+
} finally {
|
|
395
|
+
response.off("close", abortSessionMcp);
|
|
396
|
+
}
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
response.off("close", abortSessionMcp);
|
|
400
|
+
}
|
|
401
|
+
if (!authorized(request, options.token)) {
|
|
402
|
+
json(response, 401, { error: "Unauthorized." });
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const reopening = scopedSession === void 0 ? void 0 : restarting.get(decodeURIComponent(scopedSession));
|
|
406
|
+
if (reopening !== void 0 && options.headlessHub.session(decodeURIComponent(scopedSession)) === void 0) await reopening;
|
|
407
|
+
if (isSessionMcpHostRoute(url.pathname)) {
|
|
408
|
+
const hostSessionMcp = await sessionMcp.handleHost(webRequest(request, url));
|
|
409
|
+
if (hostSessionMcp !== void 0) {
|
|
410
|
+
await writeResponse(response, hostSessionMcp);
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (url.pathname === "/api/remote" || url.pathname.startsWith("/api/remote/")) {
|
|
415
|
+
const headers = new Headers();
|
|
416
|
+
for (const [name, value] of Object.entries(request.headers)) if (value !== void 0 && name !== "authorization" && name !== "x-doompi-token") headers.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
417
|
+
await writeResponse(response, await options.headlessHub.requestApi({ scope: "global" }, "remote", new Request(`http://doompi.local${url.pathname.slice(11)}${url.search}`, {
|
|
418
|
+
method: request.method,
|
|
419
|
+
headers,
|
|
420
|
+
...request.method === "GET" || request.method === "HEAD" ? {} : { body: Buffer.from(await readBody(request)) }
|
|
421
|
+
})));
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (url.pathname === "/api/telemetry/browser" && request.method === "POST") {
|
|
425
|
+
const body = JSON.parse(new TextDecoder().decode(await readBody(request)));
|
|
426
|
+
if (body.v !== 1 || !Array.isArray(body.events) || body.events.length > 10) {
|
|
427
|
+
json(response, 400, { error: "Invalid browser telemetry batch." });
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
for (const event of body.events) {
|
|
431
|
+
if (!event || typeof event !== "object" || typeof event.name !== "string" || !/^web\.browser\.[a-z_]{1,40}$/u.test(event.name)) continue;
|
|
432
|
+
if (options.telemetry) observe(options.telemetry.recordEvent(event.name, {
|
|
433
|
+
...typeof event.duration_ms === "number" && Number.isFinite(event.duration_ms) && event.duration_ms >= 0 ? { duration_ms: event.duration_ms } : {},
|
|
434
|
+
...typeof event.count === "number" && Number.isFinite(event.count) && event.count >= 0 ? { count: event.count } : {}
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
json(response, 200, { ok: true });
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (url.pathname === "/api/compositions" && request.method === "GET") {
|
|
441
|
+
json(response, 200, options.compositions?.() ?? { workspaces: [] });
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
if ((url.pathname.startsWith("/api/web-plugins/") || url.pathname === "/bundle-manifest.json" || url.pathname.startsWith("/bundle-assets/")) && options.requestAsset) {
|
|
445
|
+
const result = await options.requestAsset(new Request(url, { method: request.method }));
|
|
446
|
+
if (result) {
|
|
447
|
+
await writeResponse(response, result);
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (url.pathname === "/api/directories/children" && request.method === "GET") {
|
|
452
|
+
const listing = await directoryChildren(url.searchParams.get("path"));
|
|
453
|
+
if (listing === void 0) json(response, 404, { error: "That folder cannot be read." });
|
|
454
|
+
else json(response, 200, listing);
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
if (url.pathname === "/api/directories" && request.method === "GET") {
|
|
458
|
+
json(response, 200, { directories: await directorySuggestions(url.searchParams.get("q") ?? "", options.headlessHub.snapshot()) });
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
if (url.pathname === "/api/sessions" && request.method === "POST") {
|
|
462
|
+
const body = parseJson(await readBody(request));
|
|
463
|
+
if (!body || typeof body !== "object" || !("cwd" in body) || typeof body.cwd !== "string" || !body.cwd.trim() || "name" in body && typeof body.name !== "string") {
|
|
464
|
+
json(response, 400, { error: "A session needs a working directory and an optional name." });
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
json(response, 201, { sessionId: (await options.headlessHub.sessionService.create({
|
|
468
|
+
cwd: body.cwd,
|
|
469
|
+
name: "name" in body ? String(body.name) : path.basename(body.cwd)
|
|
470
|
+
})).sessionId });
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const workspaceSessions = /^\/api\/workspaces\/([^/]+)\/sessions$/u.exec(url.pathname);
|
|
474
|
+
if (workspaceSessions) {
|
|
475
|
+
const workspaceId = decodeURIComponent(workspaceSessions[1]);
|
|
476
|
+
const workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);
|
|
477
|
+
if (!workspace) {
|
|
478
|
+
json(response, 404, { error: "Workspace not found." });
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (request.method === "GET") {
|
|
482
|
+
json(response, 200, { sessions: [...options.headlessHub.snapshot().filter((session) => session.workspaceId === workspaceId).map(sessionView), ...dormant().filter((record) => record.workspaceId === workspaceId).map(dormantView)] });
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
if (request.method === "POST") {
|
|
486
|
+
if (workspace.available === false) {
|
|
487
|
+
json(response, 409, { error: "Workspace is unavailable." });
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const body = parseJson(await readBody(request));
|
|
491
|
+
if (!body || typeof body !== "object" || "name" in body && typeof body.name !== "string") {
|
|
492
|
+
json(response, 400, { error: "A session accepts an optional name." });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
json(response, 201, { sessionId: (await options.headlessHub.sessionService.create({
|
|
496
|
+
cwd: workspace.root,
|
|
497
|
+
name: "name" in body ? String(body.name) : path.basename(workspace.root)
|
|
498
|
+
})).sessionId });
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
if (url.pathname === "/api/events" && request.method === "GET") {
|
|
503
|
+
response.writeHead(200, {
|
|
504
|
+
"cache-control": "no-cache",
|
|
505
|
+
connection: "keep-alive",
|
|
506
|
+
"content-type": "text/event-stream; charset=utf-8"
|
|
507
|
+
});
|
|
508
|
+
sse.set(response, () => desktopAuthorized(request));
|
|
509
|
+
response.on("close", () => sse.delete(response));
|
|
510
|
+
writeSse(response, "sessions_snapshot", {
|
|
511
|
+
type: "sessions_snapshot",
|
|
512
|
+
sessions: [...options.headlessHub.snapshot().filter((session) => !options.headlessHub.computerUse?.ownsSession?.(session.id) || desktopAuthorized(request)).map(sessionView), ...dormant().map(dormantView)]
|
|
513
|
+
});
|
|
514
|
+
writeSse(response, "workspaces_snapshot", {
|
|
515
|
+
type: "workspaces_snapshot",
|
|
516
|
+
workspaces: options.headlessHub.workspaces()
|
|
517
|
+
});
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (url.pathname === "/api/workspaces") {
|
|
521
|
+
if (request.method === "GET") {
|
|
522
|
+
json(response, 200, { workspaces: options.headlessHub.workspaces() });
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
if (request.method === "POST") {
|
|
526
|
+
const admission = parseWorkspaceAdmission(parseJson(await readBody(request)));
|
|
527
|
+
if ("error" in admission) {
|
|
528
|
+
json(response, 400, admission);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
let workspace;
|
|
532
|
+
try {
|
|
533
|
+
workspace = await options.headlessHub.admitWorkspace(admission);
|
|
534
|
+
} catch (error) {
|
|
535
|
+
json(response, 422, { error: error instanceof Error ? error.message : String(error) });
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
json(response, 201, { workspace });
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const workspaceHistoryMatch = /^\/api\/workspaces\/([^/]+)\/history$/u.exec(url.pathname);
|
|
543
|
+
if (workspaceHistoryMatch && request.method === "GET" && options.workspaceHistory) {
|
|
544
|
+
const workspaceId = decodeURIComponent(workspaceHistoryMatch[1]);
|
|
545
|
+
const workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);
|
|
546
|
+
if (!workspace) {
|
|
547
|
+
json(response, 404, { error: "Workspace not found." });
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
if (workspace.available === false) {
|
|
551
|
+
json(response, 409, { error: "Workspace is unavailable." });
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
json(response, 200, { sessions: await options.workspaceHistory(workspaceId) });
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
const workspaceResumeMatch = /^\/api\/workspaces\/([^/]+)\/resume$/u.exec(url.pathname);
|
|
558
|
+
if (workspaceResumeMatch && request.method === "POST" && options.resumeWorkspaceSession) {
|
|
559
|
+
const workspaceId = decodeURIComponent(workspaceResumeMatch[1]);
|
|
560
|
+
const workspace = options.headlessHub.workspaces().find((entry) => entry.id === workspaceId);
|
|
561
|
+
if (!workspace) {
|
|
562
|
+
json(response, 404, { error: "Workspace not found." });
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (workspace.available === false) {
|
|
566
|
+
json(response, 409, { error: "Workspace is unavailable." });
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
const body = parseJson(await readBody(request));
|
|
570
|
+
const targetSessionId = body && typeof body === "object" && "targetSessionId" in body ? body.targetSessionId : void 0;
|
|
571
|
+
if (typeof targetSessionId !== "string" || !/^[A-Za-z0-9_-]+$/u.test(targetSessionId)) {
|
|
572
|
+
json(response, 400, { error: "Invalid target session id." });
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
json(response, 200, { sessionId: await options.resumeWorkspaceSession(workspaceId, targetSessionId) });
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const workspaceMatch = /^\/api\/workspaces\/([^/]+)$/u.exec(url.pathname);
|
|
579
|
+
if (workspaceMatch && request.method === "GET") {
|
|
580
|
+
const workspace = options.headlessHub.workspaces().find((entry) => entry.id === decodeURIComponent(workspaceMatch[1]));
|
|
581
|
+
json(response, workspace ? 200 : 404, workspace ? { workspace } : { error: "Workspace not found." });
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (workspaceMatch && request.method === "DELETE") {
|
|
585
|
+
const id = decodeURIComponent(workspaceMatch[1]);
|
|
586
|
+
if (!options.headlessHub.workspaces().some((workspace) => workspace.id === id)) {
|
|
587
|
+
json(response, 404, { error: "Workspace not found." });
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (options.headlessHub.snapshot().some((session) => session.workspaceId === id) || dormant().some((session) => session.workspaceId === id)) {
|
|
591
|
+
json(response, 409, { error: "Workspace still has sessions." });
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
await options.headlessHub.removeWorkspace(id);
|
|
595
|
+
json(response, 200, { ok: true });
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
const pluginMatch = DOOM_PACKAGE_API_PATH_PATTERN.exec(url.pathname);
|
|
599
|
+
if (pluginMatch !== null && request.method !== "CONNECT") {
|
|
600
|
+
const workspaceId = pluginMatch[1] === void 0 ? void 0 : decodeURIComponent(pluginMatch[1]);
|
|
601
|
+
const sessionId = pluginMatch[2] === void 0 ? void 0 : decodeURIComponent(pluginMatch[2]);
|
|
602
|
+
if (workspaceId !== void 0 && !options.headlessHub.workspaces().some((entry) => entry.id === workspaceId)) {
|
|
603
|
+
json(response, 404, { error: "Workspace not found." });
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (sessionId !== void 0 && options.headlessHub.session(sessionId)?.workspaceId !== workspaceId) {
|
|
607
|
+
if (dormant().some((record) => record.sessionId === sessionId && record.workspaceId === workspaceId) && pluginMatch[3] === "context" && request.method === "GET") {
|
|
608
|
+
const detail = await createContextApi({
|
|
609
|
+
sessionId,
|
|
610
|
+
environment: process.env
|
|
611
|
+
}).fetch(new Request(`http://doompi.local/${pluginMatch[4] ?? ""}${url.search}`));
|
|
612
|
+
const body = await detail.json();
|
|
613
|
+
if (readContextDetail(sessionId, process.env) === void 0) json(response, 404, { error: "This session is stopped. Wake it to read this item." });
|
|
614
|
+
else json(response, detail.status, body);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
json(response, 404, { error: "Session not found." });
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const mount = sessionId !== void 0 ? {
|
|
621
|
+
scope: "session",
|
|
622
|
+
sessionId
|
|
623
|
+
} : workspaceId !== void 0 ? {
|
|
624
|
+
scope: "workspace",
|
|
625
|
+
workspaceId
|
|
626
|
+
} : { scope: "global" };
|
|
627
|
+
const basePath = pluginMatch[3] === void 0 ? "settings" : decodeURIComponent(pluginMatch[3]);
|
|
628
|
+
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(basePath)) {
|
|
629
|
+
json(response, 400, { error: "Invalid package API base path." });
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
if (pluginMatch[3] === "settings" || sessionId !== void 0 && basePath === "settings") {
|
|
633
|
+
json(response, 404, { error: "Not found." });
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
const headers = new Headers();
|
|
637
|
+
const trustedCaller = options.token !== void 0 && authorized(request, options.token);
|
|
638
|
+
for (const [name, value] of Object.entries(request.headers)) if (value !== void 0 && ![
|
|
639
|
+
"host",
|
|
640
|
+
"authorization",
|
|
641
|
+
"x-doompi-token"
|
|
642
|
+
].includes(name) && (trustedCaller || !DOOM_API_CALLER_HEADERS.includes(name))) headers.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
643
|
+
if (!trustedCaller) {
|
|
644
|
+
headers.set(DOOM_API_CALLER_LOCALITY_HEADER, "local");
|
|
645
|
+
headers.set(DOOM_API_CALLER_STEP_UP_HEADER, "not-required");
|
|
646
|
+
}
|
|
647
|
+
const abort = new AbortController();
|
|
648
|
+
const disconnected = () => {
|
|
649
|
+
if (!response.writableEnded) abort.abort();
|
|
650
|
+
};
|
|
651
|
+
response.once("close", disconnected);
|
|
652
|
+
try {
|
|
653
|
+
const started = performance.now();
|
|
654
|
+
const attributes = {
|
|
655
|
+
scope: mount.scope,
|
|
656
|
+
"plugin.name": basePath,
|
|
657
|
+
"http.operation": request.method,
|
|
658
|
+
...mount.scope === "workspace" ? { "workspace.id": mount.workspaceId } : {},
|
|
659
|
+
...mount.scope === "session" ? { "session.id": mount.sessionId } : {}
|
|
660
|
+
};
|
|
661
|
+
const dispatch = async () => options.headlessHub.requestApi(mount, basePath, new Request(`http://doompi.local/${pluginMatch[4] ?? ""}${url.search}`, {
|
|
662
|
+
method: request.method,
|
|
663
|
+
headers,
|
|
664
|
+
signal: abort.signal,
|
|
665
|
+
...request.method === "GET" || request.method === "HEAD" ? {} : { body: Buffer.from(await readBody(request)) }
|
|
666
|
+
}));
|
|
667
|
+
const result = options.telemetry ? await options.telemetry.runInSpan("doompi_server.plugin.request", attributes, dispatch) : await dispatch();
|
|
668
|
+
if (options.telemetry) observe(options.telemetry.recordEvent("doompi_server.plugin.response", {
|
|
669
|
+
...attributes,
|
|
670
|
+
status: result.status,
|
|
671
|
+
durationMs: performance.now() - started
|
|
672
|
+
}), options.onNotice);
|
|
673
|
+
await writeResponse(response, result);
|
|
674
|
+
} finally {
|
|
675
|
+
response.off("close", disconnected);
|
|
676
|
+
}
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const sessionMatch = /^\/api\/workspaces\/([^/]+)\/sessions\/([^/]+)(?:\/(.*))?$/u.exec(url.pathname);
|
|
680
|
+
if (sessionMatch === null) {
|
|
681
|
+
json(response, 404, { error: "Not found." });
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
const sessionId = decodeURIComponent(sessionMatch[2]);
|
|
685
|
+
const workspaceId = decodeURIComponent(sessionMatch[1]);
|
|
686
|
+
const session = options.headlessHub.session(sessionId);
|
|
687
|
+
const suffix = sessionMatch[3] === void 0 ? "" : `/${sessionMatch[3]}`;
|
|
688
|
+
if (suffix === "/transcript" && request.method === "GET" && options.readDormantTranscript) {
|
|
689
|
+
const record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);
|
|
690
|
+
if (record === void 0) {
|
|
691
|
+
json(response, 404, { error: "Dormant session not found." });
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
694
|
+
let transcriptRequest;
|
|
695
|
+
try {
|
|
696
|
+
transcriptRequest = parseTranscriptRequest(url);
|
|
697
|
+
} catch (error) {
|
|
698
|
+
json(response, 400, { error: error instanceof Error ? error.message : "Invalid transcript request." });
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
try {
|
|
702
|
+
json(response, 200, await options.readDormantTranscript(record, transcriptRequest, BACKGROUND_CONTEXT));
|
|
703
|
+
} catch (error) {
|
|
704
|
+
const status = (error instanceof Error ? error.message : String(error)) === "STALE_TRANSCRIPT_CURSOR" ? 409 : 422;
|
|
705
|
+
json(response, status, { error: status === 409 ? "STALE_TRANSCRIPT_CURSOR" : "Saved transcript is unavailable." });
|
|
706
|
+
}
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
if (sessionMatch[3] === "revive" && request.method === "POST" && options.reviveSession) {
|
|
710
|
+
const record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);
|
|
711
|
+
if (record === void 0) {
|
|
712
|
+
json(response, 404, { error: "Dormant session not found." });
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
await options.reviveSession(record);
|
|
716
|
+
json(response, 200, { ok: true });
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
if (session === void 0 || session.workspaceId !== workspaceId) {
|
|
720
|
+
const record = dormant().find((candidate) => candidate.sessionId === sessionId && candidate.workspaceId === workspaceId);
|
|
721
|
+
if (request.method === "DELETE" && record !== void 0 && options.removeDormantSession !== void 0) {
|
|
722
|
+
sessionMcp.closeSessionBinding(record.sessionId);
|
|
723
|
+
await options.removeDormantSession(record);
|
|
724
|
+
options.headlessHub.notifySessionRemoved(record.sessionId);
|
|
725
|
+
json(response, 200, { ok: true });
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
json(response, 404, { error: "Session not found." });
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
if (suffix === "" && request.method === "GET") {
|
|
732
|
+
json(response, 200, sessionView(session));
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
if (suffix === "" && request.method === "DELETE") {
|
|
736
|
+
sessionMcp.closeSessionBinding(sessionId);
|
|
737
|
+
await options.headlessHub.closeSession(sessionId);
|
|
738
|
+
json(response, 200, { ok: true });
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
if (suffix === "/history" && request.method === "GET" && options.sessionHistory) {
|
|
742
|
+
json(response, 200, { sessions: await options.sessionHistory(session) });
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
if (suffix === "/avatar" && request.method === "GET") {
|
|
746
|
+
const avatar = options.headlessHub.sessionAvatar(sessionId);
|
|
747
|
+
if (avatar === void 0) {
|
|
748
|
+
json(response, 404, { error: "This session has no avatar." });
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
const current = url.searchParams.get("v") === session.profile?.iconVersion;
|
|
752
|
+
response.writeHead(200, {
|
|
753
|
+
"content-type": avatar.mimeType,
|
|
754
|
+
"content-length": String(avatar.bytes.byteLength),
|
|
755
|
+
"cache-control": current ? "private, max-age=31536000, immutable" : "no-store",
|
|
756
|
+
"x-content-type-options": "nosniff"
|
|
757
|
+
});
|
|
758
|
+
response.end(avatar.bytes);
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
if (suffix === "/file" && request.method === "GET") {
|
|
762
|
+
await writeResponse(response, await sessionFile(session, url.searchParams.get("path")));
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
if (suffix === "/restart" && request.method === "POST" && options.restartSession) {
|
|
766
|
+
const restart = options.restartSession(session);
|
|
767
|
+
const settled = restart.then(() => void 0, () => void 0);
|
|
768
|
+
restarting.set(sessionId, settled);
|
|
769
|
+
try {
|
|
770
|
+
await restart;
|
|
771
|
+
} finally {
|
|
772
|
+
if (restarting.get(sessionId) === settled) restarting.delete(sessionId);
|
|
773
|
+
}
|
|
774
|
+
json(response, 200, { ok: true });
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
if (suffix === "/resume" && request.method === "POST" && options.resumeSession) {
|
|
778
|
+
const body = parseJson(await readBody(request));
|
|
779
|
+
const targetSessionId = body && typeof body === "object" && "targetSessionId" in body ? body.targetSessionId : void 0;
|
|
780
|
+
if (typeof targetSessionId !== "string" || !/^[A-Za-z0-9_-]+$/u.test(targetSessionId)) {
|
|
781
|
+
json(response, 400, { error: "Invalid target session id." });
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (options.headlessHub.computerUse?.ownsSession?.(targetSessionId) && !desktopAuthorized(request)) {
|
|
785
|
+
json(response, 404, { error: "This session belongs to its Desktop instance." });
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
json(response, 200, { sessionId: await options.resumeSession(session, targetSessionId) });
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
if (suffix === "/channels" && request.method === "GET") {
|
|
792
|
+
json(response, 200, { channels: options.headlessHub.channelFrames(sessionId).filter((frame) => frame.type !== "computer_use_state" || desktopAuthorized(request)) });
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
const channelMatch = /^\/channel\/([^/]+)$/u.exec(suffix);
|
|
796
|
+
if (channelMatch !== null && request.method === "POST") {
|
|
797
|
+
const frameType = decodeURIComponent(channelMatch[1]);
|
|
798
|
+
const connectionId = request.headers["x-doompi-connection"];
|
|
799
|
+
options.headlessHub.receiveChannel(sessionId, frameType, parseJson(await readBody(request)), typeof connectionId === "string" ? connectionId : "http", desktopAuthorized(request));
|
|
800
|
+
json(response, 202, { ok: true });
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
json(response, 404, { error: "Not found." });
|
|
804
|
+
}
|
|
805
|
+
server.on("upgrade", (request, socket, head) => {
|
|
806
|
+
const url = requestPath(request);
|
|
807
|
+
const mount = parseDoomSocketPath(url.pathname);
|
|
808
|
+
if (!mount) {
|
|
809
|
+
socket.write("HTTP/1.1 404 Not Found\r\n\r\n");
|
|
810
|
+
socket.destroy();
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
if (!authorized(request, options.token)) {
|
|
814
|
+
socket.write("HTTP/1.1 401 Unauthorized\r\n\r\n");
|
|
815
|
+
socket.destroy();
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
if (mount.scope !== "global" && (!options.headlessHub.workspaces().some((entry) => entry.id === mount.workspaceId && entry.available !== false) || mount.scope === "session" && options.headlessHub.session(mount.sessionId)?.workspaceId !== mount.workspaceId)) {
|
|
819
|
+
socket.write("HTTP/1.1 404 Not Found\r\n\r\n");
|
|
820
|
+
socket.destroy();
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
(mount.scope === "global" && options.headlessHub.computerUse === void 0 ? Promise.resolve(protocol) : createHeadlessProtocol({
|
|
824
|
+
hub: options.headlessHub,
|
|
825
|
+
mount,
|
|
826
|
+
telemetry: options.telemetry,
|
|
827
|
+
onNotice: options.onNotice,
|
|
828
|
+
dormantSessions: dormant,
|
|
829
|
+
authorizeSession: (id) => !options.headlessHub.computerUse?.ownsSession?.(id) || desktopAuthorized(request),
|
|
830
|
+
authorizeDesktop: () => desktopAuthorized(request)
|
|
831
|
+
})).then(async (selected) => {
|
|
832
|
+
if (closed || socket.destroyed) {
|
|
833
|
+
if (selected !== protocol) await selected.close();
|
|
834
|
+
socket.destroy();
|
|
835
|
+
return;
|
|
836
|
+
}
|
|
837
|
+
if (selected !== protocol) {
|
|
838
|
+
scopedProtocols.add(selected);
|
|
839
|
+
socket.once("close", () => {
|
|
840
|
+
selected.close().finally(() => scopedProtocols.delete(selected));
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
webSockets.handleUpgrade(request, socket, head, (client) => {
|
|
844
|
+
webSockets.emit("connection", client, selected);
|
|
845
|
+
});
|
|
846
|
+
}).catch(() => {
|
|
847
|
+
socket.destroy();
|
|
848
|
+
});
|
|
849
|
+
});
|
|
850
|
+
webSockets.on("connection", (socket, selected) => {
|
|
851
|
+
const handler = selected.accept(socket);
|
|
852
|
+
if (!handler) return;
|
|
853
|
+
const client = {
|
|
854
|
+
socket,
|
|
855
|
+
handler
|
|
856
|
+
};
|
|
857
|
+
clients.add(client);
|
|
858
|
+
socket.on("message", (data) => {
|
|
859
|
+
if (Buffer.isBuffer(data)) handler.onData(data);
|
|
860
|
+
else if (Array.isArray(data)) handler.onData(Buffer.concat(data));
|
|
861
|
+
else handler.onData(new Uint8Array(data));
|
|
862
|
+
});
|
|
863
|
+
socket.on("close", () => {
|
|
864
|
+
clients.delete(client);
|
|
865
|
+
handler.onClose();
|
|
866
|
+
});
|
|
867
|
+
socket.on("error", (error) => handler.onError(error));
|
|
868
|
+
});
|
|
869
|
+
await new Promise((resolve, reject) => {
|
|
870
|
+
server.once("error", reject);
|
|
871
|
+
server.listen(options.port, options.host ?? "127.0.0.1", () => resolve());
|
|
872
|
+
});
|
|
873
|
+
const address = server.address();
|
|
874
|
+
if (address === null || typeof address === "string") {
|
|
875
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
876
|
+
throw new Error("The headless server did not expose a TCP address.");
|
|
877
|
+
}
|
|
878
|
+
return {
|
|
879
|
+
url: `http://${options.host ?? "127.0.0.1"}:${address.port}`,
|
|
880
|
+
sessionReservations: sessionMcp.reservations,
|
|
881
|
+
async close() {
|
|
882
|
+
if (closed) return;
|
|
883
|
+
closed = true;
|
|
884
|
+
unsubscribe();
|
|
885
|
+
for (const response of sse.keys()) response.end();
|
|
886
|
+
sse.clear();
|
|
887
|
+
for (const client of clients) client.socket.terminate();
|
|
888
|
+
clients.clear();
|
|
889
|
+
sessionMcp.close();
|
|
890
|
+
if (options.sessionMcpStateDir === void 0) await fs.promises.rm(sessionMcpStateDir, {
|
|
891
|
+
recursive: true,
|
|
892
|
+
force: true
|
|
893
|
+
});
|
|
894
|
+
await Promise.all([protocol.close(), ...[...scopedProtocols].map((selected) => selected.close())]);
|
|
895
|
+
webSockets.close();
|
|
896
|
+
server.closeAllConnections();
|
|
897
|
+
await new Promise((resolve, reject) => server.close((error) => error === void 0 ? resolve() : reject(error)));
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
//#endregion
|
|
902
|
+
export { DOOM_PACKAGE_API_PATH_PATTERN, serveHeadlessServer };
|
|
903
|
+
|
|
904
|
+
//# sourceMappingURL=headlessServer.mjs.map
|