@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { access, readFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
//#region src/services/packageResource/index.ts
|
|
6
6
|
/**
|
|
@@ -37,12 +37,16 @@ function packageResourcePath(moduleUrl, file) {
|
|
|
37
37
|
* resolution and fails the whole prompt build.
|
|
38
38
|
*/
|
|
39
39
|
async function readPackageResource(moduleUrl, file) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
let directory = path.dirname(fileURLToPath(moduleUrl));
|
|
41
|
+
for (;;) {
|
|
42
|
+
if (await access(path.join(directory, "package.json")).then(() => true, () => false)) try {
|
|
43
|
+
return await readFile(path.join(directory, file), "utf8");
|
|
44
|
+
} catch {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
const parent = path.dirname(directory);
|
|
48
|
+
if (parent === directory) return "";
|
|
49
|
+
directory = parent;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/services/packageResource/index.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * Absolute path of a file shipped by the calling package.\n *\n * Anchored on the nearest ancestor holding a `package.json`, which is the only\n * sentinel that is correct from `src/` and from `dist/` alike. Counting levels\n * with a fixed `new URL('../../..', import.meta.url)` is not: a bundled entry\n * sits at a different depth than its source, so the walk lands outside the\n * package and every read misses.\n *\n * `moduleUrl` is required on purpose. A default of `import.meta.url` resolves to\n * this package rather than the caller's, which is a silently wrong answer.\n */\nexport function packageResourcePath(moduleUrl: string | URL, file: string): string | undefined {\n let directory = path.dirname(fileURLToPath(moduleUrl));\n for (;;) {\n if (existsSync(path.join(directory, 'package.json'))) {\n const candidate = path.join(directory, file);\n return existsSync(candidate) ? candidate : undefined;\n }\n const parent = path.dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n\n/**\n * Text of a file shipped by the calling package, or `''` when it is not there.\n *\n * Empty rather than a placeholder, and never a throw. A context resource's text\n * is pasted into the system prompt, so `'(resource unavailable: README.md)'` is\n * a string the model pays for and may act on; `''` is dropped by the prompt\n * composer instead. A throw is worse still: it propagates out of resource\n * resolution and fails the whole prompt build.\n */\nexport async function readPackageResource(moduleUrl: string | URL, file: string): Promise<string> {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/services/packageResource/index.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * Absolute path of a file shipped by the calling package.\n *\n * Anchored on the nearest ancestor holding a `package.json`, which is the only\n * sentinel that is correct from `src/` and from `dist/` alike. Counting levels\n * with a fixed `new URL('../../..', import.meta.url)` is not: a bundled entry\n * sits at a different depth than its source, so the walk lands outside the\n * package and every read misses.\n *\n * `moduleUrl` is required on purpose. A default of `import.meta.url` resolves to\n * this package rather than the caller's, which is a silently wrong answer.\n */\n// sync: exported path resolver is consumed synchronously; phase 2 must migrate package consumers.\nexport function packageResourcePath(moduleUrl: string | URL, file: string): string | undefined {\n let directory = path.dirname(fileURLToPath(moduleUrl));\n for (;;) {\n if (existsSync(path.join(directory, 'package.json'))) {\n const candidate = path.join(directory, file);\n return existsSync(candidate) ? candidate : undefined;\n }\n const parent = path.dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n\n/**\n * Text of a file shipped by the calling package, or `''` when it is not there.\n *\n * Empty rather than a placeholder, and never a throw. A context resource's text\n * is pasted into the system prompt, so `'(resource unavailable: README.md)'` is\n * a string the model pays for and may act on; `''` is dropped by the prompt\n * composer instead. A throw is worse still: it propagates out of resource\n * resolution and fails the whole prompt build.\n */\nexport async function readPackageResource(moduleUrl: string | URL, file: string): Promise<string> {\n let directory = path.dirname(fileURLToPath(moduleUrl));\n for (;;) {\n if (\n await access(path.join(directory, 'package.json')).then(\n () => true,\n () => false,\n )\n ) {\n try {\n return await readFile(path.join(directory, file), 'utf8');\n } catch {\n return '';\n }\n }\n const parent = path.dirname(directory);\n if (parent === directory) return '';\n directory = parent;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,oBAAoB,WAAyB,MAAkC;CAC7F,IAAI,YAAY,KAAK,QAAQ,cAAc,SAAS,CAAC;CACrD,SAAS;EACP,IAAI,WAAW,KAAK,KAAK,WAAW,cAAc,CAAC,GAAG;GACpD,MAAM,YAAY,KAAK,KAAK,WAAW,IAAI;GAC3C,OAAO,WAAW,SAAS,IAAI,YAAY,KAAA;EAC7C;EACA,MAAM,SAAS,KAAK,QAAQ,SAAS;EACrC,IAAI,WAAW,WAAW,OAAO,KAAA;EACjC,YAAY;CACd;AACF;;;;;;;;;;AAWA,eAAsB,oBAAoB,WAAyB,MAA+B;CAChG,IAAI,YAAY,KAAK,QAAQ,cAAc,SAAS,CAAC;CACrD,SAAS;EACP,IACE,MAAM,OAAO,KAAK,KAAK,WAAW,cAAc,CAAC,CAAC,CAAC,WAC3C,YACA,KACR,GAEA,IAAI;GACF,OAAO,MAAM,SAAS,KAAK,KAAK,WAAW,IAAI,GAAG,MAAM;EAC1D,QAAQ;GACN,OAAO;EACT;EAEF,MAAM,SAAS,KAAK,QAAQ,SAAS;EACrC,IAAI,WAAW,WAAW,OAAO;EACjC,YAAY;CACd;AACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_remote = require("../../constants/remote.cjs");
|
|
2
|
+
const require_identity = require("../../schemas/identity.cjs");
|
|
2
3
|
//#region src/services/pairingPage/index.ts
|
|
3
4
|
/**
|
|
4
5
|
* The package-owned page a scanned QR opens before any cockpit JavaScript runs.
|
|
@@ -78,7 +79,8 @@ const STYLE = `
|
|
|
78
79
|
*/
|
|
79
80
|
const SCRIPT = `
|
|
80
81
|
const params = new URLSearchParams(location.hash.slice(1));
|
|
81
|
-
|
|
82
|
+
let code = params.get('c') ?? '';
|
|
83
|
+
const accountPairing = document.body.dataset.accountPairing === '1';
|
|
82
84
|
const state = document.getElementById('state');
|
|
83
85
|
const manual = document.getElementById('manual');
|
|
84
86
|
const actions = document.getElementById('actions');
|
|
@@ -97,7 +99,7 @@ const SCRIPT = `
|
|
|
97
99
|
return { publicKey: value.publicKey, revision, fingerprint: typeof value.fingerprint === 'string' ? value.fingerprint : '' };
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
let scannedTrust = trustOf({
|
|
101
103
|
publicKey: params.get('s'),
|
|
102
104
|
revision: params.get('r'),
|
|
103
105
|
});
|
|
@@ -114,6 +116,18 @@ const SCRIPT = `
|
|
|
114
116
|
}
|
|
115
117
|
rememberChannelKey(params.get('k'));
|
|
116
118
|
history.replaceState(null, '', location.pathname);
|
|
119
|
+
if (accountPairing) {
|
|
120
|
+
try {
|
|
121
|
+
const saved = JSON.parse(sessionStorage.getItem('po.pairing.resume') ?? 'null');
|
|
122
|
+
sessionStorage.removeItem('po.pairing.resume');
|
|
123
|
+
if (code === '' && saved && Number.isSafeInteger(saved.expiresAt) && saved.expiresAt > Date.now() &&
|
|
124
|
+
saved.expiresAt <= Date.now() + ${String(require_remote.PAIRING_CODE_TTL_MS)} && typeof saved.code === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(saved.code)) {
|
|
125
|
+
code = saved.code;
|
|
126
|
+
scannedTrust = trustOf(saved.trust);
|
|
127
|
+
fragmentClaimStarted = true;
|
|
128
|
+
}
|
|
129
|
+
} catch { /* Missing, unavailable or malformed tab storage never supplies a pairing. */ }
|
|
130
|
+
}
|
|
117
131
|
window.addEventListener('hashchange', () => {
|
|
118
132
|
const nextParams = new URLSearchParams(location.hash.slice(1));
|
|
119
133
|
const nextCode = nextParams.get('c') ?? '';
|
|
@@ -230,28 +244,63 @@ const SCRIPT = `
|
|
|
230
244
|
}
|
|
231
245
|
|
|
232
246
|
async function claim(value, candidateTrust) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
247
|
+
try {
|
|
248
|
+
if (accountPairing) {
|
|
249
|
+
const response = await fetch('${require_identity.AUTH_BOOTSTRAP_PATH}', { credentials: 'same-origin', redirect: 'error' });
|
|
250
|
+
if (!response.ok) throw new Error('Sign-in is unavailable. Try again.');
|
|
251
|
+
const account = await response.json();
|
|
252
|
+
if (account.issuer !== location.origin) throw new Error('This computer does not offer same-origin sign-in.');
|
|
253
|
+
if (typeof account.session?.org !== 'string' || account.session.org === '') {
|
|
254
|
+
if (value !== '') sessionStorage.setItem('po.pairing.resume', JSON.stringify({ code: value, trust: candidateTrust, expiresAt: Date.now() + ${String(require_remote.PAIRING_CODE_TTL_MS)} }));
|
|
255
|
+
location.replace('/api/auth/browser/team?next=%2Fpair');
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (value === '') { say('Scan the code shown on the host or enter its manual code.', 'bad'); manual.hidden = false; return; }
|
|
260
|
+
say('Asking the host to approve this device...');
|
|
261
|
+
const response = await fetch('${require_remote.PAIRING_CLAIM_ROUTE}', {
|
|
262
|
+
method: 'POST',
|
|
263
|
+
headers: { 'content-type': 'application/json' },
|
|
264
|
+
credentials: 'same-origin',
|
|
265
|
+
body: JSON.stringify({ code: value, ...(accountPairing ? { accountRequired: true } : {}) }),
|
|
266
|
+
});
|
|
267
|
+
if (!response.ok) {
|
|
268
|
+
say(response.status === 429 ? 'Too many attempts. Wait a minute.' : 'That code is not valid. Scan again.', 'bad');
|
|
269
|
+
manual.hidden = false;
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const claimed = await response.json();
|
|
273
|
+
if (accountPairing) {
|
|
274
|
+
if (typeof claimed.requestId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(claimed.requestId) ||
|
|
275
|
+
typeof claimed.hostPublicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(claimed.hostPublicKey))
|
|
276
|
+
throw new Error('The host returned an invalid pairing request.');
|
|
277
|
+
const proofResponse = await fetch('${require_identity.AUTH_PAIRING_PROOF_PATH}', {
|
|
278
|
+
method: 'POST', credentials: 'same-origin', redirect: 'error',
|
|
279
|
+
headers: { 'content-type': 'application/json', 'x-po-csrf': '1' },
|
|
280
|
+
body: JSON.stringify({ requestId: claimed.requestId, hostPublicKey: claimed.hostPublicKey }),
|
|
281
|
+
});
|
|
282
|
+
if (!proofResponse.ok) throw new Error('Your sign-in could not be verified for this pairing. Sign in and pair again.');
|
|
283
|
+
const proof = await proofResponse.json();
|
|
284
|
+
if (typeof proof.proof !== 'string' || !/^[a-f0-9]{64}$/.test(proof.proof) || !Number.isSafeInteger(proof.expiresAt) || proof.expiresAt <= Date.now())
|
|
285
|
+
throw new Error('The sign-in server returned an invalid pairing proof.');
|
|
286
|
+
const bound = await fetch('${require_remote.PAIRING_ACCOUNT_ROUTE}', {
|
|
287
|
+
method: 'POST', credentials: 'same-origin', redirect: 'error', headers: { 'content-type': 'application/json' },
|
|
288
|
+
body: JSON.stringify({ requestId: claimed.requestId, proof: proof.proof }),
|
|
289
|
+
});
|
|
290
|
+
if (!bound.ok) throw new Error('This account could not join the pairing. Check your team and pair again.');
|
|
291
|
+
}
|
|
292
|
+
say('Waiting for the host to approve this device.');
|
|
293
|
+
const approved = await poll(claimed.requestId);
|
|
294
|
+
if (!approved) return;
|
|
295
|
+
rememberChannelKey(approved.hostPublicKey);
|
|
296
|
+
const trust = candidateTrust ?? trustOf(approved.bundleTrust);
|
|
297
|
+
if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }
|
|
298
|
+
if (!candidateTrust && !(await confirmManualTrust(trust))) return;
|
|
299
|
+
if (await activateTrust(trust, !candidateTrust)) offerPasskey();
|
|
300
|
+
} catch (error) {
|
|
301
|
+
say(error?.message ?? 'Pairing could not finish. Try again.', 'bad');
|
|
243
302
|
manual.hidden = false;
|
|
244
|
-
return;
|
|
245
303
|
}
|
|
246
|
-
const claimed = await response.json();
|
|
247
|
-
say('Waiting for the host to approve this device.');
|
|
248
|
-
const approved = await poll(claimed.requestId);
|
|
249
|
-
if (!approved) return;
|
|
250
|
-
rememberChannelKey(approved.hostPublicKey);
|
|
251
|
-
const trust = candidateTrust ?? trustOf(approved.bundleTrust);
|
|
252
|
-
if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }
|
|
253
|
-
if (!candidateTrust && !(await confirmManualTrust(trust))) return;
|
|
254
|
-
if (await activateTrust(trust, !candidateTrust)) offerPasskey();
|
|
255
304
|
}
|
|
256
305
|
|
|
257
306
|
const fromBase64Url = (value) =>
|
|
@@ -383,6 +432,17 @@ const SCRIPT = `
|
|
|
383
432
|
skipPasskey.addEventListener('click', openCockpit);
|
|
384
433
|
|
|
385
434
|
void (async () => {
|
|
435
|
+
if (document.body.dataset.fragmentTrust === '1') {
|
|
436
|
+
try { await navigator.serviceWorker?.register('/sw.js', { scope: '/' }); } catch { /* requestWorker reports it */ }
|
|
437
|
+
if (scannedTrust) {
|
|
438
|
+
if (await activateTrust(scannedTrust)) openCockpit();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const refreshed = await requestWorker({ type: 'po:refresh-bundle' });
|
|
442
|
+
if (refreshed.ok) { openCockpit(); return; }
|
|
443
|
+
say('Open the pairing link printed when this deploy was built: /pair#s=<key>&r=<revision>.', 'bad');
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
386
446
|
if (localTrust) {
|
|
387
447
|
if (await activateTrust(localTrust)) openCockpit();
|
|
388
448
|
return;
|
|
@@ -397,6 +457,7 @@ function pairingPageHtml(input) {
|
|
|
397
457
|
const localSigner = input.localTrust?.publicKey ?? "";
|
|
398
458
|
const localRevision = input.localTrust?.revision ?? "";
|
|
399
459
|
const localFingerprint = input.localTrust?.fingerprint ?? "";
|
|
460
|
+
const fragmentTrust = input.fragmentTrust === true;
|
|
400
461
|
return `<!doctype html>
|
|
401
462
|
<html lang="en">
|
|
402
463
|
<head>
|
|
@@ -408,7 +469,7 @@ function pairingPageHtml(input) {
|
|
|
408
469
|
<title>Pair with Po</title>
|
|
409
470
|
<style>${STYLE}</style>
|
|
410
471
|
</head>
|
|
411
|
-
<body data-marker="${PAIRING_PAGE_MARKER}" data-local-signer="${localSigner}" data-local-revision="${String(localRevision)}" data-local-fingerprint="${localFingerprint}">
|
|
472
|
+
<body data-marker="${PAIRING_PAGE_MARKER}" data-local-signer="${localSigner}" data-local-revision="${String(localRevision)}" data-local-fingerprint="${localFingerprint}"${fragmentTrust ? " data-fragment-trust=\"1\"" : ""}${input.accountPairing === true ? " data-account-pairing=\"1\"" : ""}>
|
|
412
473
|
<main>
|
|
413
474
|
<h1>Pair this device</h1>
|
|
414
475
|
<p>This cockpit can run shell commands on the host machine. Pair only your own device.</p>
|
|
@@ -426,7 +487,7 @@ function pairingPageHtml(input) {
|
|
|
426
487
|
<button id="add-passkey" type="button">Add passkey</button>
|
|
427
488
|
<button id="skip-passkey" class="secondary" type="button">Not now</button>
|
|
428
489
|
</div>
|
|
429
|
-
<section id="scanner">
|
|
490
|
+
<section id="scanner"${fragmentTrust ? " hidden" : ""}>
|
|
430
491
|
<p id="pwa-status" role="status">Checking browser support.</p>
|
|
431
492
|
<video id="camera" playsinline muted hidden></video>
|
|
432
493
|
<div class="actions">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["PAIRING_STATUS_ROUTE","PAIRING_STATUS_QUERY","PAIRING_CLAIM_ROUTE","REMOTE_API_ROUTE","PASSKEY_REGISTER_BEGIN_ROUTE","PASSKEY_REGISTER_FINISH_ROUTE"],"sources":["../../../../src/services/pairingPage/index.ts"],"sourcesContent":["/**\n * The package-owned page a scanned QR opens before any cockpit JavaScript runs.\n *\n * It cannot be the cockpit bundle. The bundle sits behind the guard and must be\n * verified first. Its only subresource is the separately built package-owned PWA\n * bootstrap, whose worker verifies and stages the signed host bundle.\n *\n * Request data is never echoed into the markup. Local-loopback responses may embed\n * the package-generated public signer fields, whose alphabets cannot form markup.\n */\n\nimport {\n BUNDLE_MINIMUM_REVISION_PARAM,\n BUNDLE_SIGNING_KEY_PARAM,\n PAIRING_CLAIM_ROUTE,\n PAIRING_STATUS_QUERY,\n PAIRING_STATUS_ROUTE,\n PASSKEY_REGISTER_BEGIN_ROUTE,\n PASSKEY_REGISTER_FINISH_ROUTE,\n REMOTE_API_ROUTE,\n} from '../../constants/remote';\nimport { type BundlePairingTrust } from '../../types/remote';\n\n/** Asserted by the tunnel self-test to prove the pairing route is reachable end to end. */\nexport const PAIRING_PAGE_MARKER = 'po-pairing-page';\n\n/** How often the phone asks whether the host has answered. */\nconst POLL_INTERVAL_MS = 1000;\n\nexport interface PairingPageInput {\n /** Per-response nonce; the CSP admits exactly this one inline script. */\n nonce: string;\n /** Local-loopback bootstrap trust. Remote callers must bring it in the QR fragment. */\n localTrust?: BundlePairingTrust;\n}\n\nexport function pairingPageCsp(nonce: string): string {\n return [\n \"default-src 'none'\",\n \"style-src 'unsafe-inline'\",\n `script-src 'nonce-${nonce}' 'self'`,\n \"connect-src 'self'\",\n \"img-src 'self'\",\n \"manifest-src 'self'\",\n \"worker-src 'self'\",\n \"base-uri 'none'\",\n \"form-action 'none'\",\n \"frame-ancestors 'none'\",\n ].join('; ');\n}\n\nexport function pairingPageHeaders(nonce: string): Record<string, string> {\n return {\n 'Content-Type': 'text/html; charset=utf-8',\n 'Cache-Control': 'no-store',\n 'Referrer-Policy': 'no-referrer',\n 'X-Frame-Options': 'DENY',\n 'Content-Security-Policy': pairingPageCsp(nonce),\n };\n}\n\n/**\n * Colours are literals here rather than theme tokens on purpose: this page\n * renders before, and without, the cockpit bundle that defines the tokens, and\n * it lives outside `src/web` so the browser theming rule does not reach it.\n */\nconst STYLE = `\n :root { color-scheme: dark; }\n body {\n margin: 0; min-height: 100vh; display: grid; place-items: center;\n background: #14161a; color: #e6e8ec;\n font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;\n }\n main { width: min(30rem, 100% - 2.5rem); text-align: center; }\n [hidden] { display: none !important; }\n h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; }\n p { margin: 0 0 1rem; color: #a2a8b4; }\n .state { font-weight: 600; color: #e6e8ec; }\n .bad { color: #ff6b6b; }\n .ok { color: #6bd68a; }\n form, .actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }\n input, button {\n font: inherit; padding: 0.6rem 0.8rem; border-radius: 0.5rem;\n border: 1px solid #2c313a; background: #1b1e24; color: inherit;\n }\n input { flex: 1; min-width: 0; }\n button { flex: 1; background: #2f6feb; border-color: #2f6feb; font-weight: 600; }\n button.secondary { background: #1b1e24; border-color: #2c313a; }\n button:disabled { opacity: 0.6; }\n video { width: 100%; max-height: 18rem; border-radius: 0.75rem; margin-top: 1rem; }\n code { display: block; overflow-wrap: anywhere; margin: 0.75rem 0; color: #e6e8ec; }\n`;\n\n/**\n * The client half of the pairing handshake.\n *\n * The code arrives in the URL fragment, which no browser sends to any server,\n * so it never reaches Cloudflare's edge logs, this process's access log, or a\n * Referer header. It is scrubbed from the address bar before anything else\n * runs, so a screenshot or a shared history entry does not carry it either.\n */\nconst SCRIPT = `\n const params = new URLSearchParams(location.hash.slice(1));\n const code = params.get('c') ?? '';\n const state = document.getElementById('state');\n const manual = document.getElementById('manual');\n const actions = document.getElementById('actions');\n const addPasskey = document.getElementById('add-passkey');\n const skipPasskey = document.getElementById('skip-passkey');\n const trustPanel = document.getElementById('trust');\n const trustFingerprint = document.getElementById('trust-fingerprint');\n const acceptTrust = document.getElementById('accept-trust');\n const say = (text, tone) => { state.textContent = text; state.className = 'state ' + (tone ?? ''); };\n const openCockpit = () => location.replace('/');\n\n function trustOf(value) {\n if (!value || typeof value.publicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(value.publicKey)) return undefined;\n const revision = Number(value.revision);\n if (!Number.isSafeInteger(revision) || revision < 1) return undefined;\n return { publicKey: value.publicKey, revision, fingerprint: typeof value.fingerprint === 'string' ? value.fingerprint : '' };\n }\n\n const scannedTrust = trustOf({\n publicKey: params.get('${BUNDLE_SIGNING_KEY_PARAM}'),\n revision: params.get('${BUNDLE_MINIMUM_REVISION_PARAM}'),\n });\n let fragmentClaimStarted = code !== '';\n const localTrust = trustOf({\n publicKey: document.body.dataset.localSigner,\n revision: document.body.dataset.localRevision,\n fingerprint: document.body.dataset.localFingerprint,\n });\n\n function rememberChannelKey(value) {\n if (typeof value !== 'string' || value === '') return false;\n try { sessionStorage.setItem('po.channelKey', value); return true; } catch { return false; }\n }\n rememberChannelKey(params.get('k'));\n history.replaceState(null, '', location.pathname);\n window.addEventListener('hashchange', () => {\n const nextParams = new URLSearchParams(location.hash.slice(1));\n const nextCode = nextParams.get('c') ?? '';\n if (nextCode === '') return;\n fragmentClaimStarted = true;\n const nextTrust = trustOf({\n publicKey: nextParams.get('${BUNDLE_SIGNING_KEY_PARAM}'),\n revision: nextParams.get('${BUNDLE_MINIMUM_REVISION_PARAM}'),\n });\n rememberChannelKey(nextParams.get('k'));\n history.replaceState(null, '', location.pathname);\n void claim(nextCode, nextTrust);\n });\n\n async function requestWorker(message) {\n if (!('serviceWorker' in navigator)) return { ok: false, message: 'This browser cannot install the trusted verifier.' };\n let registration;\n try {\n registration = await Promise.race([\n navigator.serviceWorker.ready,\n new Promise((_, reject) => setTimeout(() => reject(new Error('The trusted verifier did not start.')), 20000)),\n ]);\n } catch (error) {\n return { ok: false, message: error?.message ?? 'The trusted verifier did not start.' };\n }\n const serviceWorker = registration.active ?? registration.waiting ?? registration.installing;\n if (!serviceWorker) return { ok: false, message: 'The trusted verifier is unavailable.' };\n const channel = new MessageChannel();\n return await new Promise((resolve) => {\n const timer = setTimeout(() => resolve({ ok: false, message: 'Bundle verification timed out.' }), 120000);\n channel.port1.addEventListener('message', (event) => {\n clearTimeout(timer);\n resolve(event.data && typeof event.data.ok === 'boolean' ? event.data : { ok: false, message: 'The verifier returned invalid data.' });\n }, { once: true });\n channel.port1.start();\n serviceWorker.postMessage(message, [channel.port2]);\n });\n }\n\n /**\n * Names the refusal in terms of what the person has to do about it.\n *\n * A rotated host key reaches the verifier as untrusted-public-key rather than\n * signer-mismatch, because a refresh always re-sends the pinned key and only\n * the signature check can notice the host moved on.\n */\n function bundleRefusalMessage(result) {\n if (result.code === 'untrusted-public-key')\n return 'This host now signs with a different key. Scan a fresh pairing QR so you can confirm the new fingerprint.';\n if (result.code === 'stale-revision')\n return 'This host offers an older cockpit build than this device already verified. Clear this site data to accept it.';\n return result.message ?? 'The signed cockpit bundle was refused.';\n }\n\n async function activateTrust(trust, alreadyConfirmed = false) {\n say('Verifying every cockpit file before it can run.');\n let result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n if (!result.ok && result.code === 'signer-mismatch') {\n if (!alreadyConfirmed && !(await confirmManualTrust(trust))) return false;\n say('Resetting the old host key and verifying the newly paired host.');\n const reset = await requestWorker({ type: 'po:reset-bundle-trust' });\n if (!reset.ok) { say(reset.message ?? 'The old host key could not be reset.', 'bad'); return false; }\n result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n }\n if (!result.ok) {\n say(bundleRefusalMessage(result), 'bad');\n return false;\n }\n return true;\n }\n\n function offerPasskey() {\n if (!window.PublicKeyCredential) {\n say('Paired and verified. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n return;\n }\n say('Paired and verified. Add a passkey to use Face ID, Touch ID, or your device PIN next time.', 'ok');\n actions.hidden = false;\n }\n\n async function signingFingerprint(publicKey) {\n try {\n const normalized = publicKey.replaceAll('-', '+').replaceAll('_', '/');\n const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');\n const bytes = Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');\n } catch {\n return 'unavailable';\n }\n }\n\n async function confirmManualTrust(trust) {\n const fingerprint = trust.fingerprint || await signingFingerprint(trust.publicKey);\n return await new Promise((resolve) => {\n trustFingerprint.textContent = fingerprint.match(/.{1,8}/g)?.join(' ') ?? fingerprint;\n trustPanel.hidden = false;\n say('Compare this signing-key fingerprint with the one shown on the host.');\n acceptTrust.addEventListener('click', () => { trustPanel.hidden = true; resolve(true); }, { once: true });\n });\n }\n\n async function poll(requestId) {\n for (;;) {\n await new Promise((resolve) => setTimeout(resolve, ${String(POLL_INTERVAL_MS)}));\n const response = await fetch('${PAIRING_STATUS_ROUTE}?${PAIRING_STATUS_QUERY}=' + encodeURIComponent(requestId), { credentials: 'same-origin' });\n if (!response.ok) { say('This pairing request is no longer valid. Scan again.', 'bad'); return undefined; }\n const body = await response.json();\n if (body.status === 'approved') return body;\n if (body.status === 'denied') { say('The host denied this device.', 'bad'); return undefined; }\n if (body.status === 'expired') { say('The request timed out. Scan again.', 'bad'); return undefined; }\n }\n }\n\n async function claim(value, candidateTrust) {\n if (value === '') { say('Scan the code shown on the host or enter its manual code.', 'bad'); manual.hidden = false; return; }\n say('Asking the host to approve this device...');\n const response = await fetch('${PAIRING_CLAIM_ROUTE}', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'same-origin',\n body: JSON.stringify({ code: value }),\n });\n if (!response.ok) {\n say(response.status === 429 ? 'Too many attempts. Wait a minute.' : 'That code is not valid. Scan again.', 'bad');\n manual.hidden = false;\n return;\n }\n const claimed = await response.json();\n say('Waiting for the host to approve this device.');\n const approved = await poll(claimed.requestId);\n if (!approved) return;\n rememberChannelKey(approved.hostPublicKey);\n const trust = candidateTrust ?? trustOf(approved.bundleTrust);\n if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }\n if (!candidateTrust && !(await confirmManualTrust(trust))) return;\n if (await activateTrust(trust, !candidateTrust)) offerPasskey();\n }\n\n const fromBase64Url = (value) =>\n Uint8Array.from(atob(value.replaceAll('-', '+').replaceAll('_', '/')), (c) => c.charCodeAt(0));\n const toBase64Url = (buffer) =>\n btoa(String.fromCharCode(...new Uint8Array(buffer))).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');\n\n function decodeAuthenticationOptions(options) {\n return {\n ...options,\n challenge: fromBase64Url(options.challenge),\n allowCredentials: (options.allowCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n };\n }\n\n function decodeRegistrationOptions(options) {\n return {\n ...options,\n challenge: fromBase64Url(options.challenge),\n user: { ...options.user, id: fromBase64Url(options.user.id) },\n excludeCredentials: (options.excludeCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n };\n }\n\n function encodeCredential(credential) {\n const assertion = credential.response;\n return {\n id: credential.id,\n rawId: toBase64Url(credential.rawId),\n type: credential.type,\n clientExtensionResults: credential.getClientExtensionResults(),\n response: {\n clientDataJSON: toBase64Url(assertion.clientDataJSON),\n authenticatorData: toBase64Url(assertion.authenticatorData),\n signature: toBase64Url(assertion.signature),\n userHandle: assertion.userHandle ? toBase64Url(assertion.userHandle) : undefined,\n },\n };\n }\n\n function encodeRegistrationCredential(credential) {\n const attestation = credential.response;\n return {\n id: credential.id,\n rawId: toBase64Url(credential.rawId),\n type: credential.type,\n authenticatorAttachment: credential.authenticatorAttachment,\n clientExtensionResults: credential.getClientExtensionResults(),\n response: {\n clientDataJSON: toBase64Url(attestation.clientDataJSON),\n attestationObject: toBase64Url(attestation.attestationObject),\n transports: typeof attestation.getTransports === 'function' ? attestation.getTransports() : [],\n },\n };\n }\n\n async function passkeySignIn() {\n if (!window.PublicKeyCredential) return false;\n try {\n const begun = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/begin', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n });\n if (!begun.ok) return false;\n const { ceremonyId, options } = await begun.json();\n if (typeof ceremonyId !== 'string') return false;\n const credential = await navigator.credentials.get({ publicKey: decodeAuthenticationOptions(options) });\n if (!credential) return false;\n const finished = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/finish', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n body: JSON.stringify({ ceremonyId, response: encodeCredential(credential) }),\n });\n if (!finished.ok) return false;\n const result = await finished.json();\n if (!rememberChannelKey(result.hostPublicKey)) return false;\n const refreshed = await requestWorker({ type: 'po:refresh-bundle' });\n // A host this device cannot reach is not a trust decision. The pin is the\n // last bundle this device verified for itself, so it stays usable while\n // the host is away. Every other refusal is a trust decision and still\n // blocks entry.\n if (!refreshed.ok && refreshed.code === 'manifest-fetch') {\n say('Could not check for a newer cockpit build. Opening the last verified one.');\n return true;\n }\n if (!refreshed.ok) say(bundleRefusalMessage(refreshed), 'bad');\n return refreshed.ok;\n } catch {\n return false;\n }\n }\n\n async function registerPasskey() {\n addPasskey.disabled = true;\n skipPasskey.disabled = true;\n say('Confirm passkey setup on this device.');\n try {\n const begun = await fetch('${PASSKEY_REGISTER_BEGIN_ROUTE}', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n });\n if (!begun.ok) throw new Error('Passkey setup is unavailable.');\n const { ceremonyId, options } = await begun.json();\n if (typeof ceremonyId !== 'string') throw new Error('Passkey setup is unavailable.');\n const credential = await navigator.credentials.create({ publicKey: decodeRegistrationOptions(options) });\n if (!credential) throw new Error('Passkey setup was cancelled.');\n const finished = await fetch('${PASSKEY_REGISTER_FINISH_ROUTE}', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n body: JSON.stringify({ ceremonyId, response: encodeRegistrationCredential(credential) }),\n });\n if (!finished.ok) throw new Error('That passkey was not accepted.');\n say('Passkey added. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n } catch (error) {\n if (error?.name === 'InvalidStateError') {\n say('A passkey for this site already exists. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n return;\n }\n say(error?.name === 'NotAllowedError' ? 'Passkey setup was cancelled.' : (error?.message ?? 'Passkey setup failed.'), 'bad');\n addPasskey.disabled = false;\n skipPasskey.disabled = false;\n }\n }\n\n manual.addEventListener('submit', (event) => {\n event.preventDefault();\n manual.hidden = true;\n void claim(new FormData(manual).get('code')?.toString().trim() ?? '', undefined);\n });\n addPasskey.addEventListener('click', () => void registerPasskey());\n skipPasskey.addEventListener('click', openCockpit);\n\n void (async () => {\n if (localTrust) {\n if (await activateTrust(localTrust)) openCockpit();\n return;\n }\n if (code !== '') { await claim(code, scannedTrust); return; }\n say('Checking for a passkey on this device...');\n if (await passkeySignIn()) { say('Signed in and verified. Opening the cockpit.', 'ok'); openCockpit(); return; }\n if (!fragmentClaimStarted) await claim('', undefined);\n })();\n`;\n\nexport function pairingPageHtml(input: PairingPageInput): string {\n const localSigner = input.localTrust?.publicKey ?? '';\n const localRevision = input.localTrust?.revision ?? '';\n const localFingerprint = input.localTrust?.fingerprint ?? '';\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<meta name=\"theme-color\" content=\"#14161a\">\n<link rel=\"manifest\" href=\"/manifest.webmanifest\">\n<title>Pair with Po</title>\n<style>${STYLE}</style>\n</head>\n<body data-marker=\"${PAIRING_PAGE_MARKER}\" data-local-signer=\"${localSigner}\" data-local-revision=\"${String(localRevision)}\" data-local-fingerprint=\"${localFingerprint}\">\n<main>\n <h1>Pair this device</h1>\n <p>This cockpit can run shell commands on the host machine. Pair only your own device.</p>\n <p id=\"state\" class=\"state\">Starting.</p>\n <form id=\"manual\" hidden>\n <input name=\"code\" inputmode=\"numeric\" pattern=\"[0-9]{8}\" maxlength=\"8\" autocomplete=\"one-time-code\" placeholder=\"8-digit pairing code\" aria-label=\"8-digit pairing code\">\n <button type=\"submit\">Pair</button>\n </form>\n <div id=\"trust\" hidden>\n <p>Signing-key fingerprint</p>\n <code id=\"trust-fingerprint\"></code>\n <button id=\"accept-trust\" type=\"button\">Fingerprint matches</button>\n </div>\n <div id=\"actions\" class=\"actions\" hidden>\n <button id=\"add-passkey\" type=\"button\">Add passkey</button>\n <button id=\"skip-passkey\" class=\"secondary\" type=\"button\">Not now</button>\n </div>\n <section id=\"scanner\">\n <p id=\"pwa-status\" role=\"status\">Checking browser support.</p>\n <video id=\"camera\" playsinline muted hidden></video>\n <div class=\"actions\">\n <button id=\"scan\" type=\"button\">Scan pairing QR</button>\n <button id=\"cancel\" class=\"secondary\" type=\"button\" hidden>Cancel</button>\n </div>\n </section>\n <noscript><p class=\"bad\">Pairing needs JavaScript, because the code never leaves your browser.</p></noscript>\n</main>\n<script nonce=\"${input.nonce}\">${SCRIPT}</script>\n<script type=\"module\" src=\"/pwa/pwa.js\"></script>\n</body>\n</html>`;\n}\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAa,sBAAsB;;AAGnC,MAAM,mBAAmB;AASzB,SAAgB,eAAe,OAAuB;CACpD,OAAO;EACL;EACA;EACA,qBAAqB,MAAM;EAC3B;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAgB,mBAAmB,OAAuC;CACxE,OAAO;EACL,gBAAgB;EAChB,iBAAiB;EACjB,mBAAmB;EACnB,mBAAmB;EACnB,2BAA2B,eAAe,KAAK;CACjD;AACF;;;;;;AAOA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCd,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgHiB,OAAO,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DA+BE,OAAO,gBAAgB,EAAE;sCAC9CA,eAAAA,qBAAqB,GAAGC,eAAAA,qBAAqB;;;;;;;;;;;;oCAY/CC,eAAAA,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA+ErBC,eAAAA,iBAAiB;;;;;;;;sCAQdA,eAAAA,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA4BpBC,eAAAA,6BAA6B;;;;;;;;sCAQ1BC,eAAAA,8BAA8B;;;;;;gCAMpC,OAAO,gBAAgB,EAAE;;;;kCAIvB,OAAO,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6B3D,SAAgB,gBAAgB,OAAiC;CAC/D,MAAM,cAAc,MAAM,YAAY,aAAa;CACnD,MAAM,gBAAgB,MAAM,YAAY,YAAY;CACpD,MAAM,mBAAmB,MAAM,YAAY,eAAe;CAC1D,OAAO;;;;;;;;;SASA,MAAM;;qBAEM,oBAAoB,uBAAuB,YAAY,yBAAyB,OAAO,aAAa,EAAE,4BAA4B,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BvJ,MAAM,MAAM,IAAI,OAAO;;;;AAIxC"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["PAIRING_CODE_TTL_MS","PAIRING_STATUS_ROUTE","PAIRING_STATUS_QUERY","AUTH_BOOTSTRAP_PATH","PAIRING_CLAIM_ROUTE","AUTH_PAIRING_PROOF_PATH","PAIRING_ACCOUNT_ROUTE","REMOTE_API_ROUTE","PASSKEY_REGISTER_BEGIN_ROUTE","PASSKEY_REGISTER_FINISH_ROUTE"],"sources":["../../../../src/services/pairingPage/index.ts"],"sourcesContent":["/**\n * The package-owned page a scanned QR opens before any cockpit JavaScript runs.\n *\n * It cannot be the cockpit bundle. The bundle sits behind the guard and must be\n * verified first. Its only subresource is the separately built package-owned PWA\n * bootstrap, whose worker verifies and stages the signed host bundle.\n *\n * Request data is never echoed into the markup. Local-loopback responses may embed\n * the package-generated public signer fields, whose alphabets cannot form markup.\n */\n\nimport {\n BUNDLE_MINIMUM_REVISION_PARAM,\n BUNDLE_SIGNING_KEY_PARAM,\n PAIRING_ACCOUNT_ROUTE,\n PAIRING_CLAIM_ROUTE,\n PAIRING_CODE_TTL_MS,\n PAIRING_STATUS_QUERY,\n PAIRING_STATUS_ROUTE,\n PASSKEY_REGISTER_BEGIN_ROUTE,\n PASSKEY_REGISTER_FINISH_ROUTE,\n REMOTE_API_ROUTE,\n} from '../../constants/remote';\nimport { AUTH_BOOTSTRAP_PATH, AUTH_PAIRING_PROOF_PATH } from '../../schemas/identity';\nimport { type BundlePairingTrust } from '../../types/remote';\n\n/** Asserted by the tunnel self-test to prove the pairing route is reachable end to end. */\nexport const PAIRING_PAGE_MARKER = 'po-pairing-page';\n\n/** How often the phone asks whether the host has answered. */\nconst POLL_INTERVAL_MS = 1000;\n\nexport interface PairingPageInput {\n /** Per-response nonce; the CSP admits exactly this one inline script. */\n nonce: string;\n /** Local-loopback bootstrap trust. Remote callers must bring it in the QR fragment. */\n localTrust?: BundlePairingTrust;\n /**\n * A self-hosted origin with no pairing channel (po-cloudflare bearer mode). The owner opens\n * `/pair#s=<key>&r=<rev>` from the deploy output: the fragment alone pins the signer, no code is\n * claimed, and the scanner, manual code and passkey steps stay hidden. The origin's own login gates the page.\n */\n fragmentTrust?: boolean;\n /** This team host offers its own same-origin issuer. Personal QR pairing stays account-free. */\n accountPairing?: boolean;\n}\n\nexport function pairingPageCsp(nonce: string): string {\n return [\n \"default-src 'none'\",\n \"style-src 'unsafe-inline'\",\n `script-src 'nonce-${nonce}' 'self'`,\n \"connect-src 'self'\",\n \"img-src 'self'\",\n \"manifest-src 'self'\",\n \"worker-src 'self'\",\n \"base-uri 'none'\",\n \"form-action 'none'\",\n \"frame-ancestors 'none'\",\n ].join('; ');\n}\n\nexport function pairingPageHeaders(nonce: string): Record<string, string> {\n return {\n 'Content-Type': 'text/html; charset=utf-8',\n 'Cache-Control': 'no-store',\n 'Referrer-Policy': 'no-referrer',\n 'X-Frame-Options': 'DENY',\n 'Content-Security-Policy': pairingPageCsp(nonce),\n };\n}\n\n/**\n * Colours are literals here rather than theme tokens on purpose: this page\n * renders before, and without, the cockpit bundle that defines the tokens, and\n * it lives outside `src/web` so the browser theming rule does not reach it.\n */\nconst STYLE = `\n :root { color-scheme: dark; }\n body {\n margin: 0; min-height: 100vh; display: grid; place-items: center;\n background: #14161a; color: #e6e8ec;\n font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, sans-serif;\n }\n main { width: min(30rem, 100% - 2.5rem); text-align: center; }\n [hidden] { display: none !important; }\n h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.5rem; }\n p { margin: 0 0 1rem; color: #a2a8b4; }\n .state { font-weight: 600; color: #e6e8ec; }\n .bad { color: #ff6b6b; }\n .ok { color: #6bd68a; }\n form, .actions { display: flex; gap: 0.5rem; margin-top: 1.5rem; }\n input, button {\n font: inherit; padding: 0.6rem 0.8rem; border-radius: 0.5rem;\n border: 1px solid #2c313a; background: #1b1e24; color: inherit;\n }\n input { flex: 1; min-width: 0; }\n button { flex: 1; background: #2f6feb; border-color: #2f6feb; font-weight: 600; }\n button.secondary { background: #1b1e24; border-color: #2c313a; }\n button:disabled { opacity: 0.6; }\n video { width: 100%; max-height: 18rem; border-radius: 0.75rem; margin-top: 1rem; }\n code { display: block; overflow-wrap: anywhere; margin: 0.75rem 0; color: #e6e8ec; }\n`;\n\n/**\n * The client half of the pairing handshake.\n *\n * The code arrives in the URL fragment, which no browser sends to any server,\n * so it never reaches Cloudflare's edge logs, this process's access log, or a\n * Referer header. It is scrubbed from the address bar before anything else\n * runs, so a screenshot or a shared history entry does not carry it either.\n */\nconst SCRIPT = `\n const params = new URLSearchParams(location.hash.slice(1));\n let code = params.get('c') ?? '';\n const accountPairing = document.body.dataset.accountPairing === '1';\n const state = document.getElementById('state');\n const manual = document.getElementById('manual');\n const actions = document.getElementById('actions');\n const addPasskey = document.getElementById('add-passkey');\n const skipPasskey = document.getElementById('skip-passkey');\n const trustPanel = document.getElementById('trust');\n const trustFingerprint = document.getElementById('trust-fingerprint');\n const acceptTrust = document.getElementById('accept-trust');\n const say = (text, tone) => { state.textContent = text; state.className = 'state ' + (tone ?? ''); };\n const openCockpit = () => location.replace('/');\n\n function trustOf(value) {\n if (!value || typeof value.publicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(value.publicKey)) return undefined;\n const revision = Number(value.revision);\n if (!Number.isSafeInteger(revision) || revision < 1) return undefined;\n return { publicKey: value.publicKey, revision, fingerprint: typeof value.fingerprint === 'string' ? value.fingerprint : '' };\n }\n\n let scannedTrust = trustOf({\n publicKey: params.get('${BUNDLE_SIGNING_KEY_PARAM}'),\n revision: params.get('${BUNDLE_MINIMUM_REVISION_PARAM}'),\n });\n let fragmentClaimStarted = code !== '';\n const localTrust = trustOf({\n publicKey: document.body.dataset.localSigner,\n revision: document.body.dataset.localRevision,\n fingerprint: document.body.dataset.localFingerprint,\n });\n\n function rememberChannelKey(value) {\n if (typeof value !== 'string' || value === '') return false;\n try { sessionStorage.setItem('po.channelKey', value); return true; } catch { return false; }\n }\n rememberChannelKey(params.get('k'));\n history.replaceState(null, '', location.pathname);\n if (accountPairing) {\n try {\n const saved = JSON.parse(sessionStorage.getItem('po.pairing.resume') ?? 'null');\n sessionStorage.removeItem('po.pairing.resume');\n if (code === '' && saved && Number.isSafeInteger(saved.expiresAt) && saved.expiresAt > Date.now() &&\n saved.expiresAt <= Date.now() + ${String(PAIRING_CODE_TTL_MS)} && typeof saved.code === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(saved.code)) {\n code = saved.code;\n scannedTrust = trustOf(saved.trust);\n fragmentClaimStarted = true;\n }\n } catch { /* Missing, unavailable or malformed tab storage never supplies a pairing. */ }\n }\n window.addEventListener('hashchange', () => {\n const nextParams = new URLSearchParams(location.hash.slice(1));\n const nextCode = nextParams.get('c') ?? '';\n if (nextCode === '') return;\n fragmentClaimStarted = true;\n const nextTrust = trustOf({\n publicKey: nextParams.get('${BUNDLE_SIGNING_KEY_PARAM}'),\n revision: nextParams.get('${BUNDLE_MINIMUM_REVISION_PARAM}'),\n });\n rememberChannelKey(nextParams.get('k'));\n history.replaceState(null, '', location.pathname);\n void claim(nextCode, nextTrust);\n });\n\n async function requestWorker(message) {\n if (!('serviceWorker' in navigator)) return { ok: false, message: 'This browser cannot install the trusted verifier.' };\n let registration;\n try {\n registration = await Promise.race([\n navigator.serviceWorker.ready,\n new Promise((_, reject) => setTimeout(() => reject(new Error('The trusted verifier did not start.')), 20000)),\n ]);\n } catch (error) {\n return { ok: false, message: error?.message ?? 'The trusted verifier did not start.' };\n }\n const serviceWorker = registration.active ?? registration.waiting ?? registration.installing;\n if (!serviceWorker) return { ok: false, message: 'The trusted verifier is unavailable.' };\n const channel = new MessageChannel();\n return await new Promise((resolve) => {\n const timer = setTimeout(() => resolve({ ok: false, message: 'Bundle verification timed out.' }), 120000);\n channel.port1.addEventListener('message', (event) => {\n clearTimeout(timer);\n resolve(event.data && typeof event.data.ok === 'boolean' ? event.data : { ok: false, message: 'The verifier returned invalid data.' });\n }, { once: true });\n channel.port1.start();\n serviceWorker.postMessage(message, [channel.port2]);\n });\n }\n\n /**\n * Names the refusal in terms of what the person has to do about it.\n *\n * A rotated host key reaches the verifier as untrusted-public-key rather than\n * signer-mismatch, because a refresh always re-sends the pinned key and only\n * the signature check can notice the host moved on.\n */\n function bundleRefusalMessage(result) {\n if (result.code === 'untrusted-public-key')\n return 'This host now signs with a different key. Scan a fresh pairing QR so you can confirm the new fingerprint.';\n if (result.code === 'stale-revision')\n return 'This host offers an older cockpit build than this device already verified. Clear this site data to accept it.';\n return result.message ?? 'The signed cockpit bundle was refused.';\n }\n\n async function activateTrust(trust, alreadyConfirmed = false) {\n say('Verifying every cockpit file before it can run.');\n let result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n if (!result.ok && result.code === 'signer-mismatch') {\n if (!alreadyConfirmed && !(await confirmManualTrust(trust))) return false;\n say('Resetting the old host key and verifying the newly paired host.');\n const reset = await requestWorker({ type: 'po:reset-bundle-trust' });\n if (!reset.ok) { say(reset.message ?? 'The old host key could not be reset.', 'bad'); return false; }\n result = await requestWorker({ type: 'po:activate-bundle', publicKey: trust.publicKey, minimumRevision: trust.revision });\n }\n if (!result.ok) {\n say(bundleRefusalMessage(result), 'bad');\n return false;\n }\n return true;\n }\n\n function offerPasskey() {\n if (!window.PublicKeyCredential) {\n say('Paired and verified. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n return;\n }\n say('Paired and verified. Add a passkey to use Face ID, Touch ID, or your device PIN next time.', 'ok');\n actions.hidden = false;\n }\n\n async function signingFingerprint(publicKey) {\n try {\n const normalized = publicKey.replaceAll('-', '+').replaceAll('_', '/');\n const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');\n const bytes = Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));\n const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));\n return Array.from(digest, (byte) => byte.toString(16).padStart(2, '0')).join('');\n } catch {\n return 'unavailable';\n }\n }\n\n async function confirmManualTrust(trust) {\n const fingerprint = trust.fingerprint || await signingFingerprint(trust.publicKey);\n return await new Promise((resolve) => {\n trustFingerprint.textContent = fingerprint.match(/.{1,8}/g)?.join(' ') ?? fingerprint;\n trustPanel.hidden = false;\n say('Compare this signing-key fingerprint with the one shown on the host.');\n acceptTrust.addEventListener('click', () => { trustPanel.hidden = true; resolve(true); }, { once: true });\n });\n }\n\n async function poll(requestId) {\n for (;;) {\n await new Promise((resolve) => setTimeout(resolve, ${String(POLL_INTERVAL_MS)}));\n const response = await fetch('${PAIRING_STATUS_ROUTE}?${PAIRING_STATUS_QUERY}=' + encodeURIComponent(requestId), { credentials: 'same-origin' });\n if (!response.ok) { say('This pairing request is no longer valid. Scan again.', 'bad'); return undefined; }\n const body = await response.json();\n if (body.status === 'approved') return body;\n if (body.status === 'denied') { say('The host denied this device.', 'bad'); return undefined; }\n if (body.status === 'expired') { say('The request timed out. Scan again.', 'bad'); return undefined; }\n }\n }\n\n async function claim(value, candidateTrust) {\n try {\n if (accountPairing) {\n const response = await fetch('${AUTH_BOOTSTRAP_PATH}', { credentials: 'same-origin', redirect: 'error' });\n if (!response.ok) throw new Error('Sign-in is unavailable. Try again.');\n const account = await response.json();\n if (account.issuer !== location.origin) throw new Error('This computer does not offer same-origin sign-in.');\n if (typeof account.session?.org !== 'string' || account.session.org === '') {\n if (value !== '') sessionStorage.setItem('po.pairing.resume', JSON.stringify({ code: value, trust: candidateTrust, expiresAt: Date.now() + ${String(PAIRING_CODE_TTL_MS)} }));\n location.replace('/api/auth/browser/team?next=%2Fpair');\n return;\n }\n }\n if (value === '') { say('Scan the code shown on the host or enter its manual code.', 'bad'); manual.hidden = false; return; }\n say('Asking the host to approve this device...');\n const response = await fetch('${PAIRING_CLAIM_ROUTE}', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'same-origin',\n body: JSON.stringify({ code: value, ...(accountPairing ? { accountRequired: true } : {}) }),\n });\n if (!response.ok) {\n say(response.status === 429 ? 'Too many attempts. Wait a minute.' : 'That code is not valid. Scan again.', 'bad');\n manual.hidden = false;\n return;\n }\n const claimed = await response.json();\n if (accountPairing) {\n if (typeof claimed.requestId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(claimed.requestId) ||\n typeof claimed.hostPublicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(claimed.hostPublicKey))\n throw new Error('The host returned an invalid pairing request.');\n const proofResponse = await fetch('${AUTH_PAIRING_PROOF_PATH}', {\n method: 'POST', credentials: 'same-origin', redirect: 'error',\n headers: { 'content-type': 'application/json', 'x-po-csrf': '1' },\n body: JSON.stringify({ requestId: claimed.requestId, hostPublicKey: claimed.hostPublicKey }),\n });\n if (!proofResponse.ok) throw new Error('Your sign-in could not be verified for this pairing. Sign in and pair again.');\n const proof = await proofResponse.json();\n if (typeof proof.proof !== 'string' || !/^[a-f0-9]{64}$/.test(proof.proof) || !Number.isSafeInteger(proof.expiresAt) || proof.expiresAt <= Date.now())\n throw new Error('The sign-in server returned an invalid pairing proof.');\n const bound = await fetch('${PAIRING_ACCOUNT_ROUTE}', {\n method: 'POST', credentials: 'same-origin', redirect: 'error', headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ requestId: claimed.requestId, proof: proof.proof }),\n });\n if (!bound.ok) throw new Error('This account could not join the pairing. Check your team and pair again.');\n }\n say('Waiting for the host to approve this device.');\n const approved = await poll(claimed.requestId);\n if (!approved) return;\n rememberChannelKey(approved.hostPublicKey);\n const trust = candidateTrust ?? trustOf(approved.bundleTrust);\n if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }\n if (!candidateTrust && !(await confirmManualTrust(trust))) return;\n if (await activateTrust(trust, !candidateTrust)) offerPasskey();\n } catch (error) {\n say(error?.message ?? 'Pairing could not finish. Try again.', 'bad');\n manual.hidden = false;\n }\n }\n\n const fromBase64Url = (value) =>\n Uint8Array.from(atob(value.replaceAll('-', '+').replaceAll('_', '/')), (c) => c.charCodeAt(0));\n const toBase64Url = (buffer) =>\n btoa(String.fromCharCode(...new Uint8Array(buffer))).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');\n\n function decodeAuthenticationOptions(options) {\n return {\n ...options,\n challenge: fromBase64Url(options.challenge),\n allowCredentials: (options.allowCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n };\n }\n\n function decodeRegistrationOptions(options) {\n return {\n ...options,\n challenge: fromBase64Url(options.challenge),\n user: { ...options.user, id: fromBase64Url(options.user.id) },\n excludeCredentials: (options.excludeCredentials ?? []).map((entry) => ({ ...entry, id: fromBase64Url(entry.id) })),\n };\n }\n\n function encodeCredential(credential) {\n const assertion = credential.response;\n return {\n id: credential.id,\n rawId: toBase64Url(credential.rawId),\n type: credential.type,\n clientExtensionResults: credential.getClientExtensionResults(),\n response: {\n clientDataJSON: toBase64Url(assertion.clientDataJSON),\n authenticatorData: toBase64Url(assertion.authenticatorData),\n signature: toBase64Url(assertion.signature),\n userHandle: assertion.userHandle ? toBase64Url(assertion.userHandle) : undefined,\n },\n };\n }\n\n function encodeRegistrationCredential(credential) {\n const attestation = credential.response;\n return {\n id: credential.id,\n rawId: toBase64Url(credential.rawId),\n type: credential.type,\n authenticatorAttachment: credential.authenticatorAttachment,\n clientExtensionResults: credential.getClientExtensionResults(),\n response: {\n clientDataJSON: toBase64Url(attestation.clientDataJSON),\n attestationObject: toBase64Url(attestation.attestationObject),\n transports: typeof attestation.getTransports === 'function' ? attestation.getTransports() : [],\n },\n };\n }\n\n async function passkeySignIn() {\n if (!window.PublicKeyCredential) return false;\n try {\n const begun = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/begin', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n });\n if (!begun.ok) return false;\n const { ceremonyId, options } = await begun.json();\n if (typeof ceremonyId !== 'string') return false;\n const credential = await navigator.credentials.get({ publicKey: decodeAuthenticationOptions(options) });\n if (!credential) return false;\n const finished = await fetch('${REMOTE_API_ROUTE}/passkeys/authenticate/finish', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n body: JSON.stringify({ ceremonyId, response: encodeCredential(credential) }),\n });\n if (!finished.ok) return false;\n const result = await finished.json();\n if (!rememberChannelKey(result.hostPublicKey)) return false;\n const refreshed = await requestWorker({ type: 'po:refresh-bundle' });\n // A host this device cannot reach is not a trust decision. The pin is the\n // last bundle this device verified for itself, so it stays usable while\n // the host is away. Every other refusal is a trust decision and still\n // blocks entry.\n if (!refreshed.ok && refreshed.code === 'manifest-fetch') {\n say('Could not check for a newer cockpit build. Opening the last verified one.');\n return true;\n }\n if (!refreshed.ok) say(bundleRefusalMessage(refreshed), 'bad');\n return refreshed.ok;\n } catch {\n return false;\n }\n }\n\n async function registerPasskey() {\n addPasskey.disabled = true;\n skipPasskey.disabled = true;\n say('Confirm passkey setup on this device.');\n try {\n const begun = await fetch('${PASSKEY_REGISTER_BEGIN_ROUTE}', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin', body: '{}',\n });\n if (!begun.ok) throw new Error('Passkey setup is unavailable.');\n const { ceremonyId, options } = await begun.json();\n if (typeof ceremonyId !== 'string') throw new Error('Passkey setup is unavailable.');\n const credential = await navigator.credentials.create({ publicKey: decodeRegistrationOptions(options) });\n if (!credential) throw new Error('Passkey setup was cancelled.');\n const finished = await fetch('${PASSKEY_REGISTER_FINISH_ROUTE}', {\n method: 'POST', headers: { 'content-type': 'application/json' }, credentials: 'same-origin',\n body: JSON.stringify({ ceremonyId, response: encodeRegistrationCredential(credential) }),\n });\n if (!finished.ok) throw new Error('That passkey was not accepted.');\n say('Passkey added. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n } catch (error) {\n if (error?.name === 'InvalidStateError') {\n say('A passkey for this site already exists. Opening the cockpit.', 'ok');\n setTimeout(openCockpit, ${String(POLL_INTERVAL_MS)});\n return;\n }\n say(error?.name === 'NotAllowedError' ? 'Passkey setup was cancelled.' : (error?.message ?? 'Passkey setup failed.'), 'bad');\n addPasskey.disabled = false;\n skipPasskey.disabled = false;\n }\n }\n\n manual.addEventListener('submit', (event) => {\n event.preventDefault();\n manual.hidden = true;\n void claim(new FormData(manual).get('code')?.toString().trim() ?? '', undefined);\n });\n addPasskey.addEventListener('click', () => void registerPasskey());\n skipPasskey.addEventListener('click', openCockpit);\n\n void (async () => {\n if (document.body.dataset.fragmentTrust === '1') {\n try { await navigator.serviceWorker?.register('/sw.js', { scope: '/' }); } catch { /* requestWorker reports it */ }\n if (scannedTrust) {\n if (await activateTrust(scannedTrust)) openCockpit();\n return;\n }\n const refreshed = await requestWorker({ type: 'po:refresh-bundle' });\n if (refreshed.ok) { openCockpit(); return; }\n say('Open the pairing link printed when this deploy was built: /pair#s=<key>&r=<revision>.', 'bad');\n return;\n }\n if (localTrust) {\n if (await activateTrust(localTrust)) openCockpit();\n return;\n }\n if (code !== '') { await claim(code, scannedTrust); return; }\n say('Checking for a passkey on this device...');\n if (await passkeySignIn()) { say('Signed in and verified. Opening the cockpit.', 'ok'); openCockpit(); return; }\n if (!fragmentClaimStarted) await claim('', undefined);\n })();\n`;\n\nexport function pairingPageHtml(input: PairingPageInput): string {\n const localSigner = input.localTrust?.publicKey ?? '';\n const localRevision = input.localTrust?.revision ?? '';\n const localFingerprint = input.localTrust?.fingerprint ?? '';\n const fragmentTrust = input.fragmentTrust === true;\n return `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<meta name=\"theme-color\" content=\"#14161a\">\n<link rel=\"manifest\" href=\"/manifest.webmanifest\">\n<title>Pair with Po</title>\n<style>${STYLE}</style>\n</head>\n<body data-marker=\"${PAIRING_PAGE_MARKER}\" data-local-signer=\"${localSigner}\" data-local-revision=\"${String(localRevision)}\" data-local-fingerprint=\"${localFingerprint}\"${fragmentTrust ? ' data-fragment-trust=\"1\"' : ''}${input.accountPairing === true ? ' data-account-pairing=\"1\"' : ''}>\n<main>\n <h1>Pair this device</h1>\n <p>This cockpit can run shell commands on the host machine. Pair only your own device.</p>\n <p id=\"state\" class=\"state\">Starting.</p>\n <form id=\"manual\" hidden>\n <input name=\"code\" inputmode=\"numeric\" pattern=\"[0-9]{8}\" maxlength=\"8\" autocomplete=\"one-time-code\" placeholder=\"8-digit pairing code\" aria-label=\"8-digit pairing code\">\n <button type=\"submit\">Pair</button>\n </form>\n <div id=\"trust\" hidden>\n <p>Signing-key fingerprint</p>\n <code id=\"trust-fingerprint\"></code>\n <button id=\"accept-trust\" type=\"button\">Fingerprint matches</button>\n </div>\n <div id=\"actions\" class=\"actions\" hidden>\n <button id=\"add-passkey\" type=\"button\">Add passkey</button>\n <button id=\"skip-passkey\" class=\"secondary\" type=\"button\">Not now</button>\n </div>\n <section id=\"scanner\"${fragmentTrust ? ' hidden' : ''}>\n <p id=\"pwa-status\" role=\"status\">Checking browser support.</p>\n <video id=\"camera\" playsinline muted hidden></video>\n <div class=\"actions\">\n <button id=\"scan\" type=\"button\">Scan pairing QR</button>\n <button id=\"cancel\" class=\"secondary\" type=\"button\" hidden>Cancel</button>\n </div>\n </section>\n <noscript><p class=\"bad\">Pairing needs JavaScript, because the code never leaves your browser.</p></noscript>\n</main>\n<script nonce=\"${input.nonce}\">${SCRIPT}</script>\n<script type=\"module\" src=\"/pwa/pwa.js\"></script>\n</body>\n</html>`;\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,MAAa,sBAAsB;;AAGnC,MAAM,mBAAmB;AAiBzB,SAAgB,eAAe,OAAuB;CACpD,OAAO;EACL;EACA;EACA,qBAAqB,MAAM;EAC3B;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAgB,mBAAmB,OAAuC;CACxE,OAAO;EACL,gBAAgB;EAChB,iBAAiB;EACjB,mBAAmB;EACnB,mBAAmB;EACnB,2BAA2B,eAAe,KAAK;CACjD;AACF;;;;;;AAOA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCd,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CA4C2B,OAAOA,eAAAA,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAiFtC,OAAO,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DA+BE,OAAO,gBAAgB,EAAE;sCAC9CC,eAAAA,qBAAqB,GAAGC,eAAAA,qBAAqB;;;;;;;;;;;;wCAY3CC,iBAAAA,oBAAoB;;;;;uJAK2F,OAAOH,eAAAA,mBAAmB,EAAE;;;;;;;sCAO7II,eAAAA,oBAAoB;;;;;;;;;;;;;;;;6CAgBbC,iBAAAA,wBAAwB;;;;;;;;;qCAShCC,eAAAA,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA6ExBC,eAAAA,iBAAiB;;;;;;;;sCAQdA,eAAAA,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA4BpBC,eAAAA,6BAA6B;;;;;;;;sCAQ1BC,eAAAA,8BAA8B;;;;;;gCAMpC,OAAO,gBAAgB,EAAE;;;;kCAIvB,OAAO,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwC3D,SAAgB,gBAAgB,OAAiC;CAC/D,MAAM,cAAc,MAAM,YAAY,aAAa;CACnD,MAAM,gBAAgB,MAAM,YAAY,YAAY;CACpD,MAAM,mBAAmB,MAAM,YAAY,eAAe;CAC1D,MAAM,gBAAgB,MAAM,kBAAkB;CAC9C,OAAO;;;;;;;;;SASA,MAAM;;qBAEM,oBAAoB,uBAAuB,YAAY,yBAAyB,OAAO,aAAa,EAAE,4BAA4B,iBAAiB,GAAG,gBAAgB,+BAA6B,KAAK,MAAM,mBAAmB,OAAO,gCAA8B,GAAG;;;;;;;;;;;;;;;;;;yBAkBrQ,gBAAgB,YAAY,GAAG;;;;;;;;;;iBAUvC,MAAM,MAAM,IAAI,OAAO;;;;AAIxC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BundlePairingTrust } from "../../types/remote.mjs";
|
|
2
|
+
//#region src/services/pairingPage/index.d.ts
|
|
3
|
+
/** Asserted by the tunnel self-test to prove the pairing route is reachable end to end. */
|
|
4
|
+
export declare const PAIRING_PAGE_MARKER = "po-pairing-page";
|
|
5
|
+
export interface PairingPageInput {
|
|
6
|
+
/** Per-response nonce; the CSP admits exactly this one inline script. */
|
|
7
|
+
nonce: string;
|
|
8
|
+
/** Local-loopback bootstrap trust. Remote callers must bring it in the QR fragment. */
|
|
9
|
+
localTrust?: BundlePairingTrust;
|
|
10
|
+
/**
|
|
11
|
+
* A self-hosted origin with no pairing channel (po-cloudflare bearer mode). The owner opens
|
|
12
|
+
* `/pair#s=<key>&r=<rev>` from the deploy output: the fragment alone pins the signer, no code is
|
|
13
|
+
* claimed, and the scanner, manual code and passkey steps stay hidden. The origin's own login gates the page.
|
|
14
|
+
*/
|
|
15
|
+
fragmentTrust?: boolean;
|
|
16
|
+
/** This team host offers its own same-origin issuer. Personal QR pairing stays account-free. */
|
|
17
|
+
accountPairing?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function pairingPageCsp(nonce: string): string;
|
|
20
|
+
export declare function pairingPageHeaders(nonce: string): Record<string, string>;
|
|
21
|
+
export declare function pairingPageHtml(input: PairingPageInput): string;
|
|
22
|
+
//#endregion
|
|
23
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/services/pairingPage/index.ts"],"mappings":";;;qBA2Ba;iBAKI;;EAEf;;EAEA,aAAa;;;;;;EAMb;;EAEA;;wBAGc,eAAe;wBAef,mBAAmB,gBAAgB;wBA2anC,gBAAgB,OAAO"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { PAIRING_CLAIM_ROUTE, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, REMOTE_API_ROUTE } from "../../constants/remote.mjs";
|
|
1
|
+
import { PAIRING_ACCOUNT_ROUTE, PAIRING_CLAIM_ROUTE, PAIRING_CODE_TTL_MS, PAIRING_STATUS_QUERY, PAIRING_STATUS_ROUTE, PASSKEY_REGISTER_BEGIN_ROUTE, PASSKEY_REGISTER_FINISH_ROUTE, REMOTE_API_ROUTE } from "../../constants/remote.mjs";
|
|
2
|
+
import { AUTH_BOOTSTRAP_PATH, AUTH_PAIRING_PROOF_PATH } from "../../schemas/identity.mjs";
|
|
2
3
|
//#region src/services/pairingPage/index.ts
|
|
3
4
|
/**
|
|
4
5
|
* The package-owned page a scanned QR opens before any cockpit JavaScript runs.
|
|
@@ -78,7 +79,8 @@ const STYLE = `
|
|
|
78
79
|
*/
|
|
79
80
|
const SCRIPT = `
|
|
80
81
|
const params = new URLSearchParams(location.hash.slice(1));
|
|
81
|
-
|
|
82
|
+
let code = params.get('c') ?? '';
|
|
83
|
+
const accountPairing = document.body.dataset.accountPairing === '1';
|
|
82
84
|
const state = document.getElementById('state');
|
|
83
85
|
const manual = document.getElementById('manual');
|
|
84
86
|
const actions = document.getElementById('actions');
|
|
@@ -97,7 +99,7 @@ const SCRIPT = `
|
|
|
97
99
|
return { publicKey: value.publicKey, revision, fingerprint: typeof value.fingerprint === 'string' ? value.fingerprint : '' };
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
let scannedTrust = trustOf({
|
|
101
103
|
publicKey: params.get('s'),
|
|
102
104
|
revision: params.get('r'),
|
|
103
105
|
});
|
|
@@ -114,6 +116,18 @@ const SCRIPT = `
|
|
|
114
116
|
}
|
|
115
117
|
rememberChannelKey(params.get('k'));
|
|
116
118
|
history.replaceState(null, '', location.pathname);
|
|
119
|
+
if (accountPairing) {
|
|
120
|
+
try {
|
|
121
|
+
const saved = JSON.parse(sessionStorage.getItem('po.pairing.resume') ?? 'null');
|
|
122
|
+
sessionStorage.removeItem('po.pairing.resume');
|
|
123
|
+
if (code === '' && saved && Number.isSafeInteger(saved.expiresAt) && saved.expiresAt > Date.now() &&
|
|
124
|
+
saved.expiresAt <= Date.now() + ${String(PAIRING_CODE_TTL_MS)} && typeof saved.code === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(saved.code)) {
|
|
125
|
+
code = saved.code;
|
|
126
|
+
scannedTrust = trustOf(saved.trust);
|
|
127
|
+
fragmentClaimStarted = true;
|
|
128
|
+
}
|
|
129
|
+
} catch { /* Missing, unavailable or malformed tab storage never supplies a pairing. */ }
|
|
130
|
+
}
|
|
117
131
|
window.addEventListener('hashchange', () => {
|
|
118
132
|
const nextParams = new URLSearchParams(location.hash.slice(1));
|
|
119
133
|
const nextCode = nextParams.get('c') ?? '';
|
|
@@ -230,28 +244,63 @@ const SCRIPT = `
|
|
|
230
244
|
}
|
|
231
245
|
|
|
232
246
|
async function claim(value, candidateTrust) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
247
|
+
try {
|
|
248
|
+
if (accountPairing) {
|
|
249
|
+
const response = await fetch('${AUTH_BOOTSTRAP_PATH}', { credentials: 'same-origin', redirect: 'error' });
|
|
250
|
+
if (!response.ok) throw new Error('Sign-in is unavailable. Try again.');
|
|
251
|
+
const account = await response.json();
|
|
252
|
+
if (account.issuer !== location.origin) throw new Error('This computer does not offer same-origin sign-in.');
|
|
253
|
+
if (typeof account.session?.org !== 'string' || account.session.org === '') {
|
|
254
|
+
if (value !== '') sessionStorage.setItem('po.pairing.resume', JSON.stringify({ code: value, trust: candidateTrust, expiresAt: Date.now() + ${String(PAIRING_CODE_TTL_MS)} }));
|
|
255
|
+
location.replace('/api/auth/browser/team?next=%2Fpair');
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (value === '') { say('Scan the code shown on the host or enter its manual code.', 'bad'); manual.hidden = false; return; }
|
|
260
|
+
say('Asking the host to approve this device...');
|
|
261
|
+
const response = await fetch('${PAIRING_CLAIM_ROUTE}', {
|
|
262
|
+
method: 'POST',
|
|
263
|
+
headers: { 'content-type': 'application/json' },
|
|
264
|
+
credentials: 'same-origin',
|
|
265
|
+
body: JSON.stringify({ code: value, ...(accountPairing ? { accountRequired: true } : {}) }),
|
|
266
|
+
});
|
|
267
|
+
if (!response.ok) {
|
|
268
|
+
say(response.status === 429 ? 'Too many attempts. Wait a minute.' : 'That code is not valid. Scan again.', 'bad');
|
|
269
|
+
manual.hidden = false;
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const claimed = await response.json();
|
|
273
|
+
if (accountPairing) {
|
|
274
|
+
if (typeof claimed.requestId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(claimed.requestId) ||
|
|
275
|
+
typeof claimed.hostPublicKey !== 'string' || !/^[A-Za-z0-9_-]{80,512}$/.test(claimed.hostPublicKey))
|
|
276
|
+
throw new Error('The host returned an invalid pairing request.');
|
|
277
|
+
const proofResponse = await fetch('${AUTH_PAIRING_PROOF_PATH}', {
|
|
278
|
+
method: 'POST', credentials: 'same-origin', redirect: 'error',
|
|
279
|
+
headers: { 'content-type': 'application/json', 'x-po-csrf': '1' },
|
|
280
|
+
body: JSON.stringify({ requestId: claimed.requestId, hostPublicKey: claimed.hostPublicKey }),
|
|
281
|
+
});
|
|
282
|
+
if (!proofResponse.ok) throw new Error('Your sign-in could not be verified for this pairing. Sign in and pair again.');
|
|
283
|
+
const proof = await proofResponse.json();
|
|
284
|
+
if (typeof proof.proof !== 'string' || !/^[a-f0-9]{64}$/.test(proof.proof) || !Number.isSafeInteger(proof.expiresAt) || proof.expiresAt <= Date.now())
|
|
285
|
+
throw new Error('The sign-in server returned an invalid pairing proof.');
|
|
286
|
+
const bound = await fetch('${PAIRING_ACCOUNT_ROUTE}', {
|
|
287
|
+
method: 'POST', credentials: 'same-origin', redirect: 'error', headers: { 'content-type': 'application/json' },
|
|
288
|
+
body: JSON.stringify({ requestId: claimed.requestId, proof: proof.proof }),
|
|
289
|
+
});
|
|
290
|
+
if (!bound.ok) throw new Error('This account could not join the pairing. Check your team and pair again.');
|
|
291
|
+
}
|
|
292
|
+
say('Waiting for the host to approve this device.');
|
|
293
|
+
const approved = await poll(claimed.requestId);
|
|
294
|
+
if (!approved) return;
|
|
295
|
+
rememberChannelKey(approved.hostPublicKey);
|
|
296
|
+
const trust = candidateTrust ?? trustOf(approved.bundleTrust);
|
|
297
|
+
if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }
|
|
298
|
+
if (!candidateTrust && !(await confirmManualTrust(trust))) return;
|
|
299
|
+
if (await activateTrust(trust, !candidateTrust)) offerPasskey();
|
|
300
|
+
} catch (error) {
|
|
301
|
+
say(error?.message ?? 'Pairing could not finish. Try again.', 'bad');
|
|
243
302
|
manual.hidden = false;
|
|
244
|
-
return;
|
|
245
303
|
}
|
|
246
|
-
const claimed = await response.json();
|
|
247
|
-
say('Waiting for the host to approve this device.');
|
|
248
|
-
const approved = await poll(claimed.requestId);
|
|
249
|
-
if (!approved) return;
|
|
250
|
-
rememberChannelKey(approved.hostPublicKey);
|
|
251
|
-
const trust = candidateTrust ?? trustOf(approved.bundleTrust);
|
|
252
|
-
if (!trust) { say('The host did not provide signed-bundle trust. Pair again.', 'bad'); return; }
|
|
253
|
-
if (!candidateTrust && !(await confirmManualTrust(trust))) return;
|
|
254
|
-
if (await activateTrust(trust, !candidateTrust)) offerPasskey();
|
|
255
304
|
}
|
|
256
305
|
|
|
257
306
|
const fromBase64Url = (value) =>
|
|
@@ -383,6 +432,17 @@ const SCRIPT = `
|
|
|
383
432
|
skipPasskey.addEventListener('click', openCockpit);
|
|
384
433
|
|
|
385
434
|
void (async () => {
|
|
435
|
+
if (document.body.dataset.fragmentTrust === '1') {
|
|
436
|
+
try { await navigator.serviceWorker?.register('/sw.js', { scope: '/' }); } catch { /* requestWorker reports it */ }
|
|
437
|
+
if (scannedTrust) {
|
|
438
|
+
if (await activateTrust(scannedTrust)) openCockpit();
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const refreshed = await requestWorker({ type: 'po:refresh-bundle' });
|
|
442
|
+
if (refreshed.ok) { openCockpit(); return; }
|
|
443
|
+
say('Open the pairing link printed when this deploy was built: /pair#s=<key>&r=<revision>.', 'bad');
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
386
446
|
if (localTrust) {
|
|
387
447
|
if (await activateTrust(localTrust)) openCockpit();
|
|
388
448
|
return;
|
|
@@ -397,6 +457,7 @@ function pairingPageHtml(input) {
|
|
|
397
457
|
const localSigner = input.localTrust?.publicKey ?? "";
|
|
398
458
|
const localRevision = input.localTrust?.revision ?? "";
|
|
399
459
|
const localFingerprint = input.localTrust?.fingerprint ?? "";
|
|
460
|
+
const fragmentTrust = input.fragmentTrust === true;
|
|
400
461
|
return `<!doctype html>
|
|
401
462
|
<html lang="en">
|
|
402
463
|
<head>
|
|
@@ -408,7 +469,7 @@ function pairingPageHtml(input) {
|
|
|
408
469
|
<title>Pair with Po</title>
|
|
409
470
|
<style>${STYLE}</style>
|
|
410
471
|
</head>
|
|
411
|
-
<body data-marker="${PAIRING_PAGE_MARKER}" data-local-signer="${localSigner}" data-local-revision="${String(localRevision)}" data-local-fingerprint="${localFingerprint}">
|
|
472
|
+
<body data-marker="${PAIRING_PAGE_MARKER}" data-local-signer="${localSigner}" data-local-revision="${String(localRevision)}" data-local-fingerprint="${localFingerprint}"${fragmentTrust ? " data-fragment-trust=\"1\"" : ""}${input.accountPairing === true ? " data-account-pairing=\"1\"" : ""}>
|
|
412
473
|
<main>
|
|
413
474
|
<h1>Pair this device</h1>
|
|
414
475
|
<p>This cockpit can run shell commands on the host machine. Pair only your own device.</p>
|
|
@@ -426,7 +487,7 @@ function pairingPageHtml(input) {
|
|
|
426
487
|
<button id="add-passkey" type="button">Add passkey</button>
|
|
427
488
|
<button id="skip-passkey" class="secondary" type="button">Not now</button>
|
|
428
489
|
</div>
|
|
429
|
-
<section id="scanner">
|
|
490
|
+
<section id="scanner"${fragmentTrust ? " hidden" : ""}>
|
|
430
491
|
<p id="pwa-status" role="status">Checking browser support.</p>
|
|
431
492
|
<video id="camera" playsinline muted hidden></video>
|
|
432
493
|
<div class="actions">
|