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