@agimon-ai/po-core 0.0.0-alpha.21 → 0.0.0-alpha.210
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 -149
- package/NOTICE +1 -1
- package/README.md +40 -3
- package/dist/agentModel.cjs +4 -0
- package/dist/agentModel.d.mts +3 -1
- package/dist/agentModel.mjs +3 -1
- package/dist/apiContracts.cjs +631 -326
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1252 -149
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +626 -323
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/approval.cjs +17 -0
- package/dist/approval.d.mts +5 -0
- package/dist/approval.mjs +4 -0
- package/dist/backgroundWork.cjs +5 -0
- package/dist/backgroundWork.d.mts +2 -2
- package/dist/backgroundWork.mjs +1 -1
- package/dist/bundlePublicationWorker.cjs +30 -0
- package/dist/bundlePublicationWorker.cjs.map +1 -0
- package/dist/bundlePublicationWorker.d.mts +1 -0
- package/dist/bundlePublicationWorker.mjs +28 -0
- package/dist/bundlePublicationWorker.mjs.map +1 -0
- package/dist/childSession.d.mts +3 -2
- package/dist/clientDevices.cjs +4 -0
- package/dist/clientDevices.d.mts +3 -0
- package/dist/clientDevices.mjs +1 -0
- package/dist/clientMetadata.cjs +13 -0
- package/dist/clientMetadata.d.mts +4 -0
- package/dist/clientMetadata.mjs +3 -0
- package/dist/codemode.cjs +7 -0
- package/dist/codemode.d.mts +2 -0
- package/dist/codemode.mjs +1 -0
- package/dist/contextDetailStore.cjs +20 -12
- package/dist/contextDetailStore.cjs.map +1 -1
- package/dist/contextDetailStore.d.mts +7 -4
- package/dist/contextDetailStore.d.mts.map +1 -1
- package/dist/contextDetailStore.mjs +19 -11
- package/dist/contextDetailStore.mjs.map +1 -1
- package/dist/contextProjection.cjs +68 -8
- package/dist/contextProjection.cjs.map +1 -1
- package/dist/contextProjection.d.mts +34 -10
- package/dist/contextProjection.d.mts.map +1 -1
- package/dist/contextProjection.mjs +65 -9
- package/dist/contextProjection.mjs.map +1 -1
- package/dist/delegation.cjs +3 -0
- package/dist/delegation.d.mts +2 -2
- package/dist/delegation.mjs +1 -1
- package/dist/executionBudget.cjs +13 -5
- package/dist/executionBudget.cjs.map +1 -1
- package/dist/executionBudget.d.mts.map +1 -1
- package/dist/executionBudget.mjs +13 -5
- package/dist/executionBudget.mjs.map +1 -1
- package/dist/extensionFile.cjs +1 -2
- package/dist/extensionFile.d.mts +4 -4
- package/dist/extensionFile.mjs +3 -3
- package/dist/headless.cjs +22 -0
- package/dist/headless.d.mts +6 -2
- package/dist/headless.mjs +5 -1
- package/dist/headlessHub.cjs +941 -137
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.d.mts +133 -25
- package/dist/headlessHub.d.mts.map +1 -1
- package/dist/headlessHub.mjs +938 -135
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessProtocol.cjs +331 -74
- package/dist/headlessProtocol.cjs.map +1 -1
- package/dist/headlessProtocol.d.mts +29 -3
- package/dist/headlessProtocol.d.mts.map +1 -1
- package/dist/headlessProtocol.mjs +335 -79
- package/dist/headlessProtocol.mjs.map +1 -1
- package/dist/headlessServer.cjs +1057 -219
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.d.mts +140 -14
- package/dist/headlessServer.d.mts.map +1 -1
- package/dist/headlessServer.mjs +1057 -219
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/headlessSessionHost.d.mts +65 -24
- package/dist/headlessSessionHost.d.mts.map +1 -1
- package/dist/headlessSessionManager.cjs +23 -16
- package/dist/headlessSessionManager.cjs.map +1 -1
- package/dist/headlessSessionManager.d.mts +1 -1
- package/dist/headlessSessionManager.d.mts.map +1 -1
- package/dist/headlessSessionManager.mjs +23 -16
- package/dist/headlessSessionManager.mjs.map +1 -1
- package/dist/help.cjs +6 -0
- package/dist/help.d.mts +2 -2
- package/dist/help.mjs +2 -2
- package/dist/history.cjs +7 -0
- package/dist/history.d.mts +5 -3
- package/dist/history.mjs +5 -2
- package/dist/historyOwnership.cjs +100 -71
- package/dist/historyOwnership.cjs.map +1 -1
- package/dist/historyOwnership.d.mts.map +1 -1
- package/dist/historyOwnership.mjs +103 -75
- package/dist/historyOwnership.mjs.map +1 -1
- package/dist/hubChannel.cjs +32 -0
- package/dist/hubChannel.d.mts +5 -3
- package/dist/hubChannel.mjs +5 -3
- package/dist/images.cjs +15 -0
- package/dist/images.d.mts +2 -0
- package/dist/images.mjs +1 -0
- package/dist/index.cjs +27 -0
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +7 -3
- package/dist/inputTemplate.cjs +5 -0
- package/dist/inputTemplate.d.mts +3 -0
- package/dist/inputTemplate.mjs +1 -0
- package/dist/interop/piCodingAgent.mjs +1 -0
- package/dist/lintReview.cjs +4 -0
- package/dist/lintReview.d.mts +2 -0
- package/dist/lintReview.mjs +1 -0
- package/dist/locale.cjs +19 -0
- package/dist/locale.d.mts +3 -0
- package/dist/locale.mjs +3 -0
- package/dist/machineApi.cjs +30 -81
- package/dist/machineApi.cjs.map +1 -1
- package/dist/machineApi.d.mts +1 -1
- package/dist/machineApi.d.mts.map +1 -1
- package/dist/machineApi.mjs +30 -79
- package/dist/machineApi.mjs.map +1 -1
- package/dist/main.cjs +6 -1
- package/dist/main.d.mts +3 -3
- package/dist/main.mjs +3 -3
- package/dist/mcp.cjs +7 -0
- package/dist/mcp.d.mts +2 -0
- package/dist/mcp.mjs +1 -0
- package/dist/mcpProjection.cjs +1 -0
- package/dist/mcpProjection.d.mts +2 -2
- package/dist/mcpProjection.mjs +1 -1
- package/dist/mcpSchemaCost.cjs +10 -10
- package/dist/mcpSchemaCost.cjs.map +1 -1
- package/dist/mcpSchemaCost.mjs +9 -9
- package/dist/mcpSchemaCost.mjs.map +1 -1
- package/dist/modelGateway.cjs +33 -0
- package/dist/modelGateway.d.mts +13 -0
- package/dist/modelGateway.mjs +10 -0
- package/dist/moduleResolution.cjs +18 -18
- package/dist/moduleResolution.cjs.map +1 -1
- package/dist/moduleResolution.d.mts +4 -4
- package/dist/moduleResolution.d.mts.map +1 -1
- package/dist/moduleResolution.mjs +17 -17
- package/dist/moduleResolution.mjs.map +1 -1
- package/dist/native.cjs +99 -13
- package/dist/native.d.mts +26 -9
- package/dist/native.mjs +20 -4
- package/dist/nodePlatform.cjs +42 -4
- package/dist/nodePlatform.cjs.map +1 -1
- package/dist/nodePlatform.d.mts +5 -0
- package/dist/nodePlatform.d.mts.map +1 -1
- package/dist/nodePlatform.mjs +42 -5
- package/dist/nodePlatform.mjs.map +1 -1
- package/dist/notification.cjs +1 -0
- package/dist/notification.d.mts +2 -2
- package/dist/notification.mjs +1 -1
- package/dist/operationHook.cjs +3 -0
- package/dist/operationHook.d.mts +2 -0
- package/dist/operationHook.mjs +1 -0
- package/dist/packageApi.cjs +9 -0
- package/dist/packageApi.d.mts +4 -2
- package/dist/packageApi.mjs +3 -2
- package/dist/packageApiServer.cjs +148 -40
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.d.mts +34 -6
- package/dist/packageApiServer.d.mts.map +1 -1
- package/dist/packageApiServer.mjs +140 -36
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/pairingPage.cjs +6 -0
- package/dist/pairingPage.d.mts +2 -0
- package/dist/pairingPage.mjs +1 -0
- package/dist/personTimeZone.cjs +7 -0
- package/dist/personTimeZone.d.mts +2 -0
- package/dist/personTimeZone.mjs +1 -0
- package/dist/piSettings.cjs +2 -0
- package/dist/piSettings.d.mts +3 -3
- package/dist/piSettings.mjs +3 -3
- package/dist/platform.cjs +47 -2
- package/dist/platform.d.mts +11 -6
- package/dist/platform.mjs +11 -6
- package/dist/pluginProtocol.cjs +15 -0
- package/dist/pluginProtocol.d.mts +2 -2
- package/dist/pluginProtocol.mjs +1 -1
- package/dist/po-runtime-identity.json +1 -0
- package/dist/protocolTransport.cjs +7 -0
- package/dist/protocolTransport.d.mts +3 -0
- package/dist/protocolTransport.mjs +3 -0
- package/dist/providerAuth.cjs +8 -0
- package/dist/providerAuth.d.mts +4 -0
- package/dist/providerAuth.mjs +3 -0
- package/dist/remoteChildSession.cjs +6 -0
- package/dist/remoteChildSession.d.mts +3 -0
- package/dist/remoteChildSession.mjs +1 -0
- package/dist/remoteContract.cjs +42 -0
- package/dist/remoteContract.d.mts +4 -0
- package/dist/remoteContract.mjs +3 -0
- package/dist/remoteOrigin.cjs +4 -0
- package/dist/remoteOrigin.d.mts +2 -0
- package/dist/remoteOrigin.mjs +1 -0
- package/dist/runtimeContextApi.cjs +1 -1
- package/dist/runtimeContextApi.cjs.map +1 -1
- package/dist/runtimeContextApi.mjs +1 -1
- package/dist/runtimeContextApi.mjs.map +1 -1
- package/dist/runtimeCordisHost.cjs +9 -8
- package/dist/runtimeCordisHost.cjs.map +1 -1
- package/dist/runtimeCordisHost.d.mts +1 -1
- package/dist/runtimeCordisHost.d.mts.map +1 -1
- package/dist/runtimeCordisHost.mjs +3 -2
- package/dist/runtimeCordisHost.mjs.map +1 -1
- package/dist/runtimeEnvironment.cjs +6 -0
- package/dist/runtimeEnvironment.d.mts +2 -0
- package/dist/runtimeEnvironment.mjs +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts.map +1 -1
- package/dist/runtimeIdentity.cjs.map +1 -1
- package/dist/runtimeIdentity.d.mts +1 -1
- package/dist/runtimeIdentity.mjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.cjs +4 -4
- package/dist/runtimeLogSinkTelemetry.cjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.d.mts +4 -3
- package/dist/runtimeLogSinkTelemetry.d.mts.map +1 -1
- package/dist/runtimeLogSinkTelemetry.mjs +4 -4
- package/dist/runtimeLogSinkTelemetry.mjs.map +1 -1
- package/dist/runtimePackages.cjs +27 -22
- package/dist/runtimePackages.cjs.map +1 -1
- package/dist/runtimePackages.d.mts +9 -1
- package/dist/runtimePackages.d.mts.map +1 -1
- package/dist/runtimePackages.mjs +26 -21
- package/dist/runtimePackages.mjs.map +1 -1
- package/dist/runtimePiSettings.cjs +2 -0
- package/dist/runtimePiSettings.d.mts +3 -3
- package/dist/runtimePiSettings.mjs +3 -3
- package/dist/runtimeTransition.cjs.map +1 -1
- package/dist/runtimeTransition.d.mts +7 -7
- package/dist/runtimeTransition.d.mts.map +1 -1
- package/dist/runtimeTransition.mjs.map +1 -1
- package/dist/sandboxIdentity.cjs +5 -0
- package/dist/sandboxIdentity.d.mts +2 -0
- package/dist/sandboxIdentity.mjs +1 -0
- package/dist/server.d.mts +3 -3
- package/dist/serverPlugin.cjs +45 -6
- package/dist/serverPlugin.d.mts +18 -5
- package/dist/serverPlugin.mjs +16 -3
- package/dist/serverTelemetry.cjs +2 -2
- package/dist/serverTelemetry.cjs.map +1 -1
- package/dist/serverTelemetry.d.mts +2 -1
- package/dist/serverTelemetry.d.mts.map +1 -1
- package/dist/serverTelemetry.mjs +1 -1
- package/dist/serverTelemetry.mjs.map +1 -1
- package/dist/sessionFilesApi.cjs +17 -6
- package/dist/sessionFilesApi.cjs.map +1 -1
- package/dist/sessionFilesApi.d.mts.map +1 -1
- package/dist/sessionFilesApi.mjs +17 -6
- package/dist/sessionFilesApi.mjs.map +1 -1
- package/dist/sessionMcpContract.cjs +18 -0
- package/dist/sessionMcpContract.d.mts +5 -0
- package/dist/sessionMcpContract.mjs +1 -0
- package/dist/sessionProtocol.cjs +24 -2
- package/dist/sessionProtocol.d.mts +6 -5
- package/dist/sessionProtocol.mjs +6 -5
- package/dist/skills.cjs +4 -0
- package/dist/skills.d.mts +2 -1
- package/dist/skills.mjs +3 -1
- package/dist/sqliteSessionStorage.cjs +20 -13
- package/dist/sqliteSessionStorage.cjs.map +1 -1
- package/dist/sqliteSessionStorage.d.mts +3 -3
- package/dist/sqliteSessionStorage.d.mts.map +1 -1
- package/dist/sqliteSessionStorage.mjs +19 -12
- package/dist/sqliteSessionStorage.mjs.map +1 -1
- package/dist/src/constants/agentSettled.d.mts +5 -0
- package/dist/src/constants/agentSettled.d.mts.map +1 -0
- package/dist/src/constants/cloud.cjs +11 -0
- package/dist/src/constants/cloud.cjs.map +1 -0
- package/dist/src/constants/cloud.d.mts +9 -0
- package/dist/src/constants/cloud.d.mts.map +1 -0
- package/dist/src/constants/cloud.mjs +11 -0
- package/dist/src/constants/cloud.mjs.map +1 -0
- package/dist/src/constants/fixedCore.cjs +38 -0
- package/dist/src/constants/fixedCore.cjs.map +1 -0
- package/dist/src/constants/fixedCore.d.mts +12 -0
- package/dist/src/constants/fixedCore.d.mts.map +1 -0
- package/dist/src/constants/fixedCore.mjs +38 -0
- package/dist/src/constants/fixedCore.mjs.map +1 -0
- package/dist/src/constants/globalSettings.cjs +10 -0
- package/dist/src/constants/globalSettings.cjs.map +1 -0
- package/dist/src/constants/globalSettings.d.mts +8 -0
- package/dist/src/constants/globalSettings.d.mts.map +1 -0
- package/dist/src/constants/globalSettings.mjs +10 -0
- package/dist/src/constants/globalSettings.mjs.map +1 -0
- package/dist/src/constants/modelGateway.cjs +48 -0
- package/dist/src/constants/modelGateway.cjs.map +1 -0
- package/dist/src/constants/modelGateway.d.mts +29 -0
- package/dist/src/constants/modelGateway.d.mts.map +1 -0
- package/dist/src/constants/modelGateway.mjs +42 -0
- package/dist/src/constants/modelGateway.mjs.map +1 -0
- package/dist/src/constants/nativeHost.cjs +11 -1
- package/dist/src/constants/nativeHost.cjs.map +1 -1
- package/dist/src/constants/nativeHost.d.mts +1 -1
- package/dist/src/constants/nativeHost.d.mts.map +1 -1
- package/dist/src/constants/nativeHost.mjs +11 -1
- package/dist/src/constants/nativeHost.mjs.map +1 -1
- package/dist/src/constants/remote.cjs +26 -14
- package/dist/src/constants/remote.cjs.map +1 -1
- package/dist/src/constants/remote.d.mts +105 -0
- package/dist/src/constants/remote.d.mts.map +1 -0
- package/dist/src/constants/remote.mjs +18 -10
- package/dist/src/constants/remote.mjs.map +1 -1
- package/dist/src/constants/sessionFiles.cjs +3 -0
- package/dist/src/constants/sessionFiles.cjs.map +1 -1
- package/dist/src/constants/sessionFiles.d.mts +9 -0
- package/dist/src/constants/sessionFiles.d.mts.map +1 -0
- package/dist/src/constants/sessionFiles.mjs +3 -1
- package/dist/src/constants/sessionFiles.mjs.map +1 -1
- package/dist/src/constants/template.cjs +13 -0
- package/dist/src/constants/template.cjs.map +1 -0
- package/dist/src/constants/template.d.mts +9 -0
- package/dist/src/constants/template.d.mts.map +1 -0
- package/dist/src/constants/template.mjs +11 -0
- package/dist/src/constants/template.mjs.map +1 -0
- package/dist/src/extensions/extensionFile.cjs +9 -10
- package/dist/src/extensions/extensionFile.cjs.map +1 -1
- package/dist/src/extensions/extensionFile.d.mts +16 -8
- package/dist/src/extensions/extensionFile.d.mts.map +1 -1
- package/dist/src/extensions/extensionFile.mjs +10 -10
- package/dist/src/extensions/extensionFile.mjs.map +1 -1
- package/dist/src/extensions/serverPlugin.cjs +55 -7
- package/dist/src/extensions/serverPlugin.cjs.map +1 -1
- package/dist/src/extensions/serverPlugin.d.mts +1 -1
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
- package/dist/src/extensions/serverPlugin.mjs +53 -5
- package/dist/src/extensions/serverPlugin.mjs.map +1 -1
- package/dist/src/extensions/webPlugin.cjs +25 -2
- package/dist/src/extensions/webPlugin.cjs.map +1 -1
- package/dist/src/extensions/webPlugin.d.mts +10 -2
- package/dist/src/extensions/webPlugin.d.mts.map +1 -1
- package/dist/src/extensions/webPlugin.mjs +21 -2
- package/dist/src/extensions/webPlugin.mjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.cjs +299 -132
- package/dist/src/pi/piSessionRuntime.cjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.d.mts +45 -9
- package/dist/src/pi/piSessionRuntime.d.mts.map +1 -1
- package/dist/src/pi/piSessionRuntime.mjs +299 -133
- package/dist/src/pi/piSessionRuntime.mjs.map +1 -1
- package/dist/src/schemas/agentModel.cjs +1 -1
- package/dist/src/schemas/agentModel.cjs.map +1 -1
- package/dist/src/schemas/agentModel.d.mts +1 -1
- package/dist/src/schemas/agentModel.mjs +1 -1
- package/dist/src/schemas/agentModel.mjs.map +1 -1
- package/dist/src/schemas/agentRun.cjs +16 -0
- package/dist/src/schemas/agentRun.cjs.map +1 -0
- package/dist/src/schemas/agentRun.d.mts +48 -0
- package/dist/src/schemas/agentRun.d.mts.map +1 -0
- package/dist/src/schemas/agentRun.mjs +14 -0
- package/dist/src/schemas/agentRun.mjs.map +1 -0
- package/dist/src/schemas/apiContracts.d.mts +2 -2
- package/dist/src/schemas/apiContracts.d.mts.map +1 -1
- package/dist/src/schemas/approval.cjs +21 -0
- package/dist/src/schemas/approval.cjs.map +1 -0
- package/dist/src/schemas/approval.d.mts +82 -0
- package/dist/src/schemas/approval.d.mts.map +1 -0
- package/dist/src/schemas/approval.mjs +15 -0
- package/dist/src/schemas/approval.mjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.cjs +103 -0
- package/dist/src/schemas/approvalPrompt.cjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.d.mts +83 -0
- package/dist/src/schemas/approvalPrompt.d.mts.map +1 -0
- package/dist/src/schemas/approvalPrompt.mjs +99 -0
- package/dist/src/schemas/approvalPrompt.mjs.map +1 -0
- package/dist/src/schemas/askUser.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.cjs +24 -2
- package/dist/src/schemas/backgroundWork.cjs.map +1 -1
- package/dist/src/schemas/backgroundWork.d.mts +11 -1
- package/dist/src/schemas/backgroundWork.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.mjs +20 -3
- package/dist/src/schemas/backgroundWork.mjs.map +1 -1
- package/dist/src/schemas/brain.cjs +43 -0
- package/dist/src/schemas/brain.cjs.map +1 -0
- package/dist/src/schemas/brain.d.mts +107 -0
- package/dist/src/schemas/brain.d.mts.map +1 -0
- package/dist/src/schemas/brain.mjs +43 -0
- package/dist/src/schemas/brain.mjs.map +1 -0
- package/dist/src/schemas/childProcess.cjs +2 -1
- package/dist/src/schemas/childProcess.cjs.map +1 -1
- package/dist/src/schemas/childProcess.d.mts +1 -1
- package/dist/src/schemas/childProcess.d.mts.map +1 -1
- package/dist/src/schemas/childProcess.mjs +2 -1
- package/dist/src/schemas/childProcess.mjs.map +1 -1
- package/dist/src/schemas/childReport.cjs +42 -0
- package/dist/src/schemas/childReport.cjs.map +1 -0
- package/dist/src/schemas/childReport.d.mts +96 -0
- package/dist/src/schemas/childReport.d.mts.map +1 -0
- package/dist/src/schemas/childReport.mjs +35 -0
- package/dist/src/schemas/childReport.mjs.map +1 -0
- package/dist/src/schemas/clientDevices.d.mts +25 -0
- package/dist/src/schemas/clientDevices.d.mts.map +1 -0
- package/dist/src/schemas/clientMetadata.d.mts +27 -0
- package/dist/src/schemas/clientMetadata.d.mts.map +1 -0
- package/dist/src/schemas/codemode.cjs +34 -0
- package/dist/src/schemas/codemode.cjs.map +1 -0
- package/dist/src/schemas/codemode.d.mts +162 -0
- package/dist/src/schemas/codemode.d.mts.map +1 -0
- package/dist/src/schemas/codemode.mjs +30 -0
- package/dist/src/schemas/codemode.mjs.map +1 -0
- package/dist/src/schemas/delegation.cjs +35 -3
- package/dist/src/schemas/delegation.cjs.map +1 -1
- package/dist/src/schemas/delegation.d.mts +23 -0
- package/dist/src/schemas/delegation.d.mts.map +1 -1
- package/dist/src/schemas/delegation.mjs +33 -4
- package/dist/src/schemas/delegation.mjs.map +1 -1
- package/dist/src/schemas/extensionFile.d.mts +11 -5
- package/dist/src/schemas/extensionFile.d.mts.map +1 -1
- package/dist/src/schemas/federation.cjs +50 -0
- package/dist/src/schemas/federation.cjs.map +1 -0
- package/dist/src/schemas/federation.d.mts +376 -0
- package/dist/src/schemas/federation.d.mts.map +1 -0
- package/dist/src/schemas/federation.mjs +44 -0
- package/dist/src/schemas/federation.mjs.map +1 -0
- package/dist/src/schemas/headless.cjs +153 -5
- package/dist/src/schemas/headless.cjs.map +1 -1
- package/dist/src/schemas/headless.d.mts +409 -20
- package/dist/src/schemas/headless.d.mts.map +1 -1
- package/dist/src/schemas/headless.mjs +143 -6
- package/dist/src/schemas/headless.mjs.map +1 -1
- package/dist/src/schemas/help.cjs +22 -3
- package/dist/src/schemas/help.cjs.map +1 -1
- package/dist/src/schemas/help.d.mts +70 -3
- package/dist/src/schemas/help.d.mts.map +1 -1
- package/dist/src/schemas/help.mjs +17 -4
- package/dist/src/schemas/help.mjs.map +1 -1
- package/dist/src/schemas/home.cjs +35 -12
- package/dist/src/schemas/home.cjs.map +1 -1
- package/dist/src/schemas/home.d.mts +6 -0
- package/dist/src/schemas/home.d.mts.map +1 -1
- package/dist/src/schemas/home.mjs +34 -13
- package/dist/src/schemas/home.mjs.map +1 -1
- package/dist/src/schemas/hostServiceContracts.cjs +39 -0
- package/dist/src/schemas/hostServiceContracts.cjs.map +1 -0
- package/dist/src/schemas/hostServiceContracts.d.mts +26 -0
- package/dist/src/schemas/hostServiceContracts.d.mts.map +1 -0
- package/dist/src/schemas/hostServiceContracts.mjs +39 -0
- package/dist/src/schemas/hostServiceContracts.mjs.map +1 -0
- package/dist/src/schemas/hostServices.cjs +14 -0
- package/dist/src/schemas/hostServices.cjs.map +1 -0
- package/dist/src/schemas/hostServices.d.mts +45 -0
- package/dist/src/schemas/hostServices.d.mts.map +1 -0
- package/dist/src/schemas/hostServices.mjs +12 -0
- package/dist/src/schemas/hostServices.mjs.map +1 -0
- package/dist/src/schemas/hostTeam.cjs +15 -0
- package/dist/src/schemas/hostTeam.cjs.map +1 -0
- package/dist/src/schemas/hostTeam.d.mts +64 -0
- package/dist/src/schemas/hostTeam.d.mts.map +1 -0
- package/dist/src/schemas/hostTeam.mjs +13 -0
- package/dist/src/schemas/hostTeam.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +282 -18
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
- package/dist/src/schemas/httpApiContracts.mjs +282 -18
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
- package/dist/src/schemas/hubChannel.cjs +132 -0
- package/dist/src/schemas/hubChannel.cjs.map +1 -1
- package/dist/src/schemas/hubChannel.d.mts +366 -15
- package/dist/src/schemas/hubChannel.d.mts.map +1 -1
- package/dist/src/schemas/hubChannel.mjs +116 -1
- package/dist/src/schemas/hubChannel.mjs.map +1 -1
- package/dist/src/schemas/humanIdentity.cjs +16 -0
- package/dist/src/schemas/humanIdentity.cjs.map +1 -0
- package/dist/src/schemas/humanIdentity.d.mts +39 -0
- package/dist/src/schemas/humanIdentity.d.mts.map +1 -0
- package/dist/src/schemas/humanIdentity.mjs +14 -0
- package/dist/src/schemas/humanIdentity.mjs.map +1 -0
- package/dist/src/schemas/identity.cjs +34 -0
- package/dist/src/schemas/identity.cjs.map +1 -0
- package/dist/src/schemas/identity.d.mts +193 -0
- package/dist/src/schemas/identity.d.mts.map +1 -0
- package/dist/src/schemas/identity.mjs +30 -0
- package/dist/src/schemas/identity.mjs.map +1 -0
- package/dist/src/schemas/lang.cjs +34 -0
- package/dist/src/schemas/lang.cjs.map +1 -0
- package/dist/src/schemas/lang.d.mts +37 -0
- package/dist/src/schemas/lang.d.mts.map +1 -0
- package/dist/src/schemas/lang.mjs +27 -0
- package/dist/src/schemas/lang.mjs.map +1 -0
- package/dist/src/schemas/leader.cjs +1 -1
- package/dist/src/schemas/leader.cjs.map +1 -1
- package/dist/src/schemas/leader.d.mts +1 -1
- package/dist/src/schemas/leader.d.mts.map +1 -1
- package/dist/src/schemas/leader.mjs +1 -1
- package/dist/src/schemas/leader.mjs.map +1 -1
- package/dist/src/schemas/lintReview.cjs +14 -0
- package/dist/src/schemas/lintReview.cjs.map +1 -0
- package/dist/src/schemas/lintReview.d.mts +75 -0
- package/dist/src/schemas/lintReview.d.mts.map +1 -0
- package/dist/src/schemas/lintReview.mjs +13 -0
- package/dist/src/schemas/lintReview.mjs.map +1 -0
- package/dist/src/schemas/locale.cjs +116 -0
- package/dist/src/schemas/locale.cjs.map +1 -0
- package/dist/src/schemas/locale.d.mts +40 -0
- package/dist/src/schemas/locale.d.mts.map +1 -0
- package/dist/src/schemas/locale.mjs +108 -0
- package/dist/src/schemas/locale.mjs.map +1 -0
- package/dist/src/schemas/mcp.cjs +17 -0
- package/dist/src/schemas/mcp.cjs.map +1 -0
- package/dist/src/schemas/mcp.d.mts +112 -0
- package/dist/src/schemas/mcp.d.mts.map +1 -0
- package/dist/src/schemas/mcp.mjs +13 -0
- package/dist/src/schemas/mcp.mjs.map +1 -0
- package/dist/src/schemas/mcpFacet.cjs.map +1 -1
- package/dist/src/schemas/mcpFacet.d.mts +4 -3
- package/dist/src/schemas/mcpFacet.d.mts.map +1 -1
- package/dist/src/schemas/mcpFacet.mjs.map +1 -1
- package/dist/src/schemas/mcpProjection.cjs +11 -1
- package/dist/src/schemas/mcpProjection.cjs.map +1 -1
- package/dist/src/schemas/mcpProjection.d.mts +10 -4
- package/dist/src/schemas/mcpProjection.d.mts.map +1 -1
- package/dist/src/schemas/mcpProjection.mjs +11 -2
- package/dist/src/schemas/mcpProjection.mjs.map +1 -1
- package/dist/src/schemas/mcpSession.d.mts +1 -1
- package/dist/src/schemas/modelGateway.cjs +143 -0
- package/dist/src/schemas/modelGateway.cjs.map +1 -0
- package/dist/src/schemas/modelGateway.d.mts +150 -0
- package/dist/src/schemas/modelGateway.d.mts.map +1 -0
- package/dist/src/schemas/modelGateway.mjs +135 -0
- package/dist/src/schemas/modelGateway.mjs.map +1 -0
- package/dist/src/schemas/narration.d.mts.map +1 -1
- package/dist/src/schemas/notification.cjs +59 -5
- package/dist/src/schemas/notification.cjs.map +1 -1
- package/dist/src/schemas/notification.d.mts +26 -0
- package/dist/src/schemas/notification.d.mts.map +1 -1
- package/dist/src/schemas/notification.mjs +59 -6
- package/dist/src/schemas/notification.mjs.map +1 -1
- package/dist/src/schemas/operationHook.cjs +180 -0
- package/dist/src/schemas/operationHook.cjs.map +1 -0
- package/dist/src/schemas/operationHook.d.mts +141 -0
- package/dist/src/schemas/operationHook.d.mts.map +1 -0
- package/dist/src/schemas/operationHook.mjs +180 -0
- package/dist/src/schemas/operationHook.mjs.map +1 -0
- package/dist/src/schemas/packageApi.cjs +76 -7
- package/dist/src/schemas/packageApi.cjs.map +1 -1
- package/dist/src/schemas/packageApi.d.mts +174 -30
- package/dist/src/schemas/packageApi.d.mts.map +1 -1
- package/dist/src/schemas/packageApi.mjs +70 -8
- package/dist/src/schemas/packageApi.mjs.map +1 -1
- package/dist/src/schemas/personTimeZone.cjs +29 -0
- package/dist/src/schemas/personTimeZone.cjs.map +1 -0
- package/dist/src/schemas/personTimeZone.d.mts +33 -0
- package/dist/src/schemas/personTimeZone.d.mts.map +1 -0
- package/dist/src/schemas/personTimeZone.mjs +25 -0
- package/dist/src/schemas/personTimeZone.mjs.map +1 -0
- package/dist/src/schemas/platform.cjs +48 -0
- package/dist/src/schemas/platform.cjs.map +1 -1
- package/dist/src/schemas/platform.d.mts +355 -11
- package/dist/src/schemas/platform.d.mts.map +1 -1
- package/dist/src/schemas/platform.mjs +34 -1
- package/dist/src/schemas/platform.mjs.map +1 -1
- package/dist/src/schemas/pluginCatalog.cjs +42 -0
- package/dist/src/schemas/pluginCatalog.cjs.map +1 -0
- package/dist/src/schemas/pluginCatalog.d.mts +67 -0
- package/dist/src/schemas/pluginCatalog.d.mts.map +1 -0
- package/dist/src/schemas/pluginCatalog.mjs +39 -0
- package/dist/src/schemas/pluginCatalog.mjs.map +1 -0
- package/dist/src/schemas/pluginContributions.cjs.map +1 -1
- package/dist/src/schemas/pluginContributions.d.mts +5 -2
- package/dist/src/schemas/pluginContributions.d.mts.map +1 -1
- package/dist/src/schemas/pluginContributions.mjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.cjs +110 -10
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.d.mts +63 -5
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
- package/dist/src/schemas/pluginProtocol.mjs +96 -11
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
- package/dist/src/schemas/profileIdentity.cjs +3 -3
- package/dist/src/schemas/profileIdentity.cjs.map +1 -1
- package/dist/src/schemas/profileIdentity.d.mts +2 -2
- package/dist/src/schemas/profileIdentity.mjs +3 -3
- package/dist/src/schemas/profileIdentity.mjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.cjs +4 -8
- package/dist/src/schemas/protocolChannelsContract.cjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.d.mts +16 -22
- package/dist/src/schemas/protocolChannelsContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.mjs +5 -9
- package/dist/src/schemas/protocolChannelsContract.mjs.map +1 -1
- package/dist/src/schemas/protocolContracts.cjs +193 -133
- package/dist/src/schemas/protocolContracts.cjs.map +1 -1
- package/dist/src/schemas/protocolContracts.d.mts +136 -32
- package/dist/src/schemas/protocolContracts.d.mts.map +1 -1
- package/dist/src/schemas/protocolContracts.mjs +186 -132
- package/dist/src/schemas/protocolContracts.mjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.cjs +109 -27
- package/dist/src/schemas/protocolHubContract.cjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.d.mts +292 -134
- package/dist/src/schemas/protocolHubContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolHubContract.mjs +103 -30
- package/dist/src/schemas/protocolHubContract.mjs.map +1 -1
- package/dist/src/schemas/protocolService.cjs +12 -0
- package/dist/src/schemas/protocolService.cjs.map +1 -0
- package/dist/src/schemas/protocolService.d.mts +22 -0
- package/dist/src/schemas/protocolService.d.mts.map +1 -0
- package/dist/src/schemas/protocolService.mjs +11 -0
- package/dist/src/schemas/protocolService.mjs.map +1 -0
- package/dist/src/schemas/protocolSessionContract.cjs +7 -11
- package/dist/src/schemas/protocolSessionContract.cjs.map +1 -1
- package/dist/src/schemas/protocolSessionContract.d.mts +303 -299
- package/dist/src/schemas/protocolSessionContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolSessionContract.mjs +9 -13
- package/dist/src/schemas/protocolSessionContract.mjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.cjs +5 -6
- package/dist/src/schemas/protocolThreadContract.cjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.d.mts +12 -16
- package/dist/src/schemas/protocolThreadContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolThreadContract.mjs +6 -7
- package/dist/src/schemas/protocolThreadContract.mjs.map +1 -1
- package/dist/src/schemas/remoteGateway.cjs +14 -0
- package/dist/src/schemas/remoteGateway.cjs.map +1 -0
- package/dist/src/schemas/remoteGateway.d.mts +19 -0
- package/dist/src/schemas/remoteGateway.d.mts.map +1 -0
- package/dist/src/schemas/remoteGateway.mjs +12 -0
- package/dist/src/schemas/remoteGateway.mjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.cjs +9 -0
- package/dist/src/schemas/remoteOrigin.cjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.d.mts +16 -0
- package/dist/src/schemas/remoteOrigin.d.mts.map +1 -0
- package/dist/src/schemas/remoteOrigin.mjs +8 -0
- package/dist/src/schemas/remoteOrigin.mjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.cjs +14 -0
- package/dist/src/schemas/sandboxIdentity.cjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.d.mts +23 -0
- package/dist/src/schemas/sandboxIdentity.d.mts.map +1 -0
- package/dist/src/schemas/sandboxIdentity.mjs +12 -0
- package/dist/src/schemas/sandboxIdentity.mjs.map +1 -0
- package/dist/src/schemas/serverBundle.cjs +13 -0
- package/dist/src/schemas/serverBundle.cjs.map +1 -0
- package/dist/src/schemas/serverBundle.d.mts +29 -1
- package/dist/src/schemas/serverBundle.d.mts.map +1 -1
- package/dist/src/schemas/serverBundle.mjs +13 -0
- package/dist/src/schemas/serverBundle.mjs.map +1 -0
- package/dist/src/schemas/serverPlugin.cjs +5 -3
- package/dist/src/schemas/serverPlugin.cjs.map +1 -1
- package/dist/src/schemas/serverPlugin.d.mts +2 -2
- package/dist/src/schemas/serverPlugin.d.mts.map +1 -1
- package/dist/src/schemas/serverPlugin.mjs +5 -3
- package/dist/src/schemas/serverPlugin.mjs.map +1 -1
- package/dist/src/schemas/serverScope.cjs +21 -3
- package/dist/src/schemas/serverScope.cjs.map +1 -1
- package/dist/src/schemas/serverScope.d.mts +17 -1
- package/dist/src/schemas/serverScope.d.mts.map +1 -1
- package/dist/src/schemas/serverScope.mjs +21 -4
- package/dist/src/schemas/serverScope.mjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.cjs +17 -11
- package/dist/src/schemas/sessionApiContracts.cjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.mjs +18 -11
- package/dist/src/schemas/sessionApiContracts.mjs.map +1 -1
- package/dist/src/schemas/sessionLifecycle.cjs +12 -0
- package/dist/src/schemas/sessionLifecycle.cjs.map +1 -0
- package/dist/src/schemas/sessionLifecycle.d.mts +33 -0
- package/dist/src/schemas/sessionLifecycle.d.mts.map +1 -0
- package/dist/src/schemas/sessionLifecycle.mjs +11 -0
- package/dist/src/schemas/sessionLifecycle.mjs.map +1 -0
- package/dist/src/schemas/sessionProtocol.cjs +13 -0
- package/dist/src/schemas/sessionProtocol.cjs.map +1 -1
- package/dist/src/schemas/sessionProtocol.d.mts +57 -15
- package/dist/src/schemas/sessionProtocol.d.mts.map +1 -1
- package/dist/src/schemas/sessionProtocol.mjs +12 -1
- package/dist/src/schemas/sessionProtocol.mjs.map +1 -1
- package/dist/src/schemas/sharedModels.cjs +9 -0
- package/dist/src/schemas/sharedModels.cjs.map +1 -0
- package/dist/src/schemas/sharedModels.d.mts +33 -0
- package/dist/src/schemas/sharedModels.d.mts.map +1 -0
- package/dist/src/schemas/sharedModels.mjs +8 -0
- package/dist/src/schemas/sharedModels.mjs.map +1 -0
- package/dist/src/schemas/skills.cjs +1 -1
- package/dist/src/schemas/skills.cjs.map +1 -1
- package/dist/src/schemas/skills.d.mts +1 -1
- package/dist/src/schemas/skills.mjs +1 -1
- package/dist/src/schemas/skills.mjs.map +1 -1
- package/dist/src/schemas/space.cjs +33 -0
- package/dist/src/schemas/space.cjs.map +1 -0
- package/dist/src/schemas/space.d.mts +90 -0
- package/dist/src/schemas/space.d.mts.map +1 -0
- package/dist/src/schemas/space.mjs +29 -0
- package/dist/src/schemas/space.mjs.map +1 -0
- package/dist/src/schemas/toolSurface.cjs.map +1 -1
- package/dist/src/schemas/toolSurface.d.mts +2 -2
- package/dist/src/schemas/toolSurface.d.mts.map +1 -1
- package/dist/src/schemas/toolSurface.mjs.map +1 -1
- package/dist/src/schemas/userFeedback.cjs +22 -0
- package/dist/src/schemas/userFeedback.cjs.map +1 -0
- package/dist/src/schemas/userFeedback.d.mts +30 -0
- package/dist/src/schemas/userFeedback.d.mts.map +1 -0
- package/dist/src/schemas/userFeedback.mjs +18 -0
- package/dist/src/schemas/userFeedback.mjs.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.cjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.cjs.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.d.mts +5 -5
- package/dist/src/schemas/voiceReloadHandoff.d.mts.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.mjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.mjs.map +1 -1
- package/dist/src/schemas/workflow.cjs +217 -0
- package/dist/src/schemas/workflow.cjs.map +1 -0
- package/dist/src/schemas/workflow.d.mts +593 -0
- package/dist/src/schemas/workflow.d.mts.map +1 -0
- package/dist/src/schemas/workflow.mjs +188 -0
- package/dist/src/schemas/workflow.mjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.cjs +13 -0
- package/dist/src/schemas/workspaceRegistry.cjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.d.mts +45 -0
- package/dist/src/schemas/workspaceRegistry.d.mts.map +1 -0
- package/dist/src/schemas/workspaceRegistry.mjs +11 -0
- package/dist/src/schemas/workspaceRegistry.mjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.cjs +14 -0
- package/dist/src/schemas/workspaceSandboxes.cjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts +85 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.mjs +12 -0
- package/dist/src/schemas/workspaceSandboxes.mjs.map +1 -0
- package/dist/src/server/conversationEvents.cjs +345 -0
- package/dist/src/server/conversationEvents.cjs.map +1 -0
- package/dist/src/server/conversationEvents.mjs +345 -0
- package/dist/src/server/conversationEvents.mjs.map +1 -0
- package/dist/src/server/directHarnessRuntime.cjs +1326 -549
- package/dist/src/server/directHarnessRuntime.cjs.map +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/server/directHarnessRuntime.mjs +1308 -532
- package/dist/src/server/directHarnessRuntime.mjs.map +1 -1
- package/dist/src/server/largeFrameLink.cjs +22 -37
- package/dist/src/server/largeFrameLink.cjs.map +1 -1
- package/dist/src/server/largeFrameLink.mjs +22 -37
- package/dist/src/server/largeFrameLink.mjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.cjs +2 -1
- package/dist/src/server/mcpBundleLoader.cjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts.map +1 -1
- package/dist/src/server/mcpBundleLoader.mjs +2 -1
- package/dist/src/server/mcpBundleLoader.mjs.map +1 -1
- package/dist/src/server/providerRoutes.cjs +74 -0
- package/dist/src/server/providerRoutes.cjs.map +1 -0
- package/dist/src/server/providerRoutes.d.mts +20 -0
- package/dist/src/server/providerRoutes.d.mts.map +1 -0
- package/dist/src/server/providerRoutes.mjs +74 -0
- package/dist/src/server/providerRoutes.mjs.map +1 -0
- package/dist/src/server/providerRuntime.cjs +41 -0
- package/dist/src/server/providerRuntime.cjs.map +1 -0
- package/dist/src/server/providerRuntime.d.mts +12 -0
- package/dist/src/server/providerRuntime.d.mts.map +1 -0
- package/dist/src/server/providerRuntime.mjs +39 -0
- package/dist/src/server/providerRuntime.mjs.map +1 -0
- package/dist/src/server/serverPackages.cjs +29 -7
- package/dist/src/server/serverPackages.cjs.map +1 -1
- package/dist/src/server/serverPackages.d.mts +9 -3
- package/dist/src/server/serverPackages.d.mts.map +1 -1
- package/dist/src/server/serverPackages.mjs +29 -7
- package/dist/src/server/serverPackages.mjs.map +1 -1
- package/dist/src/server/serverScope.cjs +434 -34
- package/dist/src/server/serverScope.cjs.map +1 -1
- package/dist/src/server/serverScope.d.mts +72 -8
- package/dist/src/server/serverScope.d.mts.map +1 -1
- package/dist/src/server/serverScope.mjs +435 -35
- package/dist/src/server/serverScope.mjs.map +1 -1
- package/dist/src/server/threadJournals.cjs.map +1 -1
- package/dist/src/server/threadJournals.mjs.map +1 -1
- package/dist/src/services/approvalGate/index.cjs +179 -0
- package/dist/src/services/approvalGate/index.cjs.map +1 -0
- package/dist/src/services/approvalGate/index.d.mts +30 -0
- package/dist/src/services/approvalGate/index.d.mts.map +1 -0
- package/dist/src/services/approvalGate/index.mjs +174 -0
- package/dist/src/services/approvalGate/index.mjs.map +1 -0
- package/dist/src/services/approvalGate/type.d.mts +36 -0
- package/dist/src/services/approvalGate/type.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.cjs +103 -39
- package/dist/src/services/bundlePublication/index.cjs.map +1 -1
- package/dist/src/services/bundlePublication/index.d.mts +11 -0
- package/dist/src/services/bundlePublication/index.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.mjs +101 -39
- package/dist/src/services/bundlePublication/index.mjs.map +1 -1
- package/dist/src/services/chatgptImages/index.cjs +56 -11
- package/dist/src/services/chatgptImages/index.cjs.map +1 -1
- package/dist/src/services/chatgptImages/index.mjs +56 -11
- package/dist/src/services/chatgptImages/index.mjs.map +1 -1
- package/dist/src/services/chatgptLogin/index.cjs +2 -2
- package/dist/src/services/chatgptLogin/index.cjs.map +1 -1
- package/dist/src/services/chordAdapter/index.cjs +456 -0
- package/dist/src/services/chordAdapter/index.cjs.map +1 -0
- package/dist/src/services/chordAdapter/index.d.mts +13 -0
- package/dist/src/services/chordAdapter/index.d.mts.map +1 -0
- package/dist/src/services/chordAdapter/index.mjs +453 -0
- package/dist/src/services/chordAdapter/index.mjs.map +1 -0
- package/dist/src/services/chordAdapter/type.d.mts +24 -0
- package/dist/src/services/chordAdapter/type.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.cjs +75 -0
- package/dist/src/services/clientDevices/index.cjs.map +1 -0
- package/dist/src/services/clientDevices/index.d.mts +7 -0
- package/dist/src/services/clientDevices/index.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.mjs +74 -0
- package/dist/src/services/clientDevices/index.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs +96 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts +16 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs +89 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs +63 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts +10 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs +62 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs.map +1 -0
- package/dist/src/services/contextUsage/index.cjs +0 -9
- package/dist/src/services/contextUsage/index.cjs.map +1 -1
- package/dist/src/services/contextUsage/index.mjs +1 -9
- package/dist/src/services/contextUsage/index.mjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.cjs +1 -0
- package/dist/src/services/durableNavigation/docs.cjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.mjs +1 -0
- package/dist/src/services/durableNavigation/docs.mjs.map +1 -1
- package/dist/src/services/durableNavigation/index.cjs.map +1 -1
- package/dist/src/services/durableNavigation/index.mjs.map +1 -1
- package/dist/src/services/durableQueue/docs.cjs +1 -0
- package/dist/src/services/durableQueue/docs.cjs.map +1 -1
- package/dist/src/services/durableQueue/docs.mjs +1 -0
- package/dist/src/services/durableQueue/docs.mjs.map +1 -1
- package/dist/src/services/durableQueue/index.cjs +157 -69
- package/dist/src/services/durableQueue/index.cjs.map +1 -1
- package/dist/src/services/durableQueue/index.mjs +156 -70
- package/dist/src/services/durableQueue/index.mjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.cjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.cjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.mjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.mjs.map +1 -1
- package/dist/src/services/durableResumeSnapshots/docs.cjs +49 -0
- package/dist/src/services/durableResumeSnapshots/docs.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs +48 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts +27 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts.map +1 -0
- package/dist/src/services/durableSession/docs.cjs +13 -1
- package/dist/src/services/durableSession/docs.cjs.map +1 -1
- package/dist/src/services/durableSession/docs.d.mts +9 -1
- package/dist/src/services/durableSession/docs.d.mts.map +1 -1
- package/dist/src/services/durableSession/docs.mjs +13 -1
- package/dist/src/services/durableSession/docs.mjs.map +1 -1
- package/dist/src/services/durableSession/index.cjs.map +1 -1
- package/dist/src/services/durableSession/index.d.mts +1 -1
- package/dist/src/services/durableSession/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.cjs +1 -0
- package/dist/src/services/durableSubagents/docs.cjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.mjs +1 -0
- package/dist/src/services/durableSubagents/docs.mjs.map +1 -1
- package/dist/src/services/durableSubagents/extension.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.cjs +29 -3
- package/dist/src/services/durableSubagents/index.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.mjs +29 -4
- package/dist/src/services/durableSubagents/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/tasks.cjs.map +1 -1
- package/dist/src/services/edgeModelRuntime/index.cjs +377 -0
- package/dist/src/services/edgeModelRuntime/index.cjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts +24 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.mjs +374 -0
- package/dist/src/services/edgeModelRuntime/index.mjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts +39 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.cjs +53 -0
- package/dist/src/services/editPresence/index.cjs.map +1 -0
- package/dist/src/services/editPresence/index.d.mts +6 -0
- package/dist/src/services/editPresence/index.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.mjs +53 -0
- package/dist/src/services/editPresence/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs +63 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.d.mts +1 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs +60 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs.map +1 -0
- package/dist/src/services/fileAccess/core.cjs +87 -0
- package/dist/src/services/fileAccess/core.cjs.map +1 -0
- package/dist/src/services/fileAccess/core.mjs +78 -0
- package/dist/src/services/fileAccess/core.mjs.map +1 -0
- package/dist/src/services/fileAccess/index.cjs +34 -0
- package/dist/src/services/fileAccess/index.cjs.map +1 -0
- package/dist/src/services/fileAccess/index.d.mts +23 -0
- package/dist/src/services/fileAccess/index.d.mts.map +1 -0
- package/dist/src/services/fileAccess/index.mjs +29 -0
- package/dist/src/services/fileAccess/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/type.d.mts +1 -0
- package/dist/src/services/grantLedger/index.cjs +56 -0
- package/dist/src/services/grantLedger/index.cjs.map +1 -0
- package/dist/src/services/grantLedger/index.mjs +55 -0
- package/dist/src/services/grantLedger/index.mjs.map +1 -0
- package/dist/src/services/guardedFile/index.cjs +36 -0
- package/dist/src/services/guardedFile/index.cjs.map +1 -0
- package/dist/src/services/guardedFile/index.d.mts +9 -0
- package/dist/src/services/guardedFile/index.d.mts.map +1 -0
- package/dist/src/services/guardedFile/index.mjs +33 -0
- package/dist/src/services/guardedFile/index.mjs.map +1 -0
- package/dist/src/services/headlessClient/index.cjs +85 -3
- package/dist/src/services/headlessClient/index.cjs.map +1 -1
- package/dist/src/services/headlessClient/index.mjs +86 -4
- package/dist/src/services/headlessClient/index.mjs.map +1 -1
- package/dist/src/services/hostServices/index.cjs +157 -0
- package/dist/src/services/hostServices/index.cjs.map +1 -0
- package/dist/src/services/hostServices/index.d.mts +33 -0
- package/dist/src/services/hostServices/index.d.mts.map +1 -0
- package/dist/src/services/hostServices/index.mjs +157 -0
- package/dist/src/services/hostServices/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/index.cjs +120 -0
- package/dist/src/services/inputTemplate/index.cjs.map +1 -0
- package/dist/src/services/inputTemplate/index.d.mts +10 -0
- package/dist/src/services/inputTemplate/index.d.mts.map +1 -0
- package/dist/src/services/inputTemplate/index.mjs +118 -0
- package/dist/src/services/inputTemplate/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/type.d.mts +17 -0
- package/dist/src/services/inputTemplate/type.d.mts.map +1 -0
- package/dist/src/services/json/core.cjs.map +1 -1
- package/dist/src/services/json/core.d.mts +1 -1
- package/dist/src/services/json/core.mjs.map +1 -1
- package/dist/src/services/json/sync.cjs +2 -2
- package/dist/src/services/json/sync.cjs.map +1 -1
- package/dist/src/services/json/sync.d.mts.map +1 -1
- package/dist/src/services/json/sync.mjs +1 -1
- package/dist/src/services/json/sync.mjs.map +1 -1
- package/dist/src/services/kernel/index.cjs.map +1 -1
- package/dist/src/services/kernel/index.d.mts +1 -1
- package/dist/src/services/kernel/index.mjs.map +1 -1
- package/dist/src/services/loginFlow/index.cjs +7 -1
- package/dist/src/services/loginFlow/index.cjs.map +1 -1
- package/dist/src/services/loginFlow/index.mjs +7 -1
- package/dist/src/services/loginFlow/index.mjs.map +1 -1
- package/dist/src/services/modelDispatch/index.cjs +200 -0
- package/dist/src/services/modelDispatch/index.cjs.map +1 -0
- package/dist/src/services/modelDispatch/index.mjs +197 -0
- package/dist/src/services/modelDispatch/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/index.cjs +88 -0
- package/dist/src/services/modelFallback/index.cjs.map +1 -0
- package/dist/src/services/modelFallback/index.d.mts +16 -0
- package/dist/src/services/modelFallback/index.d.mts.map +1 -0
- package/dist/src/services/modelFallback/index.mjs +86 -0
- package/dist/src/services/modelFallback/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/type.d.mts +16 -0
- package/dist/src/services/modelFallback/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.cjs +394 -0
- package/dist/src/services/modelGatewayContainer/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts +16 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.mjs +393 -0
- package/dist/src/services/modelGatewayContainer/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts +28 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts +18 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts +36 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.cjs +292 -0
- package/dist/src/services/modelGatewayHost/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayHost/index.d.mts +13 -0
- package/dist/src/services/modelGatewayHost/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.mjs +292 -0
- package/dist/src/services/modelGatewayHost/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayHost/type.d.mts +61 -0
- package/dist/src/services/modelGatewayHost/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.cjs +170 -0
- package/dist/src/services/modelGatewayWire/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayWire/index.d.mts +30 -0
- package/dist/src/services/modelGatewayWire/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.mjs +163 -0
- package/dist/src/services/modelGatewayWire/index.mjs.map +1 -0
- package/dist/src/services/nativeChildTools/index.cjs +307 -9
- package/dist/src/services/nativeChildTools/index.cjs.map +1 -1
- package/dist/src/services/nativeChildTools/index.d.mts +11 -0
- package/dist/src/services/nativeChildTools/index.d.mts.map +1 -0
- package/dist/src/services/nativeChildTools/index.mjs +298 -3
- package/dist/src/services/nativeChildTools/index.mjs.map +1 -1
- package/dist/src/services/nodeHost/index.cjs +4 -2
- package/dist/src/services/nodeHost/index.cjs.map +1 -1
- package/dist/src/services/nodeHost/index.d.mts +2 -0
- package/dist/src/services/nodeHost/index.d.mts.map +1 -1
- package/dist/src/services/nodeHost/index.mjs +3 -1
- package/dist/src/services/nodeHost/index.mjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.cjs +26 -29
- package/dist/src/services/nodeModelDependencies/index.cjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.mjs +18 -20
- package/dist/src/services/nodeModelDependencies/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.cjs +1 -0
- package/dist/src/services/openSessionRegistry/index.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.d.mts +1 -1
- package/dist/src/services/openSessionRegistry/index.mjs +1 -0
- package/dist/src/services/openSessionRegistry/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts +26 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.cjs +9 -4
- package/dist/src/services/openSessionRegistry/sync.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.mjs +8 -3
- package/dist/src/services/openSessionRegistry/sync.mjs.map +1 -1
- package/dist/src/services/operationDispatch/index.cjs +263 -0
- package/dist/src/services/operationDispatch/index.cjs.map +1 -0
- package/dist/src/services/operationDispatch/index.mjs +263 -0
- package/dist/src/services/operationDispatch/index.mjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.cjs +2 -1
- package/dist/src/services/packageApiHarness/index.cjs.map +1 -1
- package/dist/src/services/packageApiHarness/index.d.mts +2 -1
- package/dist/src/services/packageApiHarness/index.d.mts.map +1 -1
- package/dist/src/services/packageApiHarness/index.mjs +2 -1
- package/dist/src/services/packageApiHarness/index.mjs.map +1 -1
- package/dist/src/services/packageContentRevision/index.cjs +173 -0
- package/dist/src/services/packageContentRevision/index.cjs.map +1 -0
- package/dist/src/services/packageContentRevision/index.d.mts +39 -0
- package/dist/src/services/packageContentRevision/index.d.mts.map +1 -0
- package/dist/src/services/packageContentRevision/index.mjs +168 -0
- package/dist/src/services/packageContentRevision/index.mjs.map +1 -0
- package/dist/src/services/packageResource/index.cjs +12 -8
- package/dist/src/services/packageResource/index.cjs.map +1 -1
- package/dist/src/services/packageResource/index.d.mts.map +1 -1
- package/dist/src/services/packageResource/index.mjs +12 -8
- package/dist/src/services/packageResource/index.mjs.map +1 -1
- package/dist/src/services/pairingPage/index.cjs +85 -24
- package/dist/src/services/pairingPage/index.cjs.map +1 -1
- package/dist/src/services/pairingPage/index.d.mts +23 -0
- package/dist/src/services/pairingPage/index.d.mts.map +1 -0
- package/dist/src/services/pairingPage/index.mjs +86 -25
- package/dist/src/services/pairingPage/index.mjs.map +1 -1
- package/dist/src/services/piArgs/index.cjs +2 -2
- package/dist/src/services/piArgs/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.cjs +344 -56
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.d.mts +3 -1
- package/dist/src/services/piExtensionHost/index.d.mts.map +1 -1
- package/dist/src/services/piExtensionHost/index.mjs +325 -37
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
- package/dist/src/services/piMessages/index.cjs +16 -0
- package/dist/src/services/piMessages/index.cjs.map +1 -1
- package/dist/src/services/piMessages/index.d.mts +12 -0
- package/dist/src/services/piMessages/index.d.mts.map +1 -0
- package/dist/src/services/piMessages/index.mjs +16 -1
- package/dist/src/services/piMessages/index.mjs.map +1 -1
- package/dist/src/services/piSettings/core.cjs +18 -5
- package/dist/src/services/piSettings/core.cjs.map +1 -1
- package/dist/src/services/piSettings/core.d.mts +6 -1
- package/dist/src/services/piSettings/core.d.mts.map +1 -1
- package/dist/src/services/piSettings/core.mjs +18 -6
- package/dist/src/services/piSettings/core.mjs.map +1 -1
- package/dist/src/services/piSettings/sync.cjs +31 -2
- package/dist/src/services/piSettings/sync.cjs.map +1 -1
- package/dist/src/services/piSettings/sync.d.mts +3 -0
- package/dist/src/services/piSettings/sync.d.mts.map +1 -1
- package/dist/src/services/piSettings/sync.mjs +31 -3
- package/dist/src/services/piSettings/sync.mjs.map +1 -1
- package/dist/src/services/piSummary/index.cjs +2 -2
- package/dist/src/services/piSummary/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.cjs +81 -0
- package/dist/src/services/platformFiles/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.d.mts +12 -1
- package/dist/src/services/platformFiles/index.d.mts.map +1 -1
- package/dist/src/services/platformFiles/index.mjs +76 -1
- package/dist/src/services/platformFiles/index.mjs.map +1 -1
- package/dist/src/services/platformFiles/rootBoundReplace.cjs +110 -0
- package/dist/src/services/platformFiles/rootBoundReplace.cjs.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts +21 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs +106 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs.map +1 -0
- package/dist/src/services/poPackage/core.cjs.map +1 -1
- package/dist/src/services/poPackage/core.d.mts +1 -1
- package/dist/src/services/poPackage/core.mjs.map +1 -1
- package/dist/src/services/poPackage/sync.cjs +2 -2
- package/dist/src/services/poPackage/sync.cjs.map +1 -1
- package/dist/src/services/poPackage/sync.d.mts.map +1 -1
- package/dist/src/services/poPackage/sync.mjs +1 -1
- package/dist/src/services/poPackage/sync.mjs.map +1 -1
- package/dist/src/services/poTelemetry/index.cjs +69 -0
- package/dist/src/services/poTelemetry/index.cjs.map +1 -0
- package/dist/src/services/poTelemetry/index.d.mts +7 -0
- package/dist/src/services/poTelemetry/index.d.mts.map +1 -0
- package/dist/src/services/poTelemetry/index.mjs +66 -0
- package/dist/src/services/poTelemetry/index.mjs.map +1 -0
- package/dist/src/services/portableConfig/index.cjs +136 -0
- package/dist/src/services/portableConfig/index.cjs.map +1 -0
- package/dist/src/services/portableConfig/index.d.mts +30 -0
- package/dist/src/services/portableConfig/index.d.mts.map +1 -0
- package/dist/src/services/portableConfig/index.mjs +130 -0
- package/dist/src/services/portableConfig/index.mjs.map +1 -0
- package/dist/src/services/providerAuth/index.cjs +6 -10
- package/dist/src/services/providerAuth/index.cjs.map +1 -1
- package/dist/src/services/providerAuth/index.mjs +5 -7
- package/dist/src/services/providerAuth/index.mjs.map +1 -1
- package/dist/src/services/providerImages/fitter.cjs +48 -0
- package/dist/src/services/providerImages/fitter.cjs.map +1 -0
- package/dist/src/services/providerImages/fitter.mjs +47 -0
- package/dist/src/services/providerImages/fitter.mjs.map +1 -0
- package/dist/src/services/providerImages/index.cjs +21 -0
- package/dist/src/services/providerImages/index.cjs.map +1 -0
- package/dist/src/services/providerImages/index.d.mts +3 -0
- package/dist/src/services/providerImages/index.mjs +21 -0
- package/dist/src/services/providerImages/index.mjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.cjs +228 -0
- package/dist/src/services/runtimeEnvironment/index.cjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts +37 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.mjs +219 -0
- package/dist/src/services/runtimeEnvironment/index.mjs.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.cjs +2 -2
- package/dist/src/services/runtimeIdentity/sync.cjs.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.d.mts.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs.map +1 -1
- package/dist/src/services/scopeInput/index.cjs +49 -0
- package/dist/src/services/scopeInput/index.cjs.map +1 -0
- package/dist/src/services/scopeInput/index.mjs +47 -0
- package/dist/src/services/scopeInput/index.mjs.map +1 -0
- package/dist/src/services/serialRunner/index.cjs +3 -0
- package/dist/src/services/serialRunner/index.cjs.map +1 -1
- package/dist/src/services/serialRunner/index.d.mts +2 -0
- package/dist/src/services/serialRunner/index.d.mts.map +1 -1
- package/dist/src/services/serialRunner/index.mjs +3 -1
- package/dist/src/services/serialRunner/index.mjs.map +1 -1
- package/dist/src/services/serverHost/index.cjs +12 -2
- package/dist/src/services/serverHost/index.cjs.map +1 -1
- package/dist/src/services/serverHost/index.d.mts +3 -1
- package/dist/src/services/serverHost/index.d.mts.map +1 -1
- package/dist/src/services/serverHost/index.mjs +12 -2
- package/dist/src/services/serverHost/index.mjs.map +1 -1
- package/dist/src/services/sessionAccess/index.cjs +168 -0
- package/dist/src/services/sessionAccess/index.cjs.map +1 -0
- package/dist/src/services/sessionAccess/index.d.mts +11 -0
- package/dist/src/services/sessionAccess/index.d.mts.map +1 -0
- package/dist/src/services/sessionAccess/index.mjs +163 -0
- package/dist/src/services/sessionAccess/index.mjs.map +1 -0
- package/dist/src/services/sessionAccess/type.d.mts +32 -0
- package/dist/src/services/sessionAccess/type.d.mts.map +1 -0
- package/dist/src/services/sessionAttachments/index.cjs +13 -13
- package/dist/src/services/sessionAttachments/index.cjs.map +1 -1
- package/dist/src/services/sessionAttachments/index.d.mts +3 -1
- package/dist/src/services/sessionAttachments/index.d.mts.map +1 -1
- package/dist/src/services/sessionAttachments/index.mjs +12 -12
- package/dist/src/services/sessionAttachments/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/index.cjs +35 -13
- package/dist/src/services/sessionFiles/index.cjs.map +1 -1
- package/dist/src/services/sessionFiles/index.d.mts +10 -1
- package/dist/src/services/sessionFiles/index.d.mts.map +1 -1
- package/dist/src/services/sessionFiles/index.mjs +34 -14
- package/dist/src/services/sessionFiles/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.cjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.cjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.mjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.mjs.map +1 -1
- package/dist/src/services/sessionLifecycle/index.cjs +293 -0
- package/dist/src/services/sessionLifecycle/index.cjs.map +1 -0
- package/dist/src/services/sessionLifecycle/index.mjs +293 -0
- package/dist/src/services/sessionLifecycle/index.mjs.map +1 -0
- package/dist/src/services/sessionLifecycle/type.d.mts +32 -0
- package/dist/src/services/sessionLifecycle/type.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs +60 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts +31 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs +45 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts +6 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts +16 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts.map +1 -0
- package/dist/src/services/skillPrompt/index.cjs +14 -4
- package/dist/src/services/skillPrompt/index.cjs.map +1 -1
- package/dist/src/services/skillPrompt/index.mjs +14 -5
- package/dist/src/services/skillPrompt/index.mjs.map +1 -1
- package/dist/src/services/skillRelations/index.cjs +113 -0
- package/dist/src/services/skillRelations/index.cjs.map +1 -0
- package/dist/src/services/skillRelations/index.d.mts +32 -0
- package/dist/src/services/skillRelations/index.d.mts.map +1 -0
- package/dist/src/services/skillRelations/index.mjs +111 -0
- package/dist/src/services/skillRelations/index.mjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs +38 -10
- package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.d.mts +13 -0
- package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.mjs +37 -10
- package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.cjs +12 -12
- package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.d.mts +2 -2
- package/dist/src/services/sqliteTranscriptReader/index.mjs +3 -3
- package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -1
- package/dist/src/services/telemetry/index.cjs +591 -0
- package/dist/src/services/telemetry/index.cjs.map +1 -0
- package/dist/src/services/telemetry/index.d.mts +7 -0
- package/dist/src/services/telemetry/index.d.mts.map +1 -0
- package/dist/src/services/telemetry/index.mjs +587 -0
- package/dist/src/services/telemetry/index.mjs.map +1 -0
- package/dist/src/services/toolContinuation/index.cjs +84 -0
- package/dist/src/services/toolContinuation/index.cjs.map +1 -0
- package/dist/src/services/toolContinuation/index.mjs +83 -0
- package/dist/src/services/toolContinuation/index.mjs.map +1 -0
- package/dist/src/services/traceContext/index.cjs.map +1 -1
- package/dist/src/services/traceContext/index.mjs.map +1 -1
- package/dist/src/services/transcriptPages/index.cjs +169 -8
- package/dist/src/services/transcriptPages/index.cjs.map +1 -1
- package/dist/src/services/transcriptPages/index.mjs +165 -9
- package/dist/src/services/transcriptPages/index.mjs.map +1 -1
- package/dist/src/services/verifiedArchive/index.cjs +181 -0
- package/dist/src/services/verifiedArchive/index.cjs.map +1 -0
- package/dist/src/services/verifiedArchive/index.d.mts +38 -0
- package/dist/src/services/verifiedArchive/index.d.mts.map +1 -0
- package/dist/src/services/verifiedArchive/index.mjs +173 -0
- package/dist/src/services/verifiedArchive/index.mjs.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.cjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.cjs.map +1 -1
- package/dist/src/services/voiceReloadHandoff/index.d.mts +1 -1
- package/dist/src/services/voiceReloadHandoff/index.mjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.mjs.map +1 -1
- package/dist/src/services/workspaceLookup/index.cjs +34 -0
- package/dist/src/services/workspaceLookup/index.cjs.map +1 -0
- package/dist/src/services/workspaceLookup/index.d.mts +6 -0
- package/dist/src/services/workspaceLookup/index.d.mts.map +1 -0
- package/dist/src/services/workspaceLookup/index.mjs +34 -0
- package/dist/src/services/workspaceLookup/index.mjs.map +1 -0
- package/dist/src/services/workspaceRegistry/index.cjs +2 -0
- package/dist/src/services/workspaceRegistry/index.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/index.d.mts +3 -3
- package/dist/src/services/workspaceRegistry/index.mjs +4 -2
- package/dist/src/services/workspaceRegistry/index.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.cjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.d.mts +4 -4
- package/dist/src/services/workspaceRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.mjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs +60 -8
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts +20 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs +58 -9
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs.map +1 -1
- package/dist/src/services/workspaceSandboxes/index.cjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.cjs.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts +9 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.mjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.mjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +65 -27
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +19 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +65 -30
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -1
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs +328 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts +35 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs +325 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs.map +1 -0
- package/dist/src/systems/child/services/childSession/index.cjs +60 -32
- package/dist/src/systems/child/services/childSession/index.cjs.map +1 -1
- package/dist/src/systems/child/services/childSession/index.d.mts +5 -0
- package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -1
- package/dist/src/systems/child/services/childSession/index.mjs +60 -32
- package/dist/src/systems/child/services/childSession/index.mjs.map +1 -1
- package/dist/src/systems/child/types/childSession.cjs.map +1 -1
- package/dist/src/systems/child/types/childSession.d.mts +34 -18
- package/dist/src/systems/child/types/childSession.d.mts.map +1 -1
- package/dist/src/systems/child/types/childSession.mjs.map +1 -1
- package/dist/src/systems/child/types/childSessionInput.d.mts +17 -0
- package/dist/src/systems/child/types/childSessionInput.d.mts.map +1 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts +85 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.cjs +614 -82
- package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.d.mts +60 -12
- package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.mjs +612 -81
- package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +866 -184
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +23 -3
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +845 -167
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/dist/src/systems/main/types/headlessHost.d.mts +14 -5
- package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -1
- package/dist/src/testing/pi/testHost.cjs +1 -0
- package/dist/src/testing/pi/testHost.cjs.map +1 -1
- package/dist/src/testing/pi/testHost.mjs +1 -0
- package/dist/src/testing/pi/testHost.mjs.map +1 -1
- package/dist/src/types/kernel.d.mts +3 -3
- package/dist/src/types/remote.d.mts +53 -29
- package/dist/src/types/remote.d.mts.map +1 -1
- package/dist/src/types/server/agentSessionForward.d.mts +14 -0
- package/dist/src/types/server/agentSessionForward.d.mts.map +1 -0
- package/dist/src/types/server/auth.d.mts +104 -0
- package/dist/src/types/server/auth.d.mts.map +1 -0
- package/dist/src/types/server/directHarnessRuntime.d.mts +144 -19
- package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/types/server/sessionMcp.d.mts +34 -0
- package/dist/src/types/server/sessionMcp.d.mts.map +1 -0
- package/dist/src/types/telemetry.d.mts +64 -0
- package/dist/src/types/telemetry.d.mts.map +1 -0
- package/dist/src/web/hostSlots.cjs +199 -0
- package/dist/src/web/hostSlots.cjs.map +1 -0
- package/dist/src/web/hostSlots.d.mts +196 -0
- package/dist/src/web/hostSlots.d.mts.map +1 -0
- package/dist/src/web/hostSlots.mjs +195 -0
- package/dist/src/web/hostSlots.mjs.map +1 -0
- package/dist/src/web/models/globalStore.cjs +2 -2
- package/dist/src/web/models/globalStore.cjs.map +1 -1
- package/dist/src/web/models/globalStore.d.mts +2 -2
- package/dist/src/web/models/globalStore.d.mts.map +1 -1
- package/dist/src/web/models/globalStore.mjs +2 -2
- package/dist/src/web/models/globalStore.mjs.map +1 -1
- package/dist/src/web/models/sessionStore.cjs +1 -1
- package/dist/src/web/models/sessionStore.cjs.map +1 -1
- package/dist/src/web/models/sessionStore.mjs +1 -1
- package/dist/src/web/models/sessionStore.mjs.map +1 -1
- package/dist/src/web/schemas/onboarding.cjs +17 -0
- package/dist/src/web/schemas/onboarding.cjs.map +1 -0
- package/dist/src/web/schemas/onboarding.d.mts +6 -0
- package/dist/src/web/schemas/onboarding.d.mts.map +1 -0
- package/dist/src/web/schemas/onboarding.mjs +17 -0
- package/dist/src/web/schemas/onboarding.mjs.map +1 -0
- package/dist/src/web/schemas/template.cjs +20 -8
- package/dist/src/web/schemas/template.cjs.map +1 -1
- package/dist/src/web/schemas/template.d.mts +6 -2
- package/dist/src/web/schemas/template.d.mts.map +1 -1
- package/dist/src/web/schemas/template.mjs +20 -8
- package/dist/src/web/schemas/template.mjs.map +1 -1
- package/dist/src/web/services/apiClient/index.cjs +13 -2
- package/dist/src/web/services/apiClient/index.cjs.map +1 -1
- package/dist/src/web/services/apiClient/index.d.mts +3 -2
- package/dist/src/web/services/apiClient/index.d.mts.map +1 -1
- package/dist/src/web/services/apiClient/index.mjs +13 -2
- package/dist/src/web/services/apiClient/index.mjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.cjs +1 -1
- package/dist/src/web/services/apiPaths/index.cjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.d.mts +1 -1
- package/dist/src/web/services/apiPaths/index.mjs +1 -1
- package/dist/src/web/services/apiPaths/index.mjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.cjs +4 -4
- package/dist/src/web/services/apiRoutes/index.cjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.d.mts +2 -2
- package/dist/src/web/services/apiRoutes/index.mjs +4 -4
- package/dist/src/web/services/apiRoutes/index.mjs.map +1 -1
- package/dist/src/web/services/htmlInspect.cjs +277 -0
- package/dist/src/web/services/htmlInspect.cjs.map +1 -0
- package/dist/src/web/services/htmlInspect.d.mts +75 -0
- package/dist/src/web/services/htmlInspect.d.mts.map +1 -0
- package/dist/src/web/services/htmlInspect.mjs +272 -0
- package/dist/src/web/services/htmlInspect.mjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.cjs +60 -0
- package/dist/src/web/services/hubRevisions/index.cjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.d.mts +13 -0
- package/dist/src/web/services/hubRevisions/index.d.mts.map +1 -0
- package/dist/src/web/services/hubRevisions/index.mjs +57 -0
- package/dist/src/web/services/hubRevisions/index.mjs.map +1 -0
- package/dist/src/web/services/i18n/index.cjs +94 -0
- package/dist/src/web/services/i18n/index.cjs.map +1 -0
- package/dist/src/web/services/i18n/index.d.mts +18 -0
- package/dist/src/web/services/i18n/index.d.mts.map +1 -0
- package/dist/src/web/services/i18n/index.mjs +87 -0
- package/dist/src/web/services/i18n/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs +28 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts +10 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs +26 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts +8 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.cjs +39 -0
- package/dist/src/web/services/railSteps/index.cjs.map +1 -0
- package/dist/src/web/services/railSteps/index.d.mts +17 -0
- package/dist/src/web/services/railSteps/index.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.mjs +39 -0
- package/dist/src/web/services/railSteps/index.mjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts +18 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs.map +1 -0
- package/dist/src/web/services/testing/templateRail.cjs +84 -6
- package/dist/src/web/services/testing/templateRail.cjs.map +1 -1
- package/dist/src/web/services/testing/templateRail.d.mts +8 -1
- package/dist/src/web/services/testing/templateRail.d.mts.map +1 -1
- package/dist/src/web/services/testing/templateRail.mjs +83 -7
- package/dist/src/web/services/testing/templateRail.mjs.map +1 -1
- package/dist/src/web/types/extensionFile.d.mts +11 -4
- package/dist/src/web/types/extensionFile.d.mts.map +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts +170 -7
- package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
- package/dist/src/web/types/template.d.mts +133 -17
- package/dist/src/web/types/template.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +535 -38
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/telemetry.cjs +7 -0
- package/dist/telemetry.d.mts +4 -0
- package/dist/telemetry.mjs +3 -0
- package/dist/transition.d.mts +2 -2
- package/dist/transitionClassifier.cjs +9 -9
- package/dist/transitionClassifier.cjs.map +1 -1
- package/dist/transitionClassifier.d.mts +1 -1
- package/dist/transitionClassifier.mjs +9 -9
- package/dist/transitionClassifier.mjs.map +1 -1
- package/dist/userFeedback.cjs +7 -0
- package/dist/userFeedback.d.mts +2 -0
- package/dist/userFeedback.mjs +1 -0
- package/dist/vendor/upm/_chunks/main.mjs +1 -1
- package/dist/verifiedArchive.cjs +11 -0
- package/dist/verifiedArchive.d.mts +2 -0
- package/dist/verifiedArchive.mjs +1 -0
- package/dist/web.cjs +89 -32
- package/dist/web.d.mts +22 -9
- package/dist/web.mjs +16 -5
- package/dist/webCompositions.cjs +87 -17
- package/dist/webCompositions.cjs.map +1 -1
- package/dist/webCompositions.d.mts +22 -6
- package/dist/webCompositions.d.mts.map +1 -1
- package/dist/webCompositions.mjs +87 -18
- package/dist/webCompositions.mjs.map +1 -1
- package/dist/webTesting.cjs +4 -0
- package/dist/webTesting.d.mts +3 -2
- package/dist/webTesting.mjs +3 -2
- package/dist/workflow.cjs +32 -0
- package/dist/workflow.d.mts +2 -0
- package/dist/workflow.mjs +1 -0
- package/dist/workspaceRegistry.cjs +7 -0
- package/dist/workspaceRegistry.d.mts +3 -0
- package/dist/workspaceRegistry.mjs +3 -0
- package/dist/workspaceSandboxes.cjs +7 -0
- package/dist/workspaceSandboxes.d.mts +3 -0
- package/dist/workspaceSandboxes.mjs +3 -0
- package/locales/vi.json +4 -0
- package/locales/zh-CN.json +4 -0
- package/package.json +164 -51
- package/dist/authorTools.cjs +0 -5
- package/dist/authorTools.d.mts +0 -2
- package/dist/authorTools.mjs +0 -1
- package/dist/cockpitContainer.cjs +0 -4
- package/dist/cockpitContainer.d.mts +0 -2
- package/dist/cockpitContainer.mjs +0 -1
- package/dist/remoteApi.cjs +0 -45
- package/dist/remoteApi.cjs.map +0 -1
- package/dist/remoteApi.d.mts +0 -7
- package/dist/remoteApi.d.mts.map +0 -1
- package/dist/remoteApi.mjs +0 -44
- package/dist/remoteApi.mjs.map +0 -1
- package/dist/remoteRuntime.cjs +0 -475
- package/dist/remoteRuntime.cjs.map +0 -1
- package/dist/remoteRuntime.d.mts +0 -37
- package/dist/remoteRuntime.d.mts.map +0 -1
- package/dist/remoteRuntime.mjs +0 -473
- package/dist/remoteRuntime.mjs.map +0 -1
- package/dist/sandboxHarness.cjs +0 -6
- package/dist/sandboxHarness.d.mts +0 -2
- package/dist/sandboxHarness.mjs +0 -1
- package/dist/sessionMcp.cjs +0 -6
- package/dist/sessionMcp.d.mts +0 -5
- package/dist/sessionMcp.mjs +0 -3
- package/dist/src/constants/authorTools.cjs +0 -10
- package/dist/src/constants/authorTools.cjs.map +0 -1
- package/dist/src/constants/authorTools.d.mts +0 -6
- package/dist/src/constants/authorTools.d.mts.map +0 -1
- package/dist/src/constants/authorTools.mjs +0 -8
- package/dist/src/constants/authorTools.mjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.cjs +0 -31
- package/dist/src/schemas/cockpitContainer.cjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.d.mts +0 -80
- package/dist/src/schemas/cockpitContainer.d.mts.map +0 -1
- package/dist/src/schemas/cockpitContainer.mjs +0 -30
- package/dist/src/schemas/cockpitContainer.mjs.map +0 -1
- package/dist/src/schemas/httpApiContracts.d.mts +0 -78
- package/dist/src/schemas/httpApiContracts.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.cjs +0 -29
- package/dist/src/schemas/sandboxHarness.cjs.map +0 -1
- package/dist/src/schemas/sandboxHarness.d.mts +0 -39
- package/dist/src/schemas/sandboxHarness.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.mjs +0 -26
- package/dist/src/schemas/sandboxHarness.mjs.map +0 -1
- package/dist/src/server/devProxyForward.cjs +0 -141
- package/dist/src/server/devProxyForward.cjs.map +0 -1
- package/dist/src/server/devProxyForward.mjs +0 -139
- package/dist/src/server/devProxyForward.mjs.map +0 -1
- package/dist/src/server/devProxyRoutes.cjs +0 -97
- package/dist/src/server/devProxyRoutes.cjs.map +0 -1
- package/dist/src/server/devProxyRoutes.mjs +0 -97
- package/dist/src/server/devProxyRoutes.mjs.map +0 -1
- package/dist/src/server/devProxySocket.cjs +0 -93
- package/dist/src/server/devProxySocket.cjs.map +0 -1
- package/dist/src/server/devProxySocket.d.mts +0 -25
- package/dist/src/server/devProxySocket.d.mts.map +0 -1
- package/dist/src/server/devProxySocket.mjs +0 -93
- package/dist/src/server/devProxySocket.mjs.map +0 -1
- package/dist/src/server/remoteRoutes.cjs +0 -463
- package/dist/src/server/remoteRoutes.cjs.map +0 -1
- package/dist/src/server/remoteRoutes.mjs +0 -463
- package/dist/src/server/remoteRoutes.mjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.cjs +0 -585
- package/dist/src/server/sessionMcpHandler.cjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.d.mts +0 -50
- package/dist/src/server/sessionMcpHandler.d.mts.map +0 -1
- package/dist/src/server/sessionMcpHandler.mjs +0 -582
- package/dist/src/server/sessionMcpHandler.mjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.cjs +0 -822
- package/dist/src/server/sessionMcpRoutes.cjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.mjs +0 -816
- package/dist/src/server/sessionMcpRoutes.mjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.cjs +0 -168
- package/dist/src/services/devProxyPolicy/index.cjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.mjs +0 -165
- package/dist/src/services/devProxyPolicy/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.cjs +0 -59
- package/dist/src/services/devProxyStore/devProxyRecords.cjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.mjs +0 -56
- package/dist/src/services/devProxyStore/devProxyRecords.mjs.map +0 -1
- package/dist/src/services/devProxyStore/index.cjs +0 -13
- package/dist/src/services/devProxyStore/index.cjs.map +0 -1
- package/dist/src/services/devProxyStore/index.mjs +0 -10
- package/dist/src/services/devProxyStore/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.cjs +0 -66
- package/dist/src/services/devProxyStore/sync.cjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.mjs +0 -63
- package/dist/src/services/devProxyStore/sync.mjs.map +0 -1
- package/dist/src/services/deviceAuth/index.cjs +0 -146
- package/dist/src/services/deviceAuth/index.cjs.map +0 -1
- package/dist/src/services/deviceAuth/index.d.mts +0 -9
- package/dist/src/services/deviceAuth/index.d.mts.map +0 -1
- package/dist/src/services/deviceAuth/index.mjs +0 -146
- package/dist/src/services/deviceAuth/index.mjs.map +0 -1
- package/dist/src/services/deviceSessions/index.cjs +0 -147
- package/dist/src/services/deviceSessions/index.cjs.map +0 -1
- package/dist/src/services/deviceSessions/index.d.mts +0 -18
- package/dist/src/services/deviceSessions/index.d.mts.map +0 -1
- package/dist/src/services/deviceSessions/index.mjs +0 -141
- package/dist/src/services/deviceSessions/index.mjs.map +0 -1
- package/dist/src/services/deviceTrust/index.cjs +0 -294
- package/dist/src/services/deviceTrust/index.cjs.map +0 -1
- package/dist/src/services/deviceTrust/index.mjs +0 -282
- package/dist/src/services/deviceTrust/index.mjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.cjs +0 -58
- package/dist/src/services/loopbackAddress/index.cjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.mjs +0 -56
- package/dist/src/services/loopbackAddress/index.mjs.map +0 -1
- package/dist/src/services/pairingFlow/index.cjs +0 -145
- package/dist/src/services/pairingFlow/index.cjs.map +0 -1
- package/dist/src/services/pairingFlow/index.d.mts +0 -44
- package/dist/src/services/pairingFlow/index.d.mts.map +0 -1
- package/dist/src/services/pairingFlow/index.mjs +0 -145
- package/dist/src/services/pairingFlow/index.mjs.map +0 -1
- package/dist/src/services/publicFileShares/index.cjs +0 -192
- package/dist/src/services/publicFileShares/index.cjs.map +0 -1
- package/dist/src/services/publicFileShares/index.d.mts +0 -16
- package/dist/src/services/publicFileShares/index.d.mts.map +0 -1
- package/dist/src/services/publicFileShares/index.mjs +0 -188
- package/dist/src/services/publicFileShares/index.mjs.map +0 -1
- package/dist/src/services/remoteAccess/index.cjs +0 -567
- package/dist/src/services/remoteAccess/index.cjs.map +0 -1
- package/dist/src/services/remoteAccess/index.d.mts +0 -122
- package/dist/src/services/remoteAccess/index.d.mts.map +0 -1
- package/dist/src/services/remoteAccess/index.mjs +0 -567
- package/dist/src/services/remoteAccess/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.cjs +0 -151
- package/dist/src/services/remoteAccessSettings/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.mjs +0 -149
- package/dist/src/services/remoteAccessSettings/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.cjs +0 -15
- package/dist/src/services/remoteAccessStore/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.d.mts +0 -2
- package/dist/src/services/remoteAccessStore/index.mjs +0 -12
- package/dist/src/services/remoteAccessStore/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +0 -98
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +0 -88
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.cjs +0 -111
- package/dist/src/services/remoteAccessStore/sync.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.mjs +0 -108
- package/dist/src/services/remoteAccessStore/sync.mjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.cjs +0 -200
- package/dist/src/services/remoteGuardPolicy/index.cjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.d.mts +0 -7
- package/dist/src/services/remoteGuardPolicy/index.d.mts.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.mjs +0 -196
- package/dist/src/services/remoteGuardPolicy/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.cjs +0 -115
- package/dist/src/services/sessionMcpActivity/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.mjs +0 -111
- package/dist/src/services/sessionMcpActivity/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.cjs +0 -473
- package/dist/src/services/sessionMcpAuthorization/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.d.mts +0 -125
- package/dist/src/services/sessionMcpAuthorization/index.d.mts.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.mjs +0 -469
- package/dist/src/services/sessionMcpAuthorization/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.cjs +0 -217
- package/dist/src/services/sessionMcpConversations/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.mjs +0 -212
- package/dist/src/services/sessionMcpConversations/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs +0 -86
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs +0 -83
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs.map +0 -1
- package/dist/src/services/testMode/index.cjs +0 -162
- package/dist/src/services/testMode/index.cjs.map +0 -1
- package/dist/src/services/testMode/index.d.mts +0 -17
- package/dist/src/services/testMode/index.d.mts.map +0 -1
- package/dist/src/services/testMode/index.mjs +0 -155
- package/dist/src/services/testMode/index.mjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.cjs +0 -58
- package/dist/src/services/tunnelOutput/index.cjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.mjs +0 -54
- package/dist/src/services/tunnelOutput/index.mjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.cjs +0 -487
- package/dist/src/services/tunnelProcess/index.cjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.mjs +0 -481
- package/dist/src/services/tunnelProcess/index.mjs.map +0 -1
- package/dist/src/services/webauthn/index.cjs +0 -262
- package/dist/src/services/webauthn/index.cjs.map +0 -1
- package/dist/src/services/webauthn/index.d.mts +0 -39
- package/dist/src/services/webauthn/index.d.mts.map +0 -1
- package/dist/src/services/webauthn/index.mjs +0 -262
- package/dist/src/services/webauthn/index.mjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.cjs +0 -184
- package/dist/src/services/webauthnPolicy/index.cjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.d.mts +0 -41
- package/dist/src/services/webauthnPolicy/index.d.mts.map +0 -1
- package/dist/src/services/webauthnPolicy/index.mjs +0 -177
- package/dist/src/services/webauthnPolicy/index.mjs.map +0 -1
- package/dist/testMode.cjs +0 -4
- package/dist/testMode.d.mts +0 -2
- package/dist/testMode.mjs +0 -1
package/dist/headlessHub.cjs
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_index = require("./src/services/scopeInput/index.cjs");
|
|
4
|
+
const require_approvalPrompt = require("./src/schemas/approvalPrompt.cjs");
|
|
5
|
+
require("./src/schemas/approval.cjs");
|
|
6
|
+
const require_childSession = require("./src/systems/child/types/childSession.cjs");
|
|
7
|
+
const require_agentSettled = require("./src/constants/agentSettled.cjs");
|
|
3
8
|
const require_docs = require("./src/services/durableSession/docs.cjs");
|
|
4
9
|
const require_profileIdentity = require("./src/schemas/profileIdentity.cjs");
|
|
5
|
-
require("./src/
|
|
10
|
+
const require_index$1 = require("./src/services/sqliteSessionHistory/index.cjs");
|
|
11
|
+
const require_hubChannel = require("./src/schemas/hubChannel.cjs");
|
|
12
|
+
const require_packageApi = require("./src/schemas/packageApi.cjs");
|
|
6
13
|
const require_home = require("./src/schemas/home.cjs");
|
|
7
|
-
require("./
|
|
14
|
+
require("./hubChannel.cjs");
|
|
15
|
+
const require_notification = require("./src/schemas/notification.cjs");
|
|
8
16
|
require("./src/schemas/sessionProtocol.cjs");
|
|
9
|
-
require("./src/
|
|
10
|
-
const require_pluginProtocol = require("./src/schemas/pluginProtocol.cjs");
|
|
11
|
-
require("./pluginProtocol.cjs");
|
|
12
|
-
const require_index = require("./src/services/serverHost/index.cjs");
|
|
17
|
+
const require_index$2 = require("./src/services/serverHost/index.cjs");
|
|
13
18
|
const require_serverScope = require("./src/server/serverScope.cjs");
|
|
19
|
+
const require_sessionLifecycle = require("./src/schemas/sessionLifecycle.cjs");
|
|
14
20
|
require("./serverPlugin.cjs");
|
|
15
|
-
const
|
|
21
|
+
const require_pluginProtocol = require("./src/schemas/pluginProtocol.cjs");
|
|
22
|
+
const require_index$3 = require("./src/services/editPresence/index.cjs");
|
|
23
|
+
require("./pluginProtocol.cjs");
|
|
24
|
+
const require_index$4 = require("./src/services/sessionGitStatus/index.cjs");
|
|
25
|
+
const require_index$5 = require("./src/services/sessionLifecycle/index.cjs");
|
|
16
26
|
let node_crypto = require("node:crypto");
|
|
17
27
|
node_crypto = require_runtime.__toESM(node_crypto, 1);
|
|
28
|
+
let node_path = require("node:path");
|
|
29
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
18
30
|
let dist_interop_chordContext_mjs = require("../dist/interop/chordContext.mjs");
|
|
19
31
|
//#region src/server/headlessHub.ts
|
|
20
32
|
const AUTHORIZATION_HEADER = "authorization";
|
|
21
33
|
const CHANNEL_PRIORITY = {
|
|
22
|
-
|
|
34
|
+
host: 0,
|
|
23
35
|
workspace: 1,
|
|
24
36
|
session: 2
|
|
25
37
|
};
|
|
@@ -27,18 +39,34 @@ const ICON_VERSION_LENGTH = 12;
|
|
|
27
39
|
const ICON_DATA_URL = /^data:([a-z/+.-]+);base64,([A-Za-z0-9+/=]+)$/u;
|
|
28
40
|
/** A rail line, not a log: a longer label is cut to this. */
|
|
29
41
|
const MAX_ACTIVITY_LABEL = 80;
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
|
|
42
|
+
/** A peer card line, not a report: a longer summary is cut to this. */
|
|
43
|
+
const MAX_SESSION_SUMMARY = 160;
|
|
44
|
+
const CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f]/gu;
|
|
45
|
+
/** `@session:<token>` where an `@` starts the text or follows whitespace, as the composer writes it. */
|
|
46
|
+
const SESSION_MENTION = /(?<=^|\s)@session:([A-Za-z0-9_-]+)/gu;
|
|
47
|
+
/** Each of a session's active and expired mention lists keeps at most this many, dropping the oldest. */
|
|
48
|
+
const MAX_SESSION_MENTIONS = 64;
|
|
49
|
+
const MAX_SESSION_ID_LENGTH = 256;
|
|
50
|
+
/** Read only write-time proof of prior work. Missing coverage is not an empty history. */
|
|
51
|
+
async function storedHistory(host) {
|
|
52
|
+
let settledAt;
|
|
35
53
|
try {
|
|
36
|
-
const
|
|
37
|
-
const data = entry?.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
const snapshot = await host.runtime.customSnapshot(require_agentSettled.AGENT_SETTLED_ENTRY_TYPE);
|
|
55
|
+
const data = snapshot.entry?.data;
|
|
56
|
+
if (snapshot.available && typeof data?.timestamp === "number" && Number.isFinite(data.timestamp)) {
|
|
57
|
+
const date = new Date(data.timestamp);
|
|
58
|
+
if (Number.isFinite(date.getTime())) settledAt = date.toISOString();
|
|
59
|
+
}
|
|
60
|
+
} catch {}
|
|
61
|
+
if (settledAt !== void 0) return {
|
|
62
|
+
everPrompted: true,
|
|
63
|
+
lastSettledAt: settledAt
|
|
64
|
+
};
|
|
65
|
+
try {
|
|
66
|
+
const statistics = await host.runtime.readResumeStatistics();
|
|
67
|
+
if (statistics && statistics.messageCount > 0) return { everPrompted: true };
|
|
68
|
+
} catch {}
|
|
69
|
+
return { everPrompted: false };
|
|
42
70
|
}
|
|
43
71
|
/** The groups a resumed session was saved with. Sessions from before groups existed have none. */
|
|
44
72
|
async function storedGroups(host, onNotice) {
|
|
@@ -50,38 +78,118 @@ async function storedGroups(host, onNotice) {
|
|
|
50
78
|
return [];
|
|
51
79
|
}
|
|
52
80
|
}
|
|
81
|
+
/** The mentions a resumed session was saved with, ids only. Sessions from before mentions were saved have none. */
|
|
82
|
+
async function storedMentions(host, onNotice) {
|
|
83
|
+
const ids = (value) => Array.isArray(value) ? value.filter((id) => typeof id === "string" && id !== "" && id.length <= MAX_SESSION_ID_LENGTH).slice(-64) : [];
|
|
84
|
+
try {
|
|
85
|
+
const { mentions } = await host.runtime.session.snapshot(require_docs.SessionMetadataDoc, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
86
|
+
return {
|
|
87
|
+
active: ids(mentions?.active),
|
|
88
|
+
expired: ids(mentions?.expired)
|
|
89
|
+
};
|
|
90
|
+
} catch (error) {
|
|
91
|
+
onNotice?.(`Session mentions could not be read: ${String(error)}`);
|
|
92
|
+
return {
|
|
93
|
+
active: [],
|
|
94
|
+
expired: []
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** The bot marker a resumed session was saved with. A read failure leaves it an ordinary session. */
|
|
99
|
+
async function storedBot(host, onNotice) {
|
|
100
|
+
try {
|
|
101
|
+
const stored = await host.runtime.session.snapshot(require_docs.SessionMetadataDoc, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
102
|
+
const bot = require_hubChannel.parseStoredBot(stored.bot);
|
|
103
|
+
const botRevision = typeof stored.botRevision === "number" ? stored.botRevision : 0;
|
|
104
|
+
return bot === void 0 ? { botRevision } : {
|
|
105
|
+
bot,
|
|
106
|
+
botRevision
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
onNotice?.(`Session bot marker could not be read: ${String(error)}`);
|
|
110
|
+
return {};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
53
113
|
function scopeOf(session) {
|
|
54
114
|
return {
|
|
55
115
|
sessionId: session.id,
|
|
116
|
+
...session.name === "" ? {} : { name: session.name },
|
|
56
117
|
...session.workspaceId === void 0 ? {} : { workspaceId: session.workspaceId },
|
|
118
|
+
...session.parentSessionId === void 0 ? {} : { parentSessionId: session.parentSessionId },
|
|
57
119
|
cwd: session.cwd,
|
|
58
120
|
...session.environment === void 0 ? {} : { environment: session.environment },
|
|
59
|
-
...session.host.sessionContext === void 0 ? {} : { sessionContext: session.host.sessionContext }
|
|
121
|
+
...session.host.sessionContext === void 0 ? {} : { sessionContext: session.host.sessionContext },
|
|
122
|
+
...session.bot === void 0 ? {} : { bot: { ...session.bot } }
|
|
60
123
|
};
|
|
61
124
|
}
|
|
62
125
|
/** Owns direct, same-process session and channel state for presentation adapters. */
|
|
63
126
|
function createHeadlessHub(options) {
|
|
64
|
-
const
|
|
127
|
+
const gitReads = /* @__PURE__ */ new Set();
|
|
128
|
+
const readGitStatus = (cwd, shell, environment) => {
|
|
129
|
+
for (const read of gitReads) if (read.cwd === cwd && read.shell === shell && read.environment === environment) return read.promise;
|
|
130
|
+
const promise = Promise.resolve().then(() => options.readGitStatus ? options.readGitStatus(cwd) : require_index$4.readSessionGitStatus(shell, cwd));
|
|
131
|
+
const read = {
|
|
132
|
+
cwd,
|
|
133
|
+
shell,
|
|
134
|
+
environment,
|
|
135
|
+
promise
|
|
136
|
+
};
|
|
137
|
+
gitReads.add(read);
|
|
138
|
+
promise.finally(() => gitReads.delete(read)).catch(() => {});
|
|
139
|
+
return promise;
|
|
140
|
+
};
|
|
141
|
+
const lifecycle = require_index$5.createPoSessionLifecycle({ onError: (error) => options.onNotice?.(`Session lifecycle observer failed: ${String(error)}`) });
|
|
142
|
+
const pendingCreates = /* @__PURE__ */ new Map();
|
|
65
143
|
const sessions = /* @__PURE__ */ new Map();
|
|
66
144
|
const pendingSetups = /* @__PURE__ */ new Map();
|
|
67
145
|
const activities = /* @__PURE__ */ new Map();
|
|
146
|
+
const summaries = /* @__PURE__ */ new Map();
|
|
147
|
+
const pendingApprovals = /* @__PURE__ */ new Map();
|
|
148
|
+
/**
|
|
149
|
+
* Sessions the person named to a session with `@session:`, by the mentioning session. `active` lets the two message
|
|
150
|
+
* until the mentioning session compacts; then they are `expired` until approved again. Saved in its metadata.
|
|
151
|
+
*/
|
|
152
|
+
const mentions = /* @__PURE__ */ new Map();
|
|
153
|
+
/** A host package placed a session for its owner (`startedByOf`): the two may message, and nothing more. */
|
|
154
|
+
const launchLinks = /* @__PURE__ */ new Set();
|
|
155
|
+
const sessionPair = (one, two) => JSON.stringify(one < two ? [one, two] : [two, one]);
|
|
68
156
|
const present = (session) => {
|
|
69
157
|
const pending = pendingSetups.get(session.id);
|
|
70
158
|
const activity = activities.get(session.id);
|
|
71
|
-
|
|
159
|
+
const summary = summaries.get(session.id);
|
|
160
|
+
const approvals = pendingApprovals.get(session.id);
|
|
161
|
+
if (pending === void 0 && activity === void 0 && summary === void 0 && approvals === void 0) return session;
|
|
72
162
|
return {
|
|
73
163
|
...session,
|
|
74
164
|
...pending === void 0 ? {} : { pendingSetups: pending },
|
|
75
|
-
...activity === void 0 ? {} : { activity }
|
|
165
|
+
...activity === void 0 ? {} : { activity },
|
|
166
|
+
...summary === void 0 ? {} : { summary },
|
|
167
|
+
...approvals === void 0 ? {} : { pendingApprovalCount: approvals }
|
|
76
168
|
};
|
|
77
169
|
};
|
|
170
|
+
const setSessionPendingApprovals = (sessionId, count) => {
|
|
171
|
+
const session = sessions.get(sessionId);
|
|
172
|
+
const next = Number.isSafeInteger(count) && count > 0 ? count : void 0;
|
|
173
|
+
if (pendingApprovals.get(sessionId) === next) return;
|
|
174
|
+
if (next === void 0) pendingApprovals.delete(sessionId);
|
|
175
|
+
else pendingApprovals.set(sessionId, next);
|
|
176
|
+
if (session !== void 0) emit({
|
|
177
|
+
kind: "upsert",
|
|
178
|
+
session: present(session)
|
|
179
|
+
});
|
|
180
|
+
else if (options.dormantSessions?.().some((entry) => entry.sessionId === sessionId)) emit({
|
|
181
|
+
kind: "dormant_changed",
|
|
182
|
+
sessionId
|
|
183
|
+
});
|
|
184
|
+
};
|
|
78
185
|
const pluginRegistry = require_pluginProtocol.createPoPluginRegistry();
|
|
79
|
-
const
|
|
186
|
+
const workspacePresence = /* @__PURE__ */ new Map();
|
|
80
187
|
const channels = /* @__PURE__ */ new Map();
|
|
81
188
|
const listeners = /* @__PURE__ */ new Set();
|
|
82
189
|
const subscriptions = /* @__PURE__ */ new Set();
|
|
83
190
|
const sessionCleanups = /* @__PURE__ */ new Map();
|
|
84
191
|
const presentationCleanups = /* @__PURE__ */ new Map();
|
|
192
|
+
const compositionRefreshers = /* @__PURE__ */ new Map();
|
|
85
193
|
/** Profile icons by session, kept out of summaries because each can be hundreds of kilobytes. */
|
|
86
194
|
const avatarIcons = /* @__PURE__ */ new Map();
|
|
87
195
|
const sessionShutdowns = /* @__PURE__ */ new Map();
|
|
@@ -90,36 +198,117 @@ function createHeadlessHub(options) {
|
|
|
90
198
|
const maxDirectEventLatest = 4096;
|
|
91
199
|
const communicationEndpoints = /* @__PURE__ */ new Map();
|
|
92
200
|
let closed = false;
|
|
93
|
-
/** The mount table each served
|
|
201
|
+
/** The mount table each served host or workspace scope publishes, by mount key. */
|
|
94
202
|
const scopeHosts = /* @__PURE__ */ new Map();
|
|
95
203
|
let globalScope;
|
|
96
204
|
const workspaceScopes = /* @__PURE__ */ new Map();
|
|
97
|
-
const openGlobalScope = () => globalScope ??= require_serverScope.PoServerScope.open("
|
|
205
|
+
const openGlobalScope = () => globalScope ??= require_serverScope.PoServerScope.open("host");
|
|
98
206
|
const openWorkspaceScope = (workspaceId) => {
|
|
99
207
|
let scope = workspaceScopes.get(workspaceId);
|
|
100
208
|
if (scope === void 0) {
|
|
101
|
-
scope = openGlobalScope().then((global) =>
|
|
209
|
+
scope = openGlobalScope().then(async (global) => {
|
|
210
|
+
const workspace = await require_serverScope.PoServerScope.open("workspace", global);
|
|
211
|
+
const presence = require_index$3.createEditPresence();
|
|
212
|
+
workspacePresence.set(workspaceId, presence);
|
|
213
|
+
workspace.root.effect(() => () => {
|
|
214
|
+
presence.clear();
|
|
215
|
+
if (workspacePresence.get(workspaceId) === presence) workspacePresence.delete(workspaceId);
|
|
216
|
+
});
|
|
217
|
+
try {
|
|
218
|
+
await workspace.bind(require_packageApi.PO_EDIT_PRESENCE_CONTRACT, presence);
|
|
219
|
+
return workspace;
|
|
220
|
+
} catch (error) {
|
|
221
|
+
await workspace.dispose();
|
|
222
|
+
throw error;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
102
225
|
workspaceScopes.set(workspaceId, scope);
|
|
103
226
|
}
|
|
104
227
|
return scope;
|
|
105
228
|
};
|
|
106
229
|
const workspaces = /* @__PURE__ */ new Map();
|
|
230
|
+
const compositionRevisions = /* @__PURE__ */ new Map();
|
|
231
|
+
const revisions = /* @__PURE__ */ new Map();
|
|
232
|
+
const revisionBase = Date.now();
|
|
233
|
+
const bumpRevision = (topic) => {
|
|
234
|
+
revisions.set(topic, (revisions.get(topic) ?? revisionBase) + 1);
|
|
235
|
+
emit({ kind: "revisions" });
|
|
236
|
+
};
|
|
237
|
+
const pendingHomeTopics = /* @__PURE__ */ new Set();
|
|
238
|
+
const homeProjections = /* @__PURE__ */ new Map();
|
|
239
|
+
const homeCandidates = /* @__PURE__ */ new Map();
|
|
240
|
+
const homeProjectionCandidates = /* @__PURE__ */ new Map();
|
|
241
|
+
const removeHomeProjection = (key) => {
|
|
242
|
+
homeProjections.delete(key);
|
|
243
|
+
for (const identity of homeProjectionCandidates.get(key) ?? []) {
|
|
244
|
+
const candidates = homeCandidates.get(identity);
|
|
245
|
+
candidates.delete(key);
|
|
246
|
+
if (candidates.size === 0) homeCandidates.delete(identity);
|
|
247
|
+
}
|
|
248
|
+
homeProjectionCandidates.delete(key);
|
|
249
|
+
};
|
|
250
|
+
const indexHomeProjection = (key, frameType, session, projection) => {
|
|
251
|
+
for (const identity of homeProjectionCandidates.get(key) ?? []) {
|
|
252
|
+
const candidates = homeCandidates.get(identity);
|
|
253
|
+
candidates.delete(key);
|
|
254
|
+
if (candidates.size === 0) homeCandidates.delete(identity);
|
|
255
|
+
}
|
|
256
|
+
const identities = new Set(projection.entities.map((entity) => JSON.stringify([
|
|
257
|
+
frameType,
|
|
258
|
+
session.workspaceId,
|
|
259
|
+
entity.id
|
|
260
|
+
])));
|
|
261
|
+
homeProjectionCandidates.set(key, identities);
|
|
262
|
+
for (const identity of identities) {
|
|
263
|
+
const candidates = homeCandidates.get(identity) ?? /* @__PURE__ */ new Set();
|
|
264
|
+
candidates.add(key);
|
|
265
|
+
homeCandidates.set(identity, candidates);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
let homeBumpQueued = false;
|
|
269
|
+
const queueHomeBump = (session) => {
|
|
270
|
+
pendingHomeTopics.add("host:home");
|
|
271
|
+
if (session.workspaceId !== void 0) pendingHomeTopics.add(`workspace:${session.workspaceId}:home`);
|
|
272
|
+
if (homeBumpQueued) return;
|
|
273
|
+
homeBumpQueued = true;
|
|
274
|
+
queueMicrotask(() => {
|
|
275
|
+
homeBumpQueued = false;
|
|
276
|
+
const topics = [...pendingHomeTopics];
|
|
277
|
+
pendingHomeTopics.clear();
|
|
278
|
+
if (!closed) for (const topic of topics) bumpRevision(topic);
|
|
279
|
+
});
|
|
280
|
+
};
|
|
107
281
|
const worktreeProvisioners = /* @__PURE__ */ new Map();
|
|
108
282
|
let sessionService;
|
|
109
|
-
const mountKey = (mount) => mount.scope === "
|
|
110
|
-
const belongs = (mount, session) => mount.scope === "
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (root !== void 0 && root === b.host.sessionContext?.checkoutRoot) return true;
|
|
116
|
-
return (a.groups ?? []).some((group) => b.groups?.includes(group) === true);
|
|
283
|
+
const mountKey = (mount) => mount.scope === "host" ? "host" : mount.scope === "workspace" ? `workspace:${mount.workspaceId}` : `session:${mount.sessionId}`;
|
|
284
|
+
const belongs = (mount, session) => mount.scope === "host" || (mount.scope === "workspace" ? session.workspaceId === mount.workspaceId : session.id === mount.sessionId);
|
|
285
|
+
/** The live session `sessionId` is one this mount serves. */
|
|
286
|
+
const ownedBy = (mount, sessionId) => {
|
|
287
|
+
const session = sessions.get(sessionId);
|
|
288
|
+
return session !== void 0 && belongs(mount, session);
|
|
117
289
|
};
|
|
290
|
+
const canClose = (mount, session) => belongs(mount, session) || mount.scope === "session" && session.parentSessionId === mount.sessionId;
|
|
291
|
+
const policyInput = (source, target) => ({
|
|
292
|
+
source,
|
|
293
|
+
target,
|
|
294
|
+
sessions: [...sessions.values()],
|
|
295
|
+
dormantSessions: options.dormantSessions?.() ?? [],
|
|
296
|
+
workspaces: [...workspaces.values()],
|
|
297
|
+
filesOverlap: source.workspaceId !== void 0 && source.workspaceId === target.workspaceId && workspacePresence.get(source.workspaceId)?.canCommunicate(source.id, target.id) === true,
|
|
298
|
+
mentioned: mentions.get(source.id)?.active.has(target.id) === true || mentions.get(target.id)?.active.has(source.id) === true,
|
|
299
|
+
launched: launchLinks.has(sessionPair(source.id, target.id))
|
|
300
|
+
});
|
|
118
301
|
const canCommunicate = (sourceId, targetId) => {
|
|
119
302
|
if (closed || sourceId === targetId) return false;
|
|
120
303
|
const source = sessions.get(sourceId);
|
|
121
304
|
const target = sessions.get(targetId);
|
|
122
|
-
return source !== void 0 && target !== void 0 &&
|
|
305
|
+
return source !== void 0 && target !== void 0 && options.communicationPolicy?.(policyInput(source, target)) === true;
|
|
306
|
+
};
|
|
307
|
+
/** `coordinatorId` coordinates `sessionId`, and the two may talk. */
|
|
308
|
+
const coordinates = (coordinatorId, sessionId) => {
|
|
309
|
+
const session = sessions.get(sessionId);
|
|
310
|
+
const coordinator = sessions.get(coordinatorId);
|
|
311
|
+
return session !== void 0 && coordinator !== void 0 && canCommunicate(sessionId, coordinatorId) && options.coordinationPolicy?.(policyInput(session, coordinator)) === true;
|
|
123
312
|
};
|
|
124
313
|
const registerReservedWorktreeProvisioner = (mount, provisioner) => {
|
|
125
314
|
const key = mountKey(mount);
|
|
@@ -142,10 +331,16 @@ function createHeadlessHub(options) {
|
|
|
142
331
|
}
|
|
143
332
|
return provisioner;
|
|
144
333
|
};
|
|
334
|
+
/**
|
|
335
|
+
* A mirror of a session another host runs (a sandbox container) is served only by channels mounted on that session:
|
|
336
|
+
* the container's own, merged by the router. Host-level and workspace channels would read host-side state the
|
|
337
|
+
* mirror has none of (it carries no admitted environment), so they never reach it.
|
|
338
|
+
*/
|
|
339
|
+
const reaches = (mount, session) => belongs(mount, session) && (mount.scope === "session" || session.host.agentSession === void 0);
|
|
145
340
|
const selectedChannels = (session) => {
|
|
146
341
|
const selected = /* @__PURE__ */ new Map();
|
|
147
342
|
for (const started of channels.values()) {
|
|
148
|
-
if (!
|
|
343
|
+
if (!reaches(started.mount, session)) continue;
|
|
149
344
|
const previous = selected.get(started.channel.frameType);
|
|
150
345
|
if (!previous || CHANNEL_PRIORITY[started.mount.scope] > CHANNEL_PRIORITY[previous.mount.scope]) selected.set(started.channel.frameType, started);
|
|
151
346
|
}
|
|
@@ -161,7 +356,7 @@ function createHeadlessHub(options) {
|
|
|
161
356
|
* knows which sessions it is taking over.
|
|
162
357
|
*/
|
|
163
358
|
const serves = (mount, frameType, session) => {
|
|
164
|
-
if (!
|
|
359
|
+
if (!reaches(mount, session)) return false;
|
|
165
360
|
const current = selectedChannel(session, frameType);
|
|
166
361
|
return current === void 0 || CHANNEL_PRIORITY[mount.scope] >= CHANNEL_PRIORITY[current.mount.scope];
|
|
167
362
|
};
|
|
@@ -232,6 +427,9 @@ function createHeadlessHub(options) {
|
|
|
232
427
|
get sessionName() {
|
|
233
428
|
return sessions.get(sessionId)?.name;
|
|
234
429
|
},
|
|
430
|
+
get groups() {
|
|
431
|
+
return sessions.get(sessionId)?.groups ?? [];
|
|
432
|
+
},
|
|
235
433
|
publish(targetSessionId, type, payload) {
|
|
236
434
|
if (!canCommunicate(sessionId, targetSessionId)) return false;
|
|
237
435
|
const target = communicationEndpoints.get(targetSessionId);
|
|
@@ -263,13 +461,29 @@ function createHeadlessHub(options) {
|
|
|
263
461
|
const own = sessions.get(sessionId).groups ?? [];
|
|
264
462
|
const sharedGroups = (peer.groups ?? []).filter((group) => own.includes(group));
|
|
265
463
|
const profile = peer.profile?.displayName ?? peer.profile?.name;
|
|
464
|
+
const summary = summaries.get(peerSessionId);
|
|
266
465
|
return {
|
|
267
466
|
sessionId: peerSessionId,
|
|
268
467
|
name: peer.name,
|
|
269
468
|
...profile === void 0 ? {} : { profile },
|
|
270
|
-
|
|
469
|
+
...coordinates(peerSessionId, sessionId) ? { coordinator: true } : {},
|
|
470
|
+
...coordinates(sessionId, peerSessionId) ? { coordinated: true } : {},
|
|
471
|
+
sharedGroups,
|
|
472
|
+
...summary === void 0 ? {} : { summary },
|
|
473
|
+
...peer.phase === void 0 ? {} : { phase: peer.phase },
|
|
474
|
+
...peer.awaitingInput ? { awaitingInput: true } : {},
|
|
475
|
+
...peer.lastSettledAt === void 0 ? {} : { lastSettledAt: peer.lastSettledAt }
|
|
271
476
|
};
|
|
272
477
|
},
|
|
478
|
+
listPeers() {
|
|
479
|
+
const peers = [];
|
|
480
|
+
for (const [peerSessionId, peer] of communicationEndpoints) {
|
|
481
|
+
if (!peer.ready) continue;
|
|
482
|
+
const described = endpoint.describePeer?.(peerSessionId);
|
|
483
|
+
if (described !== void 0) peers.push(described);
|
|
484
|
+
}
|
|
485
|
+
return peers;
|
|
486
|
+
},
|
|
273
487
|
close() {
|
|
274
488
|
if (communicationEndpoints.get(sessionId)?.endpoint !== endpoint) return;
|
|
275
489
|
communicationEndpoints.delete(sessionId);
|
|
@@ -280,6 +494,76 @@ function createHeadlessHub(options) {
|
|
|
280
494
|
communicationEndpoints.set(sessionId, record);
|
|
281
495
|
return endpoint;
|
|
282
496
|
};
|
|
497
|
+
const mentionsOf = (owner) => {
|
|
498
|
+
let state = mentions.get(owner);
|
|
499
|
+
if (state === void 0) mentions.set(owner, state = {
|
|
500
|
+
active: /* @__PURE__ */ new Set(),
|
|
501
|
+
expired: /* @__PURE__ */ new Set()
|
|
502
|
+
});
|
|
503
|
+
return state;
|
|
504
|
+
};
|
|
505
|
+
/** Moves `id` to the newest end of a list and drops the oldest entry past the cap. */
|
|
506
|
+
const addMention = (list, id) => {
|
|
507
|
+
list.delete(id);
|
|
508
|
+
list.add(id);
|
|
509
|
+
if (list.size > MAX_SESSION_MENTIONS) list.delete(list.values().next().value);
|
|
510
|
+
};
|
|
511
|
+
/** Best effort: when the write fails, the change holds until this server stops. */
|
|
512
|
+
const persistMentions = (owner) => {
|
|
513
|
+
const store = sessions.get(owner)?.host.runtime?.session;
|
|
514
|
+
if (typeof store?.commit !== "function") return;
|
|
515
|
+
const state = mentions.get(owner);
|
|
516
|
+
const value = {
|
|
517
|
+
active: [...state?.active ?? []],
|
|
518
|
+
expired: [...state?.expired ?? []]
|
|
519
|
+
};
|
|
520
|
+
store.commit(async (tx) => {
|
|
521
|
+
(await tx.doc(require_docs.SessionMetadataDoc)).mentions = value;
|
|
522
|
+
}, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT).catch((error) => options.onNotice?.(`Session mentions could not be saved: ${String(error)}`));
|
|
523
|
+
};
|
|
524
|
+
const mentionTarget = (id, dormant) => {
|
|
525
|
+
const live = sessions.get(id);
|
|
526
|
+
if (live !== void 0) return {
|
|
527
|
+
sessionId: id,
|
|
528
|
+
name: live.name,
|
|
529
|
+
...live.workspaceId === void 0 ? {} : { workspaceId: live.workspaceId },
|
|
530
|
+
live: true
|
|
531
|
+
};
|
|
532
|
+
const stopped = dormant.find((entry) => entry.sessionId === id);
|
|
533
|
+
return stopped === void 0 ? void 0 : {
|
|
534
|
+
sessionId: id,
|
|
535
|
+
name: stopped.name,
|
|
536
|
+
workspaceId: stopped.workspaceId,
|
|
537
|
+
live: false
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
const mentionService = {
|
|
541
|
+
list(owner) {
|
|
542
|
+
const state = mentions.get(owner);
|
|
543
|
+
const dormant = options.dormantSessions?.() ?? [];
|
|
544
|
+
const described = (ids) => [...ids ?? []].flatMap((id) => mentionTarget(id, dormant) ?? []);
|
|
545
|
+
return {
|
|
546
|
+
active: described(state?.active),
|
|
547
|
+
expired: described(state?.expired)
|
|
548
|
+
};
|
|
549
|
+
},
|
|
550
|
+
expire(owner) {
|
|
551
|
+
const state = mentions.get(owner);
|
|
552
|
+
if (state === void 0 || state.active.size === 0) return;
|
|
553
|
+
for (const id of state.active) addMention(state.expired, id);
|
|
554
|
+
state.active.clear();
|
|
555
|
+
persistMentions(owner);
|
|
556
|
+
},
|
|
557
|
+
restore(owner, target) {
|
|
558
|
+
const state = mentions.get(owner);
|
|
559
|
+
if (state?.expired.has(target) !== true || mentionTarget(target, options.dormantSessions?.() ?? []) === void 0) return false;
|
|
560
|
+
state.expired.delete(target);
|
|
561
|
+
addMention(state.active, target);
|
|
562
|
+
persistMentions(owner);
|
|
563
|
+
announceCommunicationReady(owner);
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
};
|
|
283
567
|
const queuedEvents = [];
|
|
284
568
|
let publishing = false;
|
|
285
569
|
const emit = (event) => {
|
|
@@ -298,14 +582,51 @@ function createHeadlessHub(options) {
|
|
|
298
582
|
}
|
|
299
583
|
};
|
|
300
584
|
const sessionScopes = () => [...sessions.values()].map(scopeOf);
|
|
301
|
-
const publish = (frameType, sessionId, payload, connectionId) => {
|
|
302
|
-
|
|
585
|
+
const publish = (frameType, sessionId, payload, connectionId, deviceId) => {
|
|
586
|
+
const session = sessions.get(sessionId);
|
|
587
|
+
if (!session) return;
|
|
588
|
+
const source = selectedChannel(session, frameType)?.source;
|
|
589
|
+
if (source?.homeFor) {
|
|
590
|
+
const key = JSON.stringify([sessionId, frameType]);
|
|
591
|
+
let projection;
|
|
592
|
+
try {
|
|
593
|
+
const home = require_home.parseHomeProjection(source.homeFor(scopeOf(session)));
|
|
594
|
+
if (!home) throw new Error("Invalid Home projection.");
|
|
595
|
+
indexHomeProjection(key, frameType, session, home);
|
|
596
|
+
projection = JSON.stringify({
|
|
597
|
+
coverage: home.coverage,
|
|
598
|
+
entities: home.entities.map((entity) => {
|
|
599
|
+
if (entity.kind !== "running" && entity.kind !== "queued" && entity.kind !== "completed") return entity;
|
|
600
|
+
const competing = (homeCandidates.get(JSON.stringify([
|
|
601
|
+
frameType,
|
|
602
|
+
session.workspaceId,
|
|
603
|
+
entity.id
|
|
604
|
+
]))?.size ?? 0) > 1;
|
|
605
|
+
return {
|
|
606
|
+
id: entity.id,
|
|
607
|
+
kind: entity.kind,
|
|
608
|
+
sessionId: entity.sessionId,
|
|
609
|
+
relatedSessionIds: entity.relatedSessionIds,
|
|
610
|
+
...competing ? { updatedAt: entity.updatedAt } : {}
|
|
611
|
+
};
|
|
612
|
+
})
|
|
613
|
+
});
|
|
614
|
+
} catch {
|
|
615
|
+
projection = "";
|
|
616
|
+
removeHomeProjection(key);
|
|
617
|
+
}
|
|
618
|
+
if (projection === "" || homeProjections.get(key) !== projection) {
|
|
619
|
+
if (projection !== "") homeProjections.set(key, projection);
|
|
620
|
+
queueHomeBump(session);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
303
623
|
emit({
|
|
304
624
|
kind: "channel",
|
|
305
625
|
frameType,
|
|
306
626
|
sessionId,
|
|
307
627
|
payload,
|
|
308
|
-
...connectionId === void 0 ? {} : { connectionId }
|
|
628
|
+
...connectionId === void 0 ? {} : { connectionId },
|
|
629
|
+
...deviceId === void 0 ? {} : { deviceId }
|
|
309
630
|
});
|
|
310
631
|
};
|
|
311
632
|
/**
|
|
@@ -346,6 +667,68 @@ function createHeadlessHub(options) {
|
|
|
346
667
|
}
|
|
347
668
|
};
|
|
348
669
|
};
|
|
670
|
+
const createInWorkspace = (request) => {
|
|
671
|
+
if (request.parentSessionId !== void 0 || request.reservationId !== void 0) throw new Error("Explicit workspace placement requires a new top-level session.");
|
|
672
|
+
const workspace = workspaces.get(request.workspaceId);
|
|
673
|
+
if (!workspace || workspace.available === false) throw new Error("The session workspace is unavailable.");
|
|
674
|
+
if (workspace.kind === "session" && node_path.default.resolve(request.cwd) === workspace.root) throw new Error("Create a workspace-free session to allocate its working folder.");
|
|
675
|
+
if (options.createSession === void 0) throw new Error("The cockpit session service cannot create sessions in this host.");
|
|
676
|
+
const { workspaceId, ...creation } = request;
|
|
677
|
+
return options.createSession(creation, { workspaceId });
|
|
678
|
+
};
|
|
679
|
+
/** Host-only creator lookup: identities and profiles are compared here and never returned. */
|
|
680
|
+
const resolveCreator = async (query) => {
|
|
681
|
+
const { workspaceId, creatorSessionId, profile, personKey } = query;
|
|
682
|
+
const sameAs = async (starter) => !!creatorSessionId && !!personKey && !!starter && await require_hubChannel.poHubCreatorPersonKey(creatorSessionId, starter) === personKey;
|
|
683
|
+
const dormant = options.dormantSessions?.() ?? [];
|
|
684
|
+
if (creatorSessionId !== void 0) {
|
|
685
|
+
const live = sessions.get(creatorSessionId);
|
|
686
|
+
if (live !== void 0) return live.workspaceId === workspaceId && (!personKey || await sameAs(live.startedBy)) ? {
|
|
687
|
+
sessionId: live.id,
|
|
688
|
+
live: true,
|
|
689
|
+
match: "creator"
|
|
690
|
+
} : void 0;
|
|
691
|
+
const asleep = dormant.find((entry) => entry.sessionId === creatorSessionId);
|
|
692
|
+
if (asleep !== void 0) return asleep.workspaceId === workspaceId && (!personKey || await sameAs(asleep.startedBy)) ? {
|
|
693
|
+
sessionId: asleep.sessionId,
|
|
694
|
+
live: false,
|
|
695
|
+
match: "creator"
|
|
696
|
+
} : void 0;
|
|
697
|
+
}
|
|
698
|
+
if (!profile || !personKey || !creatorSessionId) return void 0;
|
|
699
|
+
const newest = (items) => items.sort((a, b) => b.at - a.at || (a.id < b.id ? -1 : 1));
|
|
700
|
+
const liveMatch = newest([...sessions.values()].filter((session) => session.workspaceId === workspaceId && session.interaction !== "unattended" && session.startedBy !== void 0 && session.profile?.name === profile).map((session) => ({
|
|
701
|
+
id: session.id,
|
|
702
|
+
at: Date.parse(session.updatedAt ?? session.createdAt) || 0,
|
|
703
|
+
starter: session.startedBy
|
|
704
|
+
})));
|
|
705
|
+
for (const candidate of liveMatch) if (await sameAs(candidate.starter)) return {
|
|
706
|
+
sessionId: candidate.id,
|
|
707
|
+
live: true,
|
|
708
|
+
match: "profile"
|
|
709
|
+
};
|
|
710
|
+
let updated;
|
|
711
|
+
try {
|
|
712
|
+
updated = new Map((await options.platform.sessions.list(dist_interop_chordContext_mjs.BACKGROUND_CONTEXT)).map((entry) => [entry.sessionId, entry.updatedAt]));
|
|
713
|
+
} catch {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const candidates = newest(dormant.filter((entry) => entry.workspaceId === workspaceId && entry.interaction !== "unattended" && !sessions.has(entry.sessionId) && entry.startedBy !== void 0).map((entry) => ({
|
|
717
|
+
id: entry.sessionId,
|
|
718
|
+
at: Number(updated.get(entry.sessionId) ?? 0),
|
|
719
|
+
starter: entry.startedBy
|
|
720
|
+
})));
|
|
721
|
+
for (const candidate of candidates) {
|
|
722
|
+
if (!await sameAs(candidate.starter)) continue;
|
|
723
|
+
try {
|
|
724
|
+
if ((await require_index$1.readSavedSelection(options.platform.sessions, candidate.id))?.profile === profile) return {
|
|
725
|
+
sessionId: candidate.id,
|
|
726
|
+
live: false,
|
|
727
|
+
match: "profile"
|
|
728
|
+
};
|
|
729
|
+
} catch {}
|
|
730
|
+
}
|
|
731
|
+
};
|
|
349
732
|
const channelHost = (frameType, mount) => ({
|
|
350
733
|
homeDirectory: options.platform.homeDirectory,
|
|
351
734
|
sessionStorage: options.platform.sessions,
|
|
@@ -355,13 +738,28 @@ function createHeadlessHub(options) {
|
|
|
355
738
|
}),
|
|
356
739
|
sessionService: {
|
|
357
740
|
reservations: reservationsFor(mount),
|
|
358
|
-
create: async (request) => {
|
|
741
|
+
create: async ({ startedBy: _startedBy, startedByOf, ...request }) => {
|
|
742
|
+
if (request.sessionProvenance === "coordinator") throw new Error("The coordinator provenance is reserved for the host.");
|
|
743
|
+
if (request.requiredParentWorkspaceId !== void 0 && mount.scope !== "host") throw new Error("Only a host mount can require parent workspace placement.");
|
|
744
|
+
if (startedByOf !== void 0 && (mount.scope !== "host" || request.workspaceId === void 0)) throw new Error("Inheriting a session starter requires explicit workspace placement on a host mount.");
|
|
745
|
+
if (request.workspaceId !== void 0) {
|
|
746
|
+
if (mount.scope !== "host") throw new Error("Explicit workspace placement requires a host mount.");
|
|
747
|
+
const owner = startedByOf === void 0 ? void 0 : sessions.get(startedByOf) ?? options.dormantSessions?.().find((entry) => entry.sessionId === startedByOf);
|
|
748
|
+
const startedBy = owner?.workspaceId === request.workspaceId ? owner.startedBy : void 0;
|
|
749
|
+
const created = await createInWorkspace({
|
|
750
|
+
...request,
|
|
751
|
+
workspaceId: request.workspaceId,
|
|
752
|
+
...startedBy === void 0 ? {} : { startedBy }
|
|
753
|
+
});
|
|
754
|
+
if (startedByOf !== void 0 && owner?.workspaceId === request.workspaceId) launchLinks.add(sessionPair(startedByOf, created.sessionId));
|
|
755
|
+
return created;
|
|
756
|
+
}
|
|
359
757
|
if (mount.scope === "workspace" && request.parentSessionId === void 0) {
|
|
360
758
|
if (request.reservationId !== void 0) throw new Error("A reserved session requires its owning parent.");
|
|
361
759
|
if (options.createSession === void 0) throw new Error("The cockpit session service cannot create sessions in this host.");
|
|
362
760
|
return options.createSession(request, { workspaceId: mount.workspaceId });
|
|
363
761
|
}
|
|
364
|
-
if (mount.scope !== "
|
|
762
|
+
if (mount.scope !== "host") {
|
|
365
763
|
const parent = request.parentSessionId === void 0 ? void 0 : sessions.get(request.parentSessionId);
|
|
366
764
|
if (!parent || !belongs(mount, parent)) throw new Error("Parent session is outside this mount.");
|
|
367
765
|
}
|
|
@@ -381,12 +779,39 @@ function createHeadlessHub(options) {
|
|
|
381
779
|
await sessionService.close(id);
|
|
382
780
|
},
|
|
383
781
|
isLive: (id) => sessionService.isLive(id),
|
|
782
|
+
...mount.scope === "host" ? {
|
|
783
|
+
scopes: sessionScopes,
|
|
784
|
+
resolveCreator,
|
|
785
|
+
homeWorkspaceId: sessionService.homeWorkspaceId?.bind(sessionService),
|
|
786
|
+
prompt: sessionService.prompt?.bind(sessionService),
|
|
787
|
+
steer: sessionService.steer?.bind(sessionService),
|
|
788
|
+
readExecutionState: sessionService.readExecutionState?.bind(sessionService),
|
|
789
|
+
release: sessionService.release?.bind(sessionService)
|
|
790
|
+
} : {},
|
|
791
|
+
...mount.scope === "host" && options.dormantSessions && options.reviveSession ? {
|
|
792
|
+
dormant: options.dormantSessions,
|
|
793
|
+
revive: options.reviveSession
|
|
794
|
+
} : {},
|
|
795
|
+
...mount.scope === "host" && options.directoryReady ? { directoryReady: options.directoryReady } : {},
|
|
796
|
+
...mount.scope === "host" && options.removedSessions ? { removed: options.removedSessions } : {},
|
|
384
797
|
registerReservedWorktreeProvisioner: (provisioner) => registerReservedWorktreeProvisioner(mount, provisioner),
|
|
385
798
|
canCommunicate: (sourceId, targetId) => {
|
|
386
799
|
const source = sessions.get(sourceId);
|
|
387
800
|
return source !== void 0 && belongs(mount, source) && sessionService.canCommunicate?.(sourceId, targetId) === true;
|
|
801
|
+
},
|
|
802
|
+
mentions: {
|
|
803
|
+
list: (owner) => ownedBy(mount, owner) ? mentionService.list(owner) : {
|
|
804
|
+
active: [],
|
|
805
|
+
expired: []
|
|
806
|
+
},
|
|
807
|
+
expire: (owner) => {
|
|
808
|
+
if (ownedBy(mount, owner)) mentionService.expire(owner);
|
|
809
|
+
},
|
|
810
|
+
restore: (owner, target) => ownedBy(mount, owner) && mentionService.restore(owner, target)
|
|
388
811
|
}
|
|
389
812
|
},
|
|
813
|
+
...mount.scope === "host" && options.admitWorkspace ? { admitWorkspace: options.admitWorkspace } : {},
|
|
814
|
+
...mount.scope === "host" ? { workspaces: () => [...workspaces.values()] } : {},
|
|
390
815
|
directEvents: {
|
|
391
816
|
publish: (type, id, payload) => {
|
|
392
817
|
const session = sessions.get(id);
|
|
@@ -398,9 +823,9 @@ function createHeadlessHub(options) {
|
|
|
398
823
|
},
|
|
399
824
|
close: () => void 0
|
|
400
825
|
},
|
|
401
|
-
publish: (sessionId, payload) => {
|
|
826
|
+
publish: (sessionId, payload, clientFilter) => {
|
|
402
827
|
const session = sessions.get(sessionId);
|
|
403
|
-
if (session && serves(mount, frameType, session)) publish(frameType, sessionId, payload);
|
|
828
|
+
if (session && serves(mount, frameType, session)) publish(frameType, sessionId, payload, void 0, clientFilter?.deviceId);
|
|
404
829
|
},
|
|
405
830
|
publishToConnection: (connectionId, sessionId, payload) => {
|
|
406
831
|
const session = sessions.get(sessionId);
|
|
@@ -426,6 +851,16 @@ function createHeadlessHub(options) {
|
|
|
426
851
|
} },
|
|
427
852
|
onNotice: (message) => options.onNotice?.(message)
|
|
428
853
|
});
|
|
854
|
+
const invalidateHomeSource = (session, frameType) => {
|
|
855
|
+
const key = JSON.stringify([session.id, frameType]);
|
|
856
|
+
removeHomeProjection(key);
|
|
857
|
+
const source = selectedChannel(session, frameType)?.source;
|
|
858
|
+
if (source?.homeFor) try {
|
|
859
|
+
const projection = require_home.parseHomeProjection(source.homeFor(scopeOf(session)));
|
|
860
|
+
if (projection) indexHomeProjection(key, frameType, session, projection);
|
|
861
|
+
} catch {}
|
|
862
|
+
queueHomeBump(session);
|
|
863
|
+
};
|
|
429
864
|
const startChannel = (channel, mount) => {
|
|
430
865
|
const key = `${mountKey(mount)}:${channel.frameType}`;
|
|
431
866
|
if (channels.has(key)) {
|
|
@@ -448,8 +883,13 @@ function createHeadlessHub(options) {
|
|
|
448
883
|
channels.set(key, started);
|
|
449
884
|
for (const session of sessions.values()) {
|
|
450
885
|
if (selectedChannel(session, channel.frameType) !== started) continue;
|
|
451
|
-
|
|
452
|
-
|
|
886
|
+
invalidateHomeSource(session, channel.frameType);
|
|
887
|
+
try {
|
|
888
|
+
displaced.get(session.id)?.source.sessionRemoved?.(session.id);
|
|
889
|
+
source.sessionAdded?.(scopeOf(session));
|
|
890
|
+
} finally {
|
|
891
|
+
invalidateHomeSource(session, channel.frameType);
|
|
892
|
+
}
|
|
453
893
|
}
|
|
454
894
|
return started;
|
|
455
895
|
} catch (error) {
|
|
@@ -462,8 +902,13 @@ function createHeadlessHub(options) {
|
|
|
462
902
|
if (channels.get(key) !== started) return;
|
|
463
903
|
const served = [...sessions.values()].filter((session) => selectedChannel(session, channel.frameType) === started);
|
|
464
904
|
channels.delete(key);
|
|
905
|
+
for (const session of served) invalidateHomeSource(session, channel.frameType);
|
|
465
906
|
started.source.close();
|
|
466
|
-
for (const session of served)
|
|
907
|
+
for (const session of served) try {
|
|
908
|
+
selectedChannel(session, channel.frameType)?.source.sessionAdded?.(scopeOf(session));
|
|
909
|
+
} finally {
|
|
910
|
+
invalidateHomeSource(session, channel.frameType);
|
|
911
|
+
}
|
|
467
912
|
};
|
|
468
913
|
const receiveMountedChannel = (mount, sessionId, frameType, payload, connectionId) => {
|
|
469
914
|
if (!connectionId) return false;
|
|
@@ -485,11 +930,25 @@ function createHeadlessHub(options) {
|
|
|
485
930
|
options.computerUse?.forgetSession?.(sessionId);
|
|
486
931
|
} finally {
|
|
487
932
|
sessions.delete(sessionId);
|
|
933
|
+
if (current.workspaceId !== void 0) workspacePresence.get(current.workspaceId)?.forget(`session:${sessionId}`);
|
|
934
|
+
for (const key of homeProjectionCandidates.keys()) if (key.startsWith(`[${JSON.stringify(sessionId)},`)) removeHomeProjection(key);
|
|
935
|
+
queueHomeBump(current);
|
|
488
936
|
pendingSetups.delete(sessionId);
|
|
489
937
|
activities.delete(sessionId);
|
|
938
|
+
if (closeOptions?.keepDormant !== true) {
|
|
939
|
+
pendingApprovals.delete(sessionId);
|
|
940
|
+
summaries.delete(sessionId);
|
|
941
|
+
for (const link of launchLinks) if (JSON.parse(link).includes(sessionId)) launchLinks.delete(link);
|
|
942
|
+
mentions.delete(sessionId);
|
|
943
|
+
for (const state of mentions.values()) {
|
|
944
|
+
state.active.delete(sessionId);
|
|
945
|
+
state.expired.delete(sessionId);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
490
948
|
sessionCleanups.delete(sessionId);
|
|
491
949
|
presentationCleanups.get(sessionId)?.();
|
|
492
950
|
presentationCleanups.delete(sessionId);
|
|
951
|
+
compositionRefreshers.delete(sessionId);
|
|
493
952
|
avatarIcons.delete(sessionId);
|
|
494
953
|
directEvents.clearSession?.(sessionId);
|
|
495
954
|
}
|
|
@@ -512,18 +971,22 @@ function createHeadlessHub(options) {
|
|
|
512
971
|
promise: Promise.resolve(),
|
|
513
972
|
pending: true
|
|
514
973
|
};
|
|
974
|
+
const attemptId = lifecycle.snapshot(id)?.attemptId;
|
|
515
975
|
const promise = Promise.resolve().then(() => closeOptions === void 0 ? options.manager.closeSession(id) : options.manager.closeSession(id, closeOptions));
|
|
516
976
|
shutdown.promise = promise;
|
|
517
977
|
sessionShutdowns.set(session.id, shutdown);
|
|
978
|
+
if (attemptId !== void 0) lifecycle.transition(id, attemptId, "stopping");
|
|
518
979
|
promise.then(() => {
|
|
519
980
|
shutdown.pending = false;
|
|
520
|
-
if (sessionShutdowns.get(
|
|
981
|
+
if (sessionShutdowns.get(id) === shutdown) sessionShutdowns.delete(id);
|
|
982
|
+
if (attemptId !== void 0) lifecycle.transition(id, attemptId, closeOptions?.keepDormant ? "dormant" : "removed");
|
|
521
983
|
}, () => {
|
|
522
984
|
shutdown.pending = false;
|
|
985
|
+
if (attemptId !== void 0) lifecycle.transition(id, attemptId, "failed", "stop_failed");
|
|
523
986
|
});
|
|
524
987
|
return promise;
|
|
525
988
|
};
|
|
526
|
-
const register = (session) => {
|
|
989
|
+
const register = (session, attempt, publishCompositions) => {
|
|
527
990
|
if (closed) throw new Error("The headless hub is closed.");
|
|
528
991
|
if (sessions.has(session.id)) throw new Error(`Session '${session.id}' is already registered.`);
|
|
529
992
|
if (sessionShutdowns.get(session.id)?.pending) throw new Error(`Session '${session.id}' is still shutting down.`);
|
|
@@ -539,8 +1002,11 @@ function createHeadlessHub(options) {
|
|
|
539
1002
|
};
|
|
540
1003
|
sessions.set(session.id, current);
|
|
541
1004
|
announceCommunicationReady(session.id);
|
|
1005
|
+
const sandboxed = session.workspaceId !== void 0 && workspaces.get(session.workspaceId)?.sandbox !== void 0;
|
|
1006
|
+
const gitShell = sandboxed ? void 0 : options.platform.env(session.cwd);
|
|
542
1007
|
const refreshGit = () => {
|
|
543
|
-
|
|
1008
|
+
if (gitShell === void 0) return;
|
|
1009
|
+
readGitStatus(session.cwd, gitShell, session.environment).then((git) => {
|
|
544
1010
|
if (closed || sessions.get(session.id)?.host !== session.host) return;
|
|
545
1011
|
if (git?.branch === current.git?.branch && git?.dirty === current.git?.dirty) return;
|
|
546
1012
|
const { git: _previous, ...rest } = current;
|
|
@@ -555,19 +1021,56 @@ function createHeadlessHub(options) {
|
|
|
555
1021
|
});
|
|
556
1022
|
}, (error) => options.onNotice?.(`session ${session.id} git status failed (${error instanceof Error ? error.message : String(error)})`));
|
|
557
1023
|
};
|
|
558
|
-
|
|
1024
|
+
let attentionDialog;
|
|
1025
|
+
let inferredWaiting = false;
|
|
1026
|
+
const publishAttention = () => {
|
|
1027
|
+
const attention = {
|
|
1028
|
+
name: current.name,
|
|
1029
|
+
...current.parentSessionId === void 0 ? {} : { parentSessionId: current.parentSessionId },
|
|
1030
|
+
phase: current.phase ?? "idle",
|
|
1031
|
+
awaitingInput: current.awaitingInput ?? false,
|
|
1032
|
+
...current.lastSettledAt === void 0 ? {} : { settledAt: current.lastSettledAt },
|
|
1033
|
+
...attentionDialog === void 0 ? {} : { dialog: attentionDialog }
|
|
1034
|
+
};
|
|
1035
|
+
directEvents.publish(require_hubChannel.PO_SESSION_ATTENTION_EVENT, session.id, attention);
|
|
1036
|
+
};
|
|
1037
|
+
const receivePresentation = (frame) => {
|
|
559
1038
|
if (sessions.get(session.id)?.host !== session.host) return;
|
|
560
1039
|
const type = typeof frame.type === "string" ? frame.type : "";
|
|
561
1040
|
const entry = frame.entry;
|
|
562
1041
|
if (type === "entry_appended" && entry?.customType === "po-notification") {
|
|
1042
|
+
const localization = require_notification.isPoNotificationEntryData(entry.data) && entry.data.ref ? session.host.takeNotificationLocalization?.(entry.data.ref) : void 0;
|
|
563
1043
|
emit({
|
|
564
1044
|
kind: "frame",
|
|
565
1045
|
sessionId: session.id,
|
|
566
|
-
frame
|
|
1046
|
+
frame,
|
|
1047
|
+
...localization ? { localization } : {}
|
|
567
1048
|
});
|
|
1049
|
+
if (entry.type === "custom" && typeof entry.id === "string" && entry.id.length > 0 && require_notification.isPoNotificationEntryData(entry.data) && entry.data.attention === true) {
|
|
1050
|
+
if (entry.data.ref?.kind === "idle-feedback" && current.phase === "idle" && !current.awaitingInput) {
|
|
1051
|
+
inferredWaiting = true;
|
|
1052
|
+
current = {
|
|
1053
|
+
...current,
|
|
1054
|
+
awaitingInput: true,
|
|
1055
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1056
|
+
};
|
|
1057
|
+
sessions.set(session.id, current);
|
|
1058
|
+
emit({
|
|
1059
|
+
kind: "upsert",
|
|
1060
|
+
session: current
|
|
1061
|
+
});
|
|
1062
|
+
publishAttention();
|
|
1063
|
+
}
|
|
1064
|
+
const notification = {
|
|
1065
|
+
entryId: entry.id,
|
|
1066
|
+
data: entry.data,
|
|
1067
|
+
...localization ? { localization } : {}
|
|
1068
|
+
};
|
|
1069
|
+
directEvents.publish(require_hubChannel.PO_SESSION_NOTIFICATION_EVENT, session.id, notification);
|
|
1070
|
+
}
|
|
568
1071
|
return;
|
|
569
1072
|
}
|
|
570
|
-
if (type !== "agent_start" && type !== "agent_settled" && type !== "message_end" && type !== "session_info_changed" && type !== "session_groups_changed" && type !== "extension_ui_request" && type !== "extension_ui_answered") return;
|
|
1073
|
+
if (type !== "agent_start" && type !== "agent_settled" && type !== "message_end" && type !== "session_info_changed" && type !== "session_groups_changed" && type !== "session_bot_changed" && type !== "extension_ui_request" && type !== "extension_ui_answered") return;
|
|
571
1074
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
572
1075
|
const phase = type === "agent_start" ? "turn" : type === "agent_settled" ? "idle" : current.phase;
|
|
573
1076
|
const phaseChanged = phase !== current.phase;
|
|
@@ -578,16 +1081,25 @@ function createHeadlessHub(options) {
|
|
|
578
1081
|
"input",
|
|
579
1082
|
"editor"
|
|
580
1083
|
].includes(method);
|
|
581
|
-
const awaitingInput = dialog ? true : type === "extension_ui_answered" || type === "agent_settled" ? false : current.awaitingInput;
|
|
1084
|
+
const awaitingInput = dialog ? true : type === "extension_ui_answered" || type === "agent_settled" || type === "agent_start" && inferredWaiting ? false : current.awaitingInput;
|
|
1085
|
+
if (dialog || type === "extension_ui_answered" || type === "agent_settled" || type === "agent_start") inferredWaiting = false;
|
|
582
1086
|
const groups = type === "session_groups_changed" && Array.isArray(frame.groups) ? frame.groups.filter((group) => typeof group === "string") : current.groups;
|
|
1087
|
+
const botChange = type === "session_bot_changed" && typeof frame.revision === "number" ? {
|
|
1088
|
+
bot: require_hubChannel.parseStoredBot(frame.bot),
|
|
1089
|
+
botRevision: frame.revision
|
|
1090
|
+
} : void 0;
|
|
583
1091
|
current = {
|
|
584
1092
|
...current,
|
|
1093
|
+
...botChange === void 0 ? {} : {
|
|
1094
|
+
botRevision: botChange.botRevision,
|
|
1095
|
+
bot: botChange.bot
|
|
1096
|
+
},
|
|
585
1097
|
name: type === "session_info_changed" && typeof frame.name === "string" ? frame.name : current.name,
|
|
586
1098
|
...groups === void 0 ? {} : { groups },
|
|
587
1099
|
updatedAt: now,
|
|
588
1100
|
phase,
|
|
589
1101
|
phaseSince: phaseChanged ? now : current.phaseSince,
|
|
590
|
-
everPrompted:
|
|
1102
|
+
everPrompted: type === "agent_start" || type === "agent_settled" ? true : current.everPrompted,
|
|
591
1103
|
awaitingInput,
|
|
592
1104
|
...type === "agent_settled" ? { lastSettledAt: now } : {}
|
|
593
1105
|
};
|
|
@@ -596,6 +1108,17 @@ function createHeadlessHub(options) {
|
|
|
596
1108
|
kind: "upsert",
|
|
597
1109
|
session: current
|
|
598
1110
|
});
|
|
1111
|
+
if (botChange !== void 0) for (const { source } of selectedChannels(current)) source.sessionBotChanged?.(scopeOf(current));
|
|
1112
|
+
const approval = dialog ? require_approvalPrompt.parsePoApprovalPrompt(frame.approval) : void 0;
|
|
1113
|
+
if (dialog) attentionDialog = typeof frame.id === "string" && typeof frame.title === "string" ? {
|
|
1114
|
+
id: frame.id,
|
|
1115
|
+
title: frame.title,
|
|
1116
|
+
...typeof frame.message === "string" ? { message: frame.message } : {},
|
|
1117
|
+
...frame.purpose === "feedback" ? { purpose: "feedback" } : {},
|
|
1118
|
+
...approval === void 0 ? {} : { approval }
|
|
1119
|
+
} : void 0;
|
|
1120
|
+
else if (type === "extension_ui_answered" || type === "agent_settled") attentionDialog = void 0;
|
|
1121
|
+
publishAttention();
|
|
599
1122
|
if (type === "session_groups_changed") announceCommunicationReady(session.id);
|
|
600
1123
|
if (dialog) {
|
|
601
1124
|
const text = (key) => typeof frame[key] === "string" ? { [key]: frame[key] } : {};
|
|
@@ -607,34 +1130,45 @@ function createHeadlessHub(options) {
|
|
|
607
1130
|
...text("id"),
|
|
608
1131
|
method,
|
|
609
1132
|
...text("title"),
|
|
610
|
-
...text("message")
|
|
1133
|
+
...text("message"),
|
|
1134
|
+
...frame.purpose === "feedback" ? { purpose: "feedback" } : {},
|
|
1135
|
+
...approval === void 0 ? {} : { approval }
|
|
611
1136
|
}
|
|
612
1137
|
});
|
|
613
1138
|
}
|
|
614
1139
|
if (type === "agent_settled") refreshGit();
|
|
615
|
-
}
|
|
1140
|
+
};
|
|
616
1141
|
let registered = false;
|
|
617
1142
|
const root = () => session.workspaceId && workspaces.get(session.workspaceId)?.root || session.cwd;
|
|
618
|
-
let
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
1143
|
+
let selected;
|
|
1144
|
+
let publishedKey;
|
|
1145
|
+
const applyCompositions = (force = false) => {
|
|
1146
|
+
const preset = selected?.preset;
|
|
1147
|
+
const extraLayers = selected?.extraLayers ?? [];
|
|
1148
|
+
const key = selected === void 0 ? void 0 : JSON.stringify([preset, extraLayers]);
|
|
1149
|
+
if (!force && key === publishedKey) return false;
|
|
1150
|
+
let next;
|
|
622
1151
|
try {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
webComposition,
|
|
627
|
-
nativeComposition
|
|
628
|
-
};
|
|
629
|
-
return true;
|
|
1152
|
+
if (publishCompositions) next = publishCompositions();
|
|
1153
|
+
else if (options.publishSessionCompositions && preset !== void 0) next = options.publishSessionCompositions(session.id, root(), preset, extraLayers);
|
|
1154
|
+
else return false;
|
|
630
1155
|
} catch (error) {
|
|
631
|
-
options.onNotice?.(`session ${session.id} plugins
|
|
1156
|
+
options.onNotice?.(`session ${session.id} plugins${preset === void 0 ? "" : ` for preset "${preset}"`} could not be published (${error instanceof Error ? error.message : String(error)})`);
|
|
632
1157
|
return false;
|
|
633
1158
|
}
|
|
1159
|
+
publishedKey = key;
|
|
1160
|
+
const { webComposition, nativeComposition } = next;
|
|
1161
|
+
if (JSON.stringify([webComposition, nativeComposition]) === JSON.stringify([current.webComposition, current.nativeComposition])) return false;
|
|
1162
|
+
current = {
|
|
1163
|
+
...current,
|
|
1164
|
+
webComposition,
|
|
1165
|
+
nativeComposition
|
|
1166
|
+
};
|
|
1167
|
+
return true;
|
|
634
1168
|
};
|
|
635
1169
|
const applyProfile = (profileName) => {
|
|
636
1170
|
let identity;
|
|
637
|
-
if (profileName) try {
|
|
1171
|
+
if (profileName && !sandboxed) try {
|
|
638
1172
|
identity = options.resolveProfileIdentity?.(root(), profileName);
|
|
639
1173
|
} catch (error) {
|
|
640
1174
|
options.onNotice?.(`session ${session.id} profile "${profileName}" could not be resolved (${error instanceof Error ? error.message : String(error)})`);
|
|
@@ -658,7 +1192,11 @@ function createHeadlessHub(options) {
|
|
|
658
1192
|
};
|
|
659
1193
|
const applySelection = (selection) => {
|
|
660
1194
|
if (closed || sessions.get(session.id)?.host !== session.host) return;
|
|
661
|
-
|
|
1195
|
+
selected = {
|
|
1196
|
+
preset: selection.preset,
|
|
1197
|
+
...selection.extraLayers ? { extraLayers: selection.extraLayers } : {}
|
|
1198
|
+
};
|
|
1199
|
+
const compositionsChanged = applyCompositions();
|
|
662
1200
|
const profileChanged = applyProfile(selection.profile);
|
|
663
1201
|
if (!compositionsChanged && !profileChanged) return;
|
|
664
1202
|
sessions.set(session.id, current);
|
|
@@ -667,6 +1205,7 @@ function createHeadlessHub(options) {
|
|
|
667
1205
|
session: current
|
|
668
1206
|
});
|
|
669
1207
|
};
|
|
1208
|
+
attempt.signal.throwIfAborted();
|
|
670
1209
|
const stopSelection = session.host.onSelection?.(applySelection);
|
|
671
1210
|
const stopBackgroundWork = session.host.onBackgroundWork?.((backgroundWorkActive) => {
|
|
672
1211
|
if (closed || sessions.get(session.id)?.host !== session.host) return;
|
|
@@ -681,23 +1220,41 @@ function createHeadlessHub(options) {
|
|
|
681
1220
|
session: current
|
|
682
1221
|
});
|
|
683
1222
|
});
|
|
1223
|
+
compositionRefreshers.set(session.id, () => {
|
|
1224
|
+
if (closed || sessions.get(session.id)?.host !== session.host) return;
|
|
1225
|
+
if (!applyCompositions(true)) return;
|
|
1226
|
+
sessions.set(session.id, current);
|
|
1227
|
+
if (registered) emit({
|
|
1228
|
+
kind: "upsert",
|
|
1229
|
+
session: current
|
|
1230
|
+
});
|
|
1231
|
+
});
|
|
1232
|
+
const stopPresentation = session.host.onPresentationFrame(receivePresentation);
|
|
684
1233
|
presentationCleanups.set(session.id, () => {
|
|
685
1234
|
stopPresentation();
|
|
686
1235
|
stopSelection?.();
|
|
687
1236
|
stopBackgroundWork?.();
|
|
688
1237
|
});
|
|
689
|
-
|
|
1238
|
+
attempt.signal.throwIfAborted();
|
|
1239
|
+
for (const { channel, source } of selectedChannels(current)) {
|
|
1240
|
+
source.sessionAdded?.(scopeOf(session));
|
|
1241
|
+
attempt.signal.throwIfAborted();
|
|
1242
|
+
invalidateHomeSource(current, channel.frameType);
|
|
1243
|
+
}
|
|
690
1244
|
const active = () => sessions.get(session.id)?.host === session.host && !closed;
|
|
691
1245
|
const cleanup = () => {
|
|
692
1246
|
subscriptions.delete(cleanup);
|
|
693
|
-
sessionCleanups.delete(session.id);
|
|
1247
|
+
if (sessionCleanups.get(session.id) === cleanup) sessionCleanups.delete(session.id);
|
|
694
1248
|
if (!active()) return;
|
|
695
1249
|
closeSession(session.id).catch((error) => options.onNotice?.(`session ${session.id} cleanup failed (${error instanceof Error ? error.message : String(error)})`));
|
|
696
1250
|
};
|
|
697
1251
|
sessionCleanups.set(session.id, cleanup);
|
|
698
1252
|
session.host.runtime.exited.then(cleanup, cleanup);
|
|
699
1253
|
subscriptions.add(cleanup);
|
|
1254
|
+
attempt.signal.throwIfAborted();
|
|
1255
|
+
lifecycle.transition(session.id, attempt.id, "ready");
|
|
700
1256
|
registered = true;
|
|
1257
|
+
queueHomeBump(current);
|
|
701
1258
|
emit({
|
|
702
1259
|
kind: "upsert",
|
|
703
1260
|
session: current
|
|
@@ -711,9 +1268,25 @@ function createHeadlessHub(options) {
|
|
|
711
1268
|
return;
|
|
712
1269
|
}
|
|
713
1270
|
const session = sessions.get(sessionId);
|
|
714
|
-
if (session === void 0)
|
|
715
|
-
|
|
716
|
-
|
|
1271
|
+
if (session === void 0) {
|
|
1272
|
+
const creation = pendingCreates.get(sessionId);
|
|
1273
|
+
const state = lifecycle.snapshot(sessionId);
|
|
1274
|
+
if (state === void 0 || creation === void 0 && lifecycle.opening(sessionId) === void 0) return;
|
|
1275
|
+
const alreadyStopping = state.state === "stopping";
|
|
1276
|
+
if (!alreadyStopping) lifecycle.transition(sessionId, state.attemptId, "stopping");
|
|
1277
|
+
if (creation !== void 0) {
|
|
1278
|
+
const [outcome] = await Promise.allSettled([creation]);
|
|
1279
|
+
if (outcome.status === "rejected" && lifecycle.snapshot(sessionId)?.reason === "startup_cleanup_failed") throw outcome.reason;
|
|
1280
|
+
}
|
|
1281
|
+
if (!alreadyStopping) lifecycle.transition(sessionId, state.attemptId, closeOptions?.keepDormant ? "dormant" : "removed");
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
const stopping = startSessionShutdown(session, closeOptions);
|
|
1285
|
+
try {
|
|
1286
|
+
unregisterSession(sessionId, closeOptions);
|
|
1287
|
+
} finally {
|
|
1288
|
+
await stopping;
|
|
1289
|
+
}
|
|
717
1290
|
};
|
|
718
1291
|
const promptTarget = (sessionId, parentSessionId) => {
|
|
719
1292
|
const session = closed ? void 0 : sessions.get(sessionId);
|
|
@@ -723,30 +1296,65 @@ function createHeadlessHub(options) {
|
|
|
723
1296
|
};
|
|
724
1297
|
sessionService = {
|
|
725
1298
|
create: async (request) => {
|
|
1299
|
+
if (request.workspaceId !== void 0) return createInWorkspace({
|
|
1300
|
+
...request,
|
|
1301
|
+
workspaceId: request.workspaceId
|
|
1302
|
+
});
|
|
726
1303
|
if (options.createSession === void 0) throw new Error("The cockpit session service cannot create sessions in this host.");
|
|
727
1304
|
return options.createSession(request);
|
|
728
1305
|
},
|
|
729
1306
|
close: closeSession,
|
|
730
1307
|
isLive: (sessionId) => !closed && sessions.has(sessionId),
|
|
1308
|
+
homeWorkspaceId: () => [...workspaces.values()].find((workspace) => workspace.kind === "session")?.id,
|
|
731
1309
|
readExecutionState: async (sessionId, readOptions) => {
|
|
732
1310
|
const target = promptTarget(sessionId, readOptions?.parentSessionId);
|
|
733
1311
|
if (!target.host.readExecutionState) throw new Error("The session cannot report execution state.");
|
|
734
1312
|
return target.host.readExecutionState();
|
|
735
1313
|
},
|
|
1314
|
+
readMessages: async (sessionId, readOptions) => {
|
|
1315
|
+
const target = promptTarget(sessionId, readOptions?.parentSessionId);
|
|
1316
|
+
if (!target.host.readMessages) throw new Error("The session cannot read its messages.");
|
|
1317
|
+
return target.host.readMessages(Math.min(Math.max(readOptions?.limit ?? 20, 1), 200));
|
|
1318
|
+
},
|
|
736
1319
|
prompt: async (sessionId, text, promptOptions) => {
|
|
737
1320
|
promptOptions?.signal?.throwIfAborted();
|
|
738
|
-
const { settled } = await promptTarget(sessionId, promptOptions?.parentSessionId).host.runtime.submitPrompt(text);
|
|
739
|
-
return
|
|
1321
|
+
const { settled, handledCommand } = await promptTarget(sessionId, promptOptions?.parentSessionId).host.runtime.submitPrompt(text);
|
|
1322
|
+
return handledCommand ? {
|
|
1323
|
+
settled,
|
|
1324
|
+
handledCommand
|
|
1325
|
+
} : { settled };
|
|
740
1326
|
},
|
|
741
1327
|
abort: async (sessionId, abortOptions) => {
|
|
742
1328
|
await promptTarget(sessionId, abortOptions?.parentSessionId).host.runtime.abort();
|
|
743
1329
|
},
|
|
744
1330
|
steer: async (sessionId, message, steerOptions) => {
|
|
745
|
-
|
|
1331
|
+
const { runtime } = promptTarget(sessionId, steerOptions?.parentSessionId).host;
|
|
1332
|
+
await runtime.steer(typeof message === "string" ? message : {
|
|
1333
|
+
role: "custom",
|
|
1334
|
+
customType: require_childSession.PO_CHILD_INPUT_CUSTOM_TYPE,
|
|
1335
|
+
content: message.text,
|
|
1336
|
+
display: true,
|
|
1337
|
+
details: { sender: message.sender },
|
|
1338
|
+
timestamp: Date.now()
|
|
1339
|
+
});
|
|
746
1340
|
},
|
|
747
1341
|
release: async (sessionId, releaseOptions) => {
|
|
748
|
-
promptTarget(sessionId, releaseOptions?.parentSessionId);
|
|
749
|
-
|
|
1342
|
+
const target = promptTarget(sessionId, releaseOptions?.parentSessionId);
|
|
1343
|
+
if (releaseOptions?.onlyIfIdle) {
|
|
1344
|
+
let shutdown;
|
|
1345
|
+
await target.host.runIfIdle?.(() => {
|
|
1346
|
+
shutdown = closeSession(sessionId, {
|
|
1347
|
+
keepDormant: true,
|
|
1348
|
+
reason: "released"
|
|
1349
|
+
});
|
|
1350
|
+
});
|
|
1351
|
+
await shutdown;
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1354
|
+
await closeSession(sessionId, {
|
|
1355
|
+
keepDormant: true,
|
|
1356
|
+
reason: "released"
|
|
1357
|
+
});
|
|
750
1358
|
},
|
|
751
1359
|
reservations: options.sessionReservations,
|
|
752
1360
|
provisionReservedWorktree: async (request) => {
|
|
@@ -755,14 +1363,22 @@ function createHeadlessHub(options) {
|
|
|
755
1363
|
if (provisioner === void 0) throw new Error("Automatic conversation worktree provisioning is unavailable.");
|
|
756
1364
|
return provisioner(request);
|
|
757
1365
|
},
|
|
758
|
-
registerReservedWorktreeProvisioner: (provisioner) => registerReservedWorktreeProvisioner({ scope: "
|
|
1366
|
+
registerReservedWorktreeProvisioner: (provisioner) => registerReservedWorktreeProvisioner({ scope: "host" }, provisioner),
|
|
759
1367
|
canCommunicate,
|
|
1368
|
+
mentions: mentionService,
|
|
760
1369
|
bindCommunication
|
|
761
1370
|
};
|
|
1371
|
+
const installOptions = (mount) => ({
|
|
1372
|
+
onNotice: (message) => options.onNotice?.(message),
|
|
1373
|
+
onPackageFailed: (failure) => options.onPackageFailed?.(mount, failure)
|
|
1374
|
+
});
|
|
762
1375
|
const serveScope = async (suppliedContext, packages = []) => {
|
|
763
1376
|
if (closed) throw new Error("The headless hub is closed.");
|
|
764
|
-
const context = suppliedContext
|
|
765
|
-
|
|
1377
|
+
const context = suppliedContext ? {
|
|
1378
|
+
...suppliedContext,
|
|
1379
|
+
scope: require_index.requireCurrentScope(suppliedContext.scope, "definition")
|
|
1380
|
+
} : {
|
|
1381
|
+
scope: "host",
|
|
766
1382
|
...options.hubToken?.() === void 0 ? {} : { hubToken: options.hubToken() },
|
|
767
1383
|
sessionService,
|
|
768
1384
|
directEvents,
|
|
@@ -770,21 +1386,24 @@ function createHeadlessHub(options) {
|
|
|
770
1386
|
};
|
|
771
1387
|
if (context.scope === "session") throw new Error("Session packages belong to their session host.");
|
|
772
1388
|
if (context.scope === "workspace" && (!context.workspaceId || !context.workspaceRoot)) throw new Error("Workspace mounts require an admitted identity and root.");
|
|
773
|
-
const mount = context.scope === "
|
|
1389
|
+
const mount = context.scope === "host" ? { scope: "host" } : {
|
|
774
1390
|
scope: "workspace",
|
|
775
1391
|
workspaceId: context.workspaceId
|
|
776
1392
|
};
|
|
777
1393
|
const key = mountKey(mount);
|
|
778
1394
|
if (scopeHosts.has(key)) throw new Error(`The '${key}' scope is already served.`);
|
|
779
|
-
const host = require_index.createPoServerHost({
|
|
1395
|
+
const host = require_index$2.createPoServerHost({
|
|
780
1396
|
scope: context.scope,
|
|
781
1397
|
context: {
|
|
782
1398
|
...context,
|
|
1399
|
+
...options.clientDevices === void 0 ? {} : { clientDevices: options.clientDevices },
|
|
783
1400
|
homeDirectory: context.homeDirectory ?? options.platform.homeDirectory,
|
|
784
1401
|
sessionStorage: options.platform.sessions,
|
|
785
1402
|
sessionService: channelHost("", mount).sessionService,
|
|
786
1403
|
directEvents: channelHost("", mount).directEvents,
|
|
787
|
-
receiveChannel: (sessionId, frameType, payload, connectionId) => receiveMountedChannel(mount, sessionId, frameType, payload, connectionId)
|
|
1404
|
+
receiveChannel: (sessionId, frameType, payload, connectionId) => receiveMountedChannel(mount, sessionId, frameType, payload, connectionId),
|
|
1405
|
+
bumpRevision: (name) => bumpRevision(mount.scope === "host" ? `host:${name}` : `workspace:${mount.workspaceId}:${name}`),
|
|
1406
|
+
...mount.scope === "host" ? { setSessionPendingApprovals } : {}
|
|
788
1407
|
},
|
|
789
1408
|
mountChannel: (channel) => {
|
|
790
1409
|
const started = startChannel(channel, mount);
|
|
@@ -801,7 +1420,7 @@ function createHeadlessHub(options) {
|
|
|
801
1420
|
});
|
|
802
1421
|
let scope;
|
|
803
1422
|
try {
|
|
804
|
-
scope = await (mount.scope === "
|
|
1423
|
+
scope = await (mount.scope === "host" ? openGlobalScope() : openWorkspaceScope(mount.workspaceId));
|
|
805
1424
|
await scope.serve({
|
|
806
1425
|
host,
|
|
807
1426
|
platform: options.platform
|
|
@@ -810,10 +1429,11 @@ function createHeadlessHub(options) {
|
|
|
810
1429
|
host,
|
|
811
1430
|
scope
|
|
812
1431
|
});
|
|
813
|
-
await scope.install(packages,
|
|
1432
|
+
await scope.install(packages, installOptions(mount));
|
|
814
1433
|
if (closed) throw new Error("The headless hub was closed while serving a scope.");
|
|
815
1434
|
if (mount.scope === "workspace") {
|
|
816
1435
|
const workspace = {
|
|
1436
|
+
...workspaces.get(mount.workspaceId),
|
|
817
1437
|
id: mount.workspaceId,
|
|
818
1438
|
root: context.workspaceRoot,
|
|
819
1439
|
available: true
|
|
@@ -833,13 +1453,15 @@ function createHeadlessHub(options) {
|
|
|
833
1453
|
throw error;
|
|
834
1454
|
}
|
|
835
1455
|
};
|
|
836
|
-
const
|
|
1456
|
+
const servedScope = (mount) => {
|
|
837
1457
|
if (mount.scope === "session") throw new Error("Session packages belong to their session host.");
|
|
838
1458
|
if (closed) throw new Error("The headless hub is closed.");
|
|
839
1459
|
const served = scopeHosts.get(mountKey(mount));
|
|
840
1460
|
if (served === void 0) throw new Error(`The '${mountKey(mount)}' scope is not served.`);
|
|
841
|
-
|
|
1461
|
+
return served.scope;
|
|
842
1462
|
};
|
|
1463
|
+
const installPackages = async (mount, packages) => servedScope(mount).install(packages, installOptions(mount));
|
|
1464
|
+
const uninstallPackages = async (mount, names) => servedScope(mount).uninstall(names);
|
|
843
1465
|
return {
|
|
844
1466
|
sessionService,
|
|
845
1467
|
directEvents,
|
|
@@ -947,12 +1569,14 @@ function createHeadlessHub(options) {
|
|
|
947
1569
|
"blocked",
|
|
948
1570
|
"paused"
|
|
949
1571
|
].indexOf(b.kind) || Date.parse(b.updatedAt) - Date.parse(a.updatedAt) || a.id.localeCompare(b.id) || a.source.localeCompare(b.source));
|
|
1572
|
+
const recent = [...entities.values()].filter((entity) => require_home.HOME_RECENT_KINDS.includes(entity.kind)).sort((a, b) => Date.parse(b.updatedAt) - Date.parse(a.updatedAt) || a.id.localeCompare(b.id)).slice(0, 20);
|
|
950
1573
|
return {
|
|
951
1574
|
version: 1,
|
|
952
1575
|
observedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
953
1576
|
sources: [...statuses.values()],
|
|
954
1577
|
counts,
|
|
955
1578
|
items: attention.slice(offset, offset + limit),
|
|
1579
|
+
recent,
|
|
956
1580
|
total: attention.length,
|
|
957
1581
|
...offset + limit < attention.length ? { nextOffset: offset + limit } : {}
|
|
958
1582
|
};
|
|
@@ -987,6 +1611,42 @@ function createHeadlessHub(options) {
|
|
|
987
1611
|
session: present(session)
|
|
988
1612
|
});
|
|
989
1613
|
},
|
|
1614
|
+
setSessionSummary(sessionId, summary) {
|
|
1615
|
+
const session = sessions.get(sessionId);
|
|
1616
|
+
if (session === void 0) return;
|
|
1617
|
+
const next = summary?.replace(CONTROL_CHARACTERS, " ").trim().slice(0, MAX_SESSION_SUMMARY).trim() || void 0;
|
|
1618
|
+
if (summaries.get(sessionId) === next) return;
|
|
1619
|
+
if (next === void 0) summaries.delete(sessionId);
|
|
1620
|
+
else summaries.set(sessionId, next);
|
|
1621
|
+
emit({
|
|
1622
|
+
kind: "upsert",
|
|
1623
|
+
session: present(session)
|
|
1624
|
+
});
|
|
1625
|
+
},
|
|
1626
|
+
grantMentionedSessions(sessionId, text, mayActIn) {
|
|
1627
|
+
if (!sessions.has(sessionId)) return;
|
|
1628
|
+
const named = [...[...sessions.values()].map((session) => ({
|
|
1629
|
+
id: session.id,
|
|
1630
|
+
name: session.name
|
|
1631
|
+
})), ...(options.dormantSessions?.() ?? []).map((entry) => ({
|
|
1632
|
+
id: entry.sessionId,
|
|
1633
|
+
name: entry.name
|
|
1634
|
+
}))].filter((entry) => entry.id !== sessionId);
|
|
1635
|
+
const own = mentionsOf(sessionId);
|
|
1636
|
+
let linked = false;
|
|
1637
|
+
for (const [, token] of text.matchAll(SESSION_MENTION)) {
|
|
1638
|
+
const target = require_hubChannel.resolveSessionMention(token, named);
|
|
1639
|
+
if (target === void 0 || own.active.has(target) || mayActIn !== void 0 && !mayActIn(target)) continue;
|
|
1640
|
+
own.expired.delete(target);
|
|
1641
|
+
addMention(own.active, target);
|
|
1642
|
+
linked = true;
|
|
1643
|
+
}
|
|
1644
|
+
if (!linked) return;
|
|
1645
|
+
persistMentions(sessionId);
|
|
1646
|
+
announceCommunicationReady(sessionId);
|
|
1647
|
+
},
|
|
1648
|
+
setSessionPendingApprovals,
|
|
1649
|
+
sessionPendingApprovalCount: (sessionId) => pendingApprovals.get(sessionId),
|
|
990
1650
|
runtime: (sessionId) => sessions.get(sessionId)?.host.runtime,
|
|
991
1651
|
sessionAvatar(sessionId) {
|
|
992
1652
|
const match = ICON_DATA_URL.exec(avatarIcons.get(sessionId) ?? "");
|
|
@@ -1001,14 +1661,52 @@ function createHeadlessHub(options) {
|
|
|
1001
1661
|
listeners.add(listener);
|
|
1002
1662
|
return () => listeners.delete(listener);
|
|
1003
1663
|
},
|
|
1004
|
-
|
|
1664
|
+
lifecycle,
|
|
1665
|
+
register(session, publishCompositions) {
|
|
1666
|
+
if (closed) throw new Error("The headless hub is closed.");
|
|
1667
|
+
if (sessions.has(session.id)) throw new Error(`Session '${session.id}' is already registered.`);
|
|
1668
|
+
if (sessionShutdowns.get(session.id)?.pending) throw new Error(`Session '${session.id}' is still shutting down.`);
|
|
1669
|
+
const attempt = lifecycle.begin(session.id, "create");
|
|
1670
|
+
try {
|
|
1671
|
+
register(session, attempt, publishCompositions);
|
|
1672
|
+
} catch (error) {
|
|
1673
|
+
lifecycle.fail(session.id, attempt.id, error, {
|
|
1674
|
+
cancelled: false,
|
|
1675
|
+
recorded: false
|
|
1676
|
+
});
|
|
1677
|
+
if (sessions.get(session.id)?.host === session.host) unregisterSession(session.id);
|
|
1678
|
+
throw error;
|
|
1679
|
+
}
|
|
1680
|
+
},
|
|
1005
1681
|
notifySessionRemoved(sessionId) {
|
|
1682
|
+
const state = lifecycle.snapshot(sessionId);
|
|
1683
|
+
if (state?.state === "dormant" || state?.state === "failed" || state?.state === "paused") lifecycle.transition(sessionId, state.attemptId, "removed");
|
|
1006
1684
|
emit({
|
|
1007
1685
|
kind: "removed",
|
|
1008
1686
|
sessionId
|
|
1009
1687
|
});
|
|
1688
|
+
for (const { channel, source } of channels.values()) try {
|
|
1689
|
+
source.sessionDeleted?.(sessionId);
|
|
1690
|
+
} catch (error) {
|
|
1691
|
+
options.onNotice?.(`hub channel '${channel.frameType}' removal of ${sessionId} failed (${String(error)})`);
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
notifySessionDeleted(sessionId) {
|
|
1695
|
+
for (const { channel, source } of channels.values()) try {
|
|
1696
|
+
source.sessionPermanentlyDeleted?.(sessionId);
|
|
1697
|
+
} catch (error) {
|
|
1698
|
+
options.onNotice?.(`hub channel '${channel.frameType}' deletion of ${sessionId} failed (${String(error)})`);
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
notifyWorkspaceDeleted(workspaceId) {
|
|
1702
|
+
for (const { channel, source } of channels.values()) try {
|
|
1703
|
+
source.workspaceDeleted?.(workspaceId);
|
|
1704
|
+
} catch (error) {
|
|
1705
|
+
options.onNotice?.(`hub channel '${channel.frameType}' deletion of ${workspaceId} failed (${String(error)})`);
|
|
1706
|
+
}
|
|
1010
1707
|
},
|
|
1011
1708
|
notifyDormantChanged(sessionId) {
|
|
1709
|
+
lifecycle.rememberDormant(sessionId);
|
|
1012
1710
|
emit({
|
|
1013
1711
|
kind: "dormant_changed",
|
|
1014
1712
|
sessionId
|
|
@@ -1016,13 +1714,26 @@ function createHeadlessHub(options) {
|
|
|
1016
1714
|
},
|
|
1017
1715
|
serveScope,
|
|
1018
1716
|
installPackages,
|
|
1717
|
+
uninstallPackages,
|
|
1019
1718
|
sessionParentScope: (workspaceId) => {
|
|
1020
1719
|
if (closed) return Promise.reject(/* @__PURE__ */ new Error("The headless hub is closed."));
|
|
1021
1720
|
return workspaceId === void 0 ? openGlobalScope() : openWorkspaceScope(workspaceId);
|
|
1022
1721
|
},
|
|
1023
1722
|
workspaces: () => [...workspaces.values()],
|
|
1723
|
+
compositionRevisions: () => Object.fromEntries(compositionRevisions),
|
|
1724
|
+
revisions: () => Object.fromEntries(revisions),
|
|
1725
|
+
bumpRevision,
|
|
1726
|
+
touchCompositions(mounts) {
|
|
1727
|
+
if (mounts.length === 0) return;
|
|
1728
|
+
for (const key of mounts.map(mountKey)) compositionRevisions.set(key, (compositionRevisions.get(key) ?? 0) + 1);
|
|
1729
|
+
emit({ kind: "compositions" });
|
|
1730
|
+
},
|
|
1731
|
+
refreshSessionCompositions() {
|
|
1732
|
+
for (const refresh of compositionRefreshers.values()) refresh();
|
|
1733
|
+
},
|
|
1024
1734
|
registerWorkspace(workspace) {
|
|
1025
1735
|
workspaces.set(workspace.id, workspace);
|
|
1736
|
+
queueHomeBump({ workspaceId: workspace.id });
|
|
1026
1737
|
emit({
|
|
1027
1738
|
kind: "workspace_upsert",
|
|
1028
1739
|
workspace
|
|
@@ -1045,6 +1756,9 @@ function createHeadlessHub(options) {
|
|
|
1045
1756
|
if (workspaces.has(id)) {
|
|
1046
1757
|
options.onWorkspaceRemoved?.(id);
|
|
1047
1758
|
workspaces.delete(id);
|
|
1759
|
+
compositionRevisions.delete(key);
|
|
1760
|
+
for (const topic of revisions.keys()) if (topic.startsWith(`workspace:${id}:`)) revisions.delete(topic);
|
|
1761
|
+
queueHomeBump({ workspaceId: id });
|
|
1048
1762
|
emit({
|
|
1049
1763
|
kind: "workspace_removed",
|
|
1050
1764
|
workspaceId: id
|
|
@@ -1056,6 +1770,21 @@ function createHeadlessHub(options) {
|
|
|
1056
1770
|
served?.host.dispose();
|
|
1057
1771
|
}
|
|
1058
1772
|
},
|
|
1773
|
+
async unloadWorkspaceScope(id) {
|
|
1774
|
+
const key = mountKey({
|
|
1775
|
+
scope: "workspace",
|
|
1776
|
+
workspaceId: id
|
|
1777
|
+
});
|
|
1778
|
+
const served = scopeHosts.get(key);
|
|
1779
|
+
scopeHosts.delete(key);
|
|
1780
|
+
const scope = workspaceScopes.get(id);
|
|
1781
|
+
workspaceScopes.delete(id);
|
|
1782
|
+
try {
|
|
1783
|
+
await (await scope)?.dispose();
|
|
1784
|
+
} finally {
|
|
1785
|
+
served?.host.dispose();
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1059
1788
|
async requestApi(mount, basePath, request) {
|
|
1060
1789
|
if (closed) return Response.json({ error: "Server is closed." }, { status: 503 });
|
|
1061
1790
|
if (mount.scope === "session") {
|
|
@@ -1071,51 +1800,110 @@ function createHeadlessHub(options) {
|
|
|
1071
1800
|
body: request.body === null ? void 0 : new Uint8Array(await request.arrayBuffer())
|
|
1072
1801
|
});
|
|
1073
1802
|
}
|
|
1074
|
-
const handler = scopeHosts.get(mountKey(mount))?.scope.apiHandler(basePath);
|
|
1803
|
+
const handler = scopeHosts.get(mountKey(mount))?.scope.apiHandler(basePath) ?? (mount.scope === "workspace" && !scopeHosts.has(mountKey(mount)) ? options.unservedWorkspaceApi?.(mount.workspaceId, basePath) : void 0);
|
|
1075
1804
|
if (!handler) return Response.json({ error: `API '${basePath}' is not mounted in ${mountKey(mount)}.` }, { status: 404 });
|
|
1076
1805
|
return handler.fetch(request);
|
|
1077
1806
|
},
|
|
1807
|
+
apiOperation(mount, basePath, method, path) {
|
|
1808
|
+
return scopeHosts.get(mountKey(mount))?.scope.apiOperation(basePath, method, path);
|
|
1809
|
+
},
|
|
1810
|
+
publicApi(basePath) {
|
|
1811
|
+
const served = closed ? void 0 : scopeHosts.get(mountKey({ scope: "host" }));
|
|
1812
|
+
const routes = served?.host.publicRoutesFor(basePath);
|
|
1813
|
+
const handler = served?.host.handlerFor(basePath);
|
|
1814
|
+
return routes === void 0 || handler === void 0 ? void 0 : {
|
|
1815
|
+
routes,
|
|
1816
|
+
handler
|
|
1817
|
+
};
|
|
1818
|
+
},
|
|
1078
1819
|
pluginRegistry,
|
|
1079
|
-
editPresence,
|
|
1080
1820
|
invokePlugin: (call, direction, caller) => pluginRegistry.invoke(call, direction, caller),
|
|
1081
|
-
async create(sessionOptions) {
|
|
1821
|
+
async create(sessionOptions, joinedAttempt) {
|
|
1082
1822
|
const id = sessionOptions.sessionId;
|
|
1083
1823
|
if (closed) throw new Error("The headless hub is closed.");
|
|
1084
1824
|
if (sessions.has(id)) throw new Error(`Session '${id}' is already registered.`);
|
|
1085
1825
|
if (sessionShutdowns.get(id)?.pending) throw new Error(`Session '${id}' is still shutting down.`);
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1826
|
+
if (pendingCreates.has(id)) throw new Error(`Session '${id}' is already opening.`);
|
|
1827
|
+
const attempt = lifecycle.begin(id, joinedAttempt === void 0 && sessionOptions.resume ? "wake" : "create", joinedAttempt);
|
|
1828
|
+
const startupSignal = sessionOptions.startupSignal === void 0 ? attempt.signal : AbortSignal.any([attempt.signal, sessionOptions.startupSignal]);
|
|
1829
|
+
const creation = Promise.resolve().then(async () => {
|
|
1830
|
+
let host;
|
|
1831
|
+
try {
|
|
1832
|
+
startupSignal.throwIfAborted();
|
|
1833
|
+
host = await options.manager.create({
|
|
1834
|
+
...sessionOptions,
|
|
1835
|
+
startupSignal,
|
|
1836
|
+
admitStartup: async () => {
|
|
1837
|
+
await lifecycle.runGates(attempt, startupSignal);
|
|
1838
|
+
startupSignal.throwIfAborted();
|
|
1839
|
+
lifecycle.transition(id, attempt.id, "ready");
|
|
1840
|
+
},
|
|
1841
|
+
bindSessionLifecycle: (root) => {
|
|
1842
|
+
const view = lifecycle.sessionView(attempt, (dispose) => {
|
|
1843
|
+
root.effect(() => dispose);
|
|
1844
|
+
});
|
|
1845
|
+
root.provide(require_sessionLifecycle.PO_SESSION_LIFECYCLE_SERVICE, view);
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
const history = await storedHistory(host);
|
|
1849
|
+
const groups = await storedGroups(host, options.onNotice);
|
|
1850
|
+
const botState = await storedBot(host, options.onNotice);
|
|
1851
|
+
const savedMentions = await storedMentions(host, options.onNotice);
|
|
1852
|
+
const session = {
|
|
1853
|
+
id: sessionOptions.sessionId,
|
|
1854
|
+
workspaceId: sessionOptions.workspaceId,
|
|
1855
|
+
webComposition: sessionOptions.webComposition,
|
|
1856
|
+
nativeComposition: sessionOptions.nativeComposition,
|
|
1857
|
+
name: sessionOptions.sessionName,
|
|
1858
|
+
cwd: sessionOptions.cwd,
|
|
1859
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1860
|
+
...sessionOptions.parentSessionId === void 0 ? {} : { parentSessionId: sessionOptions.parentSessionId },
|
|
1861
|
+
...sessionOptions.sessionProvenance === void 0 ? {} : { sessionProvenance: sessionOptions.sessionProvenance },
|
|
1862
|
+
...sessionOptions.interaction === void 0 ? {} : { interaction: sessionOptions.interaction },
|
|
1863
|
+
...sessionOptions.startedBy === void 0 ? {} : { startedBy: sessionOptions.startedBy },
|
|
1864
|
+
environment: sessionOptions.environment,
|
|
1865
|
+
...history,
|
|
1866
|
+
groups,
|
|
1867
|
+
...botState,
|
|
1868
|
+
host
|
|
1869
|
+
};
|
|
1870
|
+
if (closed) throw new Error("The headless hub is closed.");
|
|
1871
|
+
startupSignal.throwIfAborted();
|
|
1872
|
+
if (!mentions.has(id)) mentions.set(id, {
|
|
1873
|
+
active: new Set(savedMentions.active),
|
|
1874
|
+
expired: new Set(savedMentions.expired.filter((target) => !savedMentions.active.includes(target)))
|
|
1875
|
+
});
|
|
1876
|
+
register(session, attempt);
|
|
1877
|
+
startupSignal.throwIfAborted();
|
|
1878
|
+
return session;
|
|
1879
|
+
} catch (error) {
|
|
1880
|
+
if (host !== void 0 && sessions.get(id)?.host === host) try {
|
|
1881
|
+
unregisterSession(id);
|
|
1882
|
+
} catch (cleanupError) {
|
|
1883
|
+
options.onNotice?.(`Session '${id}' registration rollback failed: ${String(cleanupError)}`);
|
|
1884
|
+
}
|
|
1885
|
+
if (host !== void 0) try {
|
|
1886
|
+
const stopping = sessionShutdowns.get(id);
|
|
1887
|
+
if (stopping !== void 0) await stopping.promise;
|
|
1888
|
+
else if (startupSignal.aborted) await options.manager.closeSession(id, { keepDormant: true });
|
|
1889
|
+
else await options.manager.closeSession(id);
|
|
1890
|
+
} catch (closeError) {
|
|
1891
|
+
lifecycle.transition(id, attempt.id, "failed", "startup_cleanup_failed");
|
|
1892
|
+
throw new AggregateError([error, closeError], `Session '${id}' startup and cleanup failed.`);
|
|
1893
|
+
}
|
|
1894
|
+
lifecycle.fail(id, attempt.id, error, {
|
|
1895
|
+
cancelled: startupSignal.aborted,
|
|
1896
|
+
recorded: sessionOptions.resume === true || options.dormantSessions?.().some((session) => session.sessionId === id) === true
|
|
1897
|
+
});
|
|
1898
|
+
throw error;
|
|
1114
1899
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1900
|
+
});
|
|
1901
|
+
pendingCreates.set(id, creation);
|
|
1902
|
+
try {
|
|
1903
|
+
return await creation;
|
|
1904
|
+
} finally {
|
|
1905
|
+
pendingCreates.delete(id);
|
|
1117
1906
|
}
|
|
1118
|
-
return session;
|
|
1119
1907
|
},
|
|
1120
1908
|
closeSession,
|
|
1121
1909
|
async requestSessionApi(scope, request) {
|
|
@@ -1123,20 +1911,20 @@ function createHeadlessHub(options) {
|
|
|
1123
1911
|
if (options.requestSessionApi === void 0) return Response.json({ error: "Session API unavailable." }, { status: 404 });
|
|
1124
1912
|
return options.requestSessionApi(scope, request);
|
|
1125
1913
|
},
|
|
1126
|
-
registerChannel(channel, mount = { scope: "
|
|
1914
|
+
registerChannel(channel, mount = { scope: "host" }) {
|
|
1127
1915
|
const started = startChannel(channel, mount);
|
|
1128
1916
|
if (started === void 0) return () => void 0;
|
|
1129
1917
|
return () => releaseChannel(channel, started);
|
|
1130
1918
|
},
|
|
1131
1919
|
channelTypes: () => [...new Set([...channels.values()].map(({ channel }) => channel.frameType))],
|
|
1132
|
-
channelFrames(sessionId) {
|
|
1920
|
+
channelFrames(sessionId, connection) {
|
|
1133
1921
|
const session = sessions.get(sessionId);
|
|
1134
1922
|
if (session === void 0) return [];
|
|
1135
1923
|
const scope = scopeOf(session);
|
|
1136
1924
|
const frames = [];
|
|
1137
1925
|
for (const { channel, source } of selectedChannels(session)) {
|
|
1138
1926
|
const type = channel.frameType;
|
|
1139
|
-
const payload = source.payloadFor(scope);
|
|
1927
|
+
const payload = source.payloadFor(scope, connection);
|
|
1140
1928
|
if (payload !== void 0) frames.push({
|
|
1141
1929
|
type,
|
|
1142
1930
|
sessionId,
|
|
@@ -1146,7 +1934,7 @@ function createHeadlessHub(options) {
|
|
|
1146
1934
|
return frames;
|
|
1147
1935
|
},
|
|
1148
1936
|
childThread: (sessionId, threadId) => sessions.get(sessionId)?.host.childThread?.(threadId),
|
|
1149
|
-
receiveChannel(sessionId, frameType, payload, connectionId, desktopAuthorized = false, computerUseAuthorized = false) {
|
|
1937
|
+
receiveChannel(sessionId, frameType, payload, connectionId, desktopAuthorized = false, computerUseAuthorized = false, client) {
|
|
1150
1938
|
if (connectionId === "") return;
|
|
1151
1939
|
const session = sessions.get(sessionId);
|
|
1152
1940
|
const started = session && selectedChannels(session).find(({ channel }) => channel.frameType === frameType);
|
|
@@ -1154,7 +1942,8 @@ function createHeadlessHub(options) {
|
|
|
1154
1942
|
started.channel.receive?.(scopeOf(session), payload, {
|
|
1155
1943
|
connectionId,
|
|
1156
1944
|
...desktopAuthorized ? { desktopAuthorized: true } : {},
|
|
1157
|
-
...computerUseAuthorized ? { computerUseAuthorized: true } : {}
|
|
1945
|
+
...computerUseAuthorized ? { computerUseAuthorized: true } : {},
|
|
1946
|
+
client
|
|
1158
1947
|
});
|
|
1159
1948
|
},
|
|
1160
1949
|
disconnectChannels(connectionId) {
|
|
@@ -1165,19 +1954,34 @@ function createHeadlessHub(options) {
|
|
|
1165
1954
|
if (closed) return;
|
|
1166
1955
|
const ids = [...sessions.keys()];
|
|
1167
1956
|
closed = true;
|
|
1957
|
+
lifecycle.seal();
|
|
1958
|
+
const startupShutdowns = lifecycle.list().filter(({ sessionId }) => pendingCreates.has(sessionId) || lifecycle.opening(sessionId) !== void 0).map(({ sessionId }) => closeSession(sessionId, {
|
|
1959
|
+
keepDormant: true,
|
|
1960
|
+
reason: "host_shutdown"
|
|
1961
|
+
}));
|
|
1962
|
+
const failures = [];
|
|
1168
1963
|
directEvents.close();
|
|
1169
1964
|
for (const unsubscribe of subscriptions) unsubscribe();
|
|
1170
1965
|
subscriptions.clear();
|
|
1171
|
-
for (const cleanup of presentationCleanups.values())
|
|
1966
|
+
for (const cleanup of presentationCleanups.values()) try {
|
|
1967
|
+
cleanup();
|
|
1968
|
+
} catch (error) {
|
|
1969
|
+
failures.push(error);
|
|
1970
|
+
}
|
|
1172
1971
|
presentationCleanups.clear();
|
|
1173
|
-
|
|
1972
|
+
compositionRefreshers.clear();
|
|
1174
1973
|
pluginRegistry.dispose();
|
|
1175
|
-
|
|
1974
|
+
for (const presence of workspacePresence.values()) presence.clear();
|
|
1176
1975
|
workspaces.clear();
|
|
1177
|
-
for (const { source } of channels.values())
|
|
1976
|
+
for (const { source } of channels.values()) try {
|
|
1977
|
+
source.close();
|
|
1978
|
+
} catch (error) {
|
|
1979
|
+
failures.push(error);
|
|
1980
|
+
}
|
|
1178
1981
|
channels.clear();
|
|
1179
1982
|
listeners.clear();
|
|
1180
1983
|
const shutdowns = [...sessionShutdowns.values()].filter(({ pending }) => pending).map(({ promise }) => promise);
|
|
1984
|
+
shutdowns.push(...startupShutdowns);
|
|
1181
1985
|
for (const id of ids) {
|
|
1182
1986
|
const session = sessions.get(id);
|
|
1183
1987
|
if (session !== void 0 && !sessionShutdowns.has(id)) shutdowns.push(startSessionShutdown(session));
|