@agimon-ai/po-core 0.0.0-alpha.21 → 0.0.0-alpha.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -149
- package/NOTICE +1 -1
- package/README.md +40 -3
- package/dist/agentModel.cjs +4 -0
- package/dist/agentModel.d.mts +3 -1
- package/dist/agentModel.mjs +3 -1
- package/dist/apiContracts.cjs +631 -326
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1252 -149
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +626 -323
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/approval.cjs +17 -0
- package/dist/approval.d.mts +5 -0
- package/dist/approval.mjs +4 -0
- package/dist/backgroundWork.cjs +5 -0
- package/dist/backgroundWork.d.mts +2 -2
- package/dist/backgroundWork.mjs +1 -1
- package/dist/bundlePublicationWorker.cjs +30 -0
- package/dist/bundlePublicationWorker.cjs.map +1 -0
- package/dist/bundlePublicationWorker.d.mts +1 -0
- package/dist/bundlePublicationWorker.mjs +28 -0
- package/dist/bundlePublicationWorker.mjs.map +1 -0
- package/dist/childSession.d.mts +3 -2
- package/dist/clientDevices.cjs +4 -0
- package/dist/clientDevices.d.mts +3 -0
- package/dist/clientDevices.mjs +1 -0
- package/dist/clientMetadata.cjs +13 -0
- package/dist/clientMetadata.d.mts +4 -0
- package/dist/clientMetadata.mjs +3 -0
- package/dist/codemode.cjs +7 -0
- package/dist/codemode.d.mts +2 -0
- package/dist/codemode.mjs +1 -0
- package/dist/contextDetailStore.cjs +20 -12
- package/dist/contextDetailStore.cjs.map +1 -1
- package/dist/contextDetailStore.d.mts +7 -4
- package/dist/contextDetailStore.d.mts.map +1 -1
- package/dist/contextDetailStore.mjs +19 -11
- package/dist/contextDetailStore.mjs.map +1 -1
- package/dist/contextProjection.cjs +68 -8
- package/dist/contextProjection.cjs.map +1 -1
- package/dist/contextProjection.d.mts +34 -10
- package/dist/contextProjection.d.mts.map +1 -1
- package/dist/contextProjection.mjs +65 -9
- package/dist/contextProjection.mjs.map +1 -1
- package/dist/delegation.cjs +3 -0
- package/dist/delegation.d.mts +2 -2
- package/dist/delegation.mjs +1 -1
- package/dist/executionBudget.cjs +13 -5
- package/dist/executionBudget.cjs.map +1 -1
- package/dist/executionBudget.d.mts.map +1 -1
- package/dist/executionBudget.mjs +13 -5
- package/dist/executionBudget.mjs.map +1 -1
- package/dist/extensionFile.cjs +1 -2
- package/dist/extensionFile.d.mts +4 -4
- package/dist/extensionFile.mjs +3 -3
- package/dist/headless.cjs +22 -0
- package/dist/headless.d.mts +6 -2
- package/dist/headless.mjs +5 -1
- package/dist/headlessHub.cjs +941 -137
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.d.mts +133 -25
- package/dist/headlessHub.d.mts.map +1 -1
- package/dist/headlessHub.mjs +938 -135
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessProtocol.cjs +331 -74
- package/dist/headlessProtocol.cjs.map +1 -1
- package/dist/headlessProtocol.d.mts +29 -3
- package/dist/headlessProtocol.d.mts.map +1 -1
- package/dist/headlessProtocol.mjs +335 -79
- package/dist/headlessProtocol.mjs.map +1 -1
- package/dist/headlessServer.cjs +1057 -219
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.d.mts +140 -14
- package/dist/headlessServer.d.mts.map +1 -1
- package/dist/headlessServer.mjs +1057 -219
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/headlessSessionHost.d.mts +65 -24
- package/dist/headlessSessionHost.d.mts.map +1 -1
- package/dist/headlessSessionManager.cjs +23 -16
- package/dist/headlessSessionManager.cjs.map +1 -1
- package/dist/headlessSessionManager.d.mts +1 -1
- package/dist/headlessSessionManager.d.mts.map +1 -1
- package/dist/headlessSessionManager.mjs +23 -16
- package/dist/headlessSessionManager.mjs.map +1 -1
- package/dist/help.cjs +6 -0
- package/dist/help.d.mts +2 -2
- package/dist/help.mjs +2 -2
- package/dist/history.cjs +7 -0
- package/dist/history.d.mts +5 -3
- package/dist/history.mjs +5 -2
- package/dist/historyOwnership.cjs +100 -71
- package/dist/historyOwnership.cjs.map +1 -1
- package/dist/historyOwnership.d.mts.map +1 -1
- package/dist/historyOwnership.mjs +103 -75
- package/dist/historyOwnership.mjs.map +1 -1
- package/dist/hubChannel.cjs +32 -0
- package/dist/hubChannel.d.mts +5 -3
- package/dist/hubChannel.mjs +5 -3
- package/dist/images.cjs +15 -0
- package/dist/images.d.mts +2 -0
- package/dist/images.mjs +1 -0
- package/dist/index.cjs +27 -0
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +7 -3
- package/dist/inputTemplate.cjs +5 -0
- package/dist/inputTemplate.d.mts +3 -0
- package/dist/inputTemplate.mjs +1 -0
- package/dist/interop/piCodingAgent.mjs +1 -0
- package/dist/lintReview.cjs +4 -0
- package/dist/lintReview.d.mts +2 -0
- package/dist/lintReview.mjs +1 -0
- package/dist/locale.cjs +19 -0
- package/dist/locale.d.mts +3 -0
- package/dist/locale.mjs +3 -0
- package/dist/machineApi.cjs +30 -81
- package/dist/machineApi.cjs.map +1 -1
- package/dist/machineApi.d.mts +1 -1
- package/dist/machineApi.d.mts.map +1 -1
- package/dist/machineApi.mjs +30 -79
- package/dist/machineApi.mjs.map +1 -1
- package/dist/main.cjs +6 -1
- package/dist/main.d.mts +3 -3
- package/dist/main.mjs +3 -3
- package/dist/mcp.cjs +7 -0
- package/dist/mcp.d.mts +2 -0
- package/dist/mcp.mjs +1 -0
- package/dist/mcpProjection.cjs +1 -0
- package/dist/mcpProjection.d.mts +2 -2
- package/dist/mcpProjection.mjs +1 -1
- package/dist/mcpSchemaCost.cjs +10 -10
- package/dist/mcpSchemaCost.cjs.map +1 -1
- package/dist/mcpSchemaCost.mjs +9 -9
- package/dist/mcpSchemaCost.mjs.map +1 -1
- package/dist/modelGateway.cjs +33 -0
- package/dist/modelGateway.d.mts +13 -0
- package/dist/modelGateway.mjs +10 -0
- package/dist/moduleResolution.cjs +18 -18
- package/dist/moduleResolution.cjs.map +1 -1
- package/dist/moduleResolution.d.mts +4 -4
- package/dist/moduleResolution.d.mts.map +1 -1
- package/dist/moduleResolution.mjs +17 -17
- package/dist/moduleResolution.mjs.map +1 -1
- package/dist/native.cjs +99 -13
- package/dist/native.d.mts +26 -9
- package/dist/native.mjs +20 -4
- package/dist/nodePlatform.cjs +42 -4
- package/dist/nodePlatform.cjs.map +1 -1
- package/dist/nodePlatform.d.mts +5 -0
- package/dist/nodePlatform.d.mts.map +1 -1
- package/dist/nodePlatform.mjs +42 -5
- package/dist/nodePlatform.mjs.map +1 -1
- package/dist/notification.cjs +1 -0
- package/dist/notification.d.mts +2 -2
- package/dist/notification.mjs +1 -1
- package/dist/operationHook.cjs +3 -0
- package/dist/operationHook.d.mts +2 -0
- package/dist/operationHook.mjs +1 -0
- package/dist/packageApi.cjs +9 -0
- package/dist/packageApi.d.mts +4 -2
- package/dist/packageApi.mjs +3 -2
- package/dist/packageApiServer.cjs +148 -40
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.d.mts +34 -6
- package/dist/packageApiServer.d.mts.map +1 -1
- package/dist/packageApiServer.mjs +140 -36
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/pairingPage.cjs +6 -0
- package/dist/pairingPage.d.mts +2 -0
- package/dist/pairingPage.mjs +1 -0
- package/dist/personTimeZone.cjs +7 -0
- package/dist/personTimeZone.d.mts +2 -0
- package/dist/personTimeZone.mjs +1 -0
- package/dist/piSettings.cjs +2 -0
- package/dist/piSettings.d.mts +3 -3
- package/dist/piSettings.mjs +3 -3
- package/dist/platform.cjs +47 -2
- package/dist/platform.d.mts +11 -6
- package/dist/platform.mjs +11 -6
- package/dist/pluginProtocol.cjs +15 -0
- package/dist/pluginProtocol.d.mts +2 -2
- package/dist/pluginProtocol.mjs +1 -1
- package/dist/po-runtime-identity.json +1 -0
- package/dist/protocolTransport.cjs +7 -0
- package/dist/protocolTransport.d.mts +3 -0
- package/dist/protocolTransport.mjs +3 -0
- package/dist/providerAuth.cjs +8 -0
- package/dist/providerAuth.d.mts +4 -0
- package/dist/providerAuth.mjs +3 -0
- package/dist/remoteChildSession.cjs +6 -0
- package/dist/remoteChildSession.d.mts +3 -0
- package/dist/remoteChildSession.mjs +1 -0
- package/dist/remoteContract.cjs +42 -0
- package/dist/remoteContract.d.mts +4 -0
- package/dist/remoteContract.mjs +3 -0
- package/dist/remoteOrigin.cjs +4 -0
- package/dist/remoteOrigin.d.mts +2 -0
- package/dist/remoteOrigin.mjs +1 -0
- package/dist/runtimeContextApi.cjs +1 -1
- package/dist/runtimeContextApi.cjs.map +1 -1
- package/dist/runtimeContextApi.mjs +1 -1
- package/dist/runtimeContextApi.mjs.map +1 -1
- package/dist/runtimeCordisHost.cjs +9 -8
- package/dist/runtimeCordisHost.cjs.map +1 -1
- package/dist/runtimeCordisHost.d.mts +1 -1
- package/dist/runtimeCordisHost.d.mts.map +1 -1
- package/dist/runtimeCordisHost.mjs +3 -2
- package/dist/runtimeCordisHost.mjs.map +1 -1
- package/dist/runtimeEnvironment.cjs +6 -0
- package/dist/runtimeEnvironment.d.mts +2 -0
- package/dist/runtimeEnvironment.mjs +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts.map +1 -1
- package/dist/runtimeIdentity.cjs.map +1 -1
- package/dist/runtimeIdentity.d.mts +1 -1
- package/dist/runtimeIdentity.mjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.cjs +4 -4
- package/dist/runtimeLogSinkTelemetry.cjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.d.mts +4 -3
- package/dist/runtimeLogSinkTelemetry.d.mts.map +1 -1
- package/dist/runtimeLogSinkTelemetry.mjs +4 -4
- package/dist/runtimeLogSinkTelemetry.mjs.map +1 -1
- package/dist/runtimePackages.cjs +27 -22
- package/dist/runtimePackages.cjs.map +1 -1
- package/dist/runtimePackages.d.mts +9 -1
- package/dist/runtimePackages.d.mts.map +1 -1
- package/dist/runtimePackages.mjs +26 -21
- package/dist/runtimePackages.mjs.map +1 -1
- package/dist/runtimePiSettings.cjs +2 -0
- package/dist/runtimePiSettings.d.mts +3 -3
- package/dist/runtimePiSettings.mjs +3 -3
- package/dist/runtimeTransition.cjs.map +1 -1
- package/dist/runtimeTransition.d.mts +7 -7
- package/dist/runtimeTransition.d.mts.map +1 -1
- package/dist/runtimeTransition.mjs.map +1 -1
- package/dist/sandboxIdentity.cjs +5 -0
- package/dist/sandboxIdentity.d.mts +2 -0
- package/dist/sandboxIdentity.mjs +1 -0
- package/dist/server.d.mts +3 -3
- package/dist/serverPlugin.cjs +45 -6
- package/dist/serverPlugin.d.mts +18 -5
- package/dist/serverPlugin.mjs +16 -3
- package/dist/serverTelemetry.cjs +2 -2
- package/dist/serverTelemetry.cjs.map +1 -1
- package/dist/serverTelemetry.d.mts +2 -1
- package/dist/serverTelemetry.d.mts.map +1 -1
- package/dist/serverTelemetry.mjs +1 -1
- package/dist/serverTelemetry.mjs.map +1 -1
- package/dist/sessionFilesApi.cjs +17 -6
- package/dist/sessionFilesApi.cjs.map +1 -1
- package/dist/sessionFilesApi.d.mts.map +1 -1
- package/dist/sessionFilesApi.mjs +17 -6
- package/dist/sessionFilesApi.mjs.map +1 -1
- package/dist/sessionMcpContract.cjs +18 -0
- package/dist/sessionMcpContract.d.mts +5 -0
- package/dist/sessionMcpContract.mjs +1 -0
- package/dist/sessionProtocol.cjs +24 -2
- package/dist/sessionProtocol.d.mts +6 -5
- package/dist/sessionProtocol.mjs +6 -5
- package/dist/skills.cjs +4 -0
- package/dist/skills.d.mts +2 -1
- package/dist/skills.mjs +3 -1
- package/dist/sqliteSessionStorage.cjs +20 -13
- package/dist/sqliteSessionStorage.cjs.map +1 -1
- package/dist/sqliteSessionStorage.d.mts +3 -3
- package/dist/sqliteSessionStorage.d.mts.map +1 -1
- package/dist/sqliteSessionStorage.mjs +19 -12
- package/dist/sqliteSessionStorage.mjs.map +1 -1
- package/dist/src/constants/agentSettled.d.mts +5 -0
- package/dist/src/constants/agentSettled.d.mts.map +1 -0
- package/dist/src/constants/cloud.cjs +11 -0
- package/dist/src/constants/cloud.cjs.map +1 -0
- package/dist/src/constants/cloud.d.mts +9 -0
- package/dist/src/constants/cloud.d.mts.map +1 -0
- package/dist/src/constants/cloud.mjs +11 -0
- package/dist/src/constants/cloud.mjs.map +1 -0
- package/dist/src/constants/fixedCore.cjs +38 -0
- package/dist/src/constants/fixedCore.cjs.map +1 -0
- package/dist/src/constants/fixedCore.d.mts +12 -0
- package/dist/src/constants/fixedCore.d.mts.map +1 -0
- package/dist/src/constants/fixedCore.mjs +38 -0
- package/dist/src/constants/fixedCore.mjs.map +1 -0
- package/dist/src/constants/globalSettings.cjs +10 -0
- package/dist/src/constants/globalSettings.cjs.map +1 -0
- package/dist/src/constants/globalSettings.d.mts +8 -0
- package/dist/src/constants/globalSettings.d.mts.map +1 -0
- package/dist/src/constants/globalSettings.mjs +10 -0
- package/dist/src/constants/globalSettings.mjs.map +1 -0
- package/dist/src/constants/modelGateway.cjs +48 -0
- package/dist/src/constants/modelGateway.cjs.map +1 -0
- package/dist/src/constants/modelGateway.d.mts +29 -0
- package/dist/src/constants/modelGateway.d.mts.map +1 -0
- package/dist/src/constants/modelGateway.mjs +42 -0
- package/dist/src/constants/modelGateway.mjs.map +1 -0
- package/dist/src/constants/nativeHost.cjs +11 -1
- package/dist/src/constants/nativeHost.cjs.map +1 -1
- package/dist/src/constants/nativeHost.d.mts +1 -1
- package/dist/src/constants/nativeHost.d.mts.map +1 -1
- package/dist/src/constants/nativeHost.mjs +11 -1
- package/dist/src/constants/nativeHost.mjs.map +1 -1
- package/dist/src/constants/remote.cjs +26 -14
- package/dist/src/constants/remote.cjs.map +1 -1
- package/dist/src/constants/remote.d.mts +105 -0
- package/dist/src/constants/remote.d.mts.map +1 -0
- package/dist/src/constants/remote.mjs +18 -10
- package/dist/src/constants/remote.mjs.map +1 -1
- package/dist/src/constants/sessionFiles.cjs +3 -0
- package/dist/src/constants/sessionFiles.cjs.map +1 -1
- package/dist/src/constants/sessionFiles.d.mts +9 -0
- package/dist/src/constants/sessionFiles.d.mts.map +1 -0
- package/dist/src/constants/sessionFiles.mjs +3 -1
- package/dist/src/constants/sessionFiles.mjs.map +1 -1
- package/dist/src/constants/template.cjs +13 -0
- package/dist/src/constants/template.cjs.map +1 -0
- package/dist/src/constants/template.d.mts +9 -0
- package/dist/src/constants/template.d.mts.map +1 -0
- package/dist/src/constants/template.mjs +11 -0
- package/dist/src/constants/template.mjs.map +1 -0
- package/dist/src/extensions/extensionFile.cjs +9 -10
- package/dist/src/extensions/extensionFile.cjs.map +1 -1
- package/dist/src/extensions/extensionFile.d.mts +16 -8
- package/dist/src/extensions/extensionFile.d.mts.map +1 -1
- package/dist/src/extensions/extensionFile.mjs +10 -10
- package/dist/src/extensions/extensionFile.mjs.map +1 -1
- package/dist/src/extensions/serverPlugin.cjs +55 -7
- package/dist/src/extensions/serverPlugin.cjs.map +1 -1
- package/dist/src/extensions/serverPlugin.d.mts +1 -1
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
- package/dist/src/extensions/serverPlugin.mjs +53 -5
- package/dist/src/extensions/serverPlugin.mjs.map +1 -1
- package/dist/src/extensions/webPlugin.cjs +25 -2
- package/dist/src/extensions/webPlugin.cjs.map +1 -1
- package/dist/src/extensions/webPlugin.d.mts +10 -2
- package/dist/src/extensions/webPlugin.d.mts.map +1 -1
- package/dist/src/extensions/webPlugin.mjs +21 -2
- package/dist/src/extensions/webPlugin.mjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.cjs +299 -132
- package/dist/src/pi/piSessionRuntime.cjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.d.mts +45 -9
- package/dist/src/pi/piSessionRuntime.d.mts.map +1 -1
- package/dist/src/pi/piSessionRuntime.mjs +299 -133
- package/dist/src/pi/piSessionRuntime.mjs.map +1 -1
- package/dist/src/schemas/agentModel.cjs +1 -1
- package/dist/src/schemas/agentModel.cjs.map +1 -1
- package/dist/src/schemas/agentModel.d.mts +1 -1
- package/dist/src/schemas/agentModel.mjs +1 -1
- package/dist/src/schemas/agentModel.mjs.map +1 -1
- package/dist/src/schemas/agentRun.cjs +16 -0
- package/dist/src/schemas/agentRun.cjs.map +1 -0
- package/dist/src/schemas/agentRun.d.mts +48 -0
- package/dist/src/schemas/agentRun.d.mts.map +1 -0
- package/dist/src/schemas/agentRun.mjs +14 -0
- package/dist/src/schemas/agentRun.mjs.map +1 -0
- package/dist/src/schemas/apiContracts.d.mts +2 -2
- package/dist/src/schemas/apiContracts.d.mts.map +1 -1
- package/dist/src/schemas/approval.cjs +21 -0
- package/dist/src/schemas/approval.cjs.map +1 -0
- package/dist/src/schemas/approval.d.mts +82 -0
- package/dist/src/schemas/approval.d.mts.map +1 -0
- package/dist/src/schemas/approval.mjs +15 -0
- package/dist/src/schemas/approval.mjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.cjs +103 -0
- package/dist/src/schemas/approvalPrompt.cjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.d.mts +83 -0
- package/dist/src/schemas/approvalPrompt.d.mts.map +1 -0
- package/dist/src/schemas/approvalPrompt.mjs +99 -0
- package/dist/src/schemas/approvalPrompt.mjs.map +1 -0
- package/dist/src/schemas/askUser.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.cjs +24 -2
- package/dist/src/schemas/backgroundWork.cjs.map +1 -1
- package/dist/src/schemas/backgroundWork.d.mts +11 -1
- package/dist/src/schemas/backgroundWork.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.mjs +20 -3
- package/dist/src/schemas/backgroundWork.mjs.map +1 -1
- package/dist/src/schemas/brain.cjs +43 -0
- package/dist/src/schemas/brain.cjs.map +1 -0
- package/dist/src/schemas/brain.d.mts +107 -0
- package/dist/src/schemas/brain.d.mts.map +1 -0
- package/dist/src/schemas/brain.mjs +43 -0
- package/dist/src/schemas/brain.mjs.map +1 -0
- package/dist/src/schemas/childProcess.cjs +2 -1
- package/dist/src/schemas/childProcess.cjs.map +1 -1
- package/dist/src/schemas/childProcess.d.mts +1 -1
- package/dist/src/schemas/childProcess.d.mts.map +1 -1
- package/dist/src/schemas/childProcess.mjs +2 -1
- package/dist/src/schemas/childProcess.mjs.map +1 -1
- package/dist/src/schemas/childReport.cjs +42 -0
- package/dist/src/schemas/childReport.cjs.map +1 -0
- package/dist/src/schemas/childReport.d.mts +96 -0
- package/dist/src/schemas/childReport.d.mts.map +1 -0
- package/dist/src/schemas/childReport.mjs +35 -0
- package/dist/src/schemas/childReport.mjs.map +1 -0
- package/dist/src/schemas/clientDevices.d.mts +25 -0
- package/dist/src/schemas/clientDevices.d.mts.map +1 -0
- package/dist/src/schemas/clientMetadata.d.mts +27 -0
- package/dist/src/schemas/clientMetadata.d.mts.map +1 -0
- package/dist/src/schemas/codemode.cjs +34 -0
- package/dist/src/schemas/codemode.cjs.map +1 -0
- package/dist/src/schemas/codemode.d.mts +162 -0
- package/dist/src/schemas/codemode.d.mts.map +1 -0
- package/dist/src/schemas/codemode.mjs +30 -0
- package/dist/src/schemas/codemode.mjs.map +1 -0
- package/dist/src/schemas/delegation.cjs +35 -3
- package/dist/src/schemas/delegation.cjs.map +1 -1
- package/dist/src/schemas/delegation.d.mts +23 -0
- package/dist/src/schemas/delegation.d.mts.map +1 -1
- package/dist/src/schemas/delegation.mjs +33 -4
- package/dist/src/schemas/delegation.mjs.map +1 -1
- package/dist/src/schemas/extensionFile.d.mts +11 -5
- package/dist/src/schemas/extensionFile.d.mts.map +1 -1
- package/dist/src/schemas/federation.cjs +50 -0
- package/dist/src/schemas/federation.cjs.map +1 -0
- package/dist/src/schemas/federation.d.mts +376 -0
- package/dist/src/schemas/federation.d.mts.map +1 -0
- package/dist/src/schemas/federation.mjs +44 -0
- package/dist/src/schemas/federation.mjs.map +1 -0
- package/dist/src/schemas/headless.cjs +153 -5
- package/dist/src/schemas/headless.cjs.map +1 -1
- package/dist/src/schemas/headless.d.mts +409 -20
- package/dist/src/schemas/headless.d.mts.map +1 -1
- package/dist/src/schemas/headless.mjs +143 -6
- package/dist/src/schemas/headless.mjs.map +1 -1
- package/dist/src/schemas/help.cjs +22 -3
- package/dist/src/schemas/help.cjs.map +1 -1
- package/dist/src/schemas/help.d.mts +70 -3
- package/dist/src/schemas/help.d.mts.map +1 -1
- package/dist/src/schemas/help.mjs +17 -4
- package/dist/src/schemas/help.mjs.map +1 -1
- package/dist/src/schemas/home.cjs +35 -12
- package/dist/src/schemas/home.cjs.map +1 -1
- package/dist/src/schemas/home.d.mts +6 -0
- package/dist/src/schemas/home.d.mts.map +1 -1
- package/dist/src/schemas/home.mjs +34 -13
- package/dist/src/schemas/home.mjs.map +1 -1
- package/dist/src/schemas/hostServiceContracts.cjs +39 -0
- package/dist/src/schemas/hostServiceContracts.cjs.map +1 -0
- package/dist/src/schemas/hostServiceContracts.d.mts +26 -0
- package/dist/src/schemas/hostServiceContracts.d.mts.map +1 -0
- package/dist/src/schemas/hostServiceContracts.mjs +39 -0
- package/dist/src/schemas/hostServiceContracts.mjs.map +1 -0
- package/dist/src/schemas/hostServices.cjs +14 -0
- package/dist/src/schemas/hostServices.cjs.map +1 -0
- package/dist/src/schemas/hostServices.d.mts +45 -0
- package/dist/src/schemas/hostServices.d.mts.map +1 -0
- package/dist/src/schemas/hostServices.mjs +12 -0
- package/dist/src/schemas/hostServices.mjs.map +1 -0
- package/dist/src/schemas/hostTeam.cjs +15 -0
- package/dist/src/schemas/hostTeam.cjs.map +1 -0
- package/dist/src/schemas/hostTeam.d.mts +64 -0
- package/dist/src/schemas/hostTeam.d.mts.map +1 -0
- package/dist/src/schemas/hostTeam.mjs +13 -0
- package/dist/src/schemas/hostTeam.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +282 -18
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
- package/dist/src/schemas/httpApiContracts.mjs +282 -18
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
- package/dist/src/schemas/hubChannel.cjs +132 -0
- package/dist/src/schemas/hubChannel.cjs.map +1 -1
- package/dist/src/schemas/hubChannel.d.mts +366 -15
- package/dist/src/schemas/hubChannel.d.mts.map +1 -1
- package/dist/src/schemas/hubChannel.mjs +116 -1
- package/dist/src/schemas/hubChannel.mjs.map +1 -1
- package/dist/src/schemas/humanIdentity.cjs +16 -0
- package/dist/src/schemas/humanIdentity.cjs.map +1 -0
- package/dist/src/schemas/humanIdentity.d.mts +39 -0
- package/dist/src/schemas/humanIdentity.d.mts.map +1 -0
- package/dist/src/schemas/humanIdentity.mjs +14 -0
- package/dist/src/schemas/humanIdentity.mjs.map +1 -0
- package/dist/src/schemas/identity.cjs +34 -0
- package/dist/src/schemas/identity.cjs.map +1 -0
- package/dist/src/schemas/identity.d.mts +193 -0
- package/dist/src/schemas/identity.d.mts.map +1 -0
- package/dist/src/schemas/identity.mjs +30 -0
- package/dist/src/schemas/identity.mjs.map +1 -0
- package/dist/src/schemas/lang.cjs +34 -0
- package/dist/src/schemas/lang.cjs.map +1 -0
- package/dist/src/schemas/lang.d.mts +37 -0
- package/dist/src/schemas/lang.d.mts.map +1 -0
- package/dist/src/schemas/lang.mjs +27 -0
- package/dist/src/schemas/lang.mjs.map +1 -0
- package/dist/src/schemas/leader.cjs +1 -1
- package/dist/src/schemas/leader.cjs.map +1 -1
- package/dist/src/schemas/leader.d.mts +1 -1
- package/dist/src/schemas/leader.d.mts.map +1 -1
- package/dist/src/schemas/leader.mjs +1 -1
- package/dist/src/schemas/leader.mjs.map +1 -1
- package/dist/src/schemas/lintReview.cjs +14 -0
- package/dist/src/schemas/lintReview.cjs.map +1 -0
- package/dist/src/schemas/lintReview.d.mts +75 -0
- package/dist/src/schemas/lintReview.d.mts.map +1 -0
- package/dist/src/schemas/lintReview.mjs +13 -0
- package/dist/src/schemas/lintReview.mjs.map +1 -0
- package/dist/src/schemas/locale.cjs +116 -0
- package/dist/src/schemas/locale.cjs.map +1 -0
- package/dist/src/schemas/locale.d.mts +40 -0
- package/dist/src/schemas/locale.d.mts.map +1 -0
- package/dist/src/schemas/locale.mjs +108 -0
- package/dist/src/schemas/locale.mjs.map +1 -0
- package/dist/src/schemas/mcp.cjs +17 -0
- package/dist/src/schemas/mcp.cjs.map +1 -0
- package/dist/src/schemas/mcp.d.mts +112 -0
- package/dist/src/schemas/mcp.d.mts.map +1 -0
- package/dist/src/schemas/mcp.mjs +13 -0
- package/dist/src/schemas/mcp.mjs.map +1 -0
- package/dist/src/schemas/mcpFacet.cjs.map +1 -1
- package/dist/src/schemas/mcpFacet.d.mts +4 -3
- package/dist/src/schemas/mcpFacet.d.mts.map +1 -1
- package/dist/src/schemas/mcpFacet.mjs.map +1 -1
- package/dist/src/schemas/mcpProjection.cjs +11 -1
- package/dist/src/schemas/mcpProjection.cjs.map +1 -1
- package/dist/src/schemas/mcpProjection.d.mts +10 -4
- package/dist/src/schemas/mcpProjection.d.mts.map +1 -1
- package/dist/src/schemas/mcpProjection.mjs +11 -2
- package/dist/src/schemas/mcpProjection.mjs.map +1 -1
- package/dist/src/schemas/mcpSession.d.mts +1 -1
- package/dist/src/schemas/modelGateway.cjs +143 -0
- package/dist/src/schemas/modelGateway.cjs.map +1 -0
- package/dist/src/schemas/modelGateway.d.mts +150 -0
- package/dist/src/schemas/modelGateway.d.mts.map +1 -0
- package/dist/src/schemas/modelGateway.mjs +135 -0
- package/dist/src/schemas/modelGateway.mjs.map +1 -0
- package/dist/src/schemas/narration.d.mts.map +1 -1
- package/dist/src/schemas/notification.cjs +59 -5
- package/dist/src/schemas/notification.cjs.map +1 -1
- package/dist/src/schemas/notification.d.mts +26 -0
- package/dist/src/schemas/notification.d.mts.map +1 -1
- package/dist/src/schemas/notification.mjs +59 -6
- package/dist/src/schemas/notification.mjs.map +1 -1
- package/dist/src/schemas/operationHook.cjs +180 -0
- package/dist/src/schemas/operationHook.cjs.map +1 -0
- package/dist/src/schemas/operationHook.d.mts +141 -0
- package/dist/src/schemas/operationHook.d.mts.map +1 -0
- package/dist/src/schemas/operationHook.mjs +180 -0
- package/dist/src/schemas/operationHook.mjs.map +1 -0
- package/dist/src/schemas/packageApi.cjs +76 -7
- package/dist/src/schemas/packageApi.cjs.map +1 -1
- package/dist/src/schemas/packageApi.d.mts +174 -30
- package/dist/src/schemas/packageApi.d.mts.map +1 -1
- package/dist/src/schemas/packageApi.mjs +70 -8
- package/dist/src/schemas/packageApi.mjs.map +1 -1
- package/dist/src/schemas/personTimeZone.cjs +29 -0
- package/dist/src/schemas/personTimeZone.cjs.map +1 -0
- package/dist/src/schemas/personTimeZone.d.mts +33 -0
- package/dist/src/schemas/personTimeZone.d.mts.map +1 -0
- package/dist/src/schemas/personTimeZone.mjs +25 -0
- package/dist/src/schemas/personTimeZone.mjs.map +1 -0
- package/dist/src/schemas/platform.cjs +48 -0
- package/dist/src/schemas/platform.cjs.map +1 -1
- package/dist/src/schemas/platform.d.mts +355 -11
- package/dist/src/schemas/platform.d.mts.map +1 -1
- package/dist/src/schemas/platform.mjs +34 -1
- package/dist/src/schemas/platform.mjs.map +1 -1
- package/dist/src/schemas/pluginCatalog.cjs +42 -0
- package/dist/src/schemas/pluginCatalog.cjs.map +1 -0
- package/dist/src/schemas/pluginCatalog.d.mts +67 -0
- package/dist/src/schemas/pluginCatalog.d.mts.map +1 -0
- package/dist/src/schemas/pluginCatalog.mjs +39 -0
- package/dist/src/schemas/pluginCatalog.mjs.map +1 -0
- package/dist/src/schemas/pluginContributions.cjs.map +1 -1
- package/dist/src/schemas/pluginContributions.d.mts +5 -2
- package/dist/src/schemas/pluginContributions.d.mts.map +1 -1
- package/dist/src/schemas/pluginContributions.mjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.cjs +110 -10
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.d.mts +63 -5
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
- package/dist/src/schemas/pluginProtocol.mjs +96 -11
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
- package/dist/src/schemas/profileIdentity.cjs +3 -3
- package/dist/src/schemas/profileIdentity.cjs.map +1 -1
- package/dist/src/schemas/profileIdentity.d.mts +2 -2
- package/dist/src/schemas/profileIdentity.mjs +3 -3
- package/dist/src/schemas/profileIdentity.mjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.cjs +4 -8
- package/dist/src/schemas/protocolChannelsContract.cjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.d.mts +16 -22
- package/dist/src/schemas/protocolChannelsContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.mjs +5 -9
- package/dist/src/schemas/protocolChannelsContract.mjs.map +1 -1
- package/dist/src/schemas/protocolContracts.cjs +193 -133
- package/dist/src/schemas/protocolContracts.cjs.map +1 -1
- package/dist/src/schemas/protocolContracts.d.mts +136 -32
- package/dist/src/schemas/protocolContracts.d.mts.map +1 -1
- package/dist/src/schemas/protocolContracts.mjs +186 -132
- package/dist/src/schemas/protocolContracts.mjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.cjs +109 -27
- package/dist/src/schemas/protocolHubContract.cjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.d.mts +292 -134
- package/dist/src/schemas/protocolHubContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolHubContract.mjs +103 -30
- package/dist/src/schemas/protocolHubContract.mjs.map +1 -1
- package/dist/src/schemas/protocolService.cjs +12 -0
- package/dist/src/schemas/protocolService.cjs.map +1 -0
- package/dist/src/schemas/protocolService.d.mts +22 -0
- package/dist/src/schemas/protocolService.d.mts.map +1 -0
- package/dist/src/schemas/protocolService.mjs +11 -0
- package/dist/src/schemas/protocolService.mjs.map +1 -0
- package/dist/src/schemas/protocolSessionContract.cjs +7 -11
- package/dist/src/schemas/protocolSessionContract.cjs.map +1 -1
- package/dist/src/schemas/protocolSessionContract.d.mts +303 -299
- package/dist/src/schemas/protocolSessionContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolSessionContract.mjs +9 -13
- package/dist/src/schemas/protocolSessionContract.mjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.cjs +5 -6
- package/dist/src/schemas/protocolThreadContract.cjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.d.mts +12 -16
- package/dist/src/schemas/protocolThreadContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolThreadContract.mjs +6 -7
- package/dist/src/schemas/protocolThreadContract.mjs.map +1 -1
- package/dist/src/schemas/remoteGateway.cjs +14 -0
- package/dist/src/schemas/remoteGateway.cjs.map +1 -0
- package/dist/src/schemas/remoteGateway.d.mts +19 -0
- package/dist/src/schemas/remoteGateway.d.mts.map +1 -0
- package/dist/src/schemas/remoteGateway.mjs +12 -0
- package/dist/src/schemas/remoteGateway.mjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.cjs +9 -0
- package/dist/src/schemas/remoteOrigin.cjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.d.mts +16 -0
- package/dist/src/schemas/remoteOrigin.d.mts.map +1 -0
- package/dist/src/schemas/remoteOrigin.mjs +8 -0
- package/dist/src/schemas/remoteOrigin.mjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.cjs +14 -0
- package/dist/src/schemas/sandboxIdentity.cjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.d.mts +23 -0
- package/dist/src/schemas/sandboxIdentity.d.mts.map +1 -0
- package/dist/src/schemas/sandboxIdentity.mjs +12 -0
- package/dist/src/schemas/sandboxIdentity.mjs.map +1 -0
- package/dist/src/schemas/serverBundle.cjs +13 -0
- package/dist/src/schemas/serverBundle.cjs.map +1 -0
- package/dist/src/schemas/serverBundle.d.mts +29 -1
- package/dist/src/schemas/serverBundle.d.mts.map +1 -1
- package/dist/src/schemas/serverBundle.mjs +13 -0
- package/dist/src/schemas/serverBundle.mjs.map +1 -0
- package/dist/src/schemas/serverPlugin.cjs +5 -3
- package/dist/src/schemas/serverPlugin.cjs.map +1 -1
- package/dist/src/schemas/serverPlugin.d.mts +2 -2
- package/dist/src/schemas/serverPlugin.d.mts.map +1 -1
- package/dist/src/schemas/serverPlugin.mjs +5 -3
- package/dist/src/schemas/serverPlugin.mjs.map +1 -1
- package/dist/src/schemas/serverScope.cjs +21 -3
- package/dist/src/schemas/serverScope.cjs.map +1 -1
- package/dist/src/schemas/serverScope.d.mts +17 -1
- package/dist/src/schemas/serverScope.d.mts.map +1 -1
- package/dist/src/schemas/serverScope.mjs +21 -4
- package/dist/src/schemas/serverScope.mjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.cjs +17 -11
- package/dist/src/schemas/sessionApiContracts.cjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.mjs +18 -11
- package/dist/src/schemas/sessionApiContracts.mjs.map +1 -1
- package/dist/src/schemas/sessionLifecycle.cjs +12 -0
- package/dist/src/schemas/sessionLifecycle.cjs.map +1 -0
- package/dist/src/schemas/sessionLifecycle.d.mts +33 -0
- package/dist/src/schemas/sessionLifecycle.d.mts.map +1 -0
- package/dist/src/schemas/sessionLifecycle.mjs +11 -0
- package/dist/src/schemas/sessionLifecycle.mjs.map +1 -0
- package/dist/src/schemas/sessionProtocol.cjs +13 -0
- package/dist/src/schemas/sessionProtocol.cjs.map +1 -1
- package/dist/src/schemas/sessionProtocol.d.mts +57 -15
- package/dist/src/schemas/sessionProtocol.d.mts.map +1 -1
- package/dist/src/schemas/sessionProtocol.mjs +12 -1
- package/dist/src/schemas/sessionProtocol.mjs.map +1 -1
- package/dist/src/schemas/sharedModels.cjs +9 -0
- package/dist/src/schemas/sharedModels.cjs.map +1 -0
- package/dist/src/schemas/sharedModels.d.mts +33 -0
- package/dist/src/schemas/sharedModels.d.mts.map +1 -0
- package/dist/src/schemas/sharedModels.mjs +8 -0
- package/dist/src/schemas/sharedModels.mjs.map +1 -0
- package/dist/src/schemas/skills.cjs +1 -1
- package/dist/src/schemas/skills.cjs.map +1 -1
- package/dist/src/schemas/skills.d.mts +1 -1
- package/dist/src/schemas/skills.mjs +1 -1
- package/dist/src/schemas/skills.mjs.map +1 -1
- package/dist/src/schemas/space.cjs +33 -0
- package/dist/src/schemas/space.cjs.map +1 -0
- package/dist/src/schemas/space.d.mts +90 -0
- package/dist/src/schemas/space.d.mts.map +1 -0
- package/dist/src/schemas/space.mjs +29 -0
- package/dist/src/schemas/space.mjs.map +1 -0
- package/dist/src/schemas/toolSurface.cjs.map +1 -1
- package/dist/src/schemas/toolSurface.d.mts +2 -2
- package/dist/src/schemas/toolSurface.d.mts.map +1 -1
- package/dist/src/schemas/toolSurface.mjs.map +1 -1
- package/dist/src/schemas/userFeedback.cjs +22 -0
- package/dist/src/schemas/userFeedback.cjs.map +1 -0
- package/dist/src/schemas/userFeedback.d.mts +30 -0
- package/dist/src/schemas/userFeedback.d.mts.map +1 -0
- package/dist/src/schemas/userFeedback.mjs +18 -0
- package/dist/src/schemas/userFeedback.mjs.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.cjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.cjs.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.d.mts +5 -5
- package/dist/src/schemas/voiceReloadHandoff.d.mts.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.mjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.mjs.map +1 -1
- package/dist/src/schemas/workflow.cjs +217 -0
- package/dist/src/schemas/workflow.cjs.map +1 -0
- package/dist/src/schemas/workflow.d.mts +593 -0
- package/dist/src/schemas/workflow.d.mts.map +1 -0
- package/dist/src/schemas/workflow.mjs +188 -0
- package/dist/src/schemas/workflow.mjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.cjs +13 -0
- package/dist/src/schemas/workspaceRegistry.cjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.d.mts +45 -0
- package/dist/src/schemas/workspaceRegistry.d.mts.map +1 -0
- package/dist/src/schemas/workspaceRegistry.mjs +11 -0
- package/dist/src/schemas/workspaceRegistry.mjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.cjs +14 -0
- package/dist/src/schemas/workspaceSandboxes.cjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts +85 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.mjs +12 -0
- package/dist/src/schemas/workspaceSandboxes.mjs.map +1 -0
- package/dist/src/server/conversationEvents.cjs +345 -0
- package/dist/src/server/conversationEvents.cjs.map +1 -0
- package/dist/src/server/conversationEvents.mjs +345 -0
- package/dist/src/server/conversationEvents.mjs.map +1 -0
- package/dist/src/server/directHarnessRuntime.cjs +1326 -549
- package/dist/src/server/directHarnessRuntime.cjs.map +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/server/directHarnessRuntime.mjs +1308 -532
- package/dist/src/server/directHarnessRuntime.mjs.map +1 -1
- package/dist/src/server/largeFrameLink.cjs +22 -37
- package/dist/src/server/largeFrameLink.cjs.map +1 -1
- package/dist/src/server/largeFrameLink.mjs +22 -37
- package/dist/src/server/largeFrameLink.mjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.cjs +2 -1
- package/dist/src/server/mcpBundleLoader.cjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts.map +1 -1
- package/dist/src/server/mcpBundleLoader.mjs +2 -1
- package/dist/src/server/mcpBundleLoader.mjs.map +1 -1
- package/dist/src/server/providerRoutes.cjs +74 -0
- package/dist/src/server/providerRoutes.cjs.map +1 -0
- package/dist/src/server/providerRoutes.d.mts +20 -0
- package/dist/src/server/providerRoutes.d.mts.map +1 -0
- package/dist/src/server/providerRoutes.mjs +74 -0
- package/dist/src/server/providerRoutes.mjs.map +1 -0
- package/dist/src/server/providerRuntime.cjs +41 -0
- package/dist/src/server/providerRuntime.cjs.map +1 -0
- package/dist/src/server/providerRuntime.d.mts +12 -0
- package/dist/src/server/providerRuntime.d.mts.map +1 -0
- package/dist/src/server/providerRuntime.mjs +39 -0
- package/dist/src/server/providerRuntime.mjs.map +1 -0
- package/dist/src/server/serverPackages.cjs +29 -7
- package/dist/src/server/serverPackages.cjs.map +1 -1
- package/dist/src/server/serverPackages.d.mts +9 -3
- package/dist/src/server/serverPackages.d.mts.map +1 -1
- package/dist/src/server/serverPackages.mjs +29 -7
- package/dist/src/server/serverPackages.mjs.map +1 -1
- package/dist/src/server/serverScope.cjs +434 -34
- package/dist/src/server/serverScope.cjs.map +1 -1
- package/dist/src/server/serverScope.d.mts +72 -8
- package/dist/src/server/serverScope.d.mts.map +1 -1
- package/dist/src/server/serverScope.mjs +435 -35
- package/dist/src/server/serverScope.mjs.map +1 -1
- package/dist/src/server/threadJournals.cjs.map +1 -1
- package/dist/src/server/threadJournals.mjs.map +1 -1
- package/dist/src/services/approvalGate/index.cjs +179 -0
- package/dist/src/services/approvalGate/index.cjs.map +1 -0
- package/dist/src/services/approvalGate/index.d.mts +30 -0
- package/dist/src/services/approvalGate/index.d.mts.map +1 -0
- package/dist/src/services/approvalGate/index.mjs +174 -0
- package/dist/src/services/approvalGate/index.mjs.map +1 -0
- package/dist/src/services/approvalGate/type.d.mts +36 -0
- package/dist/src/services/approvalGate/type.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.cjs +103 -39
- package/dist/src/services/bundlePublication/index.cjs.map +1 -1
- package/dist/src/services/bundlePublication/index.d.mts +11 -0
- package/dist/src/services/bundlePublication/index.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.mjs +101 -39
- package/dist/src/services/bundlePublication/index.mjs.map +1 -1
- package/dist/src/services/chatgptImages/index.cjs +56 -11
- package/dist/src/services/chatgptImages/index.cjs.map +1 -1
- package/dist/src/services/chatgptImages/index.mjs +56 -11
- package/dist/src/services/chatgptImages/index.mjs.map +1 -1
- package/dist/src/services/chatgptLogin/index.cjs +2 -2
- package/dist/src/services/chatgptLogin/index.cjs.map +1 -1
- package/dist/src/services/chordAdapter/index.cjs +456 -0
- package/dist/src/services/chordAdapter/index.cjs.map +1 -0
- package/dist/src/services/chordAdapter/index.d.mts +13 -0
- package/dist/src/services/chordAdapter/index.d.mts.map +1 -0
- package/dist/src/services/chordAdapter/index.mjs +453 -0
- package/dist/src/services/chordAdapter/index.mjs.map +1 -0
- package/dist/src/services/chordAdapter/type.d.mts +24 -0
- package/dist/src/services/chordAdapter/type.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.cjs +75 -0
- package/dist/src/services/clientDevices/index.cjs.map +1 -0
- package/dist/src/services/clientDevices/index.d.mts +7 -0
- package/dist/src/services/clientDevices/index.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.mjs +74 -0
- package/dist/src/services/clientDevices/index.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs +96 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts +16 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs +89 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs +63 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts +10 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs +62 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs.map +1 -0
- package/dist/src/services/contextUsage/index.cjs +0 -9
- package/dist/src/services/contextUsage/index.cjs.map +1 -1
- package/dist/src/services/contextUsage/index.mjs +1 -9
- package/dist/src/services/contextUsage/index.mjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.cjs +1 -0
- package/dist/src/services/durableNavigation/docs.cjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.mjs +1 -0
- package/dist/src/services/durableNavigation/docs.mjs.map +1 -1
- package/dist/src/services/durableNavigation/index.cjs.map +1 -1
- package/dist/src/services/durableNavigation/index.mjs.map +1 -1
- package/dist/src/services/durableQueue/docs.cjs +1 -0
- package/dist/src/services/durableQueue/docs.cjs.map +1 -1
- package/dist/src/services/durableQueue/docs.mjs +1 -0
- package/dist/src/services/durableQueue/docs.mjs.map +1 -1
- package/dist/src/services/durableQueue/index.cjs +157 -69
- package/dist/src/services/durableQueue/index.cjs.map +1 -1
- package/dist/src/services/durableQueue/index.mjs +156 -70
- package/dist/src/services/durableQueue/index.mjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.cjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.cjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.mjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.mjs.map +1 -1
- package/dist/src/services/durableResumeSnapshots/docs.cjs +49 -0
- package/dist/src/services/durableResumeSnapshots/docs.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs +48 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts +27 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts.map +1 -0
- package/dist/src/services/durableSession/docs.cjs +13 -1
- package/dist/src/services/durableSession/docs.cjs.map +1 -1
- package/dist/src/services/durableSession/docs.d.mts +9 -1
- package/dist/src/services/durableSession/docs.d.mts.map +1 -1
- package/dist/src/services/durableSession/docs.mjs +13 -1
- package/dist/src/services/durableSession/docs.mjs.map +1 -1
- package/dist/src/services/durableSession/index.cjs.map +1 -1
- package/dist/src/services/durableSession/index.d.mts +1 -1
- package/dist/src/services/durableSession/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.cjs +1 -0
- package/dist/src/services/durableSubagents/docs.cjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.mjs +1 -0
- package/dist/src/services/durableSubagents/docs.mjs.map +1 -1
- package/dist/src/services/durableSubagents/extension.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.cjs +29 -3
- package/dist/src/services/durableSubagents/index.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.mjs +29 -4
- package/dist/src/services/durableSubagents/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/tasks.cjs.map +1 -1
- package/dist/src/services/edgeModelRuntime/index.cjs +377 -0
- package/dist/src/services/edgeModelRuntime/index.cjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts +24 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.mjs +374 -0
- package/dist/src/services/edgeModelRuntime/index.mjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts +39 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.cjs +53 -0
- package/dist/src/services/editPresence/index.cjs.map +1 -0
- package/dist/src/services/editPresence/index.d.mts +6 -0
- package/dist/src/services/editPresence/index.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.mjs +53 -0
- package/dist/src/services/editPresence/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs +63 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.d.mts +1 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs +60 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs.map +1 -0
- package/dist/src/services/fileAccess/core.cjs +87 -0
- package/dist/src/services/fileAccess/core.cjs.map +1 -0
- package/dist/src/services/fileAccess/core.mjs +78 -0
- package/dist/src/services/fileAccess/core.mjs.map +1 -0
- package/dist/src/services/fileAccess/index.cjs +34 -0
- package/dist/src/services/fileAccess/index.cjs.map +1 -0
- package/dist/src/services/fileAccess/index.d.mts +23 -0
- package/dist/src/services/fileAccess/index.d.mts.map +1 -0
- package/dist/src/services/fileAccess/index.mjs +29 -0
- package/dist/src/services/fileAccess/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/type.d.mts +1 -0
- package/dist/src/services/grantLedger/index.cjs +56 -0
- package/dist/src/services/grantLedger/index.cjs.map +1 -0
- package/dist/src/services/grantLedger/index.mjs +55 -0
- package/dist/src/services/grantLedger/index.mjs.map +1 -0
- package/dist/src/services/guardedFile/index.cjs +36 -0
- package/dist/src/services/guardedFile/index.cjs.map +1 -0
- package/dist/src/services/guardedFile/index.d.mts +9 -0
- package/dist/src/services/guardedFile/index.d.mts.map +1 -0
- package/dist/src/services/guardedFile/index.mjs +33 -0
- package/dist/src/services/guardedFile/index.mjs.map +1 -0
- package/dist/src/services/headlessClient/index.cjs +85 -3
- package/dist/src/services/headlessClient/index.cjs.map +1 -1
- package/dist/src/services/headlessClient/index.mjs +86 -4
- package/dist/src/services/headlessClient/index.mjs.map +1 -1
- package/dist/src/services/hostServices/index.cjs +157 -0
- package/dist/src/services/hostServices/index.cjs.map +1 -0
- package/dist/src/services/hostServices/index.d.mts +33 -0
- package/dist/src/services/hostServices/index.d.mts.map +1 -0
- package/dist/src/services/hostServices/index.mjs +157 -0
- package/dist/src/services/hostServices/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/index.cjs +120 -0
- package/dist/src/services/inputTemplate/index.cjs.map +1 -0
- package/dist/src/services/inputTemplate/index.d.mts +10 -0
- package/dist/src/services/inputTemplate/index.d.mts.map +1 -0
- package/dist/src/services/inputTemplate/index.mjs +118 -0
- package/dist/src/services/inputTemplate/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/type.d.mts +17 -0
- package/dist/src/services/inputTemplate/type.d.mts.map +1 -0
- package/dist/src/services/json/core.cjs.map +1 -1
- package/dist/src/services/json/core.d.mts +1 -1
- package/dist/src/services/json/core.mjs.map +1 -1
- package/dist/src/services/json/sync.cjs +2 -2
- package/dist/src/services/json/sync.cjs.map +1 -1
- package/dist/src/services/json/sync.d.mts.map +1 -1
- package/dist/src/services/json/sync.mjs +1 -1
- package/dist/src/services/json/sync.mjs.map +1 -1
- package/dist/src/services/kernel/index.cjs.map +1 -1
- package/dist/src/services/kernel/index.d.mts +1 -1
- package/dist/src/services/kernel/index.mjs.map +1 -1
- package/dist/src/services/loginFlow/index.cjs +7 -1
- package/dist/src/services/loginFlow/index.cjs.map +1 -1
- package/dist/src/services/loginFlow/index.mjs +7 -1
- package/dist/src/services/loginFlow/index.mjs.map +1 -1
- package/dist/src/services/modelDispatch/index.cjs +200 -0
- package/dist/src/services/modelDispatch/index.cjs.map +1 -0
- package/dist/src/services/modelDispatch/index.mjs +197 -0
- package/dist/src/services/modelDispatch/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/index.cjs +88 -0
- package/dist/src/services/modelFallback/index.cjs.map +1 -0
- package/dist/src/services/modelFallback/index.d.mts +16 -0
- package/dist/src/services/modelFallback/index.d.mts.map +1 -0
- package/dist/src/services/modelFallback/index.mjs +86 -0
- package/dist/src/services/modelFallback/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/type.d.mts +16 -0
- package/dist/src/services/modelFallback/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.cjs +394 -0
- package/dist/src/services/modelGatewayContainer/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts +16 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.mjs +393 -0
- package/dist/src/services/modelGatewayContainer/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts +28 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts +18 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts +36 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.cjs +292 -0
- package/dist/src/services/modelGatewayHost/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayHost/index.d.mts +13 -0
- package/dist/src/services/modelGatewayHost/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.mjs +292 -0
- package/dist/src/services/modelGatewayHost/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayHost/type.d.mts +61 -0
- package/dist/src/services/modelGatewayHost/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.cjs +170 -0
- package/dist/src/services/modelGatewayWire/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayWire/index.d.mts +30 -0
- package/dist/src/services/modelGatewayWire/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.mjs +163 -0
- package/dist/src/services/modelGatewayWire/index.mjs.map +1 -0
- package/dist/src/services/nativeChildTools/index.cjs +307 -9
- package/dist/src/services/nativeChildTools/index.cjs.map +1 -1
- package/dist/src/services/nativeChildTools/index.d.mts +11 -0
- package/dist/src/services/nativeChildTools/index.d.mts.map +1 -0
- package/dist/src/services/nativeChildTools/index.mjs +298 -3
- package/dist/src/services/nativeChildTools/index.mjs.map +1 -1
- package/dist/src/services/nodeHost/index.cjs +4 -2
- package/dist/src/services/nodeHost/index.cjs.map +1 -1
- package/dist/src/services/nodeHost/index.d.mts +2 -0
- package/dist/src/services/nodeHost/index.d.mts.map +1 -1
- package/dist/src/services/nodeHost/index.mjs +3 -1
- package/dist/src/services/nodeHost/index.mjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.cjs +26 -29
- package/dist/src/services/nodeModelDependencies/index.cjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.mjs +18 -20
- package/dist/src/services/nodeModelDependencies/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.cjs +1 -0
- package/dist/src/services/openSessionRegistry/index.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.d.mts +1 -1
- package/dist/src/services/openSessionRegistry/index.mjs +1 -0
- package/dist/src/services/openSessionRegistry/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts +26 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.cjs +9 -4
- package/dist/src/services/openSessionRegistry/sync.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.mjs +8 -3
- package/dist/src/services/openSessionRegistry/sync.mjs.map +1 -1
- package/dist/src/services/operationDispatch/index.cjs +263 -0
- package/dist/src/services/operationDispatch/index.cjs.map +1 -0
- package/dist/src/services/operationDispatch/index.mjs +263 -0
- package/dist/src/services/operationDispatch/index.mjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.cjs +2 -1
- package/dist/src/services/packageApiHarness/index.cjs.map +1 -1
- package/dist/src/services/packageApiHarness/index.d.mts +2 -1
- package/dist/src/services/packageApiHarness/index.d.mts.map +1 -1
- package/dist/src/services/packageApiHarness/index.mjs +2 -1
- package/dist/src/services/packageApiHarness/index.mjs.map +1 -1
- package/dist/src/services/packageContentRevision/index.cjs +173 -0
- package/dist/src/services/packageContentRevision/index.cjs.map +1 -0
- package/dist/src/services/packageContentRevision/index.d.mts +39 -0
- package/dist/src/services/packageContentRevision/index.d.mts.map +1 -0
- package/dist/src/services/packageContentRevision/index.mjs +168 -0
- package/dist/src/services/packageContentRevision/index.mjs.map +1 -0
- package/dist/src/services/packageResource/index.cjs +12 -8
- package/dist/src/services/packageResource/index.cjs.map +1 -1
- package/dist/src/services/packageResource/index.d.mts.map +1 -1
- package/dist/src/services/packageResource/index.mjs +12 -8
- package/dist/src/services/packageResource/index.mjs.map +1 -1
- package/dist/src/services/pairingPage/index.cjs +85 -24
- package/dist/src/services/pairingPage/index.cjs.map +1 -1
- package/dist/src/services/pairingPage/index.d.mts +23 -0
- package/dist/src/services/pairingPage/index.d.mts.map +1 -0
- package/dist/src/services/pairingPage/index.mjs +86 -25
- package/dist/src/services/pairingPage/index.mjs.map +1 -1
- package/dist/src/services/piArgs/index.cjs +2 -2
- package/dist/src/services/piArgs/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.cjs +344 -56
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.d.mts +3 -1
- package/dist/src/services/piExtensionHost/index.d.mts.map +1 -1
- package/dist/src/services/piExtensionHost/index.mjs +325 -37
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
- package/dist/src/services/piMessages/index.cjs +16 -0
- package/dist/src/services/piMessages/index.cjs.map +1 -1
- package/dist/src/services/piMessages/index.d.mts +12 -0
- package/dist/src/services/piMessages/index.d.mts.map +1 -0
- package/dist/src/services/piMessages/index.mjs +16 -1
- package/dist/src/services/piMessages/index.mjs.map +1 -1
- package/dist/src/services/piSettings/core.cjs +18 -5
- package/dist/src/services/piSettings/core.cjs.map +1 -1
- package/dist/src/services/piSettings/core.d.mts +6 -1
- package/dist/src/services/piSettings/core.d.mts.map +1 -1
- package/dist/src/services/piSettings/core.mjs +18 -6
- package/dist/src/services/piSettings/core.mjs.map +1 -1
- package/dist/src/services/piSettings/sync.cjs +31 -2
- package/dist/src/services/piSettings/sync.cjs.map +1 -1
- package/dist/src/services/piSettings/sync.d.mts +3 -0
- package/dist/src/services/piSettings/sync.d.mts.map +1 -1
- package/dist/src/services/piSettings/sync.mjs +31 -3
- package/dist/src/services/piSettings/sync.mjs.map +1 -1
- package/dist/src/services/piSummary/index.cjs +2 -2
- package/dist/src/services/piSummary/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.cjs +81 -0
- package/dist/src/services/platformFiles/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.d.mts +12 -1
- package/dist/src/services/platformFiles/index.d.mts.map +1 -1
- package/dist/src/services/platformFiles/index.mjs +76 -1
- package/dist/src/services/platformFiles/index.mjs.map +1 -1
- package/dist/src/services/platformFiles/rootBoundReplace.cjs +110 -0
- package/dist/src/services/platformFiles/rootBoundReplace.cjs.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts +21 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs +106 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs.map +1 -0
- package/dist/src/services/poPackage/core.cjs.map +1 -1
- package/dist/src/services/poPackage/core.d.mts +1 -1
- package/dist/src/services/poPackage/core.mjs.map +1 -1
- package/dist/src/services/poPackage/sync.cjs +2 -2
- package/dist/src/services/poPackage/sync.cjs.map +1 -1
- package/dist/src/services/poPackage/sync.d.mts.map +1 -1
- package/dist/src/services/poPackage/sync.mjs +1 -1
- package/dist/src/services/poPackage/sync.mjs.map +1 -1
- package/dist/src/services/poTelemetry/index.cjs +69 -0
- package/dist/src/services/poTelemetry/index.cjs.map +1 -0
- package/dist/src/services/poTelemetry/index.d.mts +7 -0
- package/dist/src/services/poTelemetry/index.d.mts.map +1 -0
- package/dist/src/services/poTelemetry/index.mjs +66 -0
- package/dist/src/services/poTelemetry/index.mjs.map +1 -0
- package/dist/src/services/portableConfig/index.cjs +136 -0
- package/dist/src/services/portableConfig/index.cjs.map +1 -0
- package/dist/src/services/portableConfig/index.d.mts +30 -0
- package/dist/src/services/portableConfig/index.d.mts.map +1 -0
- package/dist/src/services/portableConfig/index.mjs +130 -0
- package/dist/src/services/portableConfig/index.mjs.map +1 -0
- package/dist/src/services/providerAuth/index.cjs +6 -10
- package/dist/src/services/providerAuth/index.cjs.map +1 -1
- package/dist/src/services/providerAuth/index.mjs +5 -7
- package/dist/src/services/providerAuth/index.mjs.map +1 -1
- package/dist/src/services/providerImages/fitter.cjs +48 -0
- package/dist/src/services/providerImages/fitter.cjs.map +1 -0
- package/dist/src/services/providerImages/fitter.mjs +47 -0
- package/dist/src/services/providerImages/fitter.mjs.map +1 -0
- package/dist/src/services/providerImages/index.cjs +21 -0
- package/dist/src/services/providerImages/index.cjs.map +1 -0
- package/dist/src/services/providerImages/index.d.mts +3 -0
- package/dist/src/services/providerImages/index.mjs +21 -0
- package/dist/src/services/providerImages/index.mjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.cjs +228 -0
- package/dist/src/services/runtimeEnvironment/index.cjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts +37 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.mjs +219 -0
- package/dist/src/services/runtimeEnvironment/index.mjs.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.cjs +2 -2
- package/dist/src/services/runtimeIdentity/sync.cjs.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.d.mts.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs.map +1 -1
- package/dist/src/services/scopeInput/index.cjs +49 -0
- package/dist/src/services/scopeInput/index.cjs.map +1 -0
- package/dist/src/services/scopeInput/index.mjs +47 -0
- package/dist/src/services/scopeInput/index.mjs.map +1 -0
- package/dist/src/services/serialRunner/index.cjs +3 -0
- package/dist/src/services/serialRunner/index.cjs.map +1 -1
- package/dist/src/services/serialRunner/index.d.mts +2 -0
- package/dist/src/services/serialRunner/index.d.mts.map +1 -1
- package/dist/src/services/serialRunner/index.mjs +3 -1
- package/dist/src/services/serialRunner/index.mjs.map +1 -1
- package/dist/src/services/serverHost/index.cjs +12 -2
- package/dist/src/services/serverHost/index.cjs.map +1 -1
- package/dist/src/services/serverHost/index.d.mts +3 -1
- package/dist/src/services/serverHost/index.d.mts.map +1 -1
- package/dist/src/services/serverHost/index.mjs +12 -2
- package/dist/src/services/serverHost/index.mjs.map +1 -1
- package/dist/src/services/sessionAccess/index.cjs +168 -0
- package/dist/src/services/sessionAccess/index.cjs.map +1 -0
- package/dist/src/services/sessionAccess/index.d.mts +11 -0
- package/dist/src/services/sessionAccess/index.d.mts.map +1 -0
- package/dist/src/services/sessionAccess/index.mjs +163 -0
- package/dist/src/services/sessionAccess/index.mjs.map +1 -0
- package/dist/src/services/sessionAccess/type.d.mts +32 -0
- package/dist/src/services/sessionAccess/type.d.mts.map +1 -0
- package/dist/src/services/sessionAttachments/index.cjs +13 -13
- package/dist/src/services/sessionAttachments/index.cjs.map +1 -1
- package/dist/src/services/sessionAttachments/index.d.mts +3 -1
- package/dist/src/services/sessionAttachments/index.d.mts.map +1 -1
- package/dist/src/services/sessionAttachments/index.mjs +12 -12
- package/dist/src/services/sessionAttachments/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/index.cjs +35 -13
- package/dist/src/services/sessionFiles/index.cjs.map +1 -1
- package/dist/src/services/sessionFiles/index.d.mts +10 -1
- package/dist/src/services/sessionFiles/index.d.mts.map +1 -1
- package/dist/src/services/sessionFiles/index.mjs +34 -14
- package/dist/src/services/sessionFiles/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.cjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.cjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.mjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.mjs.map +1 -1
- package/dist/src/services/sessionLifecycle/index.cjs +293 -0
- package/dist/src/services/sessionLifecycle/index.cjs.map +1 -0
- package/dist/src/services/sessionLifecycle/index.mjs +293 -0
- package/dist/src/services/sessionLifecycle/index.mjs.map +1 -0
- package/dist/src/services/sessionLifecycle/type.d.mts +32 -0
- package/dist/src/services/sessionLifecycle/type.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs +60 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts +31 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs +45 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts +6 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts +16 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts.map +1 -0
- package/dist/src/services/skillPrompt/index.cjs +14 -4
- package/dist/src/services/skillPrompt/index.cjs.map +1 -1
- package/dist/src/services/skillPrompt/index.mjs +14 -5
- package/dist/src/services/skillPrompt/index.mjs.map +1 -1
- package/dist/src/services/skillRelations/index.cjs +113 -0
- package/dist/src/services/skillRelations/index.cjs.map +1 -0
- package/dist/src/services/skillRelations/index.d.mts +32 -0
- package/dist/src/services/skillRelations/index.d.mts.map +1 -0
- package/dist/src/services/skillRelations/index.mjs +111 -0
- package/dist/src/services/skillRelations/index.mjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs +38 -10
- package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.d.mts +13 -0
- package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.mjs +37 -10
- package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.cjs +12 -12
- package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.d.mts +2 -2
- package/dist/src/services/sqliteTranscriptReader/index.mjs +3 -3
- package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -1
- package/dist/src/services/telemetry/index.cjs +591 -0
- package/dist/src/services/telemetry/index.cjs.map +1 -0
- package/dist/src/services/telemetry/index.d.mts +7 -0
- package/dist/src/services/telemetry/index.d.mts.map +1 -0
- package/dist/src/services/telemetry/index.mjs +587 -0
- package/dist/src/services/telemetry/index.mjs.map +1 -0
- package/dist/src/services/toolContinuation/index.cjs +84 -0
- package/dist/src/services/toolContinuation/index.cjs.map +1 -0
- package/dist/src/services/toolContinuation/index.mjs +83 -0
- package/dist/src/services/toolContinuation/index.mjs.map +1 -0
- package/dist/src/services/traceContext/index.cjs.map +1 -1
- package/dist/src/services/traceContext/index.mjs.map +1 -1
- package/dist/src/services/transcriptPages/index.cjs +169 -8
- package/dist/src/services/transcriptPages/index.cjs.map +1 -1
- package/dist/src/services/transcriptPages/index.mjs +165 -9
- package/dist/src/services/transcriptPages/index.mjs.map +1 -1
- package/dist/src/services/verifiedArchive/index.cjs +181 -0
- package/dist/src/services/verifiedArchive/index.cjs.map +1 -0
- package/dist/src/services/verifiedArchive/index.d.mts +38 -0
- package/dist/src/services/verifiedArchive/index.d.mts.map +1 -0
- package/dist/src/services/verifiedArchive/index.mjs +173 -0
- package/dist/src/services/verifiedArchive/index.mjs.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.cjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.cjs.map +1 -1
- package/dist/src/services/voiceReloadHandoff/index.d.mts +1 -1
- package/dist/src/services/voiceReloadHandoff/index.mjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.mjs.map +1 -1
- package/dist/src/services/workspaceLookup/index.cjs +34 -0
- package/dist/src/services/workspaceLookup/index.cjs.map +1 -0
- package/dist/src/services/workspaceLookup/index.d.mts +6 -0
- package/dist/src/services/workspaceLookup/index.d.mts.map +1 -0
- package/dist/src/services/workspaceLookup/index.mjs +34 -0
- package/dist/src/services/workspaceLookup/index.mjs.map +1 -0
- package/dist/src/services/workspaceRegistry/index.cjs +2 -0
- package/dist/src/services/workspaceRegistry/index.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/index.d.mts +3 -3
- package/dist/src/services/workspaceRegistry/index.mjs +4 -2
- package/dist/src/services/workspaceRegistry/index.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.cjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.d.mts +4 -4
- package/dist/src/services/workspaceRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.mjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs +60 -8
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts +20 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs +58 -9
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs.map +1 -1
- package/dist/src/services/workspaceSandboxes/index.cjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.cjs.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts +9 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.mjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.mjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +65 -27
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +19 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +65 -30
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -1
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs +328 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts +35 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs +325 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs.map +1 -0
- package/dist/src/systems/child/services/childSession/index.cjs +60 -32
- package/dist/src/systems/child/services/childSession/index.cjs.map +1 -1
- package/dist/src/systems/child/services/childSession/index.d.mts +5 -0
- package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -1
- package/dist/src/systems/child/services/childSession/index.mjs +60 -32
- package/dist/src/systems/child/services/childSession/index.mjs.map +1 -1
- package/dist/src/systems/child/types/childSession.cjs.map +1 -1
- package/dist/src/systems/child/types/childSession.d.mts +34 -18
- package/dist/src/systems/child/types/childSession.d.mts.map +1 -1
- package/dist/src/systems/child/types/childSession.mjs.map +1 -1
- package/dist/src/systems/child/types/childSessionInput.d.mts +17 -0
- package/dist/src/systems/child/types/childSessionInput.d.mts.map +1 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts +85 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.cjs +614 -82
- package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.d.mts +60 -12
- package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.mjs +612 -81
- package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +866 -184
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +23 -3
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +845 -167
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/dist/src/systems/main/types/headlessHost.d.mts +14 -5
- package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -1
- package/dist/src/testing/pi/testHost.cjs +1 -0
- package/dist/src/testing/pi/testHost.cjs.map +1 -1
- package/dist/src/testing/pi/testHost.mjs +1 -0
- package/dist/src/testing/pi/testHost.mjs.map +1 -1
- package/dist/src/types/kernel.d.mts +3 -3
- package/dist/src/types/remote.d.mts +53 -29
- package/dist/src/types/remote.d.mts.map +1 -1
- package/dist/src/types/server/agentSessionForward.d.mts +14 -0
- package/dist/src/types/server/agentSessionForward.d.mts.map +1 -0
- package/dist/src/types/server/auth.d.mts +104 -0
- package/dist/src/types/server/auth.d.mts.map +1 -0
- package/dist/src/types/server/directHarnessRuntime.d.mts +144 -19
- package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/types/server/sessionMcp.d.mts +34 -0
- package/dist/src/types/server/sessionMcp.d.mts.map +1 -0
- package/dist/src/types/telemetry.d.mts +64 -0
- package/dist/src/types/telemetry.d.mts.map +1 -0
- package/dist/src/web/hostSlots.cjs +199 -0
- package/dist/src/web/hostSlots.cjs.map +1 -0
- package/dist/src/web/hostSlots.d.mts +196 -0
- package/dist/src/web/hostSlots.d.mts.map +1 -0
- package/dist/src/web/hostSlots.mjs +195 -0
- package/dist/src/web/hostSlots.mjs.map +1 -0
- package/dist/src/web/models/globalStore.cjs +2 -2
- package/dist/src/web/models/globalStore.cjs.map +1 -1
- package/dist/src/web/models/globalStore.d.mts +2 -2
- package/dist/src/web/models/globalStore.d.mts.map +1 -1
- package/dist/src/web/models/globalStore.mjs +2 -2
- package/dist/src/web/models/globalStore.mjs.map +1 -1
- package/dist/src/web/models/sessionStore.cjs +1 -1
- package/dist/src/web/models/sessionStore.cjs.map +1 -1
- package/dist/src/web/models/sessionStore.mjs +1 -1
- package/dist/src/web/models/sessionStore.mjs.map +1 -1
- package/dist/src/web/schemas/onboarding.cjs +17 -0
- package/dist/src/web/schemas/onboarding.cjs.map +1 -0
- package/dist/src/web/schemas/onboarding.d.mts +6 -0
- package/dist/src/web/schemas/onboarding.d.mts.map +1 -0
- package/dist/src/web/schemas/onboarding.mjs +17 -0
- package/dist/src/web/schemas/onboarding.mjs.map +1 -0
- package/dist/src/web/schemas/template.cjs +20 -8
- package/dist/src/web/schemas/template.cjs.map +1 -1
- package/dist/src/web/schemas/template.d.mts +6 -2
- package/dist/src/web/schemas/template.d.mts.map +1 -1
- package/dist/src/web/schemas/template.mjs +20 -8
- package/dist/src/web/schemas/template.mjs.map +1 -1
- package/dist/src/web/services/apiClient/index.cjs +13 -2
- package/dist/src/web/services/apiClient/index.cjs.map +1 -1
- package/dist/src/web/services/apiClient/index.d.mts +3 -2
- package/dist/src/web/services/apiClient/index.d.mts.map +1 -1
- package/dist/src/web/services/apiClient/index.mjs +13 -2
- package/dist/src/web/services/apiClient/index.mjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.cjs +1 -1
- package/dist/src/web/services/apiPaths/index.cjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.d.mts +1 -1
- package/dist/src/web/services/apiPaths/index.mjs +1 -1
- package/dist/src/web/services/apiPaths/index.mjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.cjs +4 -4
- package/dist/src/web/services/apiRoutes/index.cjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.d.mts +2 -2
- package/dist/src/web/services/apiRoutes/index.mjs +4 -4
- package/dist/src/web/services/apiRoutes/index.mjs.map +1 -1
- package/dist/src/web/services/htmlInspect.cjs +277 -0
- package/dist/src/web/services/htmlInspect.cjs.map +1 -0
- package/dist/src/web/services/htmlInspect.d.mts +75 -0
- package/dist/src/web/services/htmlInspect.d.mts.map +1 -0
- package/dist/src/web/services/htmlInspect.mjs +272 -0
- package/dist/src/web/services/htmlInspect.mjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.cjs +60 -0
- package/dist/src/web/services/hubRevisions/index.cjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.d.mts +13 -0
- package/dist/src/web/services/hubRevisions/index.d.mts.map +1 -0
- package/dist/src/web/services/hubRevisions/index.mjs +57 -0
- package/dist/src/web/services/hubRevisions/index.mjs.map +1 -0
- package/dist/src/web/services/i18n/index.cjs +94 -0
- package/dist/src/web/services/i18n/index.cjs.map +1 -0
- package/dist/src/web/services/i18n/index.d.mts +18 -0
- package/dist/src/web/services/i18n/index.d.mts.map +1 -0
- package/dist/src/web/services/i18n/index.mjs +87 -0
- package/dist/src/web/services/i18n/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs +28 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts +10 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs +26 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts +8 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.cjs +39 -0
- package/dist/src/web/services/railSteps/index.cjs.map +1 -0
- package/dist/src/web/services/railSteps/index.d.mts +17 -0
- package/dist/src/web/services/railSteps/index.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.mjs +39 -0
- package/dist/src/web/services/railSteps/index.mjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts +18 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs.map +1 -0
- package/dist/src/web/services/testing/templateRail.cjs +84 -6
- package/dist/src/web/services/testing/templateRail.cjs.map +1 -1
- package/dist/src/web/services/testing/templateRail.d.mts +8 -1
- package/dist/src/web/services/testing/templateRail.d.mts.map +1 -1
- package/dist/src/web/services/testing/templateRail.mjs +83 -7
- package/dist/src/web/services/testing/templateRail.mjs.map +1 -1
- package/dist/src/web/types/extensionFile.d.mts +11 -4
- package/dist/src/web/types/extensionFile.d.mts.map +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts +170 -7
- package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
- package/dist/src/web/types/template.d.mts +133 -17
- package/dist/src/web/types/template.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +535 -38
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/telemetry.cjs +7 -0
- package/dist/telemetry.d.mts +4 -0
- package/dist/telemetry.mjs +3 -0
- package/dist/transition.d.mts +2 -2
- package/dist/transitionClassifier.cjs +9 -9
- package/dist/transitionClassifier.cjs.map +1 -1
- package/dist/transitionClassifier.d.mts +1 -1
- package/dist/transitionClassifier.mjs +9 -9
- package/dist/transitionClassifier.mjs.map +1 -1
- package/dist/userFeedback.cjs +7 -0
- package/dist/userFeedback.d.mts +2 -0
- package/dist/userFeedback.mjs +1 -0
- package/dist/vendor/upm/_chunks/main.mjs +1 -1
- package/dist/verifiedArchive.cjs +11 -0
- package/dist/verifiedArchive.d.mts +2 -0
- package/dist/verifiedArchive.mjs +1 -0
- package/dist/web.cjs +89 -32
- package/dist/web.d.mts +22 -9
- package/dist/web.mjs +16 -5
- package/dist/webCompositions.cjs +87 -17
- package/dist/webCompositions.cjs.map +1 -1
- package/dist/webCompositions.d.mts +22 -6
- package/dist/webCompositions.d.mts.map +1 -1
- package/dist/webCompositions.mjs +87 -18
- package/dist/webCompositions.mjs.map +1 -1
- package/dist/webTesting.cjs +4 -0
- package/dist/webTesting.d.mts +3 -2
- package/dist/webTesting.mjs +3 -2
- package/dist/workflow.cjs +32 -0
- package/dist/workflow.d.mts +2 -0
- package/dist/workflow.mjs +1 -0
- package/dist/workspaceRegistry.cjs +7 -0
- package/dist/workspaceRegistry.d.mts +3 -0
- package/dist/workspaceRegistry.mjs +3 -0
- package/dist/workspaceSandboxes.cjs +7 -0
- package/dist/workspaceSandboxes.d.mts +3 -0
- package/dist/workspaceSandboxes.mjs +3 -0
- package/locales/vi.json +4 -0
- package/locales/zh-CN.json +4 -0
- package/package.json +164 -51
- package/dist/authorTools.cjs +0 -5
- package/dist/authorTools.d.mts +0 -2
- package/dist/authorTools.mjs +0 -1
- package/dist/cockpitContainer.cjs +0 -4
- package/dist/cockpitContainer.d.mts +0 -2
- package/dist/cockpitContainer.mjs +0 -1
- package/dist/remoteApi.cjs +0 -45
- package/dist/remoteApi.cjs.map +0 -1
- package/dist/remoteApi.d.mts +0 -7
- package/dist/remoteApi.d.mts.map +0 -1
- package/dist/remoteApi.mjs +0 -44
- package/dist/remoteApi.mjs.map +0 -1
- package/dist/remoteRuntime.cjs +0 -475
- package/dist/remoteRuntime.cjs.map +0 -1
- package/dist/remoteRuntime.d.mts +0 -37
- package/dist/remoteRuntime.d.mts.map +0 -1
- package/dist/remoteRuntime.mjs +0 -473
- package/dist/remoteRuntime.mjs.map +0 -1
- package/dist/sandboxHarness.cjs +0 -6
- package/dist/sandboxHarness.d.mts +0 -2
- package/dist/sandboxHarness.mjs +0 -1
- package/dist/sessionMcp.cjs +0 -6
- package/dist/sessionMcp.d.mts +0 -5
- package/dist/sessionMcp.mjs +0 -3
- package/dist/src/constants/authorTools.cjs +0 -10
- package/dist/src/constants/authorTools.cjs.map +0 -1
- package/dist/src/constants/authorTools.d.mts +0 -6
- package/dist/src/constants/authorTools.d.mts.map +0 -1
- package/dist/src/constants/authorTools.mjs +0 -8
- package/dist/src/constants/authorTools.mjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.cjs +0 -31
- package/dist/src/schemas/cockpitContainer.cjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.d.mts +0 -80
- package/dist/src/schemas/cockpitContainer.d.mts.map +0 -1
- package/dist/src/schemas/cockpitContainer.mjs +0 -30
- package/dist/src/schemas/cockpitContainer.mjs.map +0 -1
- package/dist/src/schemas/httpApiContracts.d.mts +0 -78
- package/dist/src/schemas/httpApiContracts.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.cjs +0 -29
- package/dist/src/schemas/sandboxHarness.cjs.map +0 -1
- package/dist/src/schemas/sandboxHarness.d.mts +0 -39
- package/dist/src/schemas/sandboxHarness.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.mjs +0 -26
- package/dist/src/schemas/sandboxHarness.mjs.map +0 -1
- package/dist/src/server/devProxyForward.cjs +0 -141
- package/dist/src/server/devProxyForward.cjs.map +0 -1
- package/dist/src/server/devProxyForward.mjs +0 -139
- package/dist/src/server/devProxyForward.mjs.map +0 -1
- package/dist/src/server/devProxyRoutes.cjs +0 -97
- package/dist/src/server/devProxyRoutes.cjs.map +0 -1
- package/dist/src/server/devProxyRoutes.mjs +0 -97
- package/dist/src/server/devProxyRoutes.mjs.map +0 -1
- package/dist/src/server/devProxySocket.cjs +0 -93
- package/dist/src/server/devProxySocket.cjs.map +0 -1
- package/dist/src/server/devProxySocket.d.mts +0 -25
- package/dist/src/server/devProxySocket.d.mts.map +0 -1
- package/dist/src/server/devProxySocket.mjs +0 -93
- package/dist/src/server/devProxySocket.mjs.map +0 -1
- package/dist/src/server/remoteRoutes.cjs +0 -463
- package/dist/src/server/remoteRoutes.cjs.map +0 -1
- package/dist/src/server/remoteRoutes.mjs +0 -463
- package/dist/src/server/remoteRoutes.mjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.cjs +0 -585
- package/dist/src/server/sessionMcpHandler.cjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.d.mts +0 -50
- package/dist/src/server/sessionMcpHandler.d.mts.map +0 -1
- package/dist/src/server/sessionMcpHandler.mjs +0 -582
- package/dist/src/server/sessionMcpHandler.mjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.cjs +0 -822
- package/dist/src/server/sessionMcpRoutes.cjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.mjs +0 -816
- package/dist/src/server/sessionMcpRoutes.mjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.cjs +0 -168
- package/dist/src/services/devProxyPolicy/index.cjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.mjs +0 -165
- package/dist/src/services/devProxyPolicy/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.cjs +0 -59
- package/dist/src/services/devProxyStore/devProxyRecords.cjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.mjs +0 -56
- package/dist/src/services/devProxyStore/devProxyRecords.mjs.map +0 -1
- package/dist/src/services/devProxyStore/index.cjs +0 -13
- package/dist/src/services/devProxyStore/index.cjs.map +0 -1
- package/dist/src/services/devProxyStore/index.mjs +0 -10
- package/dist/src/services/devProxyStore/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.cjs +0 -66
- package/dist/src/services/devProxyStore/sync.cjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.mjs +0 -63
- package/dist/src/services/devProxyStore/sync.mjs.map +0 -1
- package/dist/src/services/deviceAuth/index.cjs +0 -146
- package/dist/src/services/deviceAuth/index.cjs.map +0 -1
- package/dist/src/services/deviceAuth/index.d.mts +0 -9
- package/dist/src/services/deviceAuth/index.d.mts.map +0 -1
- package/dist/src/services/deviceAuth/index.mjs +0 -146
- package/dist/src/services/deviceAuth/index.mjs.map +0 -1
- package/dist/src/services/deviceSessions/index.cjs +0 -147
- package/dist/src/services/deviceSessions/index.cjs.map +0 -1
- package/dist/src/services/deviceSessions/index.d.mts +0 -18
- package/dist/src/services/deviceSessions/index.d.mts.map +0 -1
- package/dist/src/services/deviceSessions/index.mjs +0 -141
- package/dist/src/services/deviceSessions/index.mjs.map +0 -1
- package/dist/src/services/deviceTrust/index.cjs +0 -294
- package/dist/src/services/deviceTrust/index.cjs.map +0 -1
- package/dist/src/services/deviceTrust/index.mjs +0 -282
- package/dist/src/services/deviceTrust/index.mjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.cjs +0 -58
- package/dist/src/services/loopbackAddress/index.cjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.mjs +0 -56
- package/dist/src/services/loopbackAddress/index.mjs.map +0 -1
- package/dist/src/services/pairingFlow/index.cjs +0 -145
- package/dist/src/services/pairingFlow/index.cjs.map +0 -1
- package/dist/src/services/pairingFlow/index.d.mts +0 -44
- package/dist/src/services/pairingFlow/index.d.mts.map +0 -1
- package/dist/src/services/pairingFlow/index.mjs +0 -145
- package/dist/src/services/pairingFlow/index.mjs.map +0 -1
- package/dist/src/services/publicFileShares/index.cjs +0 -192
- package/dist/src/services/publicFileShares/index.cjs.map +0 -1
- package/dist/src/services/publicFileShares/index.d.mts +0 -16
- package/dist/src/services/publicFileShares/index.d.mts.map +0 -1
- package/dist/src/services/publicFileShares/index.mjs +0 -188
- package/dist/src/services/publicFileShares/index.mjs.map +0 -1
- package/dist/src/services/remoteAccess/index.cjs +0 -567
- package/dist/src/services/remoteAccess/index.cjs.map +0 -1
- package/dist/src/services/remoteAccess/index.d.mts +0 -122
- package/dist/src/services/remoteAccess/index.d.mts.map +0 -1
- package/dist/src/services/remoteAccess/index.mjs +0 -567
- package/dist/src/services/remoteAccess/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.cjs +0 -151
- package/dist/src/services/remoteAccessSettings/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.mjs +0 -149
- package/dist/src/services/remoteAccessSettings/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.cjs +0 -15
- package/dist/src/services/remoteAccessStore/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.d.mts +0 -2
- package/dist/src/services/remoteAccessStore/index.mjs +0 -12
- package/dist/src/services/remoteAccessStore/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +0 -98
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +0 -88
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.cjs +0 -111
- package/dist/src/services/remoteAccessStore/sync.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.mjs +0 -108
- package/dist/src/services/remoteAccessStore/sync.mjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.cjs +0 -200
- package/dist/src/services/remoteGuardPolicy/index.cjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.d.mts +0 -7
- package/dist/src/services/remoteGuardPolicy/index.d.mts.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.mjs +0 -196
- package/dist/src/services/remoteGuardPolicy/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.cjs +0 -115
- package/dist/src/services/sessionMcpActivity/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.mjs +0 -111
- package/dist/src/services/sessionMcpActivity/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.cjs +0 -473
- package/dist/src/services/sessionMcpAuthorization/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.d.mts +0 -125
- package/dist/src/services/sessionMcpAuthorization/index.d.mts.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.mjs +0 -469
- package/dist/src/services/sessionMcpAuthorization/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.cjs +0 -217
- package/dist/src/services/sessionMcpConversations/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.mjs +0 -212
- package/dist/src/services/sessionMcpConversations/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs +0 -86
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs +0 -83
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs.map +0 -1
- package/dist/src/services/testMode/index.cjs +0 -162
- package/dist/src/services/testMode/index.cjs.map +0 -1
- package/dist/src/services/testMode/index.d.mts +0 -17
- package/dist/src/services/testMode/index.d.mts.map +0 -1
- package/dist/src/services/testMode/index.mjs +0 -155
- package/dist/src/services/testMode/index.mjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.cjs +0 -58
- package/dist/src/services/tunnelOutput/index.cjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.mjs +0 -54
- package/dist/src/services/tunnelOutput/index.mjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.cjs +0 -487
- package/dist/src/services/tunnelProcess/index.cjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.mjs +0 -481
- package/dist/src/services/tunnelProcess/index.mjs.map +0 -1
- package/dist/src/services/webauthn/index.cjs +0 -262
- package/dist/src/services/webauthn/index.cjs.map +0 -1
- package/dist/src/services/webauthn/index.d.mts +0 -39
- package/dist/src/services/webauthn/index.d.mts.map +0 -1
- package/dist/src/services/webauthn/index.mjs +0 -262
- package/dist/src/services/webauthn/index.mjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.cjs +0 -184
- package/dist/src/services/webauthnPolicy/index.cjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.d.mts +0 -41
- package/dist/src/services/webauthnPolicy/index.d.mts.map +0 -1
- package/dist/src/services/webauthnPolicy/index.mjs +0 -177
- package/dist/src/services/webauthnPolicy/index.mjs.map +0 -1
- package/dist/testMode.cjs +0 -4
- package/dist/testMode.d.mts +0 -2
- package/dist/testMode.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HostStore } from "../types/webPlugin.mjs";
|
|
2
2
|
//#region src/web/models/globalStore.d.ts
|
|
3
3
|
/** Page-wide plugin state shared by every contribution from the plugin. */
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function defineHostStore<T>(initial: T): HostStore<T>;
|
|
5
5
|
//#endregion
|
|
6
6
|
//# sourceMappingURL=globalStore.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalStore.d.mts","names":[],"sources":["../../../../src/web/models/globalStore.ts"],"mappings":";;;wBAKgB,
|
|
1
|
+
{"version":3,"file":"globalStore.d.mts","names":[],"sources":["../../../../src/web/models/globalStore.ts"],"mappings":";;;wBAKgB,gBAAgB,GAAG,SAAS,IAAI,UAAU"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Store } from "@tanstack/store";
|
|
2
2
|
//#region src/web/models/globalStore.ts
|
|
3
3
|
/** Page-wide plugin state shared by every contribution from the plugin. */
|
|
4
|
-
function
|
|
4
|
+
function defineHostStore(initial) {
|
|
5
5
|
const store = new Store(initial);
|
|
6
6
|
const update = (updater) => {
|
|
7
7
|
const current = store.state;
|
|
@@ -18,6 +18,6 @@ function defineGlobalStore(initial) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
|
-
export {
|
|
21
|
+
export { defineHostStore };
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=globalStore.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalStore.mjs","names":[],"sources":["../../../../src/web/models/globalStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"globalStore.mjs","names":[],"sources":["../../../../src/web/models/globalStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport type { HostStore } from '../types/webPlugin';\n\n/** Page-wide plugin state shared by every contribution from the plugin. */\nexport function defineHostStore<T>(initial: T): HostStore<T> {\n const store = new Store<T>(initial);\n\n const update = (updater: (current: T) => T): void => {\n const current = store.state;\n const next = updater(current);\n if (next !== current) store.setState(() => next);\n };\n\n const reset = (): void => {\n store.setState((current) => (current === initial ? current : initial));\n };\n\n return { store, update, reset };\n}\n"],"mappings":";;;AAKA,SAAgB,gBAAmB,SAA0B;CAC3D,MAAM,QAAQ,IAAI,MAAS,OAAO;CAElC,MAAM,UAAU,YAAqC;EACnD,MAAM,UAAU,MAAM;EACtB,MAAM,OAAO,QAAQ,OAAO;EAC5B,IAAI,SAAS,SAAS,MAAM,eAAe,IAAI;CACjD;CAEA,MAAM,cAAoB;EACxB,MAAM,UAAU,YAAa,YAAY,UAAU,UAAU,OAAQ;CACvE;CAEA,OAAO;EAAE;EAAO;EAAQ;CAAM;AAChC"}
|
|
@@ -37,7 +37,7 @@ function defineSessionStore(empty) {
|
|
|
37
37
|
channel: options.channel,
|
|
38
38
|
parse: (input) => options.parse(input),
|
|
39
39
|
apply(sessionId, payload) {
|
|
40
|
-
update(sessionId, (current) => options.reduce(current, payload));
|
|
40
|
+
update(sessionId, (current) => options.reduce(current, payload, sessionId));
|
|
41
41
|
},
|
|
42
42
|
drop
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStore.cjs","names":["Store","defineSessionChannel"],"sources":["../../../../src/web/models/sessionStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { defineSessionChannel } from '../../extensions/webPlugin';\nimport type { SessionChannelContribution, SessionRecords, SessionStore, SessionStoreChannel } from '../types/webPlugin';\n\n/**\n * Per-session plugin state with the drop and reset bookkeeping built in.\n *\n * One TanStack store holds a record per session id. `empty` is handed back by\n * reference for every session that has not reported, which is what keeps a\n * useStore selector stable: the hook compares by identity, so a fresh object\n * per read would re-render forever. Records are therefore immutable values,\n * and updaters and reducers return new ones.\n */\nexport function defineSessionStore<T>(empty: T): SessionStore<T> {\n const store = new Store<SessionRecords<T>>({});\n\n const select = (state: SessionRecords<T>, sessionId: string | null): T =>\n sessionId === null ? empty : (state[sessionId] ?? empty);\n\n const update = (sessionId: string, updater: (current: T) => T): void => {\n const current = select(store.state, sessionId);\n const next = updater(current);\n if (next === current) return;\n store.setState((state) => ({ ...state, [sessionId]: next }));\n };\n\n const drop = (sessionId: string): void => {\n store.setState((state) => {\n if (!(sessionId in state)) return state;\n const rest = { ...state };\n delete rest[sessionId];\n return rest;\n });\n };\n\n const reset = (): void => {\n store.setState(() => ({}));\n };\n\n const channel = <Payload>(options: SessionStoreChannel<T, Payload>): SessionChannelContribution =>\n defineSessionChannel<Payload>({\n channel: options.channel,\n parse: (input) => options.parse(input),\n apply(sessionId, payload) {\n update(sessionId, (current) => options.reduce(current, payload));\n },\n drop,\n });\n\n return { store, select, update, drop, reset, channel };\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,mBAAsB,OAA2B;CAC/D,MAAM,QAAQ,IAAIA,gBAAAA,MAAyB,CAAC,CAAC;CAE7C,MAAM,UAAU,OAA0B,cACxC,cAAc,OAAO,QAAS,MAAM,cAAc;CAEpD,MAAM,UAAU,WAAmB,YAAqC;EACtE,MAAM,UAAU,OAAO,MAAM,OAAO,SAAS;EAC7C,MAAM,OAAO,QAAQ,OAAO;EAC5B,IAAI,SAAS,SAAS;EACtB,MAAM,UAAU,WAAW;GAAE,GAAG;IAAQ,YAAY;EAAK,EAAE;CAC7D;CAEA,MAAM,QAAQ,cAA4B;EACxC,MAAM,UAAU,UAAU;GACxB,IAAI,EAAE,aAAa,QAAQ,OAAO;GAClC,MAAM,OAAO,EAAE,GAAG,MAAM;GACxB,OAAO,KAAK;GACZ,OAAO;EACT,CAAC;CACH;CAEA,MAAM,cAAoB;EACxB,MAAM,gBAAgB,CAAC,EAAE;CAC3B;CAEA,MAAM,WAAoB,YACxBC,kBAAAA,qBAA8B;EAC5B,SAAS,QAAQ;EACjB,QAAQ,UAAU,QAAQ,MAAM,KAAK;EACrC,MAAM,WAAW,SAAS;GACxB,OAAO,YAAY,YAAY,QAAQ,OAAO,SAAS,
|
|
1
|
+
{"version":3,"file":"sessionStore.cjs","names":["Store","defineSessionChannel"],"sources":["../../../../src/web/models/sessionStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { defineSessionChannel } from '../../extensions/webPlugin';\nimport type { SessionChannelContribution, SessionRecords, SessionStore, SessionStoreChannel } from '../types/webPlugin';\n\n/**\n * Per-session plugin state with the drop and reset bookkeeping built in.\n *\n * One TanStack store holds a record per session id. `empty` is handed back by\n * reference for every session that has not reported, which is what keeps a\n * useStore selector stable: the hook compares by identity, so a fresh object\n * per read would re-render forever. Records are therefore immutable values,\n * and updaters and reducers return new ones.\n */\nexport function defineSessionStore<T>(empty: T): SessionStore<T> {\n const store = new Store<SessionRecords<T>>({});\n\n const select = (state: SessionRecords<T>, sessionId: string | null): T =>\n sessionId === null ? empty : (state[sessionId] ?? empty);\n\n const update = (sessionId: string, updater: (current: T) => T): void => {\n const current = select(store.state, sessionId);\n const next = updater(current);\n if (next === current) return;\n store.setState((state) => ({ ...state, [sessionId]: next }));\n };\n\n const drop = (sessionId: string): void => {\n store.setState((state) => {\n if (!(sessionId in state)) return state;\n const rest = { ...state };\n delete rest[sessionId];\n return rest;\n });\n };\n\n const reset = (): void => {\n store.setState(() => ({}));\n };\n\n const channel = <Payload>(options: SessionStoreChannel<T, Payload>): SessionChannelContribution =>\n defineSessionChannel<Payload>({\n channel: options.channel,\n parse: (input) => options.parse(input),\n apply(sessionId, payload) {\n update(sessionId, (current) => options.reduce(current, payload, sessionId));\n },\n drop,\n });\n\n return { store, select, update, drop, reset, channel };\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,mBAAsB,OAA2B;CAC/D,MAAM,QAAQ,IAAIA,gBAAAA,MAAyB,CAAC,CAAC;CAE7C,MAAM,UAAU,OAA0B,cACxC,cAAc,OAAO,QAAS,MAAM,cAAc;CAEpD,MAAM,UAAU,WAAmB,YAAqC;EACtE,MAAM,UAAU,OAAO,MAAM,OAAO,SAAS;EAC7C,MAAM,OAAO,QAAQ,OAAO;EAC5B,IAAI,SAAS,SAAS;EACtB,MAAM,UAAU,WAAW;GAAE,GAAG;IAAQ,YAAY;EAAK,EAAE;CAC7D;CAEA,MAAM,QAAQ,cAA4B;EACxC,MAAM,UAAU,UAAU;GACxB,IAAI,EAAE,aAAa,QAAQ,OAAO;GAClC,MAAM,OAAO,EAAE,GAAG,MAAM;GACxB,OAAO,KAAK;GACZ,OAAO;EACT,CAAC;CACH;CAEA,MAAM,cAAoB;EACxB,MAAM,gBAAgB,CAAC,EAAE;CAC3B;CAEA,MAAM,WAAoB,YACxBC,kBAAAA,qBAA8B;EAC5B,SAAS,QAAQ;EACjB,QAAQ,UAAU,QAAQ,MAAM,KAAK;EACrC,MAAM,WAAW,SAAS;GACxB,OAAO,YAAY,YAAY,QAAQ,OAAO,SAAS,SAAS,SAAS,CAAC;EAC5E;EACA;CACF,CAAC;CAEH,OAAO;EAAE;EAAO;EAAQ;EAAQ;EAAM;EAAO;CAAQ;AACvD"}
|
|
@@ -37,7 +37,7 @@ function defineSessionStore(empty) {
|
|
|
37
37
|
channel: options.channel,
|
|
38
38
|
parse: (input) => options.parse(input),
|
|
39
39
|
apply(sessionId, payload) {
|
|
40
|
-
update(sessionId, (current) => options.reduce(current, payload));
|
|
40
|
+
update(sessionId, (current) => options.reduce(current, payload, sessionId));
|
|
41
41
|
},
|
|
42
42
|
drop
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStore.mjs","names":[],"sources":["../../../../src/web/models/sessionStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { defineSessionChannel } from '../../extensions/webPlugin';\nimport type { SessionChannelContribution, SessionRecords, SessionStore, SessionStoreChannel } from '../types/webPlugin';\n\n/**\n * Per-session plugin state with the drop and reset bookkeeping built in.\n *\n * One TanStack store holds a record per session id. `empty` is handed back by\n * reference for every session that has not reported, which is what keeps a\n * useStore selector stable: the hook compares by identity, so a fresh object\n * per read would re-render forever. Records are therefore immutable values,\n * and updaters and reducers return new ones.\n */\nexport function defineSessionStore<T>(empty: T): SessionStore<T> {\n const store = new Store<SessionRecords<T>>({});\n\n const select = (state: SessionRecords<T>, sessionId: string | null): T =>\n sessionId === null ? empty : (state[sessionId] ?? empty);\n\n const update = (sessionId: string, updater: (current: T) => T): void => {\n const current = select(store.state, sessionId);\n const next = updater(current);\n if (next === current) return;\n store.setState((state) => ({ ...state, [sessionId]: next }));\n };\n\n const drop = (sessionId: string): void => {\n store.setState((state) => {\n if (!(sessionId in state)) return state;\n const rest = { ...state };\n delete rest[sessionId];\n return rest;\n });\n };\n\n const reset = (): void => {\n store.setState(() => ({}));\n };\n\n const channel = <Payload>(options: SessionStoreChannel<T, Payload>): SessionChannelContribution =>\n defineSessionChannel<Payload>({\n channel: options.channel,\n parse: (input) => options.parse(input),\n apply(sessionId, payload) {\n update(sessionId, (current) => options.reduce(current, payload));\n },\n drop,\n });\n\n return { store, select, update, drop, reset, channel };\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,mBAAsB,OAA2B;CAC/D,MAAM,QAAQ,IAAI,MAAyB,CAAC,CAAC;CAE7C,MAAM,UAAU,OAA0B,cACxC,cAAc,OAAO,QAAS,MAAM,cAAc;CAEpD,MAAM,UAAU,WAAmB,YAAqC;EACtE,MAAM,UAAU,OAAO,MAAM,OAAO,SAAS;EAC7C,MAAM,OAAO,QAAQ,OAAO;EAC5B,IAAI,SAAS,SAAS;EACtB,MAAM,UAAU,WAAW;GAAE,GAAG;IAAQ,YAAY;EAAK,EAAE;CAC7D;CAEA,MAAM,QAAQ,cAA4B;EACxC,MAAM,UAAU,UAAU;GACxB,IAAI,EAAE,aAAa,QAAQ,OAAO;GAClC,MAAM,OAAO,EAAE,GAAG,MAAM;GACxB,OAAO,KAAK;GACZ,OAAO;EACT,CAAC;CACH;CAEA,MAAM,cAAoB;EACxB,MAAM,gBAAgB,CAAC,EAAE;CAC3B;CAEA,MAAM,WAAoB,YACxB,qBAA8B;EAC5B,SAAS,QAAQ;EACjB,QAAQ,UAAU,QAAQ,MAAM,KAAK;EACrC,MAAM,WAAW,SAAS;GACxB,OAAO,YAAY,YAAY,QAAQ,OAAO,SAAS,
|
|
1
|
+
{"version":3,"file":"sessionStore.mjs","names":[],"sources":["../../../../src/web/models/sessionStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { defineSessionChannel } from '../../extensions/webPlugin';\nimport type { SessionChannelContribution, SessionRecords, SessionStore, SessionStoreChannel } from '../types/webPlugin';\n\n/**\n * Per-session plugin state with the drop and reset bookkeeping built in.\n *\n * One TanStack store holds a record per session id. `empty` is handed back by\n * reference for every session that has not reported, which is what keeps a\n * useStore selector stable: the hook compares by identity, so a fresh object\n * per read would re-render forever. Records are therefore immutable values,\n * and updaters and reducers return new ones.\n */\nexport function defineSessionStore<T>(empty: T): SessionStore<T> {\n const store = new Store<SessionRecords<T>>({});\n\n const select = (state: SessionRecords<T>, sessionId: string | null): T =>\n sessionId === null ? empty : (state[sessionId] ?? empty);\n\n const update = (sessionId: string, updater: (current: T) => T): void => {\n const current = select(store.state, sessionId);\n const next = updater(current);\n if (next === current) return;\n store.setState((state) => ({ ...state, [sessionId]: next }));\n };\n\n const drop = (sessionId: string): void => {\n store.setState((state) => {\n if (!(sessionId in state)) return state;\n const rest = { ...state };\n delete rest[sessionId];\n return rest;\n });\n };\n\n const reset = (): void => {\n store.setState(() => ({}));\n };\n\n const channel = <Payload>(options: SessionStoreChannel<T, Payload>): SessionChannelContribution =>\n defineSessionChannel<Payload>({\n channel: options.channel,\n parse: (input) => options.parse(input),\n apply(sessionId, payload) {\n update(sessionId, (current) => options.reduce(current, payload, sessionId));\n },\n drop,\n });\n\n return { store, select, update, drop, reset, channel };\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,mBAAsB,OAA2B;CAC/D,MAAM,QAAQ,IAAI,MAAyB,CAAC,CAAC;CAE7C,MAAM,UAAU,OAA0B,cACxC,cAAc,OAAO,QAAS,MAAM,cAAc;CAEpD,MAAM,UAAU,WAAmB,YAAqC;EACtE,MAAM,UAAU,OAAO,MAAM,OAAO,SAAS;EAC7C,MAAM,OAAO,QAAQ,OAAO;EAC5B,IAAI,SAAS,SAAS;EACtB,MAAM,UAAU,WAAW;GAAE,GAAG;IAAQ,YAAY;EAAK,EAAE;CAC7D;CAEA,MAAM,QAAQ,cAA4B;EACxC,MAAM,UAAU,UAAU;GACxB,IAAI,EAAE,aAAa,QAAQ,OAAO;GAClC,MAAM,OAAO,EAAE,GAAG,MAAM;GACxB,OAAO,KAAK;GACZ,OAAO;EACT,CAAC;CACH;CAEA,MAAM,cAAoB;EACxB,MAAM,gBAAgB,CAAC,EAAE;CAC3B;CAEA,MAAM,WAAoB,YACxB,qBAA8B;EAC5B,SAAS,QAAQ;EACjB,QAAQ,UAAU,QAAQ,MAAM,KAAK;EACrC,MAAM,WAAW,SAAS;GACxB,OAAO,YAAY,YAAY,QAAQ,OAAO,SAAS,SAAS,SAAS,CAAC;EAC5E;EACA;CACF,CAAC;CAEH,OAAO;EAAE;EAAO;EAAQ;EAAQ;EAAM;EAAO;CAAQ;AACvD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/web/schemas/onboarding.ts
|
|
2
|
+
/** Validate without executing plugin code. A bad setup contribution never costs the plugin its other features. */
|
|
3
|
+
function parseOnboarding(value) {
|
|
4
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
5
|
+
const candidate = value;
|
|
6
|
+
const component = candidate.component;
|
|
7
|
+
const isComponent = typeof component === "function" || typeof component === "object" && component !== null && "$$typeof" in component && (component.$$typeof === Symbol.for("react.memo") || component.$$typeof === Symbol.for("react.forward_ref"));
|
|
8
|
+
if (typeof candidate.id !== "string" || candidate.id.length > 160 || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(candidate.id) || typeof candidate.status !== "function" || !isComponent || candidate.activation !== void 0 && candidate.activation !== "before-setup" && candidate.activation !== "after-setup") return void 0;
|
|
9
|
+
return {
|
|
10
|
+
...candidate,
|
|
11
|
+
activation: candidate.activation ?? "before-setup"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.parseOnboarding = parseOnboarding;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=onboarding.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.cjs","names":[],"sources":["../../../../src/web/schemas/onboarding.ts"],"sourcesContent":["import type { OnboardingContribution } from '../types/webPlugin';\n\n/** Validate without executing plugin code. A bad setup contribution never costs the plugin its other features. */\nexport function parseOnboarding(value: unknown): OnboardingContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n const component = candidate.component;\n const isComponent =\n typeof component === 'function' ||\n (typeof component === 'object' &&\n component !== null &&\n '$$typeof' in component &&\n (component.$$typeof === Symbol.for('react.memo') || component.$$typeof === Symbol.for('react.forward_ref')));\n if (\n typeof candidate.id !== 'string' ||\n candidate.id.length > 160 ||\n !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(candidate.id) ||\n typeof candidate.status !== 'function' ||\n !isComponent ||\n (candidate.activation !== undefined &&\n candidate.activation !== 'before-setup' &&\n candidate.activation !== 'after-setup')\n )\n return undefined;\n return { ...candidate, activation: candidate.activation ?? 'before-setup' } as unknown as OnboardingContribution;\n}\n"],"mappings":";;AAGA,SAAgB,gBAAgB,OAAoD;CAClF,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,MAAM,YAAY,UAAU;CAC5B,MAAM,cACJ,OAAO,cAAc,cACpB,OAAO,cAAc,YACpB,cAAc,QACd,cAAc,cACb,UAAU,aAAa,OAAO,IAAI,YAAY,KAAK,UAAU,aAAa,OAAO,IAAI,mBAAmB;CAC7G,IACE,OAAO,UAAU,OAAO,YACxB,UAAU,GAAG,SAAS,OACtB,CAAC,kCAAkC,KAAK,UAAU,EAAE,KACpD,OAAO,UAAU,WAAW,cAC5B,CAAC,eACA,UAAU,eAAe,KAAA,KACxB,UAAU,eAAe,kBACzB,UAAU,eAAe,eAE3B,OAAO,KAAA;CACT,OAAO;EAAE,GAAG;EAAW,YAAY,UAAU,cAAc;CAAe;AAC5E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OnboardingContribution } from "../types/webPlugin.mjs";
|
|
2
|
+
//#region src/web/schemas/onboarding.d.ts
|
|
3
|
+
/** Validate without executing plugin code. A bad setup contribution never costs the plugin its other features. */
|
|
4
|
+
export declare function parseOnboarding(value: unknown): OnboardingContribution | undefined;
|
|
5
|
+
//#endregion
|
|
6
|
+
//# sourceMappingURL=onboarding.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.d.mts","names":[],"sources":["../../../../src/web/schemas/onboarding.ts"],"mappings":";;;wBAGgB,gBAAgB,iBAAiB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/web/schemas/onboarding.ts
|
|
2
|
+
/** Validate without executing plugin code. A bad setup contribution never costs the plugin its other features. */
|
|
3
|
+
function parseOnboarding(value) {
|
|
4
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
5
|
+
const candidate = value;
|
|
6
|
+
const component = candidate.component;
|
|
7
|
+
const isComponent = typeof component === "function" || typeof component === "object" && component !== null && "$$typeof" in component && (component.$$typeof === Symbol.for("react.memo") || component.$$typeof === Symbol.for("react.forward_ref"));
|
|
8
|
+
if (typeof candidate.id !== "string" || candidate.id.length > 160 || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(candidate.id) || typeof candidate.status !== "function" || !isComponent || candidate.activation !== void 0 && candidate.activation !== "before-setup" && candidate.activation !== "after-setup") return void 0;
|
|
9
|
+
return {
|
|
10
|
+
...candidate,
|
|
11
|
+
activation: candidate.activation ?? "before-setup"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { parseOnboarding };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=onboarding.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.mjs","names":[],"sources":["../../../../src/web/schemas/onboarding.ts"],"sourcesContent":["import type { OnboardingContribution } from '../types/webPlugin';\n\n/** Validate without executing plugin code. A bad setup contribution never costs the plugin its other features. */\nexport function parseOnboarding(value: unknown): OnboardingContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n const component = candidate.component;\n const isComponent =\n typeof component === 'function' ||\n (typeof component === 'object' &&\n component !== null &&\n '$$typeof' in component &&\n (component.$$typeof === Symbol.for('react.memo') || component.$$typeof === Symbol.for('react.forward_ref')));\n if (\n typeof candidate.id !== 'string' ||\n candidate.id.length > 160 ||\n !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(candidate.id) ||\n typeof candidate.status !== 'function' ||\n !isComponent ||\n (candidate.activation !== undefined &&\n candidate.activation !== 'before-setup' &&\n candidate.activation !== 'after-setup')\n )\n return undefined;\n return { ...candidate, activation: candidate.activation ?? 'before-setup' } as unknown as OnboardingContribution;\n}\n"],"mappings":";;AAGA,SAAgB,gBAAgB,OAAoD;CAClF,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,MAAM,YAAY,UAAU;CAC5B,MAAM,cACJ,OAAO,cAAc,cACpB,OAAO,cAAc,YACpB,cAAc,QACd,cAAc,cACb,UAAU,aAAa,OAAO,IAAI,YAAY,KAAK,UAAU,aAAa,OAAO,IAAI,mBAAmB;CAC7G,IACE,OAAO,UAAU,OAAO,YACxB,UAAU,GAAG,SAAS,OACtB,CAAC,kCAAkC,KAAK,UAAU,EAAE,KACpD,OAAO,UAAU,WAAW,cAC5B,CAAC,eACA,UAAU,eAAe,KAAA,KACxB,UAAU,eAAe,kBACzB,UAAU,eAAe,eAE3B,OAAO,KAAA;CACT,OAAO;EAAE,GAAG;EAAW,YAAY,UAAU,cAAc;CAAe;AAC5E"}
|
|
@@ -8,24 +8,36 @@ function isComponent(value) {
|
|
|
8
8
|
function hasTemplateIdentity(candidate) {
|
|
9
9
|
return typeof candidate.id === "string" && candidate.id.length <= 160 && TEMPLATE_ID.test(candidate.id) && typeof candidate.label === "string" && candidate.label.trim() !== "" && typeof candidate.description === "string";
|
|
10
10
|
}
|
|
11
|
-
/** Check separately from loading so one incompatible app does not break the catalog. */
|
|
11
|
+
/** Check separately from loading so one incompatible app does not break the catalog. A v2 app expects rail remote state. */
|
|
12
12
|
function parseWebTemplate(value) {
|
|
13
13
|
if (typeof value !== "object" || value === null) return void 0;
|
|
14
14
|
const candidate = value;
|
|
15
|
-
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
15
|
+
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 3 || !isComponent(candidate.app)) return void 0;
|
|
16
|
+
if (candidate.preview !== void 0 && !isComponent(candidate.preview) || candidate.translateCopy !== void 0 && typeof candidate.translateCopy !== "function") {
|
|
17
|
+
const { preview, translateCopy, ...rest } = candidate;
|
|
18
|
+
return {
|
|
19
|
+
...rest,
|
|
20
|
+
...isComponent(preview) ? { preview } : {},
|
|
21
|
+
...typeof translateCopy === "function" ? { translateCopy } : {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
16
24
|
return candidate;
|
|
17
25
|
}
|
|
18
|
-
/** Screens this app version
|
|
19
|
-
const NATIVE_TEMPLATE_SCREENS = ["sessions"];
|
|
20
|
-
/**
|
|
26
|
+
/** Screens this app version draws from a template. A newer template's other screens are ignored, not fatal. */
|
|
27
|
+
const NATIVE_TEMPLATE_SCREENS = ["sessions", "session"];
|
|
28
|
+
/**
|
|
29
|
+
* A v2 native template must provide every known screen as a component, so the phone never pairs one
|
|
30
|
+
* template's list with another's conversation. v1 is refused: an older computer's layouts give way to
|
|
31
|
+
* the phone's bundled ones.
|
|
32
|
+
*/
|
|
21
33
|
function parseNativeTemplate(value) {
|
|
22
34
|
if (typeof value !== "object" || value === null) return void 0;
|
|
23
35
|
const candidate = value;
|
|
24
|
-
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
36
|
+
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 2) return void 0;
|
|
37
|
+
if (candidate.translateCopy !== void 0 && typeof candidate.translateCopy !== "function") return void 0;
|
|
25
38
|
const screens = candidate.screens;
|
|
26
39
|
if (typeof screens !== "object" || screens === null) return void 0;
|
|
27
|
-
|
|
28
|
-
if (known.length === 0 || !known.every(isComponent)) return void 0;
|
|
40
|
+
if (!NATIVE_TEMPLATE_SCREENS.every((name) => isComponent(screens[name]))) return void 0;
|
|
29
41
|
return candidate;
|
|
30
42
|
}
|
|
31
43
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.cjs","names":[],"sources":["../../../../src/web/schemas/template.ts"],"sourcesContent":["import type { NativeTemplateContribution } from '../types/nativeTemplate';\nimport type { WebTemplateContribution } from '../types/template';\n\nconst TEMPLATE_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\n/** A function component, or a memo/forwardRef wrapper around one. */\nfunction isComponent(value: unknown): boolean {\n if (typeof value === 'function') return true;\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n (value.$$typeof === Symbol.for('react.memo') || value.$$typeof === Symbol.for('react.forward_ref'))\n );\n}\n\nfunction hasTemplateIdentity(candidate: Record<string, unknown>): boolean {\n return (\n typeof candidate.id === 'string' &&\n candidate.id.length <= 160 &&\n TEMPLATE_ID.test(candidate.id) &&\n typeof candidate.label === 'string' &&\n candidate.label.trim() !== '' &&\n typeof candidate.description === 'string'\n );\n}\n\n/** Check separately from loading so one incompatible app does not break the catalog. */\nexport function parseWebTemplate(value: unknown): WebTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
1
|
+
{"version":3,"file":"template.cjs","names":[],"sources":["../../../../src/web/schemas/template.ts"],"sourcesContent":["import type { NativeTemplateContribution } from '../types/nativeTemplate';\nimport type { WebTemplateContribution } from '../types/template';\n\nconst TEMPLATE_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\n/** A function component, or a memo/forwardRef wrapper around one. */\nfunction isComponent(value: unknown): boolean {\n if (typeof value === 'function') return true;\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n (value.$$typeof === Symbol.for('react.memo') || value.$$typeof === Symbol.for('react.forward_ref'))\n );\n}\n\nfunction hasTemplateIdentity(candidate: Record<string, unknown>): boolean {\n return (\n typeof candidate.id === 'string' &&\n candidate.id.length <= 160 &&\n TEMPLATE_ID.test(candidate.id) &&\n typeof candidate.label === 'string' &&\n candidate.label.trim() !== '' &&\n typeof candidate.description === 'string'\n );\n}\n\n/** Check separately from loading so one incompatible app does not break the catalog. A v2 app expects rail remote state. */\nexport function parseWebTemplate(value: unknown): WebTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 3 || !isComponent(candidate.app))\n return undefined;\n // Bad optional presentation metadata never disables the layout itself.\n if (\n (candidate.preview !== undefined && !isComponent(candidate.preview)) ||\n (candidate.translateCopy !== undefined && typeof candidate.translateCopy !== 'function')\n ) {\n const { preview, translateCopy, ...rest } = candidate;\n return {\n ...rest,\n ...(isComponent(preview) ? { preview } : {}),\n ...(typeof translateCopy === 'function' ? { translateCopy } : {}),\n } as unknown as WebTemplateContribution;\n }\n return candidate as unknown as WebTemplateContribution;\n}\n\n/** Screens this app version draws from a template. A newer template's other screens are ignored, not fatal. */\nconst NATIVE_TEMPLATE_SCREENS = ['sessions', 'session'] as const;\n\n/**\n * A v2 native template must provide every known screen as a component, so the phone never pairs one\n * template's list with another's conversation. v1 is refused: an older computer's layouts give way to\n * the phone's bundled ones.\n */\nexport function parseNativeTemplate(value: unknown): NativeTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 2) return undefined;\n if (candidate.translateCopy !== undefined && typeof candidate.translateCopy !== 'function') return undefined;\n const screens = candidate.screens;\n if (typeof screens !== 'object' || screens === null) return undefined;\n if (!NATIVE_TEMPLATE_SCREENS.every((name) => isComponent((screens as Record<string, unknown>)[name])))\n return undefined;\n return candidate as unknown as NativeTemplateContribution;\n}\n"],"mappings":";AAGA,MAAM,cAAc;;AAGpB,SAAS,YAAY,OAAyB;CAC5C,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,OACE,OAAO,UAAU,YACjB,UAAU,QACV,cAAc,UACb,MAAM,aAAa,OAAO,IAAI,YAAY,KAAK,MAAM,aAAa,OAAO,IAAI,mBAAmB;AAErG;AAEA,SAAS,oBAAoB,WAA6C;CACxE,OACE,OAAO,UAAU,OAAO,YACxB,UAAU,GAAG,UAAU,OACvB,YAAY,KAAK,UAAU,EAAE,KAC7B,OAAO,UAAU,UAAU,YAC3B,UAAU,MAAM,KAAK,MAAM,MAC3B,OAAO,UAAU,gBAAgB;AAErC;;AAGA,SAAgB,iBAAiB,OAAqD;CACpF,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,IAAI,CAAC,oBAAoB,SAAS,KAAK,UAAU,oBAAoB,KAAK,CAAC,YAAY,UAAU,GAAG,GAClG,OAAO,KAAA;CAET,IACG,UAAU,YAAY,KAAA,KAAa,CAAC,YAAY,UAAU,OAAO,KACjE,UAAU,kBAAkB,KAAA,KAAa,OAAO,UAAU,kBAAkB,YAC7E;EACA,MAAM,EAAE,SAAS,eAAe,GAAG,SAAS;EAC5C,OAAO;GACL,GAAG;GACH,GAAI,YAAY,OAAO,IAAI,EAAE,QAAQ,IAAI,CAAC;GAC1C,GAAI,OAAO,kBAAkB,aAAa,EAAE,cAAc,IAAI,CAAC;EACjE;CACF;CACA,OAAO;AACT;;AAGA,MAAM,0BAA0B,CAAC,YAAY,SAAS;;;;;;AAOtD,SAAgB,oBAAoB,OAAwD;CAC1F,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,IAAI,CAAC,oBAAoB,SAAS,KAAK,UAAU,oBAAoB,GAAG,OAAO,KAAA;CAC/E,IAAI,UAAU,kBAAkB,KAAA,KAAa,OAAO,UAAU,kBAAkB,YAAY,OAAO,KAAA;CACnG,MAAM,UAAU,UAAU;CAC1B,IAAI,OAAO,YAAY,YAAY,YAAY,MAAM,OAAO,KAAA;CAC5D,IAAI,CAAC,wBAAwB,OAAO,SAAS,YAAa,QAAoC,KAAK,CAAC,GAClG,OAAO,KAAA;CACT,OAAO;AACT"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { WebTemplateContribution } from "../types/template.mjs";
|
|
2
2
|
import { NativeTemplateContribution } from "../types/nativeTemplate.mjs";
|
|
3
3
|
//#region src/web/schemas/template.d.ts
|
|
4
|
-
/** Check separately from loading so one incompatible app does not break the catalog. */
|
|
4
|
+
/** Check separately from loading so one incompatible app does not break the catalog. A v2 app expects rail remote state. */
|
|
5
5
|
export declare function parseWebTemplate(value: unknown): WebTemplateContribution | undefined;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A v2 native template must provide every known screen as a component, so the phone never pairs one
|
|
8
|
+
* template's list with another's conversation. v1 is refused: an older computer's layouts give way to
|
|
9
|
+
* the phone's bundled ones.
|
|
10
|
+
*/
|
|
7
11
|
export declare function parseNativeTemplate(value: unknown): NativeTemplateContribution | undefined;
|
|
8
12
|
//#endregion
|
|
9
13
|
//# sourceMappingURL=template.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.mts","names":[],"sources":["../../../../src/web/schemas/template.ts"],"mappings":";;;;wBA4BgB,iBAAiB,iBAAiB
|
|
1
|
+
{"version":3,"file":"template.d.mts","names":[],"sources":["../../../../src/web/schemas/template.ts"],"mappings":";;;;wBA4BgB,iBAAiB,iBAAiB;;;;;;wBA4BlC,oBAAoB,iBAAiB"}
|
|
@@ -8,24 +8,36 @@ function isComponent(value) {
|
|
|
8
8
|
function hasTemplateIdentity(candidate) {
|
|
9
9
|
return typeof candidate.id === "string" && candidate.id.length <= 160 && TEMPLATE_ID.test(candidate.id) && typeof candidate.label === "string" && candidate.label.trim() !== "" && typeof candidate.description === "string";
|
|
10
10
|
}
|
|
11
|
-
/** Check separately from loading so one incompatible app does not break the catalog. */
|
|
11
|
+
/** Check separately from loading so one incompatible app does not break the catalog. A v2 app expects rail remote state. */
|
|
12
12
|
function parseWebTemplate(value) {
|
|
13
13
|
if (typeof value !== "object" || value === null) return void 0;
|
|
14
14
|
const candidate = value;
|
|
15
|
-
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
15
|
+
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 3 || !isComponent(candidate.app)) return void 0;
|
|
16
|
+
if (candidate.preview !== void 0 && !isComponent(candidate.preview) || candidate.translateCopy !== void 0 && typeof candidate.translateCopy !== "function") {
|
|
17
|
+
const { preview, translateCopy, ...rest } = candidate;
|
|
18
|
+
return {
|
|
19
|
+
...rest,
|
|
20
|
+
...isComponent(preview) ? { preview } : {},
|
|
21
|
+
...typeof translateCopy === "function" ? { translateCopy } : {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
16
24
|
return candidate;
|
|
17
25
|
}
|
|
18
|
-
/** Screens this app version
|
|
19
|
-
const NATIVE_TEMPLATE_SCREENS = ["sessions"];
|
|
20
|
-
/**
|
|
26
|
+
/** Screens this app version draws from a template. A newer template's other screens are ignored, not fatal. */
|
|
27
|
+
const NATIVE_TEMPLATE_SCREENS = ["sessions", "session"];
|
|
28
|
+
/**
|
|
29
|
+
* A v2 native template must provide every known screen as a component, so the phone never pairs one
|
|
30
|
+
* template's list with another's conversation. v1 is refused: an older computer's layouts give way to
|
|
31
|
+
* the phone's bundled ones.
|
|
32
|
+
*/
|
|
21
33
|
function parseNativeTemplate(value) {
|
|
22
34
|
if (typeof value !== "object" || value === null) return void 0;
|
|
23
35
|
const candidate = value;
|
|
24
|
-
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
36
|
+
if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 2) return void 0;
|
|
37
|
+
if (candidate.translateCopy !== void 0 && typeof candidate.translateCopy !== "function") return void 0;
|
|
25
38
|
const screens = candidate.screens;
|
|
26
39
|
if (typeof screens !== "object" || screens === null) return void 0;
|
|
27
|
-
|
|
28
|
-
if (known.length === 0 || !known.every(isComponent)) return void 0;
|
|
40
|
+
if (!NATIVE_TEMPLATE_SCREENS.every((name) => isComponent(screens[name]))) return void 0;
|
|
29
41
|
return candidate;
|
|
30
42
|
}
|
|
31
43
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.mjs","names":[],"sources":["../../../../src/web/schemas/template.ts"],"sourcesContent":["import type { NativeTemplateContribution } from '../types/nativeTemplate';\nimport type { WebTemplateContribution } from '../types/template';\n\nconst TEMPLATE_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\n/** A function component, or a memo/forwardRef wrapper around one. */\nfunction isComponent(value: unknown): boolean {\n if (typeof value === 'function') return true;\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n (value.$$typeof === Symbol.for('react.memo') || value.$$typeof === Symbol.for('react.forward_ref'))\n );\n}\n\nfunction hasTemplateIdentity(candidate: Record<string, unknown>): boolean {\n return (\n typeof candidate.id === 'string' &&\n candidate.id.length <= 160 &&\n TEMPLATE_ID.test(candidate.id) &&\n typeof candidate.label === 'string' &&\n candidate.label.trim() !== '' &&\n typeof candidate.description === 'string'\n );\n}\n\n/** Check separately from loading so one incompatible app does not break the catalog. */\nexport function parseWebTemplate(value: unknown): WebTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !==
|
|
1
|
+
{"version":3,"file":"template.mjs","names":[],"sources":["../../../../src/web/schemas/template.ts"],"sourcesContent":["import type { NativeTemplateContribution } from '../types/nativeTemplate';\nimport type { WebTemplateContribution } from '../types/template';\n\nconst TEMPLATE_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\n/** A function component, or a memo/forwardRef wrapper around one. */\nfunction isComponent(value: unknown): boolean {\n if (typeof value === 'function') return true;\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n (value.$$typeof === Symbol.for('react.memo') || value.$$typeof === Symbol.for('react.forward_ref'))\n );\n}\n\nfunction hasTemplateIdentity(candidate: Record<string, unknown>): boolean {\n return (\n typeof candidate.id === 'string' &&\n candidate.id.length <= 160 &&\n TEMPLATE_ID.test(candidate.id) &&\n typeof candidate.label === 'string' &&\n candidate.label.trim() !== '' &&\n typeof candidate.description === 'string'\n );\n}\n\n/** Check separately from loading so one incompatible app does not break the catalog. A v2 app expects rail remote state. */\nexport function parseWebTemplate(value: unknown): WebTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 3 || !isComponent(candidate.app))\n return undefined;\n // Bad optional presentation metadata never disables the layout itself.\n if (\n (candidate.preview !== undefined && !isComponent(candidate.preview)) ||\n (candidate.translateCopy !== undefined && typeof candidate.translateCopy !== 'function')\n ) {\n const { preview, translateCopy, ...rest } = candidate;\n return {\n ...rest,\n ...(isComponent(preview) ? { preview } : {}),\n ...(typeof translateCopy === 'function' ? { translateCopy } : {}),\n } as unknown as WebTemplateContribution;\n }\n return candidate as unknown as WebTemplateContribution;\n}\n\n/** Screens this app version draws from a template. A newer template's other screens are ignored, not fatal. */\nconst NATIVE_TEMPLATE_SCREENS = ['sessions', 'session'] as const;\n\n/**\n * A v2 native template must provide every known screen as a component, so the phone never pairs one\n * template's list with another's conversation. v1 is refused: an older computer's layouts give way to\n * the phone's bundled ones.\n */\nexport function parseNativeTemplate(value: unknown): NativeTemplateContribution | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const candidate = value as Record<string, unknown>;\n if (!hasTemplateIdentity(candidate) || candidate.contractVersion !== 2) return undefined;\n if (candidate.translateCopy !== undefined && typeof candidate.translateCopy !== 'function') return undefined;\n const screens = candidate.screens;\n if (typeof screens !== 'object' || screens === null) return undefined;\n if (!NATIVE_TEMPLATE_SCREENS.every((name) => isComponent((screens as Record<string, unknown>)[name])))\n return undefined;\n return candidate as unknown as NativeTemplateContribution;\n}\n"],"mappings":";AAGA,MAAM,cAAc;;AAGpB,SAAS,YAAY,OAAyB;CAC5C,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,OACE,OAAO,UAAU,YACjB,UAAU,QACV,cAAc,UACb,MAAM,aAAa,OAAO,IAAI,YAAY,KAAK,MAAM,aAAa,OAAO,IAAI,mBAAmB;AAErG;AAEA,SAAS,oBAAoB,WAA6C;CACxE,OACE,OAAO,UAAU,OAAO,YACxB,UAAU,GAAG,UAAU,OACvB,YAAY,KAAK,UAAU,EAAE,KAC7B,OAAO,UAAU,UAAU,YAC3B,UAAU,MAAM,KAAK,MAAM,MAC3B,OAAO,UAAU,gBAAgB;AAErC;;AAGA,SAAgB,iBAAiB,OAAqD;CACpF,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,IAAI,CAAC,oBAAoB,SAAS,KAAK,UAAU,oBAAoB,KAAK,CAAC,YAAY,UAAU,GAAG,GAClG,OAAO,KAAA;CAET,IACG,UAAU,YAAY,KAAA,KAAa,CAAC,YAAY,UAAU,OAAO,KACjE,UAAU,kBAAkB,KAAA,KAAa,OAAO,UAAU,kBAAkB,YAC7E;EACA,MAAM,EAAE,SAAS,eAAe,GAAG,SAAS;EAC5C,OAAO;GACL,GAAG;GACH,GAAI,YAAY,OAAO,IAAI,EAAE,QAAQ,IAAI,CAAC;GAC1C,GAAI,OAAO,kBAAkB,aAAa,EAAE,cAAc,IAAI,CAAC;EACjE;CACF;CACA,OAAO;AACT;;AAGA,MAAM,0BAA0B,CAAC,YAAY,SAAS;;;;;;AAOtD,SAAgB,oBAAoB,OAAwD;CAC1F,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO,KAAA;CACxD,MAAM,YAAY;CAClB,IAAI,CAAC,oBAAoB,SAAS,KAAK,UAAU,oBAAoB,GAAG,OAAO,KAAA;CAC/E,IAAI,UAAU,kBAAkB,KAAA,KAAa,OAAO,UAAU,kBAAkB,YAAY,OAAO,KAAA;CACnG,MAAM,UAAU,UAAU;CAC1B,IAAI,OAAO,YAAY,YAAY,YAAY,MAAM,OAAO,KAAA;CAC5D,IAAI,CAAC,wBAAwB,OAAO,SAAS,YAAa,QAAoC,KAAK,CAAC,GAClG,OAAO,KAAA;CACT,OAAO;AACT"}
|
|
@@ -100,7 +100,18 @@ function methodFor(spec, address, options) {
|
|
|
100
100
|
response
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
let data;
|
|
104
|
+
try {
|
|
105
|
+
data = await readBody(response);
|
|
106
|
+
} catch {
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
status: response.status,
|
|
110
|
+
error: "",
|
|
111
|
+
data: void 0,
|
|
112
|
+
response
|
|
113
|
+
};
|
|
114
|
+
}
|
|
104
115
|
if (!response.ok) return {
|
|
105
116
|
ok: false,
|
|
106
117
|
status: response.status,
|
|
@@ -139,7 +150,7 @@ function createApiClient(routes, options) {
|
|
|
139
150
|
const wide = options;
|
|
140
151
|
const accessors = {};
|
|
141
152
|
for (const scope of options.scopes) {
|
|
142
|
-
if (scope === "
|
|
153
|
+
if (scope === "host") accessors.host = scopeClient(routes, { scope: "host" }, wide);
|
|
143
154
|
if (scope === "workspace") accessors.workspace = (workspaceId) => scopeClient(routes, {
|
|
144
155
|
scope: "workspace",
|
|
145
156
|
workspaceId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["pluginApiUrl"],"sources":["../../../../../src/web/services/apiClient/index.ts"],"sourcesContent":["/**\n * The typed call surface a cockpit plugin reaches its own API through.\n *\n * A route is declared once as data, and the build supplies the two facts the\n * declaration deliberately omits: which scopes the package mounts at, and under\n * which base path. So a page names a route and a session, never a URL.\n *\n * The shape is dictated by the transport rather than by taste. Over a tunnel\n * every request is resealed and relayed, and the relay honours only a method, a\n * set of headers and a buffered body against a root-relative target. Anything\n * this surface accepted beyond that would be silently discarded at exactly the\n * moment it mattered, so it accepts nothing beyond that.\n */\n\nimport { type ApiParams, type ApiQuery, type ApiScopeAddress, pluginApiUrl } from '../apiPaths';\n\n/** Scope names a package API can mount at. */\nexport type ApiScopeName = ApiScopeAddress['scope'];\n\n/** Methods a declared route may use. */\nexport type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\ndeclare const RESPONSE_TYPE: unique symbol;\n\n/** Carries a route's response type through the declaration. Erased at runtime. */\nexport interface ApiResponseOf<T> {\n readonly [RESPONSE_TYPE]: T;\n}\n\n/** Names the type a route answers with. Returns nothing; only its type is read. */\nexport function apiResponse<T>(): ApiResponseOf<T> {\n return undefined as unknown as ApiResponseOf<T>;\n}\n\n/**\n * One route, as the package declares it.\n *\n * No scope and no base path: both are mount identity, the build reads them off\n * the folder tree, and restating them here is how they came to disagree in the\n * first place.\n */\nexport interface ApiRouteSpec<T = void> {\n readonly method: ApiRouteMethod;\n /** Below the mount, leading slash. Exactly '/' addresses the mount itself. */\n readonly path: string;\n /** Query parameter names this route reads, for documentation and review. */\n readonly query?: readonly string[];\n /** A host-owned route: it hangs off the scope root rather than under /plugins/. */\n readonly host?: true;\n /**\n * Answers `text/event-stream`.\n *\n * A streaming route gets a URL and no call method. Its consumer is the\n * browser's own `EventSource`, which does not go through the sealed\n * transport, and a relayed request buffers the whole response before\n * returning, so calling one over a tunnel would never return at all.\n */\n readonly stream?: true;\n /**\n * Answers bytes rather than JSON.\n *\n * The body is left unread, so `data` is undefined and the caller takes\n * `result.response` and reads it however it needs: `arrayBuffer`, `blob`,\n * `text`. Without this the client would consume the body to parse it, and\n * hand back a `Response` that throws on the second read.\n */\n readonly raw?: true;\n readonly response?: ApiResponseOf<T>;\n}\n\nexport type ApiRoutes = Readonly<Record<string, ApiRouteSpec<unknown>>>;\n\ntype ResponseOf<TSpec> = TSpec extends { readonly response: ApiResponseOf<infer T> } ? T : void;\n\n/**\n * What a call may carry.\n *\n * No `cache`, `credentials`, `redirect` or `mode`. The sealed transport copies\n * only the method, the headers and the body, so those four would be discarded\n * on every remote session and honoured on no one's.\n *\n * `signal` is here because it is the one of the five that is not always a lie.\n * On loopback the transport is a plain `fetch` pass-through and cancellation\n * works, which callers already rely on to drop a superseded refresh. Over a\n * tunnel the request is resealed and relayed, and the signal goes no further\n * than this process: the call still settles, so a caller that treats an abort\n * as \"no answer is coming\" stays correct, but the work at the far end is not\n * stopped. Refusing the field outright would have regressed every caller that\n * cancels today, which is a worse trade than describing the limit.\n */\nexport interface ApiCallInit {\n /** Values for the route's `:name` path segments. */\n readonly params?: ApiParams;\n readonly query?: ApiQuery;\n readonly headers?: Readonly<Record<string, string>>;\n /** JSON-encoded unless it is already a string, Blob, buffer or URLSearchParams. */\n readonly body?: unknown;\n /** Honoured on loopback; dropped when the session is remote. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a route answered.\n *\n * `status` and the raw `response` are always present on an answered call,\n * because status and headers carry protocol state across this codebase: a 409\n * returns the hash the file actually has, a 204 plus a header says a recording\n * is sealed, and the file route reports a digest. A client that returned only a\n * parsed body would lose all three.\n *\n * `status: 0` with no `response` is the one case the transport never answered.\n * A relay failure arrives as a synthetic 502 and is reported as 502, because\n * this layer cannot tell it from the real thing.\n */\nexport type ApiResult<T> =\n | { readonly ok: true; readonly status: number; readonly data: T; readonly response: Response }\n | {\n readonly ok: false;\n readonly status: number;\n readonly error: string;\n readonly data: unknown;\n readonly response?: Response;\n };\n\n/** Issues a request. The same shape as `fetch`, so the sealed transport and the step-up wrapper both fit. */\nexport type ApiTransport = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport interface ApiMethod<T> {\n (init?: ApiCallInit): Promise<ApiResult<T>>;\n /** The absolute URL, for an `EventSource`, an `<img src>`, or a download. */\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\n/** A streaming route: addressable, not callable. */\nexport interface ApiStreamMethod {\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\nexport type ApiScopeClient<TRoutes extends ApiRoutes> = {\n readonly [K in keyof TRoutes]: TRoutes[K] extends { readonly stream: true }\n ? ApiStreamMethod\n : ApiMethod<ResponseOf<TRoutes[K]>>;\n};\n\ninterface ApiScopeAccessors<TRoutes extends ApiRoutes> {\n readonly global: ApiScopeClient<TRoutes>;\n readonly workspace: (workspaceId: string) => ApiScopeClient<TRoutes>;\n readonly session: (sessionId: string) => ApiScopeClient<TRoutes>;\n}\n\n/**\n * The client, carrying an accessor only for the scopes the package mounts at.\n *\n * A package serving sessions has `session` and nothing else, so addressing it\n * globally is a missing property rather than a 404 discovered at runtime. This\n * is the whole of the scope guarantee, and it costs no test.\n */\nexport type ApiClient<TScopes extends ApiScopeName, TRoutes extends ApiRoutes> = Pick<\n ApiScopeAccessors<TRoutes>,\n TScopes\n>;\n\n/** Identity with inference, so a route table keeps its literal types. */\nexport function defineApiRoutes<const TRoutes extends ApiRoutes>(routes: TRoutes): TRoutes {\n return routes;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The body a route answered, or undefined when it sent none or sent non-JSON. */\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (text === '') return undefined;\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The message a route reported, or an empty string.\n *\n * Empty rather than invented: callers own the words their users read, and a\n * generic sentence from here would appear in a dozen packages that each already\n * have their own.\n */\nfunction errorOf(data: unknown): string {\n return isRecord(data) && typeof data.error === 'string' ? data.error : '';\n}\n\n/**\n * What the sealed relay can carry verbatim.\n *\n * Named here rather than borrowed from `BodyInit`, which the node build has no\n * lib for, and which is anyway wider than the truth: `FormData` and a\n * `ReadableStream` are both refused when a session is remote.\n */\nexport type ApiRequestBody = string | Blob | ArrayBuffer | ArrayBufferView | URLSearchParams;\n\n/** Anything the sealed transport can carry verbatim; everything else becomes JSON. */\nfunction encodeBody(body: unknown): { body?: ApiRequestBody; contentType?: string } {\n if (body === undefined) return {};\n if (\n typeof body === 'string' ||\n body instanceof Blob ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n body instanceof URLSearchParams\n ) {\n return { body };\n }\n return { body: JSON.stringify(body), contentType: 'application/json' };\n}\n\nexport interface ApiClientOptions<TScopes extends ApiScopeName> {\n /** Scopes the package's routed api/ tree actually mounts at. The build supplies these. */\n readonly scopes: readonly TScopes[];\n /** The mount segment. The build reads it off the api/<base-path>/ folder. */\n readonly basePath: string;\n readonly transport: ApiTransport;\n /** Resolves which workspace owns a session; the host binds it from its own summaries. */\n readonly sessionAddress: (sessionId: string) => ApiScopeAddress;\n}\n\n/**\n * One route, as the page calls it.\n *\n * A streaming route is returned as a plain object with no call signature, not\n * merely typed as one. The type stops an author; the missing function stops a\n * cast, a JavaScript caller, and a generic helper that iterates the client.\n * Calling one over a tunnel would buffer forever rather than fail, and that is\n * too quiet a way to lose an afternoon.\n */\nfunction methodFor(\n spec: ApiRouteSpec<unknown>,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiMethod<unknown> | ApiStreamMethod {\n const basePath = spec.host === true ? undefined : options.basePath;\n const url = (init?: Pick<ApiCallInit, 'query' | 'params'>): string =>\n pluginApiUrl(address, basePath, spec.path, init?.query, init?.params);\n\n const call = async (init?: ApiCallInit): Promise<ApiResult<unknown>> => {\n const encoded = encodeBody(init?.body);\n const headers = {\n ...(encoded.contentType === undefined ? {} : { 'content-type': encoded.contentType }),\n ...init?.headers,\n };\n let response: Response;\n try {\n response = await options.transport(url(init), {\n method: spec.method,\n ...(init?.signal === undefined ? {} : { signal: init.signal }),\n ...(Object.keys(headers).length === 0 ? {} : { headers }),\n // Cast because the node build's `BodyInit` enumerates concrete typed\n // arrays rather than accepting `ArrayBufferView`. Every value reaching\n // here is one fetch already carries; the two libs disagree about the\n // type, not the runtime.\n ...(encoded.body === undefined ? {} : { body: encoded.body as RequestInit['body'] }),\n });\n } catch {\n return { ok: false, status: 0, error: '', data: undefined };\n }\n // A raw route's body belongs to the caller, and reading it here to look\n // for an `error` would spend the one read it gets.\n if (spec.raw === true) {\n if (!response.ok) return { ok: false, status: response.status, error: '', data: undefined, response };\n return { ok: true, status: response.status, data: undefined, response };\n }\n const data = await readBody(response);\n if (!response.ok) return { ok: false, status: response.status, error: errorOf(data), data, response };\n return { ok: true, status: response.status, data, response };\n };\n\n if (spec.stream === true) return { url, spec };\n return Object.assign(call, { url, spec });\n}\n\nfunction scopeClient<TRoutes extends ApiRoutes>(\n routes: TRoutes,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiScopeClient<TRoutes> {\n const client: Record<string, ApiMethod<unknown> | ApiStreamMethod> = {};\n for (const [key, spec] of Object.entries(routes)) client[key] = methodFor(spec, address, options);\n return client as ApiScopeClient<TRoutes>;\n}\n\n/**\n * Binds a route table to one package's mount.\n *\n * Only the scopes named in `options.scopes` get an accessor, so the returned\n * value describes exactly what this package serves and nothing else.\n */\nexport function createApiClient<const TScopes extends ApiScopeName, const TRoutes extends ApiRoutes>(\n routes: TRoutes,\n options: ApiClientOptions<TScopes>,\n): ApiClient<TScopes, TRoutes> {\n const wide = options as ApiClientOptions<ApiScopeName>;\n const accessors: { -readonly [K in keyof ApiScopeAccessors<TRoutes>]?: ApiScopeAccessors<TRoutes>[K] } = {};\n for (const scope of options.scopes) {\n if (scope === 'global') accessors.global = scopeClient(routes, { scope: 'global' }, wide);\n if (scope === 'workspace') {\n accessors.workspace = (workspaceId: string) => scopeClient(routes, { scope: 'workspace', workspaceId }, wide);\n }\n if (scope === 'session') {\n accessors.session = (sessionId: string) => scopeClient(routes, wide.sessionAddress(sessionId), wide);\n }\n }\n return accessors as ApiClient<TScopes, TRoutes>;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["pluginApiUrl"],"sources":["../../../../../src/web/services/apiClient/index.ts"],"sourcesContent":["/**\n * The typed call surface a cockpit plugin reaches its own API through.\n *\n * A route is declared once as data, and the build supplies the two facts the\n * declaration deliberately omits: which scopes the package mounts at, and under\n * which base path. So a page names a route and a session, never a URL.\n *\n * The shape is dictated by the transport rather than by taste. Over a tunnel\n * every request is resealed and relayed, and the relay honours only a method, a\n * set of headers and a buffered body against a root-relative target. Anything\n * this surface accepted beyond that would be silently discarded at exactly the\n * moment it mattered, so it accepts nothing beyond that.\n */\n\nimport { type ApiParams, type ApiQuery, type ApiScopeAddress, pluginApiUrl } from '../apiPaths';\n\n/** Scope names a package API can mount at. */\nexport type ApiScopeName = ApiScopeAddress['scope'];\n\n/** Methods a declared route may use. */\nexport type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\ndeclare const RESPONSE_TYPE: unique symbol;\n\n/** Carries a route's response type through the declaration. Erased at runtime. */\nexport interface ApiResponseOf<T> {\n readonly [RESPONSE_TYPE]: T;\n}\n\n/** Names the type a route answers with. Returns nothing; only its type is read. */\nexport function apiResponse<T>(): ApiResponseOf<T> {\n return undefined as unknown as ApiResponseOf<T>;\n}\n\n/**\n * One route, as the package declares it.\n *\n * No scope and no base path: both are mount identity, the build reads them off\n * the folder tree, and restating them here is how they came to disagree in the\n * first place.\n */\nexport interface ApiRouteSpec<T = void> {\n readonly method: ApiRouteMethod;\n /** Below the mount, leading slash. Exactly '/' addresses the mount itself. */\n readonly path: string;\n /** Query parameter names this route reads, for documentation and review. */\n readonly query?: readonly string[];\n /** A host-owned route: it hangs off the scope root rather than under /plugins/. */\n readonly host?: true;\n /**\n * Answers `text/event-stream`.\n *\n * A streaming route gets a URL and no call method. Its consumer is the\n * browser's own `EventSource`, which does not go through the sealed\n * transport, and a relayed request buffers the whole response before\n * returning, so calling one over a tunnel would never return at all.\n */\n readonly stream?: true;\n /**\n * Answers bytes rather than JSON.\n *\n * The body is left unread, so `data` is undefined and the caller takes\n * `result.response` and reads it however it needs: `arrayBuffer`, `blob`,\n * `text`. Without this the client would consume the body to parse it, and\n * hand back a `Response` that throws on the second read.\n */\n readonly raw?: true;\n readonly response?: ApiResponseOf<T>;\n}\n\nexport type ApiRoutes = Readonly<Record<string, ApiRouteSpec<unknown>>>;\n\ntype ResponseOf<TSpec> = TSpec extends { readonly response: ApiResponseOf<infer T> } ? T : void;\n\n/**\n * What a call may carry.\n *\n * No `cache`, `credentials`, `redirect` or `mode`. The sealed transport copies\n * only the method, the headers and the body, so those four would be discarded\n * on every remote session and honoured on no one's.\n *\n * `signal` is here because it is the one of the five that is not always a lie.\n * On loopback the transport is a plain `fetch` pass-through and cancellation\n * works, which callers already rely on to drop a superseded refresh. Over a\n * tunnel the request is resealed and relayed, and the signal goes no further\n * than this process: the call still settles, so a caller that treats an abort\n * as \"no answer is coming\" stays correct, but the work at the far end is not\n * stopped. Refusing the field outright would have regressed every caller that\n * cancels today, which is a worse trade than describing the limit.\n */\nexport interface ApiCallInit {\n /** Values for the route's `:name` path segments. */\n readonly params?: ApiParams;\n readonly query?: ApiQuery;\n readonly headers?: Readonly<Record<string, string>>;\n /** JSON-encoded unless it is already a string, Blob, buffer or URLSearchParams. */\n readonly body?: unknown;\n /** Honoured on loopback; dropped when the session is remote. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a route answered.\n *\n * `status` and the raw `response` are always present on an answered call,\n * because status and headers carry protocol state across this codebase: a 409\n * returns the hash the file actually has, a 204 plus a header says a recording\n * is sealed, and the file route reports a digest. A client that returned only a\n * parsed body would lose all three.\n *\n * `status: 0` with no `response` is the one case the transport never answered.\n * A relay failure arrives as a synthetic 502 and is reported as 502, because\n * this layer cannot tell it from the real thing. An answered call whose body\n * cannot be read fails with that response's status and metadata intact.\n */\nexport type ApiResult<T> =\n | { readonly ok: true; readonly status: number; readonly data: T; readonly response: Response }\n | {\n readonly ok: false;\n readonly status: number;\n readonly error: string;\n readonly data: unknown;\n readonly response?: Response;\n };\n\n/** Issues a request. The same shape as `fetch`, so the sealed transport and the step-up wrapper both fit. */\nexport type ApiTransport = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport interface ApiMethod<T> {\n (init?: ApiCallInit): Promise<ApiResult<T>>;\n /** The absolute URL, for an `EventSource`, an `<img src>`, or a download. */\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\n/** A streaming route: addressable, not callable. */\nexport interface ApiStreamMethod {\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\nexport type ApiScopeClient<TRoutes extends ApiRoutes> = {\n readonly [K in keyof TRoutes]: TRoutes[K] extends { readonly stream: true }\n ? ApiStreamMethod\n : ApiMethod<ResponseOf<TRoutes[K]>>;\n};\n\ninterface ApiScopeAccessors<TRoutes extends ApiRoutes> {\n readonly host: ApiScopeClient<TRoutes>;\n readonly workspace: (workspaceId: string) => ApiScopeClient<TRoutes>;\n readonly session: (sessionId: string) => ApiScopeClient<TRoutes>;\n}\n\n/**\n * The client, carrying an accessor only for the scopes the package mounts at.\n *\n * A package serving sessions has `session` and nothing else, so addressing it\n * globally is a missing property rather than a 404 discovered at runtime. This\n * is the whole of the scope guarantee, and it costs no test.\n */\nexport type ApiClient<TScopes extends ApiScopeName, TRoutes extends ApiRoutes> = Pick<\n ApiScopeAccessors<TRoutes>,\n TScopes\n>;\n\n/** Identity with inference, so a route table keeps its literal types. */\nexport function defineApiRoutes<const TRoutes extends ApiRoutes>(routes: TRoutes): TRoutes {\n return routes;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The body a route answered, or undefined when it sent none or sent non-JSON. */\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (text === '') return undefined;\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The message a route reported, or an empty string.\n *\n * Empty rather than invented: callers own the words their users read, and a\n * generic sentence from here would appear in a dozen packages that each already\n * have their own.\n */\nfunction errorOf(data: unknown): string {\n return isRecord(data) && typeof data.error === 'string' ? data.error : '';\n}\n\n/**\n * What the sealed relay can carry verbatim.\n *\n * Named here rather than borrowed from `BodyInit`, which the node build has no\n * lib for, and which is anyway wider than the truth: `FormData` and a\n * `ReadableStream` are both refused when a session is remote.\n */\nexport type ApiRequestBody = string | Blob | ArrayBuffer | ArrayBufferView | URLSearchParams;\n\n/** Anything the sealed transport can carry verbatim; everything else becomes JSON. */\nfunction encodeBody(body: unknown): { body?: ApiRequestBody; contentType?: string } {\n if (body === undefined) return {};\n if (\n typeof body === 'string' ||\n body instanceof Blob ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n body instanceof URLSearchParams\n ) {\n return { body };\n }\n return { body: JSON.stringify(body), contentType: 'application/json' };\n}\n\nexport interface ApiClientOptions<TScopes extends ApiScopeName> {\n /** Scopes the package's routed api/ tree actually mounts at. The build supplies these. */\n readonly scopes: readonly TScopes[];\n /** The mount segment. The build reads it off the api/<base-path>/ folder. */\n readonly basePath: string;\n readonly transport: ApiTransport;\n /** Resolves which workspace owns a session; the host binds it from its own summaries. */\n readonly sessionAddress: (sessionId: string) => ApiScopeAddress;\n}\n\n/**\n * One route, as the page calls it.\n *\n * A streaming route is returned as a plain object with no call signature, not\n * merely typed as one. The type stops an author; the missing function stops a\n * cast, a JavaScript caller, and a generic helper that iterates the client.\n * Calling one over a tunnel would buffer forever rather than fail, and that is\n * too quiet a way to lose an afternoon.\n */\nfunction methodFor(\n spec: ApiRouteSpec<unknown>,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiMethod<unknown> | ApiStreamMethod {\n const basePath = spec.host === true ? undefined : options.basePath;\n const url = (init?: Pick<ApiCallInit, 'query' | 'params'>): string =>\n pluginApiUrl(address, basePath, spec.path, init?.query, init?.params);\n\n const call = async (init?: ApiCallInit): Promise<ApiResult<unknown>> => {\n const encoded = encodeBody(init?.body);\n const headers = {\n ...(encoded.contentType === undefined ? {} : { 'content-type': encoded.contentType }),\n ...init?.headers,\n };\n let response: Response;\n try {\n response = await options.transport(url(init), {\n method: spec.method,\n ...(init?.signal === undefined ? {} : { signal: init.signal }),\n ...(Object.keys(headers).length === 0 ? {} : { headers }),\n // Cast because the node build's `BodyInit` enumerates concrete typed\n // arrays rather than accepting `ArrayBufferView`. Every value reaching\n // here is one fetch already carries; the two libs disagree about the\n // type, not the runtime.\n ...(encoded.body === undefined ? {} : { body: encoded.body as RequestInit['body'] }),\n });\n } catch {\n return { ok: false, status: 0, error: '', data: undefined };\n }\n // A raw route's body belongs to the caller, and reading it here to look\n // for an `error` would spend the one read it gets.\n if (spec.raw === true) {\n if (!response.ok) return { ok: false, status: response.status, error: '', data: undefined, response };\n return { ok: true, status: response.status, data: undefined, response };\n }\n let data: unknown;\n try {\n data = await readBody(response);\n } catch {\n return { ok: false, status: response.status, error: '', data: undefined, response };\n }\n if (!response.ok) return { ok: false, status: response.status, error: errorOf(data), data, response };\n return { ok: true, status: response.status, data, response };\n };\n\n if (spec.stream === true) return { url, spec };\n return Object.assign(call, { url, spec });\n}\n\nfunction scopeClient<TRoutes extends ApiRoutes>(\n routes: TRoutes,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiScopeClient<TRoutes> {\n const client: Record<string, ApiMethod<unknown> | ApiStreamMethod> = {};\n for (const [key, spec] of Object.entries(routes)) client[key] = methodFor(spec, address, options);\n return client as ApiScopeClient<TRoutes>;\n}\n\n/**\n * Binds a route table to one package's mount.\n *\n * Only the scopes named in `options.scopes` get an accessor, so the returned\n * value describes exactly what this package serves and nothing else.\n */\nexport function createApiClient<const TScopes extends ApiScopeName, const TRoutes extends ApiRoutes>(\n routes: TRoutes,\n options: ApiClientOptions<TScopes>,\n): ApiClient<TScopes, TRoutes> {\n const wide = options as ApiClientOptions<ApiScopeName>;\n const accessors: { -readonly [K in keyof ApiScopeAccessors<TRoutes>]?: ApiScopeAccessors<TRoutes>[K] } = {};\n for (const scope of options.scopes) {\n if (scope === 'host') accessors.host = scopeClient(routes, { scope: 'host' }, wide);\n if (scope === 'workspace') {\n accessors.workspace = (workspaceId: string) => scopeClient(routes, { scope: 'workspace', workspaceId }, wide);\n }\n if (scope === 'session') {\n accessors.session = (sessionId: string) => scopeClient(routes, wide.sessionAddress(sessionId), wide);\n }\n }\n return accessors as ApiClient<TScopes, TRoutes>;\n}\n"],"mappings":"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"}
|
|
@@ -87,7 +87,8 @@ export interface ApiCallInit {
|
|
|
87
87
|
*
|
|
88
88
|
* `status: 0` with no `response` is the one case the transport never answered.
|
|
89
89
|
* A relay failure arrives as a synthetic 502 and is reported as 502, because
|
|
90
|
-
* this layer cannot tell it from the real thing.
|
|
90
|
+
* this layer cannot tell it from the real thing. An answered call whose body
|
|
91
|
+
* cannot be read fails with that response's status and metadata intact.
|
|
91
92
|
*/
|
|
92
93
|
export type ApiResult<T> = {
|
|
93
94
|
readonly ok: true;
|
|
@@ -118,7 +119,7 @@ export type ApiScopeClient<TRoutes extends ApiRoutes> = { readonly [K in keyof T
|
|
|
118
119
|
readonly stream: true;
|
|
119
120
|
} ? ApiStreamMethod : ApiMethod<ResponseOf<TRoutes[K]>>; };
|
|
120
121
|
interface ApiScopeAccessors<TRoutes extends ApiRoutes> {
|
|
121
|
-
readonly
|
|
122
|
+
readonly host: ApiScopeClient<TRoutes>;
|
|
122
123
|
readonly workspace: (workspaceId: string) => ApiScopeClient<TRoutes>;
|
|
123
124
|
readonly session: (sessionId: string) => ApiScopeClient<TRoutes>;
|
|
124
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/web/services/apiClient/index.ts"],"mappings":";;;YAiBY,eAAe;;YAGf;cAEE;;iBAGG,cAAc;YACnB,gBAAgB;;;wBAIZ,YAAY,MAAM,cAAc;;;;;;;;iBAW/B,aAAa;WACnB,QAAQ;;WAER;;WAEA;;WAEA;;;;;;;;;WASA;;;;;;;;;WASA;WACA,WAAW,cAAc;;YAGxB,YAAY,SAAS,eAAe;KAE3C,WAAW,SAAS;WAAyB,UAAU,oBAAoB;IAAO;;;;;;;;;;;;;;;;;iBAkBtE;;WAEN,SAAS;WACT,QAAQ;WACR,UAAU,SAAS;;WAEnB;;WAEA,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/web/services/apiClient/index.ts"],"mappings":";;;YAiBY,eAAe;;YAGf;cAEE;;iBAGG,cAAc;YACnB,gBAAgB;;;wBAIZ,YAAY,MAAM,cAAc;;;;;;;;iBAW/B,aAAa;WACnB,QAAQ;;WAER;;WAEA;;WAEA;;;;;;;;;WASA;;;;;;;;;WASA;WACA,WAAW,cAAc;;YAGxB,YAAY,SAAS,eAAe;KAE3C,WAAW,SAAS;WAAyB,UAAU,oBAAoB;IAAO;;;;;;;;;;;;;;;;;iBAkBtE;;WAEN,SAAS;WACT,QAAQ;WACR,UAAU,SAAS;;WAEnB;;WAEA,SAAS;;;;;;;;;;;;;;;;YAiBR,UAAU;WACP;WAAmB;WAAyB,MAAM;WAAY,UAAU;;WAExE;WACA;WACA;WACA;WACA,WAAW;;;YAId,gBAAgB,eAAe,OAAO,gBAAgB,QAAQ;iBAEzD,UAAU;GACxB,OAAO,cAAc,QAAQ,UAAU;;EAExC,IAAI,OAAO,KAAK;WACP,MAAM;;;iBAIA;EACf,IAAI,OAAO,KAAK;WACP,MAAM;;YAGL,eAAe,gBAAgB,yBAC/B,WAAW,UAAU,QAAQ;WAAsB;IACzD,kBACA,UAAU,WAAW,QAAQ;UAGzB,kBAAkB,gBAAgB;WACjC,MAAM,eAAe;WACrB,YAAY,wBAAwB,eAAe;WACnD,UAAU,sBAAsB,eAAe;;;;;;;;;YAU9C,UAAU,gBAAgB,cAAc,gBAAgB,aAAa,KAC/E,kBAAkB,UAClB;;wBAIc,sBAAsB,gBAAgB,WAAW,QAAQ,UAAU;iBAsDlE,iBAAiB,gBAAgB;;WAEvC,iBAAiB;;WAEjB;WACA,WAAW;;WAEX,iBAAiB,sBAAsB;;;;;;;;wBA8ElC,sBAAsB,gBAAgB,oBAAoB,gBAAgB,WACxF,QAAQ,SACR,SAAS,iBAAiB,WACzB,UAAU,SAAS"}
|
|
@@ -100,7 +100,18 @@ function methodFor(spec, address, options) {
|
|
|
100
100
|
response
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
let data;
|
|
104
|
+
try {
|
|
105
|
+
data = await readBody(response);
|
|
106
|
+
} catch {
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
status: response.status,
|
|
110
|
+
error: "",
|
|
111
|
+
data: void 0,
|
|
112
|
+
response
|
|
113
|
+
};
|
|
114
|
+
}
|
|
104
115
|
if (!response.ok) return {
|
|
105
116
|
ok: false,
|
|
106
117
|
status: response.status,
|
|
@@ -139,7 +150,7 @@ function createApiClient(routes, options) {
|
|
|
139
150
|
const wide = options;
|
|
140
151
|
const accessors = {};
|
|
141
152
|
for (const scope of options.scopes) {
|
|
142
|
-
if (scope === "
|
|
153
|
+
if (scope === "host") accessors.host = scopeClient(routes, { scope: "host" }, wide);
|
|
143
154
|
if (scope === "workspace") accessors.workspace = (workspaceId) => scopeClient(routes, {
|
|
144
155
|
scope: "workspace",
|
|
145
156
|
workspaceId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/web/services/apiClient/index.ts"],"sourcesContent":["/**\n * The typed call surface a cockpit plugin reaches its own API through.\n *\n * A route is declared once as data, and the build supplies the two facts the\n * declaration deliberately omits: which scopes the package mounts at, and under\n * which base path. So a page names a route and a session, never a URL.\n *\n * The shape is dictated by the transport rather than by taste. Over a tunnel\n * every request is resealed and relayed, and the relay honours only a method, a\n * set of headers and a buffered body against a root-relative target. Anything\n * this surface accepted beyond that would be silently discarded at exactly the\n * moment it mattered, so it accepts nothing beyond that.\n */\n\nimport { type ApiParams, type ApiQuery, type ApiScopeAddress, pluginApiUrl } from '../apiPaths';\n\n/** Scope names a package API can mount at. */\nexport type ApiScopeName = ApiScopeAddress['scope'];\n\n/** Methods a declared route may use. */\nexport type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\ndeclare const RESPONSE_TYPE: unique symbol;\n\n/** Carries a route's response type through the declaration. Erased at runtime. */\nexport interface ApiResponseOf<T> {\n readonly [RESPONSE_TYPE]: T;\n}\n\n/** Names the type a route answers with. Returns nothing; only its type is read. */\nexport function apiResponse<T>(): ApiResponseOf<T> {\n return undefined as unknown as ApiResponseOf<T>;\n}\n\n/**\n * One route, as the package declares it.\n *\n * No scope and no base path: both are mount identity, the build reads them off\n * the folder tree, and restating them here is how they came to disagree in the\n * first place.\n */\nexport interface ApiRouteSpec<T = void> {\n readonly method: ApiRouteMethod;\n /** Below the mount, leading slash. Exactly '/' addresses the mount itself. */\n readonly path: string;\n /** Query parameter names this route reads, for documentation and review. */\n readonly query?: readonly string[];\n /** A host-owned route: it hangs off the scope root rather than under /plugins/. */\n readonly host?: true;\n /**\n * Answers `text/event-stream`.\n *\n * A streaming route gets a URL and no call method. Its consumer is the\n * browser's own `EventSource`, which does not go through the sealed\n * transport, and a relayed request buffers the whole response before\n * returning, so calling one over a tunnel would never return at all.\n */\n readonly stream?: true;\n /**\n * Answers bytes rather than JSON.\n *\n * The body is left unread, so `data` is undefined and the caller takes\n * `result.response` and reads it however it needs: `arrayBuffer`, `blob`,\n * `text`. Without this the client would consume the body to parse it, and\n * hand back a `Response` that throws on the second read.\n */\n readonly raw?: true;\n readonly response?: ApiResponseOf<T>;\n}\n\nexport type ApiRoutes = Readonly<Record<string, ApiRouteSpec<unknown>>>;\n\ntype ResponseOf<TSpec> = TSpec extends { readonly response: ApiResponseOf<infer T> } ? T : void;\n\n/**\n * What a call may carry.\n *\n * No `cache`, `credentials`, `redirect` or `mode`. The sealed transport copies\n * only the method, the headers and the body, so those four would be discarded\n * on every remote session and honoured on no one's.\n *\n * `signal` is here because it is the one of the five that is not always a lie.\n * On loopback the transport is a plain `fetch` pass-through and cancellation\n * works, which callers already rely on to drop a superseded refresh. Over a\n * tunnel the request is resealed and relayed, and the signal goes no further\n * than this process: the call still settles, so a caller that treats an abort\n * as \"no answer is coming\" stays correct, but the work at the far end is not\n * stopped. Refusing the field outright would have regressed every caller that\n * cancels today, which is a worse trade than describing the limit.\n */\nexport interface ApiCallInit {\n /** Values for the route's `:name` path segments. */\n readonly params?: ApiParams;\n readonly query?: ApiQuery;\n readonly headers?: Readonly<Record<string, string>>;\n /** JSON-encoded unless it is already a string, Blob, buffer or URLSearchParams. */\n readonly body?: unknown;\n /** Honoured on loopback; dropped when the session is remote. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a route answered.\n *\n * `status` and the raw `response` are always present on an answered call,\n * because status and headers carry protocol state across this codebase: a 409\n * returns the hash the file actually has, a 204 plus a header says a recording\n * is sealed, and the file route reports a digest. A client that returned only a\n * parsed body would lose all three.\n *\n * `status: 0` with no `response` is the one case the transport never answered.\n * A relay failure arrives as a synthetic 502 and is reported as 502, because\n * this layer cannot tell it from the real thing.\n */\nexport type ApiResult<T> =\n | { readonly ok: true; readonly status: number; readonly data: T; readonly response: Response }\n | {\n readonly ok: false;\n readonly status: number;\n readonly error: string;\n readonly data: unknown;\n readonly response?: Response;\n };\n\n/** Issues a request. The same shape as `fetch`, so the sealed transport and the step-up wrapper both fit. */\nexport type ApiTransport = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport interface ApiMethod<T> {\n (init?: ApiCallInit): Promise<ApiResult<T>>;\n /** The absolute URL, for an `EventSource`, an `<img src>`, or a download. */\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\n/** A streaming route: addressable, not callable. */\nexport interface ApiStreamMethod {\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\nexport type ApiScopeClient<TRoutes extends ApiRoutes> = {\n readonly [K in keyof TRoutes]: TRoutes[K] extends { readonly stream: true }\n ? ApiStreamMethod\n : ApiMethod<ResponseOf<TRoutes[K]>>;\n};\n\ninterface ApiScopeAccessors<TRoutes extends ApiRoutes> {\n readonly global: ApiScopeClient<TRoutes>;\n readonly workspace: (workspaceId: string) => ApiScopeClient<TRoutes>;\n readonly session: (sessionId: string) => ApiScopeClient<TRoutes>;\n}\n\n/**\n * The client, carrying an accessor only for the scopes the package mounts at.\n *\n * A package serving sessions has `session` and nothing else, so addressing it\n * globally is a missing property rather than a 404 discovered at runtime. This\n * is the whole of the scope guarantee, and it costs no test.\n */\nexport type ApiClient<TScopes extends ApiScopeName, TRoutes extends ApiRoutes> = Pick<\n ApiScopeAccessors<TRoutes>,\n TScopes\n>;\n\n/** Identity with inference, so a route table keeps its literal types. */\nexport function defineApiRoutes<const TRoutes extends ApiRoutes>(routes: TRoutes): TRoutes {\n return routes;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The body a route answered, or undefined when it sent none or sent non-JSON. */\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (text === '') return undefined;\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The message a route reported, or an empty string.\n *\n * Empty rather than invented: callers own the words their users read, and a\n * generic sentence from here would appear in a dozen packages that each already\n * have their own.\n */\nfunction errorOf(data: unknown): string {\n return isRecord(data) && typeof data.error === 'string' ? data.error : '';\n}\n\n/**\n * What the sealed relay can carry verbatim.\n *\n * Named here rather than borrowed from `BodyInit`, which the node build has no\n * lib for, and which is anyway wider than the truth: `FormData` and a\n * `ReadableStream` are both refused when a session is remote.\n */\nexport type ApiRequestBody = string | Blob | ArrayBuffer | ArrayBufferView | URLSearchParams;\n\n/** Anything the sealed transport can carry verbatim; everything else becomes JSON. */\nfunction encodeBody(body: unknown): { body?: ApiRequestBody; contentType?: string } {\n if (body === undefined) return {};\n if (\n typeof body === 'string' ||\n body instanceof Blob ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n body instanceof URLSearchParams\n ) {\n return { body };\n }\n return { body: JSON.stringify(body), contentType: 'application/json' };\n}\n\nexport interface ApiClientOptions<TScopes extends ApiScopeName> {\n /** Scopes the package's routed api/ tree actually mounts at. The build supplies these. */\n readonly scopes: readonly TScopes[];\n /** The mount segment. The build reads it off the api/<base-path>/ folder. */\n readonly basePath: string;\n readonly transport: ApiTransport;\n /** Resolves which workspace owns a session; the host binds it from its own summaries. */\n readonly sessionAddress: (sessionId: string) => ApiScopeAddress;\n}\n\n/**\n * One route, as the page calls it.\n *\n * A streaming route is returned as a plain object with no call signature, not\n * merely typed as one. The type stops an author; the missing function stops a\n * cast, a JavaScript caller, and a generic helper that iterates the client.\n * Calling one over a tunnel would buffer forever rather than fail, and that is\n * too quiet a way to lose an afternoon.\n */\nfunction methodFor(\n spec: ApiRouteSpec<unknown>,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiMethod<unknown> | ApiStreamMethod {\n const basePath = spec.host === true ? undefined : options.basePath;\n const url = (init?: Pick<ApiCallInit, 'query' | 'params'>): string =>\n pluginApiUrl(address, basePath, spec.path, init?.query, init?.params);\n\n const call = async (init?: ApiCallInit): Promise<ApiResult<unknown>> => {\n const encoded = encodeBody(init?.body);\n const headers = {\n ...(encoded.contentType === undefined ? {} : { 'content-type': encoded.contentType }),\n ...init?.headers,\n };\n let response: Response;\n try {\n response = await options.transport(url(init), {\n method: spec.method,\n ...(init?.signal === undefined ? {} : { signal: init.signal }),\n ...(Object.keys(headers).length === 0 ? {} : { headers }),\n // Cast because the node build's `BodyInit` enumerates concrete typed\n // arrays rather than accepting `ArrayBufferView`. Every value reaching\n // here is one fetch already carries; the two libs disagree about the\n // type, not the runtime.\n ...(encoded.body === undefined ? {} : { body: encoded.body as RequestInit['body'] }),\n });\n } catch {\n return { ok: false, status: 0, error: '', data: undefined };\n }\n // A raw route's body belongs to the caller, and reading it here to look\n // for an `error` would spend the one read it gets.\n if (spec.raw === true) {\n if (!response.ok) return { ok: false, status: response.status, error: '', data: undefined, response };\n return { ok: true, status: response.status, data: undefined, response };\n }\n const data = await readBody(response);\n if (!response.ok) return { ok: false, status: response.status, error: errorOf(data), data, response };\n return { ok: true, status: response.status, data, response };\n };\n\n if (spec.stream === true) return { url, spec };\n return Object.assign(call, { url, spec });\n}\n\nfunction scopeClient<TRoutes extends ApiRoutes>(\n routes: TRoutes,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiScopeClient<TRoutes> {\n const client: Record<string, ApiMethod<unknown> | ApiStreamMethod> = {};\n for (const [key, spec] of Object.entries(routes)) client[key] = methodFor(spec, address, options);\n return client as ApiScopeClient<TRoutes>;\n}\n\n/**\n * Binds a route table to one package's mount.\n *\n * Only the scopes named in `options.scopes` get an accessor, so the returned\n * value describes exactly what this package serves and nothing else.\n */\nexport function createApiClient<const TScopes extends ApiScopeName, const TRoutes extends ApiRoutes>(\n routes: TRoutes,\n options: ApiClientOptions<TScopes>,\n): ApiClient<TScopes, TRoutes> {\n const wide = options as ApiClientOptions<ApiScopeName>;\n const accessors: { -readonly [K in keyof ApiScopeAccessors<TRoutes>]?: ApiScopeAccessors<TRoutes>[K] } = {};\n for (const scope of options.scopes) {\n if (scope === 'global') accessors.global = scopeClient(routes, { scope: 'global' }, wide);\n if (scope === 'workspace') {\n accessors.workspace = (workspaceId: string) => scopeClient(routes, { scope: 'workspace', workspaceId }, wide);\n }\n if (scope === 'session') {\n accessors.session = (sessionId: string) => scopeClient(routes, wide.sessionAddress(sessionId), wide);\n }\n }\n return accessors as ApiClient<TScopes, TRoutes>;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/web/services/apiClient/index.ts"],"sourcesContent":["/**\n * The typed call surface a cockpit plugin reaches its own API through.\n *\n * A route is declared once as data, and the build supplies the two facts the\n * declaration deliberately omits: which scopes the package mounts at, and under\n * which base path. So a page names a route and a session, never a URL.\n *\n * The shape is dictated by the transport rather than by taste. Over a tunnel\n * every request is resealed and relayed, and the relay honours only a method, a\n * set of headers and a buffered body against a root-relative target. Anything\n * this surface accepted beyond that would be silently discarded at exactly the\n * moment it mattered, so it accepts nothing beyond that.\n */\n\nimport { type ApiParams, type ApiQuery, type ApiScopeAddress, pluginApiUrl } from '../apiPaths';\n\n/** Scope names a package API can mount at. */\nexport type ApiScopeName = ApiScopeAddress['scope'];\n\n/** Methods a declared route may use. */\nexport type ApiRouteMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';\n\ndeclare const RESPONSE_TYPE: unique symbol;\n\n/** Carries a route's response type through the declaration. Erased at runtime. */\nexport interface ApiResponseOf<T> {\n readonly [RESPONSE_TYPE]: T;\n}\n\n/** Names the type a route answers with. Returns nothing; only its type is read. */\nexport function apiResponse<T>(): ApiResponseOf<T> {\n return undefined as unknown as ApiResponseOf<T>;\n}\n\n/**\n * One route, as the package declares it.\n *\n * No scope and no base path: both are mount identity, the build reads them off\n * the folder tree, and restating them here is how they came to disagree in the\n * first place.\n */\nexport interface ApiRouteSpec<T = void> {\n readonly method: ApiRouteMethod;\n /** Below the mount, leading slash. Exactly '/' addresses the mount itself. */\n readonly path: string;\n /** Query parameter names this route reads, for documentation and review. */\n readonly query?: readonly string[];\n /** A host-owned route: it hangs off the scope root rather than under /plugins/. */\n readonly host?: true;\n /**\n * Answers `text/event-stream`.\n *\n * A streaming route gets a URL and no call method. Its consumer is the\n * browser's own `EventSource`, which does not go through the sealed\n * transport, and a relayed request buffers the whole response before\n * returning, so calling one over a tunnel would never return at all.\n */\n readonly stream?: true;\n /**\n * Answers bytes rather than JSON.\n *\n * The body is left unread, so `data` is undefined and the caller takes\n * `result.response` and reads it however it needs: `arrayBuffer`, `blob`,\n * `text`. Without this the client would consume the body to parse it, and\n * hand back a `Response` that throws on the second read.\n */\n readonly raw?: true;\n readonly response?: ApiResponseOf<T>;\n}\n\nexport type ApiRoutes = Readonly<Record<string, ApiRouteSpec<unknown>>>;\n\ntype ResponseOf<TSpec> = TSpec extends { readonly response: ApiResponseOf<infer T> } ? T : void;\n\n/**\n * What a call may carry.\n *\n * No `cache`, `credentials`, `redirect` or `mode`. The sealed transport copies\n * only the method, the headers and the body, so those four would be discarded\n * on every remote session and honoured on no one's.\n *\n * `signal` is here because it is the one of the five that is not always a lie.\n * On loopback the transport is a plain `fetch` pass-through and cancellation\n * works, which callers already rely on to drop a superseded refresh. Over a\n * tunnel the request is resealed and relayed, and the signal goes no further\n * than this process: the call still settles, so a caller that treats an abort\n * as \"no answer is coming\" stays correct, but the work at the far end is not\n * stopped. Refusing the field outright would have regressed every caller that\n * cancels today, which is a worse trade than describing the limit.\n */\nexport interface ApiCallInit {\n /** Values for the route's `:name` path segments. */\n readonly params?: ApiParams;\n readonly query?: ApiQuery;\n readonly headers?: Readonly<Record<string, string>>;\n /** JSON-encoded unless it is already a string, Blob, buffer or URLSearchParams. */\n readonly body?: unknown;\n /** Honoured on loopback; dropped when the session is remote. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a route answered.\n *\n * `status` and the raw `response` are always present on an answered call,\n * because status and headers carry protocol state across this codebase: a 409\n * returns the hash the file actually has, a 204 plus a header says a recording\n * is sealed, and the file route reports a digest. A client that returned only a\n * parsed body would lose all three.\n *\n * `status: 0` with no `response` is the one case the transport never answered.\n * A relay failure arrives as a synthetic 502 and is reported as 502, because\n * this layer cannot tell it from the real thing. An answered call whose body\n * cannot be read fails with that response's status and metadata intact.\n */\nexport type ApiResult<T> =\n | { readonly ok: true; readonly status: number; readonly data: T; readonly response: Response }\n | {\n readonly ok: false;\n readonly status: number;\n readonly error: string;\n readonly data: unknown;\n readonly response?: Response;\n };\n\n/** Issues a request. The same shape as `fetch`, so the sealed transport and the step-up wrapper both fit. */\nexport type ApiTransport = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport interface ApiMethod<T> {\n (init?: ApiCallInit): Promise<ApiResult<T>>;\n /** The absolute URL, for an `EventSource`, an `<img src>`, or a download. */\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\n/** A streaming route: addressable, not callable. */\nexport interface ApiStreamMethod {\n url(init?: Pick<ApiCallInit, 'query' | 'params'>): string;\n readonly spec: ApiRouteSpec<unknown>;\n}\n\nexport type ApiScopeClient<TRoutes extends ApiRoutes> = {\n readonly [K in keyof TRoutes]: TRoutes[K] extends { readonly stream: true }\n ? ApiStreamMethod\n : ApiMethod<ResponseOf<TRoutes[K]>>;\n};\n\ninterface ApiScopeAccessors<TRoutes extends ApiRoutes> {\n readonly host: ApiScopeClient<TRoutes>;\n readonly workspace: (workspaceId: string) => ApiScopeClient<TRoutes>;\n readonly session: (sessionId: string) => ApiScopeClient<TRoutes>;\n}\n\n/**\n * The client, carrying an accessor only for the scopes the package mounts at.\n *\n * A package serving sessions has `session` and nothing else, so addressing it\n * globally is a missing property rather than a 404 discovered at runtime. This\n * is the whole of the scope guarantee, and it costs no test.\n */\nexport type ApiClient<TScopes extends ApiScopeName, TRoutes extends ApiRoutes> = Pick<\n ApiScopeAccessors<TRoutes>,\n TScopes\n>;\n\n/** Identity with inference, so a route table keeps its literal types. */\nexport function defineApiRoutes<const TRoutes extends ApiRoutes>(routes: TRoutes): TRoutes {\n return routes;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The body a route answered, or undefined when it sent none or sent non-JSON. */\nasync function readBody(response: Response): Promise<unknown> {\n const text = await response.text();\n if (text === '') return undefined;\n try {\n return JSON.parse(text) as unknown;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The message a route reported, or an empty string.\n *\n * Empty rather than invented: callers own the words their users read, and a\n * generic sentence from here would appear in a dozen packages that each already\n * have their own.\n */\nfunction errorOf(data: unknown): string {\n return isRecord(data) && typeof data.error === 'string' ? data.error : '';\n}\n\n/**\n * What the sealed relay can carry verbatim.\n *\n * Named here rather than borrowed from `BodyInit`, which the node build has no\n * lib for, and which is anyway wider than the truth: `FormData` and a\n * `ReadableStream` are both refused when a session is remote.\n */\nexport type ApiRequestBody = string | Blob | ArrayBuffer | ArrayBufferView | URLSearchParams;\n\n/** Anything the sealed transport can carry verbatim; everything else becomes JSON. */\nfunction encodeBody(body: unknown): { body?: ApiRequestBody; contentType?: string } {\n if (body === undefined) return {};\n if (\n typeof body === 'string' ||\n body instanceof Blob ||\n body instanceof ArrayBuffer ||\n ArrayBuffer.isView(body) ||\n body instanceof URLSearchParams\n ) {\n return { body };\n }\n return { body: JSON.stringify(body), contentType: 'application/json' };\n}\n\nexport interface ApiClientOptions<TScopes extends ApiScopeName> {\n /** Scopes the package's routed api/ tree actually mounts at. The build supplies these. */\n readonly scopes: readonly TScopes[];\n /** The mount segment. The build reads it off the api/<base-path>/ folder. */\n readonly basePath: string;\n readonly transport: ApiTransport;\n /** Resolves which workspace owns a session; the host binds it from its own summaries. */\n readonly sessionAddress: (sessionId: string) => ApiScopeAddress;\n}\n\n/**\n * One route, as the page calls it.\n *\n * A streaming route is returned as a plain object with no call signature, not\n * merely typed as one. The type stops an author; the missing function stops a\n * cast, a JavaScript caller, and a generic helper that iterates the client.\n * Calling one over a tunnel would buffer forever rather than fail, and that is\n * too quiet a way to lose an afternoon.\n */\nfunction methodFor(\n spec: ApiRouteSpec<unknown>,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiMethod<unknown> | ApiStreamMethod {\n const basePath = spec.host === true ? undefined : options.basePath;\n const url = (init?: Pick<ApiCallInit, 'query' | 'params'>): string =>\n pluginApiUrl(address, basePath, spec.path, init?.query, init?.params);\n\n const call = async (init?: ApiCallInit): Promise<ApiResult<unknown>> => {\n const encoded = encodeBody(init?.body);\n const headers = {\n ...(encoded.contentType === undefined ? {} : { 'content-type': encoded.contentType }),\n ...init?.headers,\n };\n let response: Response;\n try {\n response = await options.transport(url(init), {\n method: spec.method,\n ...(init?.signal === undefined ? {} : { signal: init.signal }),\n ...(Object.keys(headers).length === 0 ? {} : { headers }),\n // Cast because the node build's `BodyInit` enumerates concrete typed\n // arrays rather than accepting `ArrayBufferView`. Every value reaching\n // here is one fetch already carries; the two libs disagree about the\n // type, not the runtime.\n ...(encoded.body === undefined ? {} : { body: encoded.body as RequestInit['body'] }),\n });\n } catch {\n return { ok: false, status: 0, error: '', data: undefined };\n }\n // A raw route's body belongs to the caller, and reading it here to look\n // for an `error` would spend the one read it gets.\n if (spec.raw === true) {\n if (!response.ok) return { ok: false, status: response.status, error: '', data: undefined, response };\n return { ok: true, status: response.status, data: undefined, response };\n }\n let data: unknown;\n try {\n data = await readBody(response);\n } catch {\n return { ok: false, status: response.status, error: '', data: undefined, response };\n }\n if (!response.ok) return { ok: false, status: response.status, error: errorOf(data), data, response };\n return { ok: true, status: response.status, data, response };\n };\n\n if (spec.stream === true) return { url, spec };\n return Object.assign(call, { url, spec });\n}\n\nfunction scopeClient<TRoutes extends ApiRoutes>(\n routes: TRoutes,\n address: ApiScopeAddress,\n options: ApiClientOptions<ApiScopeName>,\n): ApiScopeClient<TRoutes> {\n const client: Record<string, ApiMethod<unknown> | ApiStreamMethod> = {};\n for (const [key, spec] of Object.entries(routes)) client[key] = methodFor(spec, address, options);\n return client as ApiScopeClient<TRoutes>;\n}\n\n/**\n * Binds a route table to one package's mount.\n *\n * Only the scopes named in `options.scopes` get an accessor, so the returned\n * value describes exactly what this package serves and nothing else.\n */\nexport function createApiClient<const TScopes extends ApiScopeName, const TRoutes extends ApiRoutes>(\n routes: TRoutes,\n options: ApiClientOptions<TScopes>,\n): ApiClient<TScopes, TRoutes> {\n const wide = options as ApiClientOptions<ApiScopeName>;\n const accessors: { -readonly [K in keyof ApiScopeAccessors<TRoutes>]?: ApiScopeAccessors<TRoutes>[K] } = {};\n for (const scope of options.scopes) {\n if (scope === 'host') accessors.host = scopeClient(routes, { scope: 'host' }, wide);\n if (scope === 'workspace') {\n accessors.workspace = (workspaceId: string) => scopeClient(routes, { scope: 'workspace', workspaceId }, wide);\n }\n if (scope === 'session') {\n accessors.session = (sessionId: string) => scopeClient(routes, wide.sessionAddress(sessionId), wide);\n }\n }\n return accessors as ApiClient<TScopes, TRoutes>;\n}\n"],"mappings":"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"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const SETTINGS_BASE_PATH = "settings";
|
|
4
4
|
/** The scope's own resource root: what a host-owned route hangs off. */
|
|
5
5
|
function scopeApiRoot(address) {
|
|
6
|
-
if (address.scope === "
|
|
6
|
+
if (address.scope === "host") return "/api";
|
|
7
7
|
const workspace = `/api/workspaces/${encodeURIComponent(address.workspaceId)}`;
|
|
8
8
|
if (address.scope === "workspace") return workspace;
|
|
9
9
|
return `${workspace}/sessions/${encodeURIComponent(address.sessionId)}`;
|