@agimon-ai/po-core 0.0.0-alpha.2 → 0.0.0-alpha.21
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 +149 -21
- package/NOTICE +41 -0
- package/dist/agentModel.cjs +1 -1
- package/dist/agentModel.d.mts +2 -2
- package/dist/agentModel.mjs +1 -2
- package/dist/apiContracts.cjs +623 -802
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +277 -615
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +617 -794
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/askUser.cjs +2 -2
- package/dist/askUser.d.mts +2 -2
- package/dist/askUser.mjs +1 -2
- package/dist/authorTools.mjs +1 -2
- package/dist/backgroundWork.cjs +3 -3
- package/dist/backgroundWork.d.mts +2 -2
- package/dist/backgroundWork.mjs +1 -2
- package/dist/bundleAssetPolicy.mjs +1 -2
- package/dist/chatgptAuth.cjs +3 -2
- package/dist/chatgptAuth.d.mts +3 -2
- package/dist/chatgptAuth.mjs +2 -1
- package/dist/childProcess.cjs +1 -1
- package/dist/childProcess.d.mts +2 -2
- package/dist/childProcess.mjs +1 -2
- package/dist/childSession.cjs +11 -6
- package/dist/childSession.d.mts +3 -3
- package/dist/childSession.mjs +3 -3
- package/dist/cockpitContainer.mjs +1 -2
- package/dist/config.cjs +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -2
- package/dist/contextApi.cjs +1 -0
- package/dist/contextApi.d.mts +2 -2
- package/dist/contextApi.mjs +2 -2
- package/dist/contextContributions.cjs +4 -4
- package/dist/contextContributions.d.mts +3 -3
- package/dist/contextContributions.mjs +3 -3
- package/dist/contextDetailStore.cjs +7 -5
- package/dist/contextDetailStore.cjs.map +1 -1
- package/dist/contextDetailStore.d.mts +2 -1
- package/dist/contextDetailStore.d.mts.map +1 -1
- package/dist/contextDetailStore.mjs +6 -4
- package/dist/contextDetailStore.mjs.map +1 -1
- package/dist/contextProjection.cjs +7 -2
- package/dist/contextProjection.cjs.map +1 -1
- package/dist/contextProjection.d.mts +4 -1
- package/dist/contextProjection.d.mts.map +1 -1
- package/dist/contextProjection.mjs +5 -2
- package/dist/contextProjection.mjs.map +1 -1
- package/dist/cordisHost.cjs +11 -11
- package/dist/cordisHost.d.mts +2 -2
- package/dist/cordisHost.mjs +1 -2
- package/dist/delegation.cjs +8 -8
- package/dist/delegation.d.mts +2 -2
- package/dist/delegation.mjs +1 -2
- package/dist/executionBudget.cjs +4 -3
- package/dist/executionBudget.cjs.map +1 -1
- package/dist/executionBudget.d.mts +2 -2
- package/dist/executionBudget.d.mts.map +1 -1
- package/dist/executionBudget.mjs +4 -3
- package/dist/executionBudget.mjs.map +1 -1
- package/dist/extensionFile.cjs +5 -0
- package/dist/extensionFile.d.mts +4 -2
- package/dist/extensionFile.mjs +4 -2
- package/dist/footer.d.mts +2 -2
- package/dist/footer.mjs +1 -2
- package/dist/headless.cjs +14 -14
- package/dist/headless.d.mts +2 -2
- package/dist/headless.mjs +1 -2
- package/dist/headlessHub.cjs +308 -109
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.d.mts +71 -36
- package/dist/headlessHub.d.mts.map +1 -1
- package/dist/headlessHub.mjs +309 -110
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessProtocol.cjs +327 -0
- package/dist/headlessProtocol.cjs.map +1 -0
- package/dist/headlessProtocol.d.mts +30 -0
- package/dist/headlessProtocol.d.mts.map +1 -0
- package/dist/headlessProtocol.mjs +326 -0
- package/dist/headlessProtocol.mjs.map +1 -0
- package/dist/headlessServer.cjs +166 -151
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.d.mts +13 -5
- package/dist/headlessServer.d.mts.map +1 -1
- package/dist/headlessServer.mjs +166 -151
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/headlessSessionHost.d.mts +58 -21
- package/dist/headlessSessionHost.d.mts.map +1 -1
- package/dist/help.cjs +20 -20
- package/dist/help.d.mts +2 -2
- package/dist/help.mjs +2 -2
- package/dist/history.cjs +16 -20
- package/dist/history.d.mts +9 -7
- package/dist/history.mjs +6 -7
- package/dist/historyOwnership.cjs.map +1 -1
- package/dist/historyOwnership.d.mts +1 -1
- package/dist/historyOwnership.mjs.map +1 -1
- package/dist/hubChannel.cjs +9 -0
- package/dist/hubChannel.d.mts +3 -2
- package/dist/hubChannel.mjs +3 -2
- package/dist/index.cjs +26 -28
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +6 -6
- package/dist/interop/chord.mjs +1 -0
- package/dist/interop/chordContext.mjs +1 -0
- package/dist/json.cjs +11 -5
- package/dist/json.d.mts +4 -2
- package/dist/json.mjs +4 -2
- package/dist/kernel.cjs +1 -1
- package/dist/kernel.d.mts +3 -3
- package/dist/kernel.mjs +1 -2
- package/dist/leader.d.mts +2 -2
- package/dist/leader.mjs +1 -2
- package/dist/logSinkTelemetry.mjs +1 -2
- package/dist/machineApi.cjs +80 -74
- package/dist/machineApi.cjs.map +1 -1
- package/dist/machineApi.d.mts +5 -2
- package/dist/machineApi.d.mts.map +1 -1
- package/dist/machineApi.mjs +78 -71
- package/dist/machineApi.mjs.map +1 -1
- package/dist/main.cjs +2 -1
- package/dist/main.d.mts +2 -1
- package/dist/main.mjs +2 -1
- package/dist/mcpFacet.d.mts +3 -3
- package/dist/mcpProjection.cjs +13 -13
- package/dist/mcpProjection.d.mts +2 -2
- package/dist/mcpProjection.mjs +1 -2
- package/dist/mcpSchemaCost.cjs +4 -4
- package/dist/mcpSchemaCost.cjs.map +1 -1
- package/dist/mcpSchemaCost.d.mts +2 -2
- package/dist/mcpSchemaCost.mjs +4 -4
- package/dist/mcpSchemaCost.mjs.map +1 -1
- package/dist/mcpSession.cjs +7 -7
- package/dist/mcpSession.d.mts +2 -2
- package/dist/mcpSession.mjs +1 -2
- package/dist/mcpStatus.cjs +2 -2
- package/dist/mcpStatus.d.mts +2 -2
- package/dist/mcpStatus.mjs +1 -2
- package/dist/mcpToolResolver.cjs +3 -3
- package/dist/mcpToolResolver.d.mts +2 -2
- package/dist/mcpToolResolver.mjs +1 -2
- package/dist/mcpWidget.d.mts +2 -2
- package/dist/moduleResolution.cjs +43 -8
- package/dist/moduleResolution.cjs.map +1 -1
- package/dist/moduleResolution.d.mts +10 -1
- package/dist/moduleResolution.d.mts.map +1 -1
- package/dist/moduleResolution.mjs +40 -7
- package/dist/moduleResolution.mjs.map +1 -1
- package/dist/narration.cjs +3 -3
- package/dist/narration.d.mts +2 -2
- package/dist/narration.mjs +1 -2
- package/dist/native.cjs +9 -0
- package/dist/native.d.mts +4 -3
- package/dist/native.mjs +3 -2
- package/dist/nodePlatform.cjs +77 -0
- package/dist/nodePlatform.cjs.map +1 -0
- package/dist/nodePlatform.d.mts +17 -0
- package/dist/nodePlatform.d.mts.map +1 -0
- package/dist/nodePlatform.mjs +72 -0
- package/dist/nodePlatform.mjs.map +1 -0
- package/dist/notification.cjs +15 -15
- package/dist/notification.d.mts +2 -2
- package/dist/notification.mjs +1 -2
- package/dist/packageApi.cjs +11 -11
- package/dist/packageApi.d.mts +2 -2
- package/dist/packageApi.mjs +2 -2
- package/dist/packageApiServer.cjs +45 -27
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.d.mts +36 -26
- package/dist/packageApiServer.d.mts.map +1 -1
- package/dist/packageApiServer.mjs +44 -26
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/piSettings.cjs +41 -20
- package/dist/piSettings.d.mts +4 -2
- package/dist/piSettings.mjs +4 -2
- package/dist/platform.cjs +62 -0
- package/dist/platform.d.mts +10 -0
- package/dist/platform.mjs +10 -0
- package/dist/pluginProtocol.cjs +7 -8
- package/dist/pluginProtocol.d.mts +2 -2
- package/dist/pluginProtocol.mjs +1 -2
- package/dist/poPackage.cjs +12 -0
- package/dist/poPackage.d.mts +3 -0
- package/dist/poPackage.mjs +3 -0
- package/dist/profileIdentity.cjs +1 -1
- package/dist/profileIdentity.d.mts +2 -2
- package/dist/profileIdentity.mjs +1 -2
- package/dist/protocol.cjs +3 -3
- package/dist/protocol.d.mts +2 -2
- package/dist/protocol.mjs +1 -2
- package/dist/readiness.cjs +6 -6
- package/dist/readiness.d.mts +2 -2
- package/dist/readiness.mjs +1 -2
- package/dist/remoteApi.cjs.map +1 -1
- package/dist/remoteApi.d.mts +2 -2
- package/dist/remoteApi.mjs.map +1 -1
- package/dist/remoteRuntime.cjs +42 -65
- package/dist/remoteRuntime.cjs.map +1 -1
- package/dist/remoteRuntime.d.mts +3 -2
- package/dist/remoteRuntime.d.mts.map +1 -1
- package/dist/remoteRuntime.mjs +41 -62
- package/dist/remoteRuntime.mjs.map +1 -1
- package/dist/runtimeConfig.cjs +4 -4
- package/dist/runtimeConfig.cjs.map +1 -1
- package/dist/runtimeConfig.d.mts +10 -9
- package/dist/runtimeConfig.d.mts.map +1 -1
- package/dist/runtimeConfig.mjs +4 -4
- package/dist/runtimeConfig.mjs.map +1 -1
- package/dist/runtimeContextApi.cjs +10 -3
- package/dist/runtimeContextApi.cjs.map +1 -1
- package/dist/runtimeContextApi.d.mts +3 -3
- package/dist/runtimeContextApi.d.mts.map +1 -1
- package/dist/runtimeContextApi.mjs +10 -3
- package/dist/runtimeContextApi.mjs.map +1 -1
- package/dist/runtimeCordisHost.cjs +46 -46
- package/dist/runtimeCordisHost.cjs.map +1 -1
- package/dist/runtimeCordisHost.d.mts +29 -28
- package/dist/runtimeCordisHost.d.mts.map +1 -1
- package/dist/runtimeCordisHost.mjs +42 -42
- package/dist/runtimeCordisHost.mjs.map +1 -1
- package/dist/runtimeIdentity.cjs +6 -9
- package/dist/runtimeIdentity.cjs.map +1 -1
- package/dist/runtimeIdentity.d.mts +5 -1
- package/dist/runtimeIdentity.d.mts.map +1 -1
- package/dist/runtimeIdentity.mjs +5 -8
- package/dist/runtimeIdentity.mjs.map +1 -1
- package/dist/runtimeJson.cjs +10 -45
- package/dist/runtimeJson.d.mts +3 -22
- package/dist/runtimeJson.mjs +3 -39
- package/dist/runtimeLogSinkTelemetry.cjs +19 -19
- package/dist/runtimeLogSinkTelemetry.cjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.d.mts +19 -19
- package/dist/runtimeLogSinkTelemetry.mjs +19 -19
- package/dist/runtimeLogSinkTelemetry.mjs.map +1 -1
- package/dist/runtimePackages.cjs +7 -2
- package/dist/runtimePackages.cjs.map +1 -1
- package/dist/runtimePackages.d.mts +4 -1
- package/dist/runtimePackages.d.mts.map +1 -1
- package/dist/runtimePackages.mjs +7 -2
- package/dist/runtimePackages.mjs.map +1 -1
- package/dist/runtimePiSettings.cjs +40 -263
- package/dist/runtimePiSettings.d.mts +3 -72
- package/dist/runtimePiSettings.mjs +3 -241
- package/dist/runtimeProtocol.cjs +19 -19
- package/dist/runtimeProtocol.cjs.map +1 -1
- package/dist/runtimeProtocol.d.mts +7 -7
- package/dist/runtimeProtocol.d.mts.map +1 -1
- package/dist/runtimeProtocol.mjs +17 -17
- package/dist/runtimeProtocol.mjs.map +1 -1
- package/dist/runtimeTransition.cjs +9 -9
- package/dist/runtimeTransition.cjs.map +1 -1
- package/dist/runtimeTransition.d.mts +10 -10
- package/dist/runtimeTransition.d.mts.map +1 -1
- package/dist/runtimeTransition.mjs +7 -7
- package/dist/runtimeTransition.mjs.map +1 -1
- package/dist/sandboxHarness.mjs +1 -2
- package/dist/server.cjs +3 -7
- package/dist/server.d.mts +6 -6
- package/dist/server.mjs +3 -4
- package/dist/serverPlugin.cjs +39 -0
- package/dist/serverPlugin.d.mts +12 -0
- package/dist/serverPlugin.mjs +11 -0
- package/dist/serverTelemetry.cjs +1 -1
- package/dist/serverTelemetry.cjs.map +1 -1
- package/dist/serverTelemetry.d.mts +2 -2
- package/dist/serverTelemetry.mjs +2 -2
- package/dist/serverTelemetry.mjs.map +1 -1
- package/dist/sessionFilesApi.cjs +41 -37
- package/dist/sessionFilesApi.cjs.map +1 -1
- package/dist/sessionFilesApi.d.mts +6 -3
- package/dist/sessionFilesApi.d.mts.map +1 -1
- package/dist/sessionFilesApi.mjs +41 -36
- package/dist/sessionFilesApi.mjs.map +1 -1
- package/dist/sessionProtocol.cjs +31 -6
- package/dist/sessionProtocol.d.mts +8 -3
- package/dist/sessionProtocol.mjs +8 -2
- package/dist/skills.cjs +5 -5
- package/dist/skills.d.mts +2 -2
- package/dist/skills.mjs +1 -2
- package/dist/sqliteSessionStorage.cjs +28 -50
- package/dist/sqliteSessionStorage.cjs.map +1 -1
- package/dist/sqliteSessionStorage.d.mts +13 -20
- package/dist/sqliteSessionStorage.d.mts.map +1 -1
- package/dist/sqliteSessionStorage.mjs +25 -48
- package/dist/sqliteSessionStorage.mjs.map +1 -1
- package/dist/src/constants/agentSettled.cjs +7 -0
- package/dist/src/constants/agentSettled.cjs.map +1 -0
- package/dist/src/constants/agentSettled.mjs +7 -0
- package/dist/src/constants/agentSettled.mjs.map +1 -0
- package/dist/src/constants/contextApi.cjs +3 -1
- package/dist/src/constants/contextApi.cjs.map +1 -1
- package/dist/src/constants/contextApi.d.mts +2 -1
- package/dist/src/constants/contextApi.d.mts.map +1 -1
- package/dist/src/constants/contextApi.mjs +3 -2
- package/dist/src/constants/contextApi.mjs.map +1 -1
- package/dist/src/constants/voiceTools.cjs +6 -6
- package/dist/src/constants/voiceTools.cjs.map +1 -1
- package/dist/src/constants/voiceTools.d.mts +3 -3
- package/dist/src/constants/voiceTools.mjs +4 -4
- package/dist/src/constants/voiceTools.mjs.map +1 -1
- package/dist/src/extensions/extensionFile.cjs +22 -5
- package/dist/src/extensions/extensionFile.cjs.map +1 -1
- package/dist/src/extensions/extensionFile.d.mts +17 -4
- package/dist/src/extensions/extensionFile.d.mts.map +1 -1
- package/dist/src/extensions/extensionFile.mjs +22 -6
- package/dist/src/extensions/extensionFile.mjs.map +1 -1
- package/dist/src/extensions/serverPlugin.cjs +231 -92
- package/dist/src/extensions/serverPlugin.cjs.map +1 -1
- package/dist/src/extensions/serverPlugin.d.mts +2 -2
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
- package/dist/src/extensions/serverPlugin.mjs +232 -93
- package/dist/src/extensions/serverPlugin.mjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.cjs +349 -142
- package/dist/src/pi/piSessionRuntime.cjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.d.mts +18 -17
- package/dist/src/pi/piSessionRuntime.d.mts.map +1 -1
- package/dist/src/pi/piSessionRuntime.mjs +342 -135
- package/dist/src/pi/piSessionRuntime.mjs.map +1 -1
- package/dist/src/schemas/agentModel.cjs +2 -2
- package/dist/src/schemas/agentModel.cjs.map +1 -1
- package/dist/src/schemas/agentModel.d.mts +1 -1
- package/dist/src/schemas/agentModel.mjs +2 -2
- package/dist/src/schemas/agentModel.mjs.map +1 -1
- package/dist/src/schemas/apiContracts.d.mts +2 -2
- package/dist/src/schemas/apiContracts.d.mts.map +1 -1
- package/dist/src/schemas/askUser.cjs +4 -4
- package/dist/src/schemas/askUser.cjs.map +1 -1
- package/dist/src/schemas/askUser.d.mts +4 -4
- package/dist/src/schemas/askUser.d.mts.map +1 -1
- package/dist/src/schemas/askUser.mjs +3 -3
- package/dist/src/schemas/askUser.mjs.map +1 -1
- package/dist/src/schemas/backgroundWork.cjs +10 -10
- package/dist/src/schemas/backgroundWork.cjs.map +1 -1
- package/dist/src/schemas/backgroundWork.d.mts +9 -9
- package/dist/src/schemas/backgroundWork.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.mjs +8 -8
- package/dist/src/schemas/backgroundWork.mjs.map +1 -1
- package/dist/src/schemas/childProcess.cjs +5 -5
- package/dist/src/schemas/childProcess.cjs.map +1 -1
- package/dist/src/schemas/childProcess.d.mts +2 -2
- package/dist/src/schemas/childProcess.mjs +5 -5
- package/dist/src/schemas/childProcess.mjs.map +1 -1
- package/dist/src/schemas/contextContributions.cjs +10 -10
- package/dist/src/schemas/contextContributions.cjs.map +1 -1
- package/dist/src/schemas/contextContributions.d.mts +16 -16
- package/dist/src/schemas/contextContributions.d.mts.map +1 -1
- package/dist/src/schemas/contextContributions.mjs +8 -8
- package/dist/src/schemas/contextContributions.mjs.map +1 -1
- package/dist/src/schemas/delegation.cjs +17 -17
- package/dist/src/schemas/delegation.cjs.map +1 -1
- package/dist/src/schemas/delegation.d.mts +16 -16
- package/dist/src/schemas/delegation.d.mts.map +1 -1
- package/dist/src/schemas/delegation.mjs +10 -10
- package/dist/src/schemas/delegation.mjs.map +1 -1
- package/dist/src/schemas/extensionFile.d.mts +23 -19
- package/dist/src/schemas/extensionFile.d.mts.map +1 -1
- package/dist/src/schemas/footer.cjs.map +1 -1
- package/dist/src/schemas/footer.d.mts +5 -5
- package/dist/src/schemas/footer.d.mts.map +1 -1
- package/dist/src/schemas/footer.mjs.map +1 -1
- package/dist/src/schemas/headless.cjs +37 -37
- package/dist/src/schemas/headless.cjs.map +1 -1
- package/dist/src/schemas/headless.d.mts +100 -101
- package/dist/src/schemas/headless.d.mts.map +1 -1
- package/dist/src/schemas/headless.mjs +24 -24
- package/dist/src/schemas/headless.mjs.map +1 -1
- package/dist/src/schemas/help.cjs +60 -60
- package/dist/src/schemas/help.cjs.map +1 -1
- package/dist/src/schemas/help.d.mts +43 -43
- package/dist/src/schemas/help.d.mts.map +1 -1
- package/dist/src/schemas/help.mjs +41 -41
- package/dist/src/schemas/help.mjs.map +1 -1
- package/dist/src/schemas/home.cjs +127 -0
- package/dist/src/schemas/home.cjs.map +1 -0
- package/dist/src/schemas/home.d.mts +63 -0
- package/dist/src/schemas/home.d.mts.map +1 -0
- package/dist/src/schemas/home.mjs +121 -0
- package/dist/src/schemas/home.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +441 -0
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.d.mts +78 -0
- package/dist/src/schemas/httpApiContracts.d.mts.map +1 -0
- package/dist/src/schemas/httpApiContracts.mjs +434 -0
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -0
- package/dist/src/schemas/hubChannel.cjs +3 -0
- package/dist/src/schemas/hubChannel.cjs.map +1 -1
- package/dist/src/schemas/hubChannel.d.mts +84 -60
- package/dist/src/schemas/hubChannel.d.mts.map +1 -1
- package/dist/src/schemas/hubChannel.mjs +3 -1
- package/dist/src/schemas/hubChannel.mjs.map +1 -1
- package/dist/src/schemas/leader.cjs.map +1 -1
- package/dist/src/schemas/leader.d.mts +3 -3
- package/dist/src/schemas/leader.d.mts.map +1 -1
- package/dist/src/schemas/leader.mjs.map +1 -1
- package/dist/src/schemas/mcpBundle.d.mts +3 -3
- package/dist/src/schemas/mcpFacet.cjs.map +1 -1
- package/dist/src/schemas/mcpFacet.d.mts +22 -22
- 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 +41 -41
- package/dist/src/schemas/mcpProjection.cjs.map +1 -1
- package/dist/src/schemas/mcpProjection.d.mts +31 -30
- package/dist/src/schemas/mcpProjection.d.mts.map +1 -1
- package/dist/src/schemas/mcpProjection.mjs +29 -29
- package/dist/src/schemas/mcpProjection.mjs.map +1 -1
- package/dist/src/schemas/mcpSession.cjs +23 -23
- package/dist/src/schemas/mcpSession.cjs.map +1 -1
- package/dist/src/schemas/mcpSession.d.mts +12 -12
- package/dist/src/schemas/mcpSession.d.mts.map +1 -1
- package/dist/src/schemas/mcpSession.mjs +18 -18
- package/dist/src/schemas/mcpSession.mjs.map +1 -1
- package/dist/src/schemas/mcpStatus.cjs +5 -5
- package/dist/src/schemas/mcpStatus.cjs.map +1 -1
- package/dist/src/schemas/mcpStatus.d.mts +4 -4
- package/dist/src/schemas/mcpStatus.d.mts.map +1 -1
- package/dist/src/schemas/mcpStatus.mjs +4 -4
- package/dist/src/schemas/mcpStatus.mjs.map +1 -1
- package/dist/src/schemas/mcpToolResolver.cjs +9 -9
- package/dist/src/schemas/mcpToolResolver.cjs.map +1 -1
- package/dist/src/schemas/mcpToolResolver.d.mts +7 -7
- package/dist/src/schemas/mcpToolResolver.d.mts.map +1 -1
- package/dist/src/schemas/mcpToolResolver.mjs +7 -7
- package/dist/src/schemas/mcpToolResolver.mjs.map +1 -1
- package/dist/src/schemas/narration.cjs +9 -9
- package/dist/src/schemas/narration.cjs.map +1 -1
- package/dist/src/schemas/narration.d.mts +5 -5
- package/dist/src/schemas/narration.d.mts.map +1 -1
- package/dist/src/schemas/narration.mjs +7 -7
- package/dist/src/schemas/narration.mjs.map +1 -1
- package/dist/src/schemas/notification.cjs +45 -45
- package/dist/src/schemas/notification.cjs.map +1 -1
- package/dist/src/schemas/notification.d.mts +22 -22
- package/dist/src/schemas/notification.d.mts.map +1 -1
- package/dist/src/schemas/notification.mjs +31 -31
- package/dist/src/schemas/notification.mjs.map +1 -1
- package/dist/src/schemas/packageApi.cjs +28 -28
- package/dist/src/schemas/packageApi.cjs.map +1 -1
- package/dist/src/schemas/packageApi.d.mts +91 -65
- package/dist/src/schemas/packageApi.d.mts.map +1 -1
- package/dist/src/schemas/packageApi.mjs +18 -18
- package/dist/src/schemas/packageApi.mjs.map +1 -1
- package/dist/src/schemas/platform.cjs +34 -0
- package/dist/src/schemas/platform.cjs.map +1 -0
- package/dist/src/schemas/platform.d.mts +75 -0
- package/dist/src/schemas/platform.d.mts.map +1 -0
- package/dist/src/schemas/platform.mjs +27 -0
- package/dist/src/schemas/platform.mjs.map +1 -0
- package/dist/src/schemas/pluginContributions.cjs.map +1 -1
- package/dist/src/schemas/pluginContributions.d.mts +12 -12
- 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 +24 -27
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.d.mts +21 -21
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
- package/dist/src/schemas/pluginProtocol.mjs +18 -20
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
- package/dist/src/schemas/profileIdentity.cjs +2 -2
- package/dist/src/schemas/profileIdentity.cjs.map +1 -1
- package/dist/src/schemas/profileIdentity.d.mts +1 -1
- package/dist/src/schemas/profileIdentity.mjs +2 -2
- package/dist/src/schemas/profileIdentity.mjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.cjs +27 -0
- package/dist/src/schemas/protocolChannelsContract.cjs.map +1 -0
- package/dist/src/schemas/protocolChannelsContract.d.mts +37 -0
- package/dist/src/schemas/protocolChannelsContract.d.mts.map +1 -0
- package/dist/src/schemas/protocolChannelsContract.mjs +25 -0
- package/dist/src/schemas/protocolChannelsContract.mjs.map +1 -0
- package/dist/src/schemas/protocolContracts.cjs +168 -0
- package/dist/src/schemas/protocolContracts.cjs.map +1 -0
- package/dist/src/schemas/protocolContracts.d.mts +69 -0
- package/dist/src/schemas/protocolContracts.d.mts.map +1 -0
- package/dist/src/schemas/protocolContracts.mjs +164 -0
- package/dist/src/schemas/protocolContracts.mjs.map +1 -0
- package/dist/src/schemas/protocolHubContract.cjs +51 -0
- package/dist/src/schemas/protocolHubContract.cjs.map +1 -0
- package/dist/src/schemas/protocolHubContract.d.mts +218 -0
- package/dist/src/schemas/protocolHubContract.d.mts.map +1 -0
- package/dist/src/schemas/protocolHubContract.mjs +49 -0
- package/dist/src/schemas/protocolHubContract.mjs.map +1 -0
- package/dist/src/schemas/protocolSessionContract.cjs +22 -0
- package/dist/src/schemas/protocolSessionContract.cjs.map +1 -0
- package/dist/src/schemas/protocolSessionContract.d.mts +324 -0
- package/dist/src/schemas/protocolSessionContract.d.mts.map +1 -0
- package/dist/src/schemas/protocolSessionContract.mjs +22 -0
- package/dist/src/schemas/protocolSessionContract.mjs.map +1 -0
- package/dist/src/schemas/protocolThreadContract.cjs +21 -0
- package/dist/src/schemas/protocolThreadContract.cjs.map +1 -0
- package/dist/src/schemas/protocolThreadContract.d.mts +29 -0
- package/dist/src/schemas/protocolThreadContract.d.mts.map +1 -0
- package/dist/src/schemas/protocolThreadContract.mjs +20 -0
- package/dist/src/schemas/protocolThreadContract.mjs.map +1 -0
- package/dist/src/schemas/readiness.cjs +36 -36
- package/dist/src/schemas/readiness.cjs.map +1 -1
- package/dist/src/schemas/readiness.d.mts +37 -37
- package/dist/src/schemas/readiness.d.mts.map +1 -1
- package/dist/src/schemas/readiness.mjs +31 -31
- package/dist/src/schemas/readiness.mjs.map +1 -1
- package/dist/src/schemas/serverBundle.d.mts +5 -5
- package/dist/src/schemas/serverPlugin.cjs +103 -0
- package/dist/src/schemas/serverPlugin.cjs.map +1 -0
- package/dist/src/schemas/serverPlugin.d.mts +176 -0
- package/dist/src/schemas/serverPlugin.d.mts.map +1 -0
- package/dist/src/schemas/serverPlugin.mjs +95 -0
- package/dist/src/schemas/serverPlugin.mjs.map +1 -0
- package/dist/src/schemas/serverScope.cjs +37 -0
- package/dist/src/schemas/serverScope.cjs.map +1 -0
- package/dist/src/schemas/serverScope.d.mts +77 -0
- package/dist/src/schemas/serverScope.d.mts.map +1 -0
- package/dist/src/schemas/serverScope.mjs +33 -0
- package/dist/src/schemas/serverScope.mjs.map +1 -0
- package/dist/src/schemas/sessionApiContracts.cjs +320 -0
- package/dist/src/schemas/sessionApiContracts.cjs.map +1 -0
- package/dist/src/schemas/sessionApiContracts.mjs +318 -0
- package/dist/src/schemas/sessionApiContracts.mjs.map +1 -0
- package/dist/src/schemas/sessionProtocol.cjs +20 -13
- package/dist/src/schemas/sessionProtocol.cjs.map +1 -1
- package/dist/src/schemas/sessionProtocol.d.mts +37 -54
- package/dist/src/schemas/sessionProtocol.d.mts.map +1 -1
- package/dist/src/schemas/sessionProtocol.mjs +17 -8
- package/dist/src/schemas/sessionProtocol.mjs.map +1 -1
- package/dist/src/schemas/skills.cjs +16 -16
- package/dist/src/schemas/skills.cjs.map +1 -1
- package/dist/src/schemas/skills.d.mts +7 -7
- package/dist/src/schemas/skills.d.mts.map +1 -1
- package/dist/src/schemas/skills.mjs +12 -12
- package/dist/src/schemas/skills.mjs.map +1 -1
- package/dist/src/schemas/toolOverrides.cjs +9 -9
- package/dist/src/schemas/toolOverrides.cjs.map +1 -1
- package/dist/src/schemas/toolOverrides.d.mts +8 -8
- package/dist/src/schemas/toolOverrides.d.mts.map +1 -1
- package/dist/src/schemas/toolOverrides.mjs +7 -7
- package/dist/src/schemas/toolOverrides.mjs.map +1 -1
- package/dist/src/schemas/toolSurface.cjs +9 -9
- package/dist/src/schemas/toolSurface.cjs.map +1 -1
- package/dist/src/schemas/toolSurface.d.mts +13 -13
- package/dist/src/schemas/toolSurface.d.mts.map +1 -1
- package/dist/src/schemas/toolSurface.mjs +7 -7
- package/dist/src/schemas/toolSurface.mjs.map +1 -1
- package/dist/src/schemas/uiHub.cjs +9 -9
- package/dist/src/schemas/uiHub.cjs.map +1 -1
- package/dist/src/schemas/uiHub.d.mts +12 -12
- package/dist/src/schemas/uiHub.d.mts.map +1 -1
- package/dist/src/schemas/uiHub.mjs +7 -7
- package/dist/src/schemas/uiHub.mjs.map +1 -1
- package/dist/src/server/directHarnessRuntime.cjs +691 -775
- package/dist/src/server/directHarnessRuntime.cjs.map +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts +5 -1
- package/dist/src/server/directHarnessRuntime.d.mts.map +1 -0
- package/dist/src/server/directHarnessRuntime.mjs +671 -754
- package/dist/src/server/directHarnessRuntime.mjs.map +1 -1
- package/dist/src/server/largeFrameLink.cjs +47 -0
- package/dist/src/server/largeFrameLink.cjs.map +1 -0
- package/dist/src/server/largeFrameLink.mjs +47 -0
- package/dist/src/server/largeFrameLink.mjs.map +1 -0
- package/dist/src/server/liveImport.cjs +1 -1
- package/dist/src/server/liveImport.cjs.map +1 -1
- package/dist/src/server/liveImport.d.mts +1 -1
- package/dist/src/server/liveImport.mjs +1 -1
- package/dist/src/server/liveImport.mjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.cjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts +6 -6
- package/dist/src/server/mcpBundleLoader.d.mts.map +1 -1
- package/dist/src/server/mcpBundleLoader.mjs.map +1 -1
- package/dist/src/server/serverPackages.cjs +60 -0
- package/dist/src/server/serverPackages.cjs.map +1 -0
- package/dist/src/server/serverPackages.d.mts +44 -0
- package/dist/src/server/serverPackages.d.mts.map +1 -0
- package/dist/src/server/serverPackages.mjs +59 -0
- package/dist/src/server/serverPackages.mjs.map +1 -0
- package/dist/src/server/serverScope.cjs +510 -0
- package/dist/src/server/serverScope.cjs.map +1 -0
- package/dist/src/server/serverScope.d.mts +123 -0
- package/dist/src/server/serverScope.d.mts.map +1 -0
- package/dist/src/server/serverScope.mjs +510 -0
- package/dist/src/server/serverScope.mjs.map +1 -0
- package/dist/src/server/sessionMcpHandler.cjs +3 -3
- package/dist/src/server/sessionMcpHandler.cjs.map +1 -1
- package/dist/src/server/sessionMcpHandler.mjs +4 -4
- package/dist/src/server/sessionMcpHandler.mjs.map +1 -1
- package/dist/src/server/sessionMcpRoutes.cjs +2 -1
- package/dist/src/server/sessionMcpRoutes.cjs.map +1 -1
- package/dist/src/server/sessionMcpRoutes.mjs +2 -1
- package/dist/src/server/sessionMcpRoutes.mjs.map +1 -1
- package/dist/src/server/threadJournals.cjs +38 -107
- package/dist/src/server/threadJournals.cjs.map +1 -1
- package/dist/src/server/threadJournals.mjs +38 -104
- package/dist/src/server/threadJournals.mjs.map +1 -1
- package/dist/src/services/apiSurfaceAssert/index.cjs +1 -1
- package/dist/src/services/apiSurfaceAssert/index.cjs.map +1 -1
- package/dist/src/services/apiSurfaceAssert/index.d.mts +6 -6
- package/dist/src/services/apiSurfaceAssert/index.mjs +1 -1
- package/dist/src/services/apiSurfaceAssert/index.mjs.map +1 -1
- package/dist/src/services/chatgptAuth/index.cjs +1 -220
- package/dist/src/services/chatgptAuth/index.cjs.map +1 -1
- package/dist/src/services/chatgptAuth/index.d.mts +0 -18
- package/dist/src/services/chatgptAuth/index.d.mts.map +1 -1
- package/dist/src/services/chatgptAuth/index.mjs +1 -217
- package/dist/src/services/chatgptAuth/index.mjs.map +1 -1
- package/dist/src/services/chatgptImages/index.cjs +1 -1
- package/dist/src/services/chatgptImages/index.cjs.map +1 -1
- package/dist/src/services/chatgptImages/index.mjs +1 -1
- package/dist/src/services/chatgptImages/index.mjs.map +1 -1
- package/dist/src/services/chatgptLogin/index.cjs +230 -0
- package/dist/src/services/chatgptLogin/index.cjs.map +1 -0
- package/dist/src/services/chatgptLogin/index.d.mts +21 -0
- package/dist/src/services/chatgptLogin/index.d.mts.map +1 -0
- package/dist/src/services/chatgptLogin/index.mjs +227 -0
- package/dist/src/services/chatgptLogin/index.mjs.map +1 -0
- package/dist/src/services/chatgptWebSearch/index.cjs +1 -1
- package/dist/src/services/chatgptWebSearch/index.cjs.map +1 -1
- package/dist/src/services/chatgptWebSearch/index.mjs +1 -1
- package/dist/src/services/chatgptWebSearch/index.mjs.map +1 -1
- package/dist/src/services/contextContributions/index.cjs +8 -8
- package/dist/src/services/contextContributions/index.cjs.map +1 -1
- package/dist/src/services/contextContributions/index.d.mts +3 -3
- package/dist/src/services/contextContributions/index.d.mts.map +1 -1
- package/dist/src/services/contextContributions/index.mjs +8 -8
- package/dist/src/services/contextContributions/index.mjs.map +1 -1
- package/dist/src/services/devProxyStore/devProxyRecords.cjs +59 -0
- package/dist/src/services/devProxyStore/devProxyRecords.cjs.map +1 -0
- package/dist/src/services/devProxyStore/devProxyRecords.mjs +56 -0
- package/dist/src/services/devProxyStore/devProxyRecords.mjs.map +1 -0
- package/dist/src/services/devProxyStore/index.cjs +7 -101
- package/dist/src/services/devProxyStore/index.cjs.map +1 -1
- package/dist/src/services/devProxyStore/index.mjs +7 -101
- package/dist/src/services/devProxyStore/index.mjs.map +1 -1
- package/dist/src/services/devProxyStore/sync.cjs +66 -0
- package/dist/src/services/devProxyStore/sync.cjs.map +1 -0
- package/dist/src/services/devProxyStore/sync.mjs +63 -0
- package/dist/src/services/devProxyStore/sync.mjs.map +1 -0
- package/dist/src/services/durableNavigation/docs.cjs +15 -0
- package/dist/src/services/durableNavigation/docs.cjs.map +1 -0
- package/dist/src/services/durableNavigation/docs.mjs +16 -0
- package/dist/src/services/durableNavigation/docs.mjs.map +1 -0
- package/dist/src/services/durableNavigation/index.cjs +3 -18
- package/dist/src/services/durableNavigation/index.cjs.map +1 -1
- package/dist/src/services/durableNavigation/index.mjs +2 -17
- package/dist/src/services/durableNavigation/index.mjs.map +1 -1
- package/dist/src/services/durableQueue/docs.cjs +12 -0
- package/dist/src/services/durableQueue/docs.cjs.map +1 -0
- package/dist/src/services/durableQueue/docs.mjs +13 -0
- package/dist/src/services/durableQueue/docs.mjs.map +1 -0
- package/dist/src/services/durableQueue/index.cjs +151 -0
- package/dist/src/services/durableQueue/index.cjs.map +1 -0
- package/dist/src/services/durableQueue/index.mjs +149 -0
- package/dist/src/services/durableQueue/index.mjs.map +1 -0
- package/dist/src/services/durableRequestReceipts/docs.cjs +11 -0
- package/dist/src/services/durableRequestReceipts/docs.cjs.map +1 -0
- package/dist/src/services/durableRequestReceipts/docs.mjs +12 -0
- package/dist/src/services/durableRequestReceipts/docs.mjs.map +1 -0
- package/dist/src/services/{requestReceipts → durableRequestReceipts}/index.cjs +10 -16
- package/dist/src/services/durableRequestReceipts/index.cjs.map +1 -0
- package/dist/src/services/durableRequestReceipts/index.d.mts +12 -0
- package/dist/src/services/durableRequestReceipts/index.d.mts.map +1 -0
- package/dist/src/services/{requestReceipts → durableRequestReceipts}/index.mjs +7 -13
- package/dist/src/services/durableRequestReceipts/index.mjs.map +1 -0
- package/dist/src/services/durableSession/docs.cjs +65 -0
- package/dist/src/services/durableSession/docs.cjs.map +1 -0
- package/dist/src/services/durableSession/docs.d.mts +17 -0
- package/dist/src/services/durableSession/docs.d.mts.map +1 -0
- package/dist/src/services/durableSession/docs.mjs +60 -0
- package/dist/src/services/durableSession/docs.mjs.map +1 -0
- package/dist/src/services/durableSession/index.cjs +21 -0
- package/dist/src/services/durableSession/index.cjs.map +1 -0
- package/dist/src/services/durableSession/index.d.mts +13 -0
- package/dist/src/services/durableSession/index.d.mts.map +1 -0
- package/dist/src/services/durableSession/index.mjs +20 -0
- package/dist/src/services/durableSession/index.mjs.map +1 -0
- package/dist/src/services/durableSubagents/docs.cjs +15 -0
- package/dist/src/services/durableSubagents/docs.cjs.map +1 -0
- package/dist/src/services/durableSubagents/docs.mjs +16 -0
- package/dist/src/services/durableSubagents/docs.mjs.map +1 -0
- package/dist/src/services/durableSubagents/extension.cjs +11 -0
- package/dist/src/services/durableSubagents/extension.cjs.map +1 -0
- package/dist/src/services/durableSubagents/extension.mjs +12 -0
- package/dist/src/services/durableSubagents/extension.mjs.map +1 -0
- package/dist/src/services/durableSubagents/index.cjs +95 -0
- package/dist/src/services/durableSubagents/index.cjs.map +1 -0
- package/dist/src/services/durableSubagents/index.mjs +90 -0
- package/dist/src/services/durableSubagents/index.mjs.map +1 -0
- package/dist/src/services/durableSubagents/tasks.cjs +25 -0
- package/dist/src/services/durableSubagents/tasks.cjs.map +1 -0
- package/dist/src/services/durableSubagents/tasks.mjs +26 -0
- package/dist/src/services/durableSubagents/tasks.mjs.map +1 -0
- package/dist/src/services/headlessClient/index.cjs +20 -13
- package/dist/src/services/headlessClient/index.cjs.map +1 -1
- package/dist/src/services/headlessClient/index.mjs +21 -14
- package/dist/src/services/headlessClient/index.mjs.map +1 -1
- package/dist/src/services/historyOwnership/type.d.mts +15 -0
- package/dist/src/services/historyOwnership/type.d.mts.map +1 -0
- package/dist/src/services/hubChannelHarness/index.cjs +2 -2
- package/dist/src/services/hubChannelHarness/index.cjs.map +1 -1
- package/dist/src/services/hubChannelHarness/index.d.mts +8 -8
- package/dist/src/services/hubChannelHarness/index.d.mts.map +1 -1
- package/dist/src/services/hubChannelHarness/index.mjs +2 -2
- package/dist/src/services/hubChannelHarness/index.mjs.map +1 -1
- package/dist/src/services/json/core.cjs +30 -0
- package/dist/src/services/json/core.cjs.map +1 -0
- package/dist/src/services/json/core.d.mts +21 -0
- package/dist/src/services/json/core.d.mts.map +1 -0
- package/dist/src/services/json/core.mjs +26 -0
- package/dist/src/services/json/core.mjs.map +1 -0
- package/dist/src/services/json/sync.cjs +48 -0
- package/dist/src/services/json/sync.cjs.map +1 -0
- package/dist/src/services/json/sync.d.mts +22 -0
- package/dist/src/services/json/sync.d.mts.map +1 -0
- package/dist/src/services/json/sync.mjs +43 -0
- package/dist/src/services/json/sync.mjs.map +1 -0
- package/dist/src/services/kernel/index.cjs +2 -2
- package/dist/src/services/kernel/index.cjs.map +1 -1
- package/dist/src/services/kernel/index.d.mts +3 -3
- package/dist/src/services/kernel/index.d.mts.map +1 -1
- package/dist/src/services/kernel/index.mjs +2 -2
- package/dist/src/services/kernel/index.mjs.map +1 -1
- package/dist/src/services/nativeChildTools/index.cjs +16 -0
- package/dist/src/services/nativeChildTools/index.cjs.map +1 -0
- package/dist/src/services/nativeChildTools/index.mjs +16 -0
- package/dist/src/services/nativeChildTools/index.mjs.map +1 -0
- package/dist/src/services/nodeHost/index.cjs +30 -0
- package/dist/src/services/nodeHost/index.cjs.map +1 -0
- package/dist/src/services/nodeHost/index.d.mts +16 -0
- package/dist/src/services/nodeHost/index.d.mts.map +1 -0
- package/dist/src/services/nodeHost/index.mjs +27 -0
- package/dist/src/services/nodeHost/index.mjs.map +1 -0
- package/dist/src/services/nodeModelDependencies/index.cjs +89 -0
- package/dist/src/services/nodeModelDependencies/index.cjs.map +1 -0
- package/dist/src/services/nodeModelDependencies/index.mjs +86 -0
- package/dist/src/services/nodeModelDependencies/index.mjs.map +1 -0
- package/dist/src/services/openSessionRegistry/index.cjs +6 -128
- package/dist/src/services/openSessionRegistry/index.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.d.mts +5 -36
- package/dist/src/services/openSessionRegistry/index.mjs +6 -128
- package/dist/src/services/openSessionRegistry/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs +87 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs.map +1 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts +30 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts.map +1 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs +81 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs.map +1 -0
- package/dist/src/services/openSessionRegistry/sync.cjs +71 -0
- package/dist/src/services/openSessionRegistry/sync.cjs.map +1 -0
- package/dist/src/services/openSessionRegistry/sync.d.mts +14 -0
- package/dist/src/services/openSessionRegistry/sync.d.mts.map +1 -0
- package/dist/src/services/openSessionRegistry/sync.mjs +68 -0
- package/dist/src/services/openSessionRegistry/sync.mjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.cjs +1 -1
- package/dist/src/services/packageApiHarness/index.cjs.map +1 -1
- package/dist/src/services/packageApiHarness/index.d.mts +6 -6
- package/dist/src/services/packageApiHarness/index.d.mts.map +1 -1
- package/dist/src/services/packageApiHarness/index.mjs +2 -2
- package/dist/src/services/packageApiHarness/index.mjs.map +1 -1
- package/dist/src/services/piArgs/index.cjs +53 -0
- package/dist/src/services/piArgs/index.cjs.map +1 -0
- package/dist/src/services/piArgs/index.d.mts +6 -0
- package/dist/src/services/piArgs/index.d.mts.map +1 -0
- package/dist/src/services/piArgs/index.mjs +53 -0
- package/dist/src/services/piArgs/index.mjs.map +1 -0
- package/dist/src/services/piExtensionHost/index.cjs +47 -39
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.d.mts +83 -0
- package/dist/src/services/piExtensionHost/index.d.mts.map +1 -0
- package/dist/src/services/piExtensionHost/index.mjs +47 -38
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
- package/dist/src/services/piHelpTools/index.cjs +5 -5
- package/dist/src/services/piHelpTools/index.cjs.map +1 -1
- package/dist/src/services/piHelpTools/index.d.mts.map +1 -1
- package/dist/src/services/piHelpTools/index.mjs +7 -7
- package/dist/src/services/piHelpTools/index.mjs.map +1 -1
- package/dist/src/services/piMessages/index.cjs +106 -0
- package/dist/src/services/piMessages/index.cjs.map +1 -0
- package/dist/src/services/piMessages/index.mjs +105 -0
- package/dist/src/services/piMessages/index.mjs.map +1 -0
- package/dist/src/services/piSessionEntries/index.cjs +4 -4
- package/dist/src/services/piSessionEntries/index.cjs.map +1 -1
- package/dist/src/services/piSessionEntries/index.mjs +3 -3
- package/dist/src/services/piSessionEntries/index.mjs.map +1 -1
- package/dist/src/services/piSettings/core.cjs +308 -0
- package/dist/src/services/piSettings/core.cjs.map +1 -0
- package/dist/src/services/piSettings/core.d.mts +102 -0
- package/dist/src/services/piSettings/core.d.mts.map +1 -0
- package/dist/src/services/piSettings/core.mjs +276 -0
- package/dist/src/services/piSettings/core.mjs.map +1 -0
- package/dist/src/services/piSettings/sync.cjs +119 -0
- package/dist/src/services/piSettings/sync.cjs.map +1 -0
- package/dist/src/services/piSettings/sync.d.mts +44 -0
- package/dist/src/services/piSettings/sync.d.mts.map +1 -0
- package/dist/src/services/piSettings/sync.mjs +110 -0
- package/dist/src/services/piSettings/sync.mjs.map +1 -0
- package/dist/src/services/piSummary/index.cjs +7 -0
- package/dist/src/services/piSummary/index.cjs.map +1 -0
- package/dist/src/services/piSummary/index.mjs +7 -0
- package/dist/src/services/piSummary/index.mjs.map +1 -0
- package/dist/src/services/platformFiles/index.cjs +44 -0
- package/dist/src/services/platformFiles/index.cjs.map +1 -0
- package/dist/src/services/platformFiles/index.d.mts +16 -0
- package/dist/src/services/platformFiles/index.d.mts.map +1 -0
- package/dist/src/services/platformFiles/index.mjs +39 -0
- package/dist/src/services/platformFiles/index.mjs.map +1 -0
- package/dist/src/services/pluginLifecycle/index.cjs +19 -13
- package/dist/src/services/pluginLifecycle/index.cjs.map +1 -1
- package/dist/src/services/pluginLifecycle/index.d.mts +2 -0
- package/dist/src/services/pluginLifecycle/index.d.mts.map +1 -1
- package/dist/src/services/pluginLifecycle/index.mjs +19 -14
- package/dist/src/services/pluginLifecycle/index.mjs.map +1 -1
- package/dist/src/services/poPackage/core.cjs +73 -0
- package/dist/src/services/poPackage/core.cjs.map +1 -0
- package/dist/src/services/poPackage/core.d.mts +32 -0
- package/dist/src/services/poPackage/core.d.mts.map +1 -0
- package/dist/src/services/poPackage/core.mjs +66 -0
- package/dist/src/services/poPackage/core.mjs.map +1 -0
- package/dist/src/services/poPackage/sync.cjs +55 -0
- package/dist/src/services/poPackage/sync.cjs.map +1 -0
- package/dist/src/services/poPackage/sync.d.mts +21 -0
- package/dist/src/services/poPackage/sync.d.mts.map +1 -0
- package/dist/src/services/poPackage/sync.mjs +50 -0
- package/dist/src/services/poPackage/sync.mjs.map +1 -0
- package/dist/src/services/providerAuth/index.cjs +11 -7
- package/dist/src/services/providerAuth/index.cjs.map +1 -1
- package/dist/src/services/providerAuth/index.mjs +11 -7
- package/dist/src/services/providerAuth/index.mjs.map +1 -1
- package/dist/src/services/publicFileShares/index.cjs +1 -1
- package/dist/src/services/publicFileShares/index.cjs.map +1 -1
- package/dist/src/services/publicFileShares/index.d.mts +2 -2
- package/dist/src/services/publicFileShares/index.mjs +2 -2
- package/dist/src/services/publicFileShares/index.mjs.map +1 -1
- package/dist/src/services/remoteAccess/index.d.mts +1 -0
- package/dist/src/services/remoteAccess/index.d.mts.map +1 -1
- package/dist/src/services/remoteAccessStore/index.cjs +8 -190
- package/dist/src/services/remoteAccessStore/index.cjs.map +1 -1
- package/dist/src/services/remoteAccessStore/index.d.mts +2 -0
- package/dist/src/services/remoteAccessStore/index.mjs +7 -187
- package/dist/src/services/remoteAccessStore/index.mjs.map +1 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +98 -0
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +1 -0
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +88 -0
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +1 -0
- package/dist/src/services/remoteAccessStore/sync.cjs +111 -0
- package/dist/src/services/remoteAccessStore/sync.cjs.map +1 -0
- package/dist/src/services/remoteAccessStore/sync.mjs +108 -0
- package/dist/src/services/remoteAccessStore/sync.mjs.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.cjs +23 -0
- package/dist/src/services/runtimeIdentity/sync.cjs.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.d.mts +9 -0
- package/dist/src/services/runtimeIdentity/sync.d.mts.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.mjs +20 -0
- package/dist/src/services/runtimeIdentity/sync.mjs.map +1 -0
- package/dist/src/services/serialRunner/index.cjs +25 -0
- package/dist/src/services/serialRunner/index.cjs.map +1 -0
- package/dist/src/services/serialRunner/index.d.mts +10 -0
- package/dist/src/services/serialRunner/index.d.mts.map +1 -0
- package/dist/src/services/serialRunner/index.mjs +25 -0
- package/dist/src/services/serialRunner/index.mjs.map +1 -0
- package/dist/src/services/{serverFacet → serverHost}/index.cjs +5 -5
- package/dist/src/services/serverHost/index.cjs.map +1 -0
- package/dist/src/services/serverHost/index.d.mts +31 -0
- package/dist/src/services/serverHost/index.d.mts.map +1 -0
- package/dist/src/services/{serverFacet → serverHost}/index.mjs +5 -5
- package/dist/src/services/serverHost/index.mjs.map +1 -0
- package/dist/src/services/sessionAttachments/index.cjs +4 -3
- package/dist/src/services/sessionAttachments/index.cjs.map +1 -1
- package/dist/src/services/sessionAttachments/index.d.mts +1 -6
- package/dist/src/services/sessionAttachments/index.d.mts.map +1 -1
- package/dist/src/services/sessionAttachments/index.mjs +3 -2
- package/dist/src/services/sessionAttachments/index.mjs.map +1 -1
- package/dist/src/services/sessionAttachments/type.d.mts +9 -0
- package/dist/src/services/sessionAttachments/type.d.mts.map +1 -0
- package/dist/src/services/sessionFiles/index.cjs +96 -0
- package/dist/src/services/sessionFiles/index.cjs.map +1 -0
- package/dist/src/services/sessionFiles/index.d.mts +33 -0
- package/dist/src/services/sessionFiles/index.d.mts.map +1 -0
- package/dist/src/services/sessionFiles/index.mjs +89 -0
- package/dist/src/services/sessionFiles/index.mjs.map +1 -0
- package/dist/src/services/sessionFiles/sessionDirectory.cjs +66 -0
- package/dist/src/services/sessionFiles/sessionDirectory.cjs.map +1 -0
- package/dist/src/services/sessionFiles/sessionDirectory.mjs +62 -0
- package/dist/src/services/sessionFiles/sessionDirectory.mjs.map +1 -0
- package/dist/src/services/sessionGitStatus/index.cjs +31 -33
- package/dist/src/services/sessionGitStatus/index.cjs.map +1 -1
- package/dist/src/services/sessionGitStatus/index.mjs +31 -33
- package/dist/src/services/sessionGitStatus/index.mjs.map +1 -1
- package/dist/src/services/sessionPresentation/index.cjs +3 -27
- package/dist/src/services/sessionPresentation/index.cjs.map +1 -1
- package/dist/src/services/sessionPresentation/index.mjs +3 -27
- package/dist/src/services/sessionPresentation/index.mjs.map +1 -1
- package/dist/src/services/skillPrompt/index.cjs +11 -0
- package/dist/src/services/skillPrompt/index.cjs.map +1 -0
- package/dist/src/services/skillPrompt/index.mjs +11 -0
- package/dist/src/services/skillPrompt/index.mjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs +44 -30
- package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.d.mts +7 -4
- package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.mjs +43 -28
- package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.cjs +21 -45
- package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.d.mts +3 -2
- package/dist/src/services/sqliteTranscriptReader/index.d.mts.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.mjs +16 -38
- package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -1
- package/dist/src/services/testMode/index.cjs +162 -0
- package/dist/src/services/testMode/index.cjs.map +1 -0
- package/dist/src/services/testMode/index.d.mts +17 -0
- package/dist/src/services/testMode/index.d.mts.map +1 -0
- package/dist/src/services/testMode/index.mjs +155 -0
- package/dist/src/services/testMode/index.mjs.map +1 -0
- package/dist/src/services/toolOverrides/index.cjs +6 -6
- package/dist/src/services/toolOverrides/index.cjs.map +1 -1
- package/dist/src/services/toolOverrides/index.d.mts +3 -3
- package/dist/src/services/toolOverrides/index.d.mts.map +1 -1
- package/dist/src/services/toolOverrides/index.mjs +6 -6
- package/dist/src/services/toolOverrides/index.mjs.map +1 -1
- package/dist/src/services/toolPrompt/index.d.mts +17 -0
- package/dist/src/services/toolPrompt/index.d.mts.map +1 -0
- package/dist/src/services/toolSurface/index.cjs +3 -3
- package/dist/src/services/toolSurface/index.cjs.map +1 -1
- package/dist/src/services/toolSurface/index.d.mts +3 -3
- package/dist/src/services/toolSurface/index.d.mts.map +1 -1
- package/dist/src/services/toolSurface/index.mjs +4 -4
- package/dist/src/services/toolSurface/index.mjs.map +1 -1
- 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 +159 -33
- package/dist/src/services/transcriptPages/index.cjs.map +1 -1
- package/dist/src/services/transcriptPages/index.mjs +158 -34
- package/dist/src/services/transcriptPages/index.mjs.map +1 -1
- package/dist/src/services/voiceToolsContract/index.cjs +7 -7
- package/dist/src/services/voiceToolsContract/index.cjs.map +1 -1
- package/dist/src/services/voiceToolsContract/index.d.mts +4 -4
- package/dist/src/services/voiceToolsContract/index.d.mts.map +1 -1
- package/dist/src/services/voiceToolsContract/index.mjs +7 -7
- package/dist/src/services/voiceToolsContract/index.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/index.cjs +9 -179
- package/dist/src/services/workspaceRegistry/index.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/index.d.mts +5 -47
- package/dist/src/services/workspaceRegistry/index.mjs +7 -176
- package/dist/src/services/workspaceRegistry/index.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.cjs +148 -0
- package/dist/src/services/workspaceRegistry/sync.cjs.map +1 -0
- package/dist/src/services/workspaceRegistry/sync.d.mts +34 -0
- package/dist/src/services/workspaceRegistry/sync.d.mts.map +1 -0
- package/dist/src/services/workspaceRegistry/sync.mjs +140 -0
- package/dist/src/services/workspaceRegistry/sync.mjs.map +1 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs +114 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs.map +1 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts +31 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts.map +1 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs +101 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +339 -202
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +16 -21
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +329 -191
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -1
- package/dist/src/systems/child/services/childSession/index.cjs +94 -20
- package/dist/src/systems/child/services/childSession/index.cjs.map +1 -1
- package/dist/src/systems/child/services/childSession/index.d.mts +12 -3
- package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -1
- package/dist/src/systems/child/services/childSession/index.mjs +94 -20
- package/dist/src/systems/child/services/childSession/index.mjs.map +1 -1
- package/dist/src/systems/child/types/childSession.cjs +33 -13
- package/dist/src/systems/child/types/childSession.cjs.map +1 -1
- package/dist/src/systems/child/types/childSession.d.mts +143 -80
- package/dist/src/systems/child/types/childSession.d.mts.map +1 -1
- package/dist/src/systems/child/types/childSession.mjs +24 -9
- package/dist/src/systems/child/types/childSession.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.cjs +30 -27
- package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.d.mts +22 -22
- package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.mjs +33 -30
- package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +248 -229
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +4 -5
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +239 -219
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/dist/src/systems/main/types/headlessHost.d.mts +16 -14
- package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -1
- package/dist/src/testing/pi/testHost.cjs +2 -2
- package/dist/src/testing/pi/testHost.cjs.map +1 -1
- package/dist/src/testing/pi/testHost.d.mts +3 -2
- package/dist/src/testing/pi/testHost.mjs +3 -3
- package/dist/src/testing/pi/testHost.mjs.map +1 -1
- package/dist/src/types/config.d.mts +1 -1
- package/dist/src/types/config.d.mts.map +1 -1
- package/dist/src/types/kernel.d.mts +3 -3
- package/dist/src/types/server/directHarnessRuntime.d.mts +54 -25
- package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/types/server/sessionToolSurface.d.mts +9 -9
- package/dist/src/web/services/apiClient/index.d.mts +1 -0
- 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.map +1 -1
- package/dist/src/web/services/mcpWidget.cjs.map +1 -1
- package/dist/src/web/services/mcpWidget.d.mts +2 -2
- package/dist/src/web/services/mcpWidget.d.mts.map +1 -1
- package/dist/src/web/services/mcpWidget.mjs.map +1 -1
- package/dist/src/web/services/testing/templateRail.cjs +3 -0
- package/dist/src/web/services/testing/templateRail.cjs.map +1 -1
- package/dist/src/web/services/testing/templateRail.mjs +3 -0
- package/dist/src/web/services/testing/templateRail.mjs.map +1 -1
- package/dist/src/web/types/mcpWidget.d.mts +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
- package/dist/src/web/types/template.d.mts +8 -0
- package/dist/src/web/types/template.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +17 -5
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/testMode.cjs +4 -0
- package/dist/testMode.d.mts +2 -0
- package/dist/testMode.mjs +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +2 -2
- package/dist/toolInventory.cjs.map +1 -1
- package/dist/toolInventory.mjs.map +1 -1
- package/dist/toolNames.mjs +1 -2
- package/dist/toolOverrides.cjs +4 -4
- package/dist/toolOverrides.d.mts +3 -3
- package/dist/toolOverrides.mjs +3 -3
- package/dist/toolSurface.cjs +4 -4
- package/dist/toolSurface.d.mts +3 -3
- package/dist/toolSurface.mjs +3 -3
- package/dist/transition.cjs +3 -3
- package/dist/transition.d.cjs +3 -3
- package/dist/transition.d.mts +2 -2
- package/dist/transition.mjs +1 -2
- package/dist/transitionClassifier.cjs.map +1 -1
- package/dist/transitionClassifier.d.mts +2 -2
- package/dist/transitionClassifier.d.mts.map +1 -1
- package/dist/transitionClassifier.mjs.map +1 -1
- package/dist/transitionCoordinator.cjs +3 -3
- package/dist/transitionCoordinator.cjs.map +1 -1
- package/dist/transitionCoordinator.d.mts +4 -4
- package/dist/transitionCoordinator.d.mts.map +1 -1
- package/dist/transitionCoordinator.mjs +3 -3
- package/dist/transitionCoordinator.mjs.map +1 -1
- package/dist/typesContextApi.d.mts +2 -1
- package/dist/typesContextApi.d.mts.map +1 -1
- package/dist/uiHub.cjs +3 -3
- package/dist/uiHub.d.mts +2 -2
- package/dist/uiHub.mjs +1 -2
- package/dist/voiceTools.cjs +5 -5
- package/dist/voiceTools.d.mts +3 -3
- package/dist/voiceTools.mjs +3 -3
- package/dist/web.cjs +8 -0
- package/dist/web.d.mts +3 -2
- package/dist/web.mjs +2 -1
- package/dist/webCompositions.cjs.map +1 -1
- package/dist/webCompositions.d.mts +7 -7
- package/dist/webCompositions.d.mts.map +1 -1
- package/dist/webCompositions.mjs.map +1 -1
- package/licenses/Codex-Apache-2.0.txt +201 -0
- package/package.json +58 -53
- package/dist/doomPackage.cjs +0 -61
- package/dist/doomPackage.cjs.map +0 -1
- package/dist/doomPackage.d.mts +0 -17
- package/dist/doomPackage.d.mts.map +0 -1
- package/dist/doomPackage.mjs +0 -54
- package/dist/doomPackage.mjs.map +0 -1
- package/dist/jsonlSessionRepo.cjs +0 -44
- package/dist/jsonlSessionRepo.cjs.map +0 -1
- package/dist/jsonlSessionRepo.d.mts +0 -7
- package/dist/jsonlSessionRepo.d.mts.map +0 -1
- package/dist/jsonlSessionRepo.mjs +0 -42
- package/dist/jsonlSessionRepo.mjs.map +0 -1
- package/dist/runtimeJson.cjs.map +0 -1
- package/dist/runtimeJson.d.mts.map +0 -1
- package/dist/runtimeJson.mjs.map +0 -1
- package/dist/runtimePiSettings.cjs.map +0 -1
- package/dist/runtimePiSettings.d.mts.map +0 -1
- package/dist/runtimePiSettings.mjs.map +0 -1
- package/dist/serverFacet.cjs +0 -34
- package/dist/serverFacet.d.mts +0 -10
- package/dist/serverFacet.mjs +0 -9
- package/dist/src/pi/piWebSocketListener.cjs +0 -115
- package/dist/src/pi/piWebSocketListener.cjs.map +0 -1
- package/dist/src/pi/piWebSocketListener.mjs +0 -115
- package/dist/src/pi/piWebSocketListener.mjs.map +0 -1
- package/dist/src/schemas/serverFacet.cjs +0 -111
- package/dist/src/schemas/serverFacet.cjs.map +0 -1
- package/dist/src/schemas/serverFacet.d.mts +0 -152
- package/dist/src/schemas/serverFacet.d.mts.map +0 -1
- package/dist/src/schemas/serverFacet.mjs +0 -101
- package/dist/src/schemas/serverFacet.mjs.map +0 -1
- package/dist/src/schemas/sessionUpdates.d.mts +0 -34
- package/dist/src/schemas/sessionUpdates.d.mts.map +0 -1
- package/dist/src/server/headlessProtocol.cjs +0 -382
- package/dist/src/server/headlessProtocol.cjs.map +0 -1
- package/dist/src/server/headlessProtocol.mjs +0 -382
- package/dist/src/server/headlessProtocol.mjs.map +0 -1
- package/dist/src/server/nativeChildTranscriptReader.cjs +0 -20
- package/dist/src/server/nativeChildTranscriptReader.cjs.map +0 -1
- package/dist/src/server/nativeChildTranscriptReader.mjs +0 -18
- package/dist/src/server/nativeChildTranscriptReader.mjs.map +0 -1
- package/dist/src/server/serverFacetLoader.cjs +0 -214
- package/dist/src/server/serverFacetLoader.cjs.map +0 -1
- package/dist/src/server/serverFacetLoader.d.mts +0 -72
- package/dist/src/server/serverFacetLoader.d.mts.map +0 -1
- package/dist/src/server/serverFacetLoader.mjs +0 -212
- package/dist/src/server/serverFacetLoader.mjs.map +0 -1
- package/dist/src/services/acpSessionUpdates/index.cjs +0 -129
- package/dist/src/services/acpSessionUpdates/index.cjs.map +0 -1
- package/dist/src/services/acpSessionUpdates/index.mjs +0 -129
- package/dist/src/services/acpSessionUpdates/index.mjs.map +0 -1
- package/dist/src/services/historyImport/index.cjs +0 -8
- package/dist/src/services/historyImport/index.cjs.map +0 -1
- package/dist/src/services/historyImport/index.d.mts +0 -68
- package/dist/src/services/historyImport/index.d.mts.map +0 -1
- package/dist/src/services/historyImport/index.mjs +0 -8
- package/dist/src/services/historyImport/index.mjs.map +0 -1
- package/dist/src/services/openSessionRegistry/index.d.mts.map +0 -1
- package/dist/src/services/requestReceipts/index.cjs.map +0 -1
- package/dist/src/services/requestReceipts/index.d.mts +0 -11
- package/dist/src/services/requestReceipts/index.d.mts.map +0 -1
- package/dist/src/services/requestReceipts/index.mjs.map +0 -1
- package/dist/src/services/rpcTranscript/index.cjs +0 -633
- package/dist/src/services/rpcTranscript/index.cjs.map +0 -1
- package/dist/src/services/rpcTranscript/index.d.mts +0 -50
- package/dist/src/services/rpcTranscript/index.d.mts.map +0 -1
- package/dist/src/services/rpcTranscript/index.mjs +0 -632
- package/dist/src/services/rpcTranscript/index.mjs.map +0 -1
- package/dist/src/services/serverFacet/index.cjs.map +0 -1
- package/dist/src/services/serverFacet/index.d.mts +0 -31
- package/dist/src/services/serverFacet/index.d.mts.map +0 -1
- package/dist/src/services/serverFacet/index.mjs.map +0 -1
- package/dist/src/services/workspaceRegistry/index.d.mts.map +0 -1
- package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs +0 -28
- package/dist/src/systems/child/adapters/nativeChildRuntimes.cjs.map +0 -1
- package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs +0 -25
- package/dist/src/systems/child/adapters/nativeChildRuntimes.mjs.map +0 -1
- package/dist/terminalPiChildSessionService.cjs +0 -324
- package/dist/terminalPiChildSessionService.cjs.map +0 -1
- package/dist/terminalPiChildSessionService.d.mts +0 -46
- package/dist/terminalPiChildSessionService.d.mts.map +0 -1
- package/dist/terminalPiChildSessionService.mjs +0 -318
- package/dist/terminalPiChildSessionService.mjs.map +0 -1
- package/dist/v3Export.cjs +0 -10
- package/dist/v3Export.cjs.map +0 -1
- package/dist/v3Export.d.mts +0 -35
- package/dist/v3Export.d.mts.map +0 -1
- package/dist/v3Export.mjs +0 -9
- package/dist/v3Export.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageApi.cjs","names":[],"sources":["../../../src/schemas/packageApi.ts"],"sourcesContent":["/**\n * The HTTP surface a package offers its host.\n *\n * A server facet registers one with its host. The host mounts it under the API\n * route prefix, and the package writes routes relative to that mount.\n *\n * The handler is a plain fetch callback so no host and no package is committed\n * to one HTTP framework; a Hono app satisfies it through `app.fetch`.\n */\n\nimport type {\n DoomComputerUseSessionAccess,\n DoomDirectEventBus,\n DoomHubSessionService,\n DoomSessionCommunicationEndpoint,\n DoomSessionActivity,\n DoomSessionContext,\n} from './hubChannel';\nimport type { DoomMcpProjection } from './mcpProjection';\n/** The host-owned sync view a repository-scoped package API may inspect. */\nexport interface DoomRepositorySyncView {\n fresh: boolean;\n reasons: string[];\n /** True while a background sync that may prepare what `reasons` names is running. */\n syncing?: boolean;\n mcpProjection?: DoomMcpProjection;\n}\n\n/** Where an API runs: inside one session's server, or in the machine-wide hub. */\nexport type DoomApiScope = 'global' | 'workspace' | 'session';\n\nexport const DOOM_API_SCOPES: readonly DoomApiScope[] = ['global', 'workspace', 'session'];\n\n/** Identity of an independently mounted plugin host. */\nexport type DoomApiMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; sessionId: string };\n\n/** Immutable browser contribution generation paired with a server mount. */\nexport interface DoomWebComposition {\n id: string;\n scope: DoomApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n verifiedAssetBaseUrl: string;\n /** `[slot, entry]` for each of this mount's plugin copies, the entry an absolute path below the asset prefixes. */\n pluginEntries: [string, string][];\n /** Every signed file this mount's slots can load, absolute below the asset prefixes. */\n assetPaths: string[];\n /** Per-plugin stylesheets of this mount's plugins only, so other mounts' classes never apply here. */\n stylePaths: string[];\n channels: string[];\n /** The slots resolved for this mount; the shared build may hold more. */\n plugins: string[];\n}\n\n/**\n * Immutable native contribution generation paired with a server mount. One signed CommonJS module at\n * `entryPath`, served through the same immutable plugin routes as web compositions.\n */\nexport interface DoomNativeComposition {\n id: string;\n scope: DoomApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n /** Always `/composition.js`. */\n entryPath: string;\n channels: string[];\n /** The `poNative.pluginId` values resolved for this mount; the shell installs only these. */\n plugins: string[];\n}\n\n/** Canonical public prefix. Scope selection never falls through to a parent. */\nexport function doomApiMountPath(mount: DoomApiMount & { workspaceId?: string }): string {\n if (mount.scope === 'global') return '/api/plugins';\n if (mount.scope === 'workspace') return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;\n if (!mount.workspaceId) throw new Error('A session API path requires its workspace identity.');\n return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;\n}\n\n/** Scope addressed by a public WebSocket upgrade. */\nexport type DoomSocketMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; workspaceId: string; sessionId: string };\n\n/** Only canonical resource paths may select a protocol listener. */\nexport function parseDoomSocketPath(pathname: string): DoomSocketMount | undefined {\n if (pathname === '/api/ws') return { scope: 'global' };\n const match = /^\\/api\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?\\/ws$/u.exec(pathname);\n if (!match) return undefined;\n try {\n const workspaceId = decodeURIComponent(match[1]);\n return match[2] === undefined\n ? { scope: 'workspace', workspaceId }\n : { scope: 'session', workspaceId, sessionId: decodeURIComponent(match[2]) };\n } catch {\n return undefined;\n }\n}\n\n/** The segment an API is mounted under, below this prefix. */\nexport const DOOM_API_ROUTE_PREFIX = '/api/plugins';\n/** Selects the hub API bundle that owns the named cockpit session. */\nexport const DOOM_HUB_API_SESSION_QUERY_PARAM = 'hubSession';\n\n/** Trusted caller headers written only by the cockpit-to-session proxy. */\nexport const DOOM_API_CALLER_LOCALITY_HEADER = 'x-po-api-caller-locality';\nexport const DOOM_API_CALLER_DEVICE_ID_HEADER = 'x-po-api-caller-device-id';\nexport const DOOM_API_CALLER_STEP_UP_HEADER = 'x-po-api-caller-step-up';\nexport const DOOM_API_CALLER_HEADERS = [\n DOOM_API_CALLER_LOCALITY_HEADER,\n DOOM_API_CALLER_DEVICE_ID_HEADER,\n DOOM_API_CALLER_STEP_UP_HEADER,\n] as const;\n\nexport type DoomApiCallerStepUp = 'not-required' | 'verified' | 'unavailable';\nexport type DoomApiCaller =\n | { locality: 'local'; stepUp: 'not-required' }\n | { locality: 'remote'; deviceId: string; stepUp: DoomApiCallerStepUp };\n\n/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */\nexport function doomApiCallerFrom(headers: Headers): DoomApiCaller | undefined {\n const locality = headers.get(DOOM_API_CALLER_LOCALITY_HEADER);\n const deviceId = headers.get(DOOM_API_CALLER_DEVICE_ID_HEADER);\n const stepUp = headers.get(DOOM_API_CALLER_STEP_UP_HEADER);\n if (locality === 'local') {\n return deviceId === null && stepUp === 'not-required' ? { locality, stepUp } : undefined;\n }\n if (\n locality === 'remote' &&\n deviceId !== null &&\n deviceId !== '' &&\n (stepUp === 'not-required' || stepUp === 'verified' || stepUp === 'unavailable')\n ) {\n return { locality, deviceId, stepUp };\n }\n return undefined;\n}\n/**\n * A browser-reachable OAuth redirect the host serves on its own listener.\n *\n * A package brokering third-party OAuth cannot use a loopback redirect when the\n * operator's browser is on another machine: `127.0.0.1` resolves to whichever\n * machine the browser runs on. The host owns a listener that is reachable from\n * wherever the cockpit is being used, so it lends that instead of the package\n * opening a port of its own.\n */\nexport interface DoomOAuthRedirect {\n /** Absolute URL to register as the redirect target, already origin-correct. */\n readonly redirectUri: string;\n /**\n * Accept redirects carrying this state. Must complete before the\n * authorization URL is surfaced, or the redirect races its own reservation.\n */\n reserve(state: string, timeoutMs?: number): Promise<void>;\n /** Resolves once the redirect carrying this state arrives. */\n wait(state: string, timeoutMs?: number): Promise<{ code: string; state: string }>;\n /** Drops a reservation whose flow ended without a redirect. */\n cancel(state: string): void;\n}\n\n/** An exact, host-owned receipt address. Provider IDs are not event cursor positions. */\nexport interface DoomRequestReceiptKey {\n namespace: string;\n activationId: string;\n requestId: string;\n}\n\nexport interface DoomRequestReceipt extends DoomRequestReceiptKey {\n fingerprint: string;\n destination: string;\n transactionId: string;\n outcome: 'reserved' | 'admitted' | 'rejected' | 'uncertain';\n}\n\nexport interface DoomRequestReceiptReservation extends DoomRequestReceiptKey {\n /** Lowercase SHA-256 of the authoritative request text, never the full transcript. */\n fingerprint: string;\n destination: string;\n transactionId: string;\n}\n\nexport type DoomRequestReceiptReserveResult =\n | { kind: 'reserved'; token: string }\n | { kind: 'existing'; receipt: DoomRequestReceipt }\n | { kind: 'conflict'; receipt: DoomRequestReceipt };\n\n/** A global-only receipt capability. A reservation is not an execution receipt. */\nexport interface DoomRequestReceipts {\n reserve(request: DoomRequestReceiptReservation): Promise<DoomRequestReceiptReserveResult>;\n lookup(key: DoomRequestReceiptKey): Promise<DoomRequestReceipt | undefined>;\n finish(\n request: DoomRequestReceiptKey & { token: string; outcome: 'admitted' | 'rejected' | 'uncertain' },\n ): Promise<DoomRequestReceipt>;\n}\n\n/** Permit returned for expensive local work. Calling it releases the slot. */\nexport interface DoomHostExecutionPermit {\n (): void;\n attachProcess?(pid: number): Promise<void>;\n}\n\n/** Host-wide admission for expensive local work. Release only after the owned process exits. */\nexport interface DoomHostExecutionBudget {\n acquire(signal?: AbortSignal): Promise<DoomHostExecutionPermit>;\n getSnapshot(): Readonly<{ running: number; queued: number; limit: number }>;\n}\n\n/** Synchronous host-owned exclusion across media APIs mounted at different scopes. */\nexport interface DoomHostMediaArbitration {\n register(busy: () => boolean): () => void;\n available(busy: () => boolean): boolean;\n}\n\n/** One host's paired agent registrations, shared across its global and session mounts. */\nexport interface DoomPeerAgentRegistry {\n register(sessionId: string, agent: { fetch(request: Request): Promise<Response> }, hubToken: string): () => void;\n get(sessionId: string): { fetch(request: Request): Promise<Response>; hubToken: string } | undefined;\n}\n\n/** Why shareFile rejects while the host has no public tunnel origin. */\nexport const DOOM_SHARE_FILE_REMOTE_OFF_MESSAGE =\n 'Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.';\n\n/**\n * A file published at a short-lived public tunnel URL: 10 minutes, 3 downloads, and gone\n * when the tunnel revision changes. Call revoke as soon as the consumer is done with it.\n */\nexport interface DoomSharedFile {\n /** Bearer link; never log or persist it. */\n url: string;\n fileName: string;\n mimeType: string;\n size: number;\n /** Expiry as epoch milliseconds. */\n expiresAt: number;\n maxDownloads: number;\n /** Idempotent. */\n revoke(): void;\n}\n\n/** What the host tells an API about itself when it starts. */\nexport interface DoomApiContext {\n scope: DoomApiScope;\n /** Stable, opaque workspace id, shared by every session and member checkout of the workspace. */\n workspaceId?: string;\n /**\n * The admitted workspace root for a workspace mount. For a session mount it is the checkout\n * the session runs in; read sessionContext for both roots. Absent from global mounts.\n */\n workspaceRoot?: string;\n /** The session's baseline context; present on session mounts whose host knows its workspace. */\n sessionContext?: DoomSessionContext;\n /** Explicit host home, never selected by a remote request. */\n homeDirectory?: string;\n /** The session this host serves; absent for a hub-scoped API. */\n sessionId?: string;\n /** The session's working directory; absent for a hub-scoped API. */\n cwd?: string;\n /** Session environment admitted by the server, never supplied by remote clients. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** Shared only with child processes in this session, never with remote API clients. */\n internalToken?: string;\n /** Shared only with the cockpit hub for privileged cross-session coordination. */\n hubToken?: string;\n /**\n * Resolves a hub-issued opaque repository id to an admitted canonical root.\n * Hub APIs must never accept a browser-supplied filesystem path instead.\n */\n resolveRepository?(repositoryId: string): string | undefined;\n /** Reads the admitted repository's sync projection without exposing its state path. */\n readRepositorySync?(\n repositoryId: string,\n ): Promise<DoomRepositorySyncView | undefined> | DoomRepositorySyncView | undefined;\n /** Admitted workspaces available to this mount. */\n repositories?(): readonly { id: string; name: string; path: string; active: boolean }[];\n /** Publish a successful config write to the owning mount's refresh lifecycle. */\n configurationChanged?(): void;\n /**\n * Borrows the hub's OAuth redirect surface. Undefined when the hub cannot\n * currently serve one, in which case the package keeps its own behaviour.\n */\n oauthRedirect?(): DoomOAuthRedirect | undefined;\n /** Canonical in-process lifecycle for sessions created by this host. */\n sessionService?: DoomHubSessionService;\n /** Host-bound, authenticated inter-session event endpoint for this session. */\n sessionCommunication?: DoomSessionCommunicationEndpoint;\n /** Same-process events shared by session APIs and hub channels. */\n directEvents?: DoomDirectEventBus;\n /**\n * Publishes this session's activity line to every page's rail; undefined clears it.\n * Session mounts only. The last publisher wins.\n */\n publishActivity?(activity: DoomSessionActivity | undefined): void;\n /** Trusted in-process dispatch to an explicitly selected mounted API. No browser authentication is performed here. */\n requestApi?(mount: DoomApiMount, basePath: string, request: Request): Promise<Response>;\n /** Present only on a session mounted by an authenticated Desktop host. */\n computerUse?: DoomComputerUseSessionAccess;\n /** Deliver a typed method to a channel on this exact hub mount, retaining the caller's connection identity. */\n receiveChannel?(sessionId: string, frameType: string, payload: unknown, connectionId: string): boolean;\n /** Host-owned replay evidence, supplied only on the global mount. Never exposed to browsers or agents. */\n requestReceipts?: DoomRequestReceipts;\n /** One host's exclusive media activity, shared across global and session scopes. */\n mediaArbitration?: DoomHostMediaArbitration;\n /** One host-wide heavy-job budget, not a separate budget for every session. */\n executionBudget?: DoomHostExecutionBudget;\n /** Paired agents belonging to this host only. */\n peerAgents?: DoomPeerAgentRegistry;\n /** Machine-owned Remote Control service, mounted only by the global core facet. */\n remoteControl?: { fetch(request: Request): Promise<Response> };\n /**\n * Publishes a file from this session's cwd or attachments at a short-lived tunnel URL.\n * Session mounts only; rejects with DOOM_SHARE_FILE_REMOTE_OFF_MESSAGE while remote access is off.\n * The host asks no consent: the caller must obtain it before passing the URL on.\n */\n shareFile?(path: string, label: string): Promise<DoomSharedFile>;\n onNotice(message: string): void;\n}\n\n/**\n * One running surface. The host strips the mount prefix before calling, so\n * routes are declared relative ('/runners/:id/log') and a package never\n * repeats where it was mounted.\n */\nexport interface DoomApiHandler {\n fetch(request: Request): Response | Promise<Response>;\n close(): void;\n}\n\nexport interface DoomApi {\n /** Segment under /api/plugins/; globally unique across loaded packages. */\n basePath: string;\n start(context: DoomApiContext): DoomApiHandler;\n}\n"],"mappings":";AA+BA,MAAa,kBAA2C;CAAC;CAAU;CAAa;AAAS;;AA6CzF,SAAgB,iBAAiB,OAAwD;CACvF,IAAI,MAAM,UAAU,UAAU,OAAO;CACrC,IAAI,MAAM,UAAU,aAAa,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE;CACjG,IAAI,CAAC,MAAM,aAAa,MAAM,IAAI,MAAM,qDAAqD;CAC7F,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE,YAAY,mBAAmB,MAAM,SAAS,EAAE;AAClH;;AASA,SAAgB,oBAAoB,UAA+C;CACjF,IAAI,aAAa,WAAW,OAAO,EAAE,OAAO,SAAS;CACrD,MAAM,QAAQ,4DAA4D,KAAK,QAAQ;CACvF,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI;EACF,MAAM,cAAc,mBAAmB,MAAM,EAAE;EAC/C,OAAO,MAAM,OAAO,KAAA,IAChB;GAAE,OAAO;GAAa;EAAY,IAClC;GAAE,OAAO;GAAW;GAAa,WAAW,mBAAmB,MAAM,EAAE;EAAE;CAC/E,QAAQ;EACN;CACF;AACF;;AAGA,MAAa,wBAAwB;;AAErC,MAAa,mCAAmC;;AAGhD,MAAa,kCAAkC;AAC/C,MAAa,mCAAmC;AAChD,MAAa,iCAAiC;AAC9C,MAAa,0BAA0B;CACrC;CACA;CACA;AACF;;AAQA,SAAgB,kBAAkB,SAA6C;CAC7E,MAAM,WAAW,QAAQ,IAAI,+BAA+B;CAC5D,MAAM,WAAW,QAAQ,IAAI,gCAAgC;CAC7D,MAAM,SAAS,QAAQ,IAAI,8BAA8B;CACzD,IAAI,aAAa,SACf,OAAO,aAAa,QAAQ,WAAW,iBAAiB;EAAE;EAAU;CAAO,IAAI,KAAA;CAEjF,IACE,aAAa,YACb,aAAa,QACb,aAAa,OACZ,WAAW,kBAAkB,WAAW,cAAc,WAAW,gBAElE,OAAO;EAAE;EAAU;EAAU;CAAO;AAGxC;;AAoFA,MAAa,qCACX"}
|
|
1
|
+
{"version":3,"file":"packageApi.cjs","names":[],"sources":["../../../src/schemas/packageApi.ts"],"sourcesContent":["/**\n * The HTTP surface a package offers its host.\n *\n * A server plugin registers one with its host. The host mounts it under the API\n * route prefix, and the package writes routes relative to that mount.\n *\n * The handler is a plain fetch callback so no host and no package is committed\n * to one HTTP framework; a Hono app satisfies it through `app.fetch`.\n */\n\nimport type {\n PoComputerUseSessionAccess,\n PoDirectEventBus,\n PoHubSessionService,\n PoSessionCommunicationEndpoint,\n PoSessionActivity,\n PoSessionContext,\n} from './hubChannel';\nimport type { PoMcpProjection } from './mcpProjection';\nimport type { PoSessionStorageService } from './platform';\n/** The host-owned sync view a repository-scoped package API may inspect. */\nexport interface PoRepositorySyncView {\n fresh: boolean;\n reasons: string[];\n /** True while a background sync that may prepare what `reasons` names is running. */\n syncing?: boolean;\n mcpProjection?: PoMcpProjection;\n}\n\n/** Where an API runs: inside one session's server, or in the machine-wide hub. */\nexport type PoApiScope = 'global' | 'workspace' | 'session';\n\nexport const PO_API_SCOPES: readonly PoApiScope[] = ['global', 'workspace', 'session'];\n\n/** Identity of an independently mounted plugin host. */\nexport type PoApiMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; sessionId: string };\n\n/** Immutable browser contribution generation paired with a server mount. */\nexport interface PoWebComposition {\n id: string;\n scope: PoApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n verifiedAssetBaseUrl: string;\n /** `[slot, entry]` for each of this mount's plugin copies, the entry an absolute path below the asset prefixes. */\n pluginEntries: [string, string][];\n /** Every signed file this mount's slots can load, absolute below the asset prefixes. */\n assetPaths: string[];\n /** Per-plugin stylesheets of this mount's plugins only, so other mounts' classes never apply here. */\n stylePaths: string[];\n channels: string[];\n /** The slots resolved for this mount; the shared build may hold more. */\n plugins: string[];\n}\n\n/**\n * Immutable native contribution generation paired with a server mount. One signed CommonJS module at\n * `entryPath`, served through the same immutable plugin routes as web compositions.\n */\nexport interface PoNativeComposition {\n id: string;\n scope: PoApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n /** Always `/composition.js`. */\n entryPath: string;\n channels: string[];\n /** The `poNative.pluginId` values resolved for this mount; the shell installs only these. */\n plugins: string[];\n}\n\n/** Canonical public prefix. Scope selection never falls through to a parent. */\nexport function poApiMountPath(mount: PoApiMount & { workspaceId?: string }): string {\n if (mount.scope === 'global') return '/api/plugins';\n if (mount.scope === 'workspace') return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;\n if (!mount.workspaceId) throw new Error('A session API path requires its workspace identity.');\n return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;\n}\n\n/** Scope addressed by a public WebSocket upgrade. */\nexport type PoSocketMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; workspaceId: string; sessionId: string };\n\n/** Only canonical resource paths may select a protocol listener. */\nexport function parsePoSocketPath(pathname: string): PoSocketMount | undefined {\n if (pathname === '/api/ws') return { scope: 'global' };\n const match = /^\\/api\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?\\/ws$/u.exec(pathname);\n if (!match) return undefined;\n try {\n const workspaceId = decodeURIComponent(match[1]);\n return match[2] === undefined\n ? { scope: 'workspace', workspaceId }\n : { scope: 'session', workspaceId, sessionId: decodeURIComponent(match[2]) };\n } catch {\n return undefined;\n }\n}\n\n/** The segment an API is mounted under, below this prefix. */\nexport const PO_API_ROUTE_PREFIX = '/api/plugins';\n/** Selects the hub API bundle that owns the named cockpit session. */\nexport const PO_HUB_API_SESSION_QUERY_PARAM = 'hubSession';\n\n/** Trusted caller headers written only by the cockpit-to-session proxy. */\nexport const PO_API_CALLER_LOCALITY_HEADER = 'x-po-api-caller-locality';\nexport const PO_API_CALLER_DEVICE_ID_HEADER = 'x-po-api-caller-device-id';\nexport const PO_API_CALLER_STEP_UP_HEADER = 'x-po-api-caller-step-up';\nexport const PO_API_CALLER_HEADERS = [\n PO_API_CALLER_LOCALITY_HEADER,\n PO_API_CALLER_DEVICE_ID_HEADER,\n PO_API_CALLER_STEP_UP_HEADER,\n] as const;\n\nexport type PoApiCallerStepUp = 'not-required' | 'verified' | 'unavailable';\nexport type PoApiCaller =\n | { locality: 'local'; stepUp: 'not-required' }\n | { locality: 'remote'; deviceId: string; stepUp: PoApiCallerStepUp };\n\n/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */\nexport function poApiCallerFrom(headers: Headers): PoApiCaller | undefined {\n const locality = headers.get(PO_API_CALLER_LOCALITY_HEADER);\n const deviceId = headers.get(PO_API_CALLER_DEVICE_ID_HEADER);\n const stepUp = headers.get(PO_API_CALLER_STEP_UP_HEADER);\n if (locality === 'local') {\n return deviceId === null && stepUp === 'not-required' ? { locality, stepUp } : undefined;\n }\n if (\n locality === 'remote' &&\n deviceId !== null &&\n deviceId !== '' &&\n (stepUp === 'not-required' || stepUp === 'verified' || stepUp === 'unavailable')\n ) {\n return { locality, deviceId, stepUp };\n }\n return undefined;\n}\n/**\n * A browser-reachable OAuth redirect the host serves on its own listener.\n *\n * A package brokering third-party OAuth cannot use a loopback redirect when the\n * operator's browser is on another machine: `127.0.0.1` resolves to whichever\n * machine the browser runs on. The host owns a listener that is reachable from\n * wherever the cockpit is being used, so it lends that instead of the package\n * opening a port of its own.\n */\nexport interface PoOAuthRedirect {\n /** Absolute URL to register as the redirect target, already origin-correct. */\n readonly redirectUri: string;\n /**\n * Accept redirects carrying this state. Must complete before the\n * authorization URL is surfaced, or the redirect races its own reservation.\n */\n reserve(state: string, timeoutMs?: number): Promise<void>;\n /** Resolves once the redirect carrying this state arrives. */\n wait(state: string, timeoutMs?: number): Promise<{ code: string; state: string }>;\n /** Drops a reservation whose flow ended without a redirect. */\n cancel(state: string): void;\n}\n\n/** An exact, host-owned receipt address. Provider IDs are not event cursor positions. */\nexport interface PoRequestReceiptKey {\n namespace: string;\n activationId: string;\n requestId: string;\n}\n\nexport interface PoRequestReceipt extends PoRequestReceiptKey {\n fingerprint: string;\n destination: string;\n transactionId: string;\n outcome: 'reserved' | 'admitted' | 'rejected' | 'uncertain';\n}\n\nexport interface PoRequestReceiptReservation extends PoRequestReceiptKey {\n /** Lowercase SHA-256 of the authoritative request text, never the full transcript. */\n fingerprint: string;\n destination: string;\n transactionId: string;\n}\n\nexport type PoRequestReceiptReserveResult =\n | { kind: 'reserved'; token: string }\n | { kind: 'existing'; receipt: PoRequestReceipt }\n | { kind: 'conflict'; receipt: PoRequestReceipt };\n\n/** A global-only receipt capability. A reservation is not an execution receipt. */\nexport interface PoRequestReceipts {\n reserve(request: PoRequestReceiptReservation): Promise<PoRequestReceiptReserveResult>;\n lookup(key: PoRequestReceiptKey): Promise<PoRequestReceipt | undefined>;\n finish(\n request: PoRequestReceiptKey & { token: string; outcome: 'admitted' | 'rejected' | 'uncertain' },\n ): Promise<PoRequestReceipt>;\n}\n\n/** Permit returned for expensive local work. Calling it releases the slot. */\nexport interface PoHostExecutionPermit {\n (): void;\n attachProcess?(pid: number): Promise<void>;\n}\n\n/** Host-wide admission for expensive local work. Release only after the owned process exits. */\nexport interface PoHostExecutionBudget {\n acquire(signal?: AbortSignal): Promise<PoHostExecutionPermit>;\n getSnapshot(): Readonly<{ running: number; queued: number; limit: number }>;\n}\n\n/** Synchronous host-owned exclusion across media APIs mounted at different scopes. */\nexport interface PoHostMediaArbitration {\n register(busy: () => boolean): () => void;\n available(busy: () => boolean): boolean;\n}\n\n/** One host's paired agent registrations, shared across its global and session mounts. */\nexport interface PoPeerAgentRegistry {\n register(sessionId: string, agent: { fetch(request: Request): Promise<Response> }, hubToken: string): () => void;\n get(sessionId: string): { fetch(request: Request): Promise<Response>; hubToken: string } | undefined;\n}\n\n/** One agent that edits files: a hub session or an in-process child run. */\nexport interface PoEditPresenceAgent {\n /** `session:<id>` or `run:<runId>`. Unique across the host. */\n readonly key: string;\n /** Read when a note is rendered, so a name registered after the edit still shows. */\n readonly label: () => string;\n /** Hub session id other agents can reach with intercom. */\n readonly contact: string;\n readonly isLive: () => boolean;\n}\n\nexport interface PoEditPresenceEntry {\n readonly agent: PoEditPresenceAgent;\n /** `@file` tag of the bytes this agent's last successful edit or write left behind. */\n readonly tag: string;\n readonly at: number;\n}\n\n/**\n * Host-wide record of the last edit each live agent made to a file, keyed by realpath then agent key.\n * Owners delete their entries when they dispose, so no callback outlives its session or run.\n */\nexport type PoEditPresenceLedger = Map<string, Map<string, PoEditPresenceEntry>>;\n\n/** Why shareFile rejects while the host has no public tunnel origin. */\nexport const PO_SHARE_FILE_REMOTE_OFF_MESSAGE =\n 'Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.';\n\n/**\n * A file published at a short-lived public tunnel URL: 10 minutes, 3 downloads, and gone\n * when the tunnel revision changes. Call revoke as soon as the consumer is done with it.\n */\nexport interface PoSharedFile {\n /** Bearer link; never log or persist it. */\n url: string;\n fileName: string;\n mimeType: string;\n size: number;\n /** Expiry as epoch milliseconds. */\n expiresAt: number;\n maxDownloads: number;\n /** Idempotent. */\n revoke(): void;\n}\n\n/** What the host tells an API about itself when it starts. */\nexport interface PoApiContext {\n scope: PoApiScope;\n /** Stable, opaque workspace id, shared by every session and member checkout of the workspace. */\n workspaceId?: string;\n /**\n * The admitted workspace root for a workspace mount. For a session mount it is the checkout\n * the session runs in; read sessionContext for both roots. Absent from global mounts.\n */\n workspaceRoot?: string;\n /** The session's baseline context; present on session mounts whose host knows its workspace. */\n sessionContext?: PoSessionContext;\n /** Explicit host home, never selected by a remote request. */\n homeDirectory?: string;\n /** The session this host serves; absent for a hub-scoped API. */\n sessionId?: string;\n /** The session's working directory; absent for a hub-scoped API. */\n cwd?: string;\n /** Session environment admitted by the server, never supplied by remote clients. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** Shared only with child processes in this session, never with remote API clients. */\n internalToken?: string;\n /** Shared only with the cockpit hub for privileged cross-session coordination. */\n hubToken?: string;\n /**\n * Resolves a hub-issued opaque repository id to an admitted canonical root.\n * Hub APIs must never accept a browser-supplied filesystem path instead.\n */\n resolveRepository?(repositoryId: string): string | undefined;\n /** Reads the admitted repository's sync projection without exposing its state path. */\n readRepositorySync?(\n repositoryId: string,\n ): Promise<PoRepositorySyncView | undefined> | PoRepositorySyncView | undefined;\n /** Admitted workspaces available to this mount. */\n repositories?(): readonly { id: string; name: string; path: string; active: boolean }[];\n /** Publish a successful config write to the owning mount's refresh lifecycle. */\n configurationChanged?(): void;\n /**\n * Borrows the hub's OAuth redirect surface. Undefined when the hub cannot\n * currently serve one, in which case the package keeps its own behaviour.\n */\n oauthRedirect?(): PoOAuthRedirect | undefined;\n /** Canonical in-process lifecycle for sessions created by this host. */\n sessionService?: PoHubSessionService;\n /** Trusted in-process storage capability. APIs must retain their mount's session authorization. */\n sessionStorage?: PoSessionStorageService;\n /** Host-bound, authenticated inter-session event endpoint for this session. */\n sessionCommunication?: PoSessionCommunicationEndpoint;\n /** Same-process events shared by session APIs and hub channels. */\n directEvents?: PoDirectEventBus;\n /**\n * Publishes this session's activity line to every page's rail; undefined clears it.\n * Session mounts only. The last publisher wins.\n */\n publishActivity?(activity: PoSessionActivity | undefined): void;\n /** Trusted in-process dispatch to an explicitly selected mounted API. No browser authentication is performed here. */\n requestApi?(mount: PoApiMount, basePath: string, request: Request): Promise<Response>;\n /** Present only on a session mounted by an authenticated Desktop host. */\n computerUse?: PoComputerUseSessionAccess;\n /** Deliver a typed method to the channel serving a session this mount reaches, retaining the caller's connection identity. */\n receiveChannel?(sessionId: string, frameType: string, payload: unknown, connectionId: string): boolean;\n /** Host-owned replay evidence, supplied only on the global mount. Never exposed to browsers or agents. */\n requestReceipts?: PoRequestReceipts;\n /** One host's exclusive media activity, shared across global and session scopes. */\n mediaArbitration?: PoHostMediaArbitration;\n /** One host-wide heavy-job budget, not a separate budget for every session. */\n executionBudget?: PoHostExecutionBudget;\n /** One host-wide edit presence ledger, shared by every session mount. */\n editPresence?: PoEditPresenceLedger;\n /** Paired agents belonging to this host only. */\n peerAgents?: PoPeerAgentRegistry;\n /** Machine-owned Remote Control service, mounted only by Po's own global server plugin. */\n remoteControl?: { fetch(request: Request): Promise<Response> };\n /**\n * Publishes a file from this session's cwd or attachments at a short-lived tunnel URL.\n * Session mounts only; rejects with PO_SHARE_FILE_REMOTE_OFF_MESSAGE while remote access is off.\n * The host asks no consent: the caller must obtain it before passing the URL on.\n */\n shareFile?(path: string, label: string): Promise<PoSharedFile>;\n onNotice(message: string): void;\n}\n\n/**\n * One running surface. The host strips the mount prefix before calling, so\n * routes are declared relative ('/runners/:id/log') and a package never\n * repeats where it was mounted.\n */\nexport interface PoApiHandler {\n fetch(request: Request): Response | Promise<Response>;\n close(): void;\n}\n\nexport interface PoApi {\n /** Segment under /api/plugins/; globally unique across loaded packages. */\n basePath: string;\n start(context: PoApiContext): PoApiHandler;\n}\n"],"mappings":";AAgCA,MAAa,gBAAuC;CAAC;CAAU;CAAa;AAAS;;AA6CrF,SAAgB,eAAe,OAAsD;CACnF,IAAI,MAAM,UAAU,UAAU,OAAO;CACrC,IAAI,MAAM,UAAU,aAAa,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE;CACjG,IAAI,CAAC,MAAM,aAAa,MAAM,IAAI,MAAM,qDAAqD;CAC7F,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE,YAAY,mBAAmB,MAAM,SAAS,EAAE;AAClH;;AASA,SAAgB,kBAAkB,UAA6C;CAC7E,IAAI,aAAa,WAAW,OAAO,EAAE,OAAO,SAAS;CACrD,MAAM,QAAQ,4DAA4D,KAAK,QAAQ;CACvF,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI;EACF,MAAM,cAAc,mBAAmB,MAAM,EAAE;EAC/C,OAAO,MAAM,OAAO,KAAA,IAChB;GAAE,OAAO;GAAa;EAAY,IAClC;GAAE,OAAO;GAAW;GAAa,WAAW,mBAAmB,MAAM,EAAE;EAAE;CAC/E,QAAQ;EACN;CACF;AACF;;AAGA,MAAa,sBAAsB;;AAEnC,MAAa,iCAAiC;;AAG9C,MAAa,gCAAgC;AAC7C,MAAa,iCAAiC;AAC9C,MAAa,+BAA+B;AAC5C,MAAa,wBAAwB;CACnC;CACA;CACA;AACF;;AAQA,SAAgB,gBAAgB,SAA2C;CACzE,MAAM,WAAW,QAAQ,IAAI,6BAA6B;CAC1D,MAAM,WAAW,QAAQ,IAAI,8BAA8B;CAC3D,MAAM,SAAS,QAAQ,IAAI,4BAA4B;CACvD,IAAI,aAAa,SACf,OAAO,aAAa,QAAQ,WAAW,iBAAiB;EAAE;EAAU;CAAO,IAAI,KAAA;CAEjF,IACE,aAAa,YACb,aAAa,QACb,aAAa,OACZ,WAAW,kBAAkB,WAAW,cAAc,WAAW,gBAElE,OAAO;EAAE;EAAU;EAAU;CAAO;AAGxC;;AA4GA,MAAa,mCACX"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PoSessionStorageService } from "./platform.mjs";
|
|
2
|
+
import { PoComputerUseSessionAccess, PoDirectEventBus, PoHubSessionService, PoSessionActivity, PoSessionCommunicationEndpoint, PoSessionContext } from "./hubChannel.mjs";
|
|
3
|
+
import { PoMcpProjection } from "./mcpProjection.mjs";
|
|
3
4
|
//#region src/schemas/packageApi.d.ts
|
|
4
5
|
/** The host-owned sync view a repository-scoped package API may inspect. */
|
|
5
|
-
export interface
|
|
6
|
+
export interface PoRepositorySyncView {
|
|
6
7
|
fresh: boolean;
|
|
7
8
|
reasons: string[];
|
|
8
9
|
/** True while a background sync that may prepare what `reasons` names is running. */
|
|
9
10
|
syncing?: boolean;
|
|
10
|
-
mcpProjection?:
|
|
11
|
+
mcpProjection?: PoMcpProjection;
|
|
11
12
|
}
|
|
12
13
|
/** Where an API runs: inside one session's server, or in the machine-wide hub. */
|
|
13
|
-
export type
|
|
14
|
-
export declare const
|
|
14
|
+
export type PoApiScope = 'global' | 'workspace' | 'session';
|
|
15
|
+
export declare const PO_API_SCOPES: readonly PoApiScope[];
|
|
15
16
|
/** Identity of an independently mounted plugin host. */
|
|
16
|
-
export type
|
|
17
|
+
export type PoApiMount = {
|
|
17
18
|
scope: 'global';
|
|
18
19
|
} | {
|
|
19
20
|
scope: 'workspace';
|
|
@@ -23,9 +24,9 @@ export type DoomApiMount = {
|
|
|
23
24
|
sessionId: string;
|
|
24
25
|
};
|
|
25
26
|
/** Immutable browser contribution generation paired with a server mount. */
|
|
26
|
-
export interface
|
|
27
|
+
export interface PoWebComposition {
|
|
27
28
|
id: string;
|
|
28
|
-
scope:
|
|
29
|
+
scope: PoApiScope;
|
|
29
30
|
revision: number;
|
|
30
31
|
manifestUrl: string;
|
|
31
32
|
rawAssetBaseUrl: string;
|
|
@@ -44,9 +45,9 @@ export interface DoomWebComposition {
|
|
|
44
45
|
* Immutable native contribution generation paired with a server mount. One signed CommonJS module at
|
|
45
46
|
* `entryPath`, served through the same immutable plugin routes as web compositions.
|
|
46
47
|
*/
|
|
47
|
-
export interface
|
|
48
|
+
export interface PoNativeComposition {
|
|
48
49
|
id: string;
|
|
49
|
-
scope:
|
|
50
|
+
scope: PoApiScope;
|
|
50
51
|
revision: number;
|
|
51
52
|
manifestUrl: string;
|
|
52
53
|
rawAssetBaseUrl: string;
|
|
@@ -57,11 +58,11 @@ export interface DoomNativeComposition {
|
|
|
57
58
|
plugins: string[];
|
|
58
59
|
}
|
|
59
60
|
/** Canonical public prefix. Scope selection never falls through to a parent. */
|
|
60
|
-
export declare function
|
|
61
|
+
export declare function poApiMountPath(mount: PoApiMount & {
|
|
61
62
|
workspaceId?: string;
|
|
62
63
|
}): string;
|
|
63
64
|
/** Scope addressed by a public WebSocket upgrade. */
|
|
64
|
-
export type
|
|
65
|
+
export type PoSocketMount = {
|
|
65
66
|
scope: 'global';
|
|
66
67
|
} | {
|
|
67
68
|
scope: 'workspace';
|
|
@@ -72,27 +73,27 @@ export type DoomSocketMount = {
|
|
|
72
73
|
sessionId: string;
|
|
73
74
|
};
|
|
74
75
|
/** Only canonical resource paths may select a protocol listener. */
|
|
75
|
-
export declare function
|
|
76
|
+
export declare function parsePoSocketPath(pathname: string): PoSocketMount | undefined;
|
|
76
77
|
/** The segment an API is mounted under, below this prefix. */
|
|
77
|
-
export declare const
|
|
78
|
+
export declare const PO_API_ROUTE_PREFIX = "/api/plugins";
|
|
78
79
|
/** Selects the hub API bundle that owns the named cockpit session. */
|
|
79
|
-
export declare const
|
|
80
|
+
export declare const PO_HUB_API_SESSION_QUERY_PARAM = "hubSession";
|
|
80
81
|
/** Trusted caller headers written only by the cockpit-to-session proxy. */
|
|
81
|
-
export declare const
|
|
82
|
-
export declare const
|
|
83
|
-
export declare const
|
|
84
|
-
export declare const
|
|
85
|
-
export type
|
|
86
|
-
export type
|
|
82
|
+
export declare const PO_API_CALLER_LOCALITY_HEADER = "x-po-api-caller-locality";
|
|
83
|
+
export declare const PO_API_CALLER_DEVICE_ID_HEADER = "x-po-api-caller-device-id";
|
|
84
|
+
export declare const PO_API_CALLER_STEP_UP_HEADER = "x-po-api-caller-step-up";
|
|
85
|
+
export declare const PO_API_CALLER_HEADERS: readonly ["x-po-api-caller-locality", "x-po-api-caller-device-id", "x-po-api-caller-step-up"];
|
|
86
|
+
export type PoApiCallerStepUp = 'not-required' | 'verified' | 'unavailable';
|
|
87
|
+
export type PoApiCaller = {
|
|
87
88
|
locality: 'local';
|
|
88
89
|
stepUp: 'not-required';
|
|
89
90
|
} | {
|
|
90
91
|
locality: 'remote';
|
|
91
92
|
deviceId: string;
|
|
92
|
-
stepUp:
|
|
93
|
+
stepUp: PoApiCallerStepUp;
|
|
93
94
|
};
|
|
94
95
|
/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */
|
|
95
|
-
export declare function
|
|
96
|
+
export declare function poApiCallerFrom(headers: Headers): PoApiCaller | undefined;
|
|
96
97
|
/**
|
|
97
98
|
* A browser-reachable OAuth redirect the host serves on its own listener.
|
|
98
99
|
*
|
|
@@ -102,7 +103,7 @@ export declare function doomApiCallerFrom(headers: Headers): DoomApiCaller | und
|
|
|
102
103
|
* wherever the cockpit is being used, so it lends that instead of the package
|
|
103
104
|
* opening a port of its own.
|
|
104
105
|
*/
|
|
105
|
-
export interface
|
|
106
|
+
export interface PoOAuthRedirect {
|
|
106
107
|
/** Absolute URL to register as the redirect target, already origin-correct. */
|
|
107
108
|
readonly redirectUri: string;
|
|
108
109
|
/**
|
|
@@ -119,50 +120,50 @@ export interface DoomOAuthRedirect {
|
|
|
119
120
|
cancel(state: string): void;
|
|
120
121
|
}
|
|
121
122
|
/** An exact, host-owned receipt address. Provider IDs are not event cursor positions. */
|
|
122
|
-
export interface
|
|
123
|
+
export interface PoRequestReceiptKey {
|
|
123
124
|
namespace: string;
|
|
124
125
|
activationId: string;
|
|
125
126
|
requestId: string;
|
|
126
127
|
}
|
|
127
|
-
export interface
|
|
128
|
+
export interface PoRequestReceipt extends PoRequestReceiptKey {
|
|
128
129
|
fingerprint: string;
|
|
129
130
|
destination: string;
|
|
130
131
|
transactionId: string;
|
|
131
132
|
outcome: 'reserved' | 'admitted' | 'rejected' | 'uncertain';
|
|
132
133
|
}
|
|
133
|
-
export interface
|
|
134
|
+
export interface PoRequestReceiptReservation extends PoRequestReceiptKey {
|
|
134
135
|
/** Lowercase SHA-256 of the authoritative request text, never the full transcript. */
|
|
135
136
|
fingerprint: string;
|
|
136
137
|
destination: string;
|
|
137
138
|
transactionId: string;
|
|
138
139
|
}
|
|
139
|
-
export type
|
|
140
|
+
export type PoRequestReceiptReserveResult = {
|
|
140
141
|
kind: 'reserved';
|
|
141
142
|
token: string;
|
|
142
143
|
} | {
|
|
143
144
|
kind: 'existing';
|
|
144
|
-
receipt:
|
|
145
|
+
receipt: PoRequestReceipt;
|
|
145
146
|
} | {
|
|
146
147
|
kind: 'conflict';
|
|
147
|
-
receipt:
|
|
148
|
+
receipt: PoRequestReceipt;
|
|
148
149
|
};
|
|
149
150
|
/** A global-only receipt capability. A reservation is not an execution receipt. */
|
|
150
|
-
export interface
|
|
151
|
-
reserve(request:
|
|
152
|
-
lookup(key:
|
|
153
|
-
finish(request:
|
|
151
|
+
export interface PoRequestReceipts {
|
|
152
|
+
reserve(request: PoRequestReceiptReservation): Promise<PoRequestReceiptReserveResult>;
|
|
153
|
+
lookup(key: PoRequestReceiptKey): Promise<PoRequestReceipt | undefined>;
|
|
154
|
+
finish(request: PoRequestReceiptKey & {
|
|
154
155
|
token: string;
|
|
155
156
|
outcome: 'admitted' | 'rejected' | 'uncertain';
|
|
156
|
-
}): Promise<
|
|
157
|
+
}): Promise<PoRequestReceipt>;
|
|
157
158
|
}
|
|
158
159
|
/** Permit returned for expensive local work. Calling it releases the slot. */
|
|
159
|
-
export interface
|
|
160
|
+
export interface PoHostExecutionPermit {
|
|
160
161
|
(): void;
|
|
161
162
|
attachProcess?(pid: number): Promise<void>;
|
|
162
163
|
}
|
|
163
164
|
/** Host-wide admission for expensive local work. Release only after the owned process exits. */
|
|
164
|
-
export interface
|
|
165
|
-
acquire(signal?: AbortSignal): Promise<
|
|
165
|
+
export interface PoHostExecutionBudget {
|
|
166
|
+
acquire(signal?: AbortSignal): Promise<PoHostExecutionPermit>;
|
|
166
167
|
getSnapshot(): Readonly<{
|
|
167
168
|
running: number;
|
|
168
169
|
queued: number;
|
|
@@ -170,12 +171,12 @@ export interface DoomHostExecutionBudget {
|
|
|
170
171
|
}>;
|
|
171
172
|
}
|
|
172
173
|
/** Synchronous host-owned exclusion across media APIs mounted at different scopes. */
|
|
173
|
-
export interface
|
|
174
|
+
export interface PoHostMediaArbitration {
|
|
174
175
|
register(busy: () => boolean): () => void;
|
|
175
176
|
available(busy: () => boolean): boolean;
|
|
176
177
|
}
|
|
177
178
|
/** One host's paired agent registrations, shared across its global and session mounts. */
|
|
178
|
-
export interface
|
|
179
|
+
export interface PoPeerAgentRegistry {
|
|
179
180
|
register(sessionId: string, agent: {
|
|
180
181
|
fetch(request: Request): Promise<Response>;
|
|
181
182
|
}, hubToken: string): () => void;
|
|
@@ -184,13 +185,34 @@ export interface DoomPeerAgentRegistry {
|
|
|
184
185
|
hubToken: string;
|
|
185
186
|
} | undefined;
|
|
186
187
|
}
|
|
188
|
+
/** One agent that edits files: a hub session or an in-process child run. */
|
|
189
|
+
export interface PoEditPresenceAgent {
|
|
190
|
+
/** `session:<id>` or `run:<runId>`. Unique across the host. */
|
|
191
|
+
readonly key: string;
|
|
192
|
+
/** Read when a note is rendered, so a name registered after the edit still shows. */
|
|
193
|
+
readonly label: () => string;
|
|
194
|
+
/** Hub session id other agents can reach with intercom. */
|
|
195
|
+
readonly contact: string;
|
|
196
|
+
readonly isLive: () => boolean;
|
|
197
|
+
}
|
|
198
|
+
export interface PoEditPresenceEntry {
|
|
199
|
+
readonly agent: PoEditPresenceAgent;
|
|
200
|
+
/** `@file` tag of the bytes this agent's last successful edit or write left behind. */
|
|
201
|
+
readonly tag: string;
|
|
202
|
+
readonly at: number;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Host-wide record of the last edit each live agent made to a file, keyed by realpath then agent key.
|
|
206
|
+
* Owners delete their entries when they dispose, so no callback outlives its session or run.
|
|
207
|
+
*/
|
|
208
|
+
export type PoEditPresenceLedger = Map<string, Map<string, PoEditPresenceEntry>>;
|
|
187
209
|
/** Why shareFile rejects while the host has no public tunnel origin. */
|
|
188
|
-
export declare const
|
|
210
|
+
export declare const PO_SHARE_FILE_REMOTE_OFF_MESSAGE = "Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.";
|
|
189
211
|
/**
|
|
190
212
|
* A file published at a short-lived public tunnel URL: 10 minutes, 3 downloads, and gone
|
|
191
213
|
* when the tunnel revision changes. Call revoke as soon as the consumer is done with it.
|
|
192
214
|
*/
|
|
193
|
-
export interface
|
|
215
|
+
export interface PoSharedFile {
|
|
194
216
|
/** Bearer link; never log or persist it. */
|
|
195
217
|
url: string;
|
|
196
218
|
fileName: string;
|
|
@@ -203,8 +225,8 @@ export interface DoomSharedFile {
|
|
|
203
225
|
revoke(): void;
|
|
204
226
|
}
|
|
205
227
|
/** What the host tells an API about itself when it starts. */
|
|
206
|
-
export interface
|
|
207
|
-
scope:
|
|
228
|
+
export interface PoApiContext {
|
|
229
|
+
scope: PoApiScope;
|
|
208
230
|
/** Stable, opaque workspace id, shared by every session and member checkout of the workspace. */
|
|
209
231
|
workspaceId?: string;
|
|
210
232
|
/**
|
|
@@ -213,7 +235,7 @@ export interface DoomApiContext {
|
|
|
213
235
|
*/
|
|
214
236
|
workspaceRoot?: string;
|
|
215
237
|
/** The session's baseline context; present on session mounts whose host knows its workspace. */
|
|
216
|
-
sessionContext?:
|
|
238
|
+
sessionContext?: PoSessionContext;
|
|
217
239
|
/** Explicit host home, never selected by a remote request. */
|
|
218
240
|
homeDirectory?: string;
|
|
219
241
|
/** The session this host serves; absent for a hub-scoped API. */
|
|
@@ -232,7 +254,7 @@ export interface DoomApiContext {
|
|
|
232
254
|
*/
|
|
233
255
|
resolveRepository?(repositoryId: string): string | undefined;
|
|
234
256
|
/** Reads the admitted repository's sync projection without exposing its state path. */
|
|
235
|
-
readRepositorySync?(repositoryId: string): Promise<
|
|
257
|
+
readRepositorySync?(repositoryId: string): Promise<PoRepositorySyncView | undefined> | PoRepositorySyncView | undefined;
|
|
236
258
|
/** Admitted workspaces available to this mount. */
|
|
237
259
|
repositories?(): readonly {
|
|
238
260
|
id: string;
|
|
@@ -246,42 +268,46 @@ export interface DoomApiContext {
|
|
|
246
268
|
* Borrows the hub's OAuth redirect surface. Undefined when the hub cannot
|
|
247
269
|
* currently serve one, in which case the package keeps its own behaviour.
|
|
248
270
|
*/
|
|
249
|
-
oauthRedirect?():
|
|
271
|
+
oauthRedirect?(): PoOAuthRedirect | undefined;
|
|
250
272
|
/** Canonical in-process lifecycle for sessions created by this host. */
|
|
251
|
-
sessionService?:
|
|
273
|
+
sessionService?: PoHubSessionService;
|
|
274
|
+
/** Trusted in-process storage capability. APIs must retain their mount's session authorization. */
|
|
275
|
+
sessionStorage?: PoSessionStorageService;
|
|
252
276
|
/** Host-bound, authenticated inter-session event endpoint for this session. */
|
|
253
|
-
sessionCommunication?:
|
|
277
|
+
sessionCommunication?: PoSessionCommunicationEndpoint;
|
|
254
278
|
/** Same-process events shared by session APIs and hub channels. */
|
|
255
|
-
directEvents?:
|
|
279
|
+
directEvents?: PoDirectEventBus;
|
|
256
280
|
/**
|
|
257
281
|
* Publishes this session's activity line to every page's rail; undefined clears it.
|
|
258
282
|
* Session mounts only. The last publisher wins.
|
|
259
283
|
*/
|
|
260
|
-
publishActivity?(activity:
|
|
284
|
+
publishActivity?(activity: PoSessionActivity | undefined): void;
|
|
261
285
|
/** Trusted in-process dispatch to an explicitly selected mounted API. No browser authentication is performed here. */
|
|
262
|
-
requestApi?(mount:
|
|
286
|
+
requestApi?(mount: PoApiMount, basePath: string, request: Request): Promise<Response>;
|
|
263
287
|
/** Present only on a session mounted by an authenticated Desktop host. */
|
|
264
|
-
computerUse?:
|
|
265
|
-
/** Deliver a typed method to
|
|
288
|
+
computerUse?: PoComputerUseSessionAccess;
|
|
289
|
+
/** Deliver a typed method to the channel serving a session this mount reaches, retaining the caller's connection identity. */
|
|
266
290
|
receiveChannel?(sessionId: string, frameType: string, payload: unknown, connectionId: string): boolean;
|
|
267
291
|
/** Host-owned replay evidence, supplied only on the global mount. Never exposed to browsers or agents. */
|
|
268
|
-
requestReceipts?:
|
|
292
|
+
requestReceipts?: PoRequestReceipts;
|
|
269
293
|
/** One host's exclusive media activity, shared across global and session scopes. */
|
|
270
|
-
mediaArbitration?:
|
|
294
|
+
mediaArbitration?: PoHostMediaArbitration;
|
|
271
295
|
/** One host-wide heavy-job budget, not a separate budget for every session. */
|
|
272
|
-
executionBudget?:
|
|
296
|
+
executionBudget?: PoHostExecutionBudget;
|
|
297
|
+
/** One host-wide edit presence ledger, shared by every session mount. */
|
|
298
|
+
editPresence?: PoEditPresenceLedger;
|
|
273
299
|
/** Paired agents belonging to this host only. */
|
|
274
|
-
peerAgents?:
|
|
275
|
-
/** Machine-owned Remote Control service, mounted only by
|
|
300
|
+
peerAgents?: PoPeerAgentRegistry;
|
|
301
|
+
/** Machine-owned Remote Control service, mounted only by Po's own global server plugin. */
|
|
276
302
|
remoteControl?: {
|
|
277
303
|
fetch(request: Request): Promise<Response>;
|
|
278
304
|
};
|
|
279
305
|
/**
|
|
280
306
|
* Publishes a file from this session's cwd or attachments at a short-lived tunnel URL.
|
|
281
|
-
* Session mounts only; rejects with
|
|
307
|
+
* Session mounts only; rejects with PO_SHARE_FILE_REMOTE_OFF_MESSAGE while remote access is off.
|
|
282
308
|
* The host asks no consent: the caller must obtain it before passing the URL on.
|
|
283
309
|
*/
|
|
284
|
-
shareFile?(path: string, label: string): Promise<
|
|
310
|
+
shareFile?(path: string, label: string): Promise<PoSharedFile>;
|
|
285
311
|
onNotice(message: string): void;
|
|
286
312
|
}
|
|
287
313
|
/**
|
|
@@ -289,14 +315,14 @@ export interface DoomApiContext {
|
|
|
289
315
|
* routes are declared relative ('/runners/:id/log') and a package never
|
|
290
316
|
* repeats where it was mounted.
|
|
291
317
|
*/
|
|
292
|
-
export interface
|
|
318
|
+
export interface PoApiHandler {
|
|
293
319
|
fetch(request: Request): Response | Promise<Response>;
|
|
294
320
|
close(): void;
|
|
295
321
|
}
|
|
296
|
-
export interface
|
|
322
|
+
export interface PoApi {
|
|
297
323
|
/** Segment under /api/plugins/; globally unique across loaded packages. */
|
|
298
324
|
basePath: string;
|
|
299
|
-
start(context:
|
|
325
|
+
start(context: PoApiContext): PoApiHandler;
|
|
300
326
|
}
|
|
301
327
|
//#endregion
|
|
302
328
|
//# sourceMappingURL=packageApi.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageApi.d.mts","names":[],"sources":["../../../src/schemas/packageApi.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"packageApi.d.mts","names":[],"sources":["../../../src/schemas/packageApi.ts"],"mappings":";;;;;iBAqBiB;EACf;EACA;;EAEA;EACA,gBAAgB;;;YAIN;qBAEC,wBAAwB;;YAGzB;EACN;;EACA;EAAoB;;EACpB;EAAkB;;;iBAGP;EACf;EACA,OAAO;EACP;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA;;;;;;iBAOe;EACf;EACA,OAAO;EACP;EACA;EACA;;EAEA;EACA;;EAEA;;;wBAIc,eAAe,OAAO;EAAe;;;YAQzC;EACN;;EACA;EAAoB;;EACpB;EAAkB;EAAqB;;;wBAG7B,kBAAkB,mBAAmB;;qBAexC;;qBAEA;;qBAGA;qBACA;qBACA;qBACA;YAMD;YACA;EACN;EAAmB;;EACnB;EAAoB;EAAkB,QAAQ;;;wBAGpC,gBAAgB,SAAS,UAAU;;;;;;;;;;iBA0BlC;;WAEN;;;;;EAKT,QAAQ,eAAe,qBAAqB;;EAE5C,KAAK,eAAe,qBAAqB;IAAU;IAAc;;;EAEjE,OAAO;;;iBAIQ;EACf;EACA;EACA;;iBAGe,yBAAyB;EACxC;EACA;EACA;EACA;;iBAGe,oCAAoC;;EAEnD;EACA;EACA;;YAGU;EACN;EAAkB;;EAClB;EAAkB,SAAS;;EAC3B;EAAkB,SAAS;;;iBAGhB;EACf,QAAQ,SAAS,8BAA8B,QAAQ;EACvD,OAAO,KAAK,sBAAsB,QAAQ;EAC1C,OACE,SAAS;IAAwB;IAAe;MAC/C,QAAQ;;;iBAII;;EAEf,eAAe,cAAc;;;iBAId;EACf,QAAQ,SAAS,cAAc,QAAQ;EACvC,eAAe;IAAW;IAAiB;IAAgB;;;;iBAI5C;EACf,SAAS;EACT,UAAU;;;iBAIK;EACf,SAAS,mBAAmB;IAAS,MAAM,SAAS,UAAU,QAAQ;KAAa;EACnF,IAAI;IAAsB,MAAM,SAAS,UAAU,QAAQ;IAAW;;;;iBAIvD;;WAEN;;WAEA;;WAEA;WACA;;iBAGM;WACN,OAAO;;WAEP;WACA;;;;;;YAOC,uBAAuB,YAAY,YAAY;;qBAG9C;;;;;iBAOI;;EAEf;EACA;EACA;EACA;;EAEA;EACA;;EAEA;;;iBAIe;EACf,OAAO;;EAEP;;;;;EAKA;;EAEA,iBAAiB;;EAEjB;;EAEA;;EAEA;;EAEA,cAAc,SAAS;;EAEvB;;EAEA;;;;;EAKA,mBAAmB;;EAEnB,oBACE,uBACC,QAAQ,oCAAoC;;EAE/C;IAA4B;IAAY;IAAc;IAAc;;;EAEpE;;;;;EAKA,kBAAkB;;EAElB,iBAAiB;;EAEjB,iBAAiB;;EAEjB,uBAAuB;;EAEvB,eAAe;;;;;EAKf,iBAAiB,UAAU;;EAE3B,YAAY,OAAO,YAAY,kBAAkB,SAAS,UAAU,QAAQ;;EAE5E,cAAc;;EAEd,gBAAgB,mBAAmB,mBAAmB,kBAAkB;;EAExE,kBAAkB;;EAElB,mBAAmB;;EAEnB,kBAAkB;;EAElB,eAAe;;EAEf,aAAa;;EAEb;IAAkB,MAAM,SAAS,UAAU,QAAQ;;;;;;;EAMnD,WAAW,cAAc,gBAAgB,QAAQ;EACjD,SAAS;;;;;;;iBAQM;EACf,MAAM,SAAS,UAAU,WAAW,QAAQ;EAC5C;;iBAGe;;EAEf;EACA,MAAM,SAAS,eAAe"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
//#region src/schemas/packageApi.ts
|
|
2
|
-
const
|
|
2
|
+
const PO_API_SCOPES = [
|
|
3
3
|
"global",
|
|
4
4
|
"workspace",
|
|
5
5
|
"session"
|
|
6
6
|
];
|
|
7
7
|
/** Canonical public prefix. Scope selection never falls through to a parent. */
|
|
8
|
-
function
|
|
8
|
+
function poApiMountPath(mount) {
|
|
9
9
|
if (mount.scope === "global") return "/api/plugins";
|
|
10
10
|
if (mount.scope === "workspace") return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;
|
|
11
11
|
if (!mount.workspaceId) throw new Error("A session API path requires its workspace identity.");
|
|
12
12
|
return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;
|
|
13
13
|
}
|
|
14
14
|
/** Only canonical resource paths may select a protocol listener. */
|
|
15
|
-
function
|
|
15
|
+
function parsePoSocketPath(pathname) {
|
|
16
16
|
if (pathname === "/api/ws") return { scope: "global" };
|
|
17
17
|
const match = /^\/api\/workspaces\/([^/]+)(?:\/sessions\/([^/]+))?\/ws$/u.exec(pathname);
|
|
18
18
|
if (!match) return void 0;
|
|
@@ -31,23 +31,23 @@ function parseDoomSocketPath(pathname) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
/** The segment an API is mounted under, below this prefix. */
|
|
34
|
-
const
|
|
34
|
+
const PO_API_ROUTE_PREFIX = "/api/plugins";
|
|
35
35
|
/** Selects the hub API bundle that owns the named cockpit session. */
|
|
36
|
-
const
|
|
36
|
+
const PO_HUB_API_SESSION_QUERY_PARAM = "hubSession";
|
|
37
37
|
/** Trusted caller headers written only by the cockpit-to-session proxy. */
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
const PO_API_CALLER_LOCALITY_HEADER = "x-po-api-caller-locality";
|
|
39
|
+
const PO_API_CALLER_DEVICE_ID_HEADER = "x-po-api-caller-device-id";
|
|
40
|
+
const PO_API_CALLER_STEP_UP_HEADER = "x-po-api-caller-step-up";
|
|
41
|
+
const PO_API_CALLER_HEADERS = [
|
|
42
|
+
PO_API_CALLER_LOCALITY_HEADER,
|
|
43
|
+
PO_API_CALLER_DEVICE_ID_HEADER,
|
|
44
|
+
PO_API_CALLER_STEP_UP_HEADER
|
|
45
45
|
];
|
|
46
46
|
/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */
|
|
47
|
-
function
|
|
48
|
-
const locality = headers.get(
|
|
49
|
-
const deviceId = headers.get(
|
|
50
|
-
const stepUp = headers.get(
|
|
47
|
+
function poApiCallerFrom(headers) {
|
|
48
|
+
const locality = headers.get(PO_API_CALLER_LOCALITY_HEADER);
|
|
49
|
+
const deviceId = headers.get(PO_API_CALLER_DEVICE_ID_HEADER);
|
|
50
|
+
const stepUp = headers.get(PO_API_CALLER_STEP_UP_HEADER);
|
|
51
51
|
if (locality === "local") return deviceId === null && stepUp === "not-required" ? {
|
|
52
52
|
locality,
|
|
53
53
|
stepUp
|
|
@@ -59,8 +59,8 @@ function doomApiCallerFrom(headers) {
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
/** Why shareFile rejects while the host has no public tunnel origin. */
|
|
62
|
-
const
|
|
62
|
+
const PO_SHARE_FILE_REMOTE_OFF_MESSAGE = "Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.";
|
|
63
63
|
//#endregion
|
|
64
|
-
export {
|
|
64
|
+
export { PO_API_CALLER_DEVICE_ID_HEADER, PO_API_CALLER_HEADERS, PO_API_CALLER_LOCALITY_HEADER, PO_API_CALLER_STEP_UP_HEADER, PO_API_ROUTE_PREFIX, PO_API_SCOPES, PO_HUB_API_SESSION_QUERY_PARAM, PO_SHARE_FILE_REMOTE_OFF_MESSAGE, parsePoSocketPath, poApiCallerFrom, poApiMountPath };
|
|
65
65
|
|
|
66
66
|
//# sourceMappingURL=packageApi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageApi.mjs","names":[],"sources":["../../../src/schemas/packageApi.ts"],"sourcesContent":["/**\n * The HTTP surface a package offers its host.\n *\n * A server facet registers one with its host. The host mounts it under the API\n * route prefix, and the package writes routes relative to that mount.\n *\n * The handler is a plain fetch callback so no host and no package is committed\n * to one HTTP framework; a Hono app satisfies it through `app.fetch`.\n */\n\nimport type {\n DoomComputerUseSessionAccess,\n DoomDirectEventBus,\n DoomHubSessionService,\n DoomSessionCommunicationEndpoint,\n DoomSessionActivity,\n DoomSessionContext,\n} from './hubChannel';\nimport type { DoomMcpProjection } from './mcpProjection';\n/** The host-owned sync view a repository-scoped package API may inspect. */\nexport interface DoomRepositorySyncView {\n fresh: boolean;\n reasons: string[];\n /** True while a background sync that may prepare what `reasons` names is running. */\n syncing?: boolean;\n mcpProjection?: DoomMcpProjection;\n}\n\n/** Where an API runs: inside one session's server, or in the machine-wide hub. */\nexport type DoomApiScope = 'global' | 'workspace' | 'session';\n\nexport const DOOM_API_SCOPES: readonly DoomApiScope[] = ['global', 'workspace', 'session'];\n\n/** Identity of an independently mounted plugin host. */\nexport type DoomApiMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; sessionId: string };\n\n/** Immutable browser contribution generation paired with a server mount. */\nexport interface DoomWebComposition {\n id: string;\n scope: DoomApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n verifiedAssetBaseUrl: string;\n /** `[slot, entry]` for each of this mount's plugin copies, the entry an absolute path below the asset prefixes. */\n pluginEntries: [string, string][];\n /** Every signed file this mount's slots can load, absolute below the asset prefixes. */\n assetPaths: string[];\n /** Per-plugin stylesheets of this mount's plugins only, so other mounts' classes never apply here. */\n stylePaths: string[];\n channels: string[];\n /** The slots resolved for this mount; the shared build may hold more. */\n plugins: string[];\n}\n\n/**\n * Immutable native contribution generation paired with a server mount. One signed CommonJS module at\n * `entryPath`, served through the same immutable plugin routes as web compositions.\n */\nexport interface DoomNativeComposition {\n id: string;\n scope: DoomApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n /** Always `/composition.js`. */\n entryPath: string;\n channels: string[];\n /** The `poNative.pluginId` values resolved for this mount; the shell installs only these. */\n plugins: string[];\n}\n\n/** Canonical public prefix. Scope selection never falls through to a parent. */\nexport function doomApiMountPath(mount: DoomApiMount & { workspaceId?: string }): string {\n if (mount.scope === 'global') return '/api/plugins';\n if (mount.scope === 'workspace') return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;\n if (!mount.workspaceId) throw new Error('A session API path requires its workspace identity.');\n return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;\n}\n\n/** Scope addressed by a public WebSocket upgrade. */\nexport type DoomSocketMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; workspaceId: string; sessionId: string };\n\n/** Only canonical resource paths may select a protocol listener. */\nexport function parseDoomSocketPath(pathname: string): DoomSocketMount | undefined {\n if (pathname === '/api/ws') return { scope: 'global' };\n const match = /^\\/api\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?\\/ws$/u.exec(pathname);\n if (!match) return undefined;\n try {\n const workspaceId = decodeURIComponent(match[1]);\n return match[2] === undefined\n ? { scope: 'workspace', workspaceId }\n : { scope: 'session', workspaceId, sessionId: decodeURIComponent(match[2]) };\n } catch {\n return undefined;\n }\n}\n\n/** The segment an API is mounted under, below this prefix. */\nexport const DOOM_API_ROUTE_PREFIX = '/api/plugins';\n/** Selects the hub API bundle that owns the named cockpit session. */\nexport const DOOM_HUB_API_SESSION_QUERY_PARAM = 'hubSession';\n\n/** Trusted caller headers written only by the cockpit-to-session proxy. */\nexport const DOOM_API_CALLER_LOCALITY_HEADER = 'x-po-api-caller-locality';\nexport const DOOM_API_CALLER_DEVICE_ID_HEADER = 'x-po-api-caller-device-id';\nexport const DOOM_API_CALLER_STEP_UP_HEADER = 'x-po-api-caller-step-up';\nexport const DOOM_API_CALLER_HEADERS = [\n DOOM_API_CALLER_LOCALITY_HEADER,\n DOOM_API_CALLER_DEVICE_ID_HEADER,\n DOOM_API_CALLER_STEP_UP_HEADER,\n] as const;\n\nexport type DoomApiCallerStepUp = 'not-required' | 'verified' | 'unavailable';\nexport type DoomApiCaller =\n | { locality: 'local'; stepUp: 'not-required' }\n | { locality: 'remote'; deviceId: string; stepUp: DoomApiCallerStepUp };\n\n/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */\nexport function doomApiCallerFrom(headers: Headers): DoomApiCaller | undefined {\n const locality = headers.get(DOOM_API_CALLER_LOCALITY_HEADER);\n const deviceId = headers.get(DOOM_API_CALLER_DEVICE_ID_HEADER);\n const stepUp = headers.get(DOOM_API_CALLER_STEP_UP_HEADER);\n if (locality === 'local') {\n return deviceId === null && stepUp === 'not-required' ? { locality, stepUp } : undefined;\n }\n if (\n locality === 'remote' &&\n deviceId !== null &&\n deviceId !== '' &&\n (stepUp === 'not-required' || stepUp === 'verified' || stepUp === 'unavailable')\n ) {\n return { locality, deviceId, stepUp };\n }\n return undefined;\n}\n/**\n * A browser-reachable OAuth redirect the host serves on its own listener.\n *\n * A package brokering third-party OAuth cannot use a loopback redirect when the\n * operator's browser is on another machine: `127.0.0.1` resolves to whichever\n * machine the browser runs on. The host owns a listener that is reachable from\n * wherever the cockpit is being used, so it lends that instead of the package\n * opening a port of its own.\n */\nexport interface DoomOAuthRedirect {\n /** Absolute URL to register as the redirect target, already origin-correct. */\n readonly redirectUri: string;\n /**\n * Accept redirects carrying this state. Must complete before the\n * authorization URL is surfaced, or the redirect races its own reservation.\n */\n reserve(state: string, timeoutMs?: number): Promise<void>;\n /** Resolves once the redirect carrying this state arrives. */\n wait(state: string, timeoutMs?: number): Promise<{ code: string; state: string }>;\n /** Drops a reservation whose flow ended without a redirect. */\n cancel(state: string): void;\n}\n\n/** An exact, host-owned receipt address. Provider IDs are not event cursor positions. */\nexport interface DoomRequestReceiptKey {\n namespace: string;\n activationId: string;\n requestId: string;\n}\n\nexport interface DoomRequestReceipt extends DoomRequestReceiptKey {\n fingerprint: string;\n destination: string;\n transactionId: string;\n outcome: 'reserved' | 'admitted' | 'rejected' | 'uncertain';\n}\n\nexport interface DoomRequestReceiptReservation extends DoomRequestReceiptKey {\n /** Lowercase SHA-256 of the authoritative request text, never the full transcript. */\n fingerprint: string;\n destination: string;\n transactionId: string;\n}\n\nexport type DoomRequestReceiptReserveResult =\n | { kind: 'reserved'; token: string }\n | { kind: 'existing'; receipt: DoomRequestReceipt }\n | { kind: 'conflict'; receipt: DoomRequestReceipt };\n\n/** A global-only receipt capability. A reservation is not an execution receipt. */\nexport interface DoomRequestReceipts {\n reserve(request: DoomRequestReceiptReservation): Promise<DoomRequestReceiptReserveResult>;\n lookup(key: DoomRequestReceiptKey): Promise<DoomRequestReceipt | undefined>;\n finish(\n request: DoomRequestReceiptKey & { token: string; outcome: 'admitted' | 'rejected' | 'uncertain' },\n ): Promise<DoomRequestReceipt>;\n}\n\n/** Permit returned for expensive local work. Calling it releases the slot. */\nexport interface DoomHostExecutionPermit {\n (): void;\n attachProcess?(pid: number): Promise<void>;\n}\n\n/** Host-wide admission for expensive local work. Release only after the owned process exits. */\nexport interface DoomHostExecutionBudget {\n acquire(signal?: AbortSignal): Promise<DoomHostExecutionPermit>;\n getSnapshot(): Readonly<{ running: number; queued: number; limit: number }>;\n}\n\n/** Synchronous host-owned exclusion across media APIs mounted at different scopes. */\nexport interface DoomHostMediaArbitration {\n register(busy: () => boolean): () => void;\n available(busy: () => boolean): boolean;\n}\n\n/** One host's paired agent registrations, shared across its global and session mounts. */\nexport interface DoomPeerAgentRegistry {\n register(sessionId: string, agent: { fetch(request: Request): Promise<Response> }, hubToken: string): () => void;\n get(sessionId: string): { fetch(request: Request): Promise<Response>; hubToken: string } | undefined;\n}\n\n/** Why shareFile rejects while the host has no public tunnel origin. */\nexport const DOOM_SHARE_FILE_REMOTE_OFF_MESSAGE =\n 'Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.';\n\n/**\n * A file published at a short-lived public tunnel URL: 10 minutes, 3 downloads, and gone\n * when the tunnel revision changes. Call revoke as soon as the consumer is done with it.\n */\nexport interface DoomSharedFile {\n /** Bearer link; never log or persist it. */\n url: string;\n fileName: string;\n mimeType: string;\n size: number;\n /** Expiry as epoch milliseconds. */\n expiresAt: number;\n maxDownloads: number;\n /** Idempotent. */\n revoke(): void;\n}\n\n/** What the host tells an API about itself when it starts. */\nexport interface DoomApiContext {\n scope: DoomApiScope;\n /** Stable, opaque workspace id, shared by every session and member checkout of the workspace. */\n workspaceId?: string;\n /**\n * The admitted workspace root for a workspace mount. For a session mount it is the checkout\n * the session runs in; read sessionContext for both roots. Absent from global mounts.\n */\n workspaceRoot?: string;\n /** The session's baseline context; present on session mounts whose host knows its workspace. */\n sessionContext?: DoomSessionContext;\n /** Explicit host home, never selected by a remote request. */\n homeDirectory?: string;\n /** The session this host serves; absent for a hub-scoped API. */\n sessionId?: string;\n /** The session's working directory; absent for a hub-scoped API. */\n cwd?: string;\n /** Session environment admitted by the server, never supplied by remote clients. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** Shared only with child processes in this session, never with remote API clients. */\n internalToken?: string;\n /** Shared only with the cockpit hub for privileged cross-session coordination. */\n hubToken?: string;\n /**\n * Resolves a hub-issued opaque repository id to an admitted canonical root.\n * Hub APIs must never accept a browser-supplied filesystem path instead.\n */\n resolveRepository?(repositoryId: string): string | undefined;\n /** Reads the admitted repository's sync projection without exposing its state path. */\n readRepositorySync?(\n repositoryId: string,\n ): Promise<DoomRepositorySyncView | undefined> | DoomRepositorySyncView | undefined;\n /** Admitted workspaces available to this mount. */\n repositories?(): readonly { id: string; name: string; path: string; active: boolean }[];\n /** Publish a successful config write to the owning mount's refresh lifecycle. */\n configurationChanged?(): void;\n /**\n * Borrows the hub's OAuth redirect surface. Undefined when the hub cannot\n * currently serve one, in which case the package keeps its own behaviour.\n */\n oauthRedirect?(): DoomOAuthRedirect | undefined;\n /** Canonical in-process lifecycle for sessions created by this host. */\n sessionService?: DoomHubSessionService;\n /** Host-bound, authenticated inter-session event endpoint for this session. */\n sessionCommunication?: DoomSessionCommunicationEndpoint;\n /** Same-process events shared by session APIs and hub channels. */\n directEvents?: DoomDirectEventBus;\n /**\n * Publishes this session's activity line to every page's rail; undefined clears it.\n * Session mounts only. The last publisher wins.\n */\n publishActivity?(activity: DoomSessionActivity | undefined): void;\n /** Trusted in-process dispatch to an explicitly selected mounted API. No browser authentication is performed here. */\n requestApi?(mount: DoomApiMount, basePath: string, request: Request): Promise<Response>;\n /** Present only on a session mounted by an authenticated Desktop host. */\n computerUse?: DoomComputerUseSessionAccess;\n /** Deliver a typed method to a channel on this exact hub mount, retaining the caller's connection identity. */\n receiveChannel?(sessionId: string, frameType: string, payload: unknown, connectionId: string): boolean;\n /** Host-owned replay evidence, supplied only on the global mount. Never exposed to browsers or agents. */\n requestReceipts?: DoomRequestReceipts;\n /** One host's exclusive media activity, shared across global and session scopes. */\n mediaArbitration?: DoomHostMediaArbitration;\n /** One host-wide heavy-job budget, not a separate budget for every session. */\n executionBudget?: DoomHostExecutionBudget;\n /** Paired agents belonging to this host only. */\n peerAgents?: DoomPeerAgentRegistry;\n /** Machine-owned Remote Control service, mounted only by the global core facet. */\n remoteControl?: { fetch(request: Request): Promise<Response> };\n /**\n * Publishes a file from this session's cwd or attachments at a short-lived tunnel URL.\n * Session mounts only; rejects with DOOM_SHARE_FILE_REMOTE_OFF_MESSAGE while remote access is off.\n * The host asks no consent: the caller must obtain it before passing the URL on.\n */\n shareFile?(path: string, label: string): Promise<DoomSharedFile>;\n onNotice(message: string): void;\n}\n\n/**\n * One running surface. The host strips the mount prefix before calling, so\n * routes are declared relative ('/runners/:id/log') and a package never\n * repeats where it was mounted.\n */\nexport interface DoomApiHandler {\n fetch(request: Request): Response | Promise<Response>;\n close(): void;\n}\n\nexport interface DoomApi {\n /** Segment under /api/plugins/; globally unique across loaded packages. */\n basePath: string;\n start(context: DoomApiContext): DoomApiHandler;\n}\n"],"mappings":";AA+BA,MAAa,kBAA2C;CAAC;CAAU;CAAa;AAAS;;AA6CzF,SAAgB,iBAAiB,OAAwD;CACvF,IAAI,MAAM,UAAU,UAAU,OAAO;CACrC,IAAI,MAAM,UAAU,aAAa,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE;CACjG,IAAI,CAAC,MAAM,aAAa,MAAM,IAAI,MAAM,qDAAqD;CAC7F,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE,YAAY,mBAAmB,MAAM,SAAS,EAAE;AAClH;;AASA,SAAgB,oBAAoB,UAA+C;CACjF,IAAI,aAAa,WAAW,OAAO,EAAE,OAAO,SAAS;CACrD,MAAM,QAAQ,4DAA4D,KAAK,QAAQ;CACvF,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI;EACF,MAAM,cAAc,mBAAmB,MAAM,EAAE;EAC/C,OAAO,MAAM,OAAO,KAAA,IAChB;GAAE,OAAO;GAAa;EAAY,IAClC;GAAE,OAAO;GAAW;GAAa,WAAW,mBAAmB,MAAM,EAAE;EAAE;CAC/E,QAAQ;EACN;CACF;AACF;;AAGA,MAAa,wBAAwB;;AAErC,MAAa,mCAAmC;;AAGhD,MAAa,kCAAkC;AAC/C,MAAa,mCAAmC;AAChD,MAAa,iCAAiC;AAC9C,MAAa,0BAA0B;CACrC;CACA;CACA;AACF;;AAQA,SAAgB,kBAAkB,SAA6C;CAC7E,MAAM,WAAW,QAAQ,IAAI,+BAA+B;CAC5D,MAAM,WAAW,QAAQ,IAAI,gCAAgC;CAC7D,MAAM,SAAS,QAAQ,IAAI,8BAA8B;CACzD,IAAI,aAAa,SACf,OAAO,aAAa,QAAQ,WAAW,iBAAiB;EAAE;EAAU;CAAO,IAAI,KAAA;CAEjF,IACE,aAAa,YACb,aAAa,QACb,aAAa,OACZ,WAAW,kBAAkB,WAAW,cAAc,WAAW,gBAElE,OAAO;EAAE;EAAU;EAAU;CAAO;AAGxC;;AAoFA,MAAa,qCACX"}
|
|
1
|
+
{"version":3,"file":"packageApi.mjs","names":[],"sources":["../../../src/schemas/packageApi.ts"],"sourcesContent":["/**\n * The HTTP surface a package offers its host.\n *\n * A server plugin registers one with its host. The host mounts it under the API\n * route prefix, and the package writes routes relative to that mount.\n *\n * The handler is a plain fetch callback so no host and no package is committed\n * to one HTTP framework; a Hono app satisfies it through `app.fetch`.\n */\n\nimport type {\n PoComputerUseSessionAccess,\n PoDirectEventBus,\n PoHubSessionService,\n PoSessionCommunicationEndpoint,\n PoSessionActivity,\n PoSessionContext,\n} from './hubChannel';\nimport type { PoMcpProjection } from './mcpProjection';\nimport type { PoSessionStorageService } from './platform';\n/** The host-owned sync view a repository-scoped package API may inspect. */\nexport interface PoRepositorySyncView {\n fresh: boolean;\n reasons: string[];\n /** True while a background sync that may prepare what `reasons` names is running. */\n syncing?: boolean;\n mcpProjection?: PoMcpProjection;\n}\n\n/** Where an API runs: inside one session's server, or in the machine-wide hub. */\nexport type PoApiScope = 'global' | 'workspace' | 'session';\n\nexport const PO_API_SCOPES: readonly PoApiScope[] = ['global', 'workspace', 'session'];\n\n/** Identity of an independently mounted plugin host. */\nexport type PoApiMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; sessionId: string };\n\n/** Immutable browser contribution generation paired with a server mount. */\nexport interface PoWebComposition {\n id: string;\n scope: PoApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n verifiedAssetBaseUrl: string;\n /** `[slot, entry]` for each of this mount's plugin copies, the entry an absolute path below the asset prefixes. */\n pluginEntries: [string, string][];\n /** Every signed file this mount's slots can load, absolute below the asset prefixes. */\n assetPaths: string[];\n /** Per-plugin stylesheets of this mount's plugins only, so other mounts' classes never apply here. */\n stylePaths: string[];\n channels: string[];\n /** The slots resolved for this mount; the shared build may hold more. */\n plugins: string[];\n}\n\n/**\n * Immutable native contribution generation paired with a server mount. One signed CommonJS module at\n * `entryPath`, served through the same immutable plugin routes as web compositions.\n */\nexport interface PoNativeComposition {\n id: string;\n scope: PoApiScope;\n revision: number;\n manifestUrl: string;\n rawAssetBaseUrl: string;\n /** Always `/composition.js`. */\n entryPath: string;\n channels: string[];\n /** The `poNative.pluginId` values resolved for this mount; the shell installs only these. */\n plugins: string[];\n}\n\n/** Canonical public prefix. Scope selection never falls through to a parent. */\nexport function poApiMountPath(mount: PoApiMount & { workspaceId?: string }): string {\n if (mount.scope === 'global') return '/api/plugins';\n if (mount.scope === 'workspace') return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/plugins`;\n if (!mount.workspaceId) throw new Error('A session API path requires its workspace identity.');\n return `/api/workspaces/${encodeURIComponent(mount.workspaceId)}/sessions/${encodeURIComponent(mount.sessionId)}/plugins`;\n}\n\n/** Scope addressed by a public WebSocket upgrade. */\nexport type PoSocketMount =\n | { scope: 'global' }\n | { scope: 'workspace'; workspaceId: string }\n | { scope: 'session'; workspaceId: string; sessionId: string };\n\n/** Only canonical resource paths may select a protocol listener. */\nexport function parsePoSocketPath(pathname: string): PoSocketMount | undefined {\n if (pathname === '/api/ws') return { scope: 'global' };\n const match = /^\\/api\\/workspaces\\/([^/]+)(?:\\/sessions\\/([^/]+))?\\/ws$/u.exec(pathname);\n if (!match) return undefined;\n try {\n const workspaceId = decodeURIComponent(match[1]);\n return match[2] === undefined\n ? { scope: 'workspace', workspaceId }\n : { scope: 'session', workspaceId, sessionId: decodeURIComponent(match[2]) };\n } catch {\n return undefined;\n }\n}\n\n/** The segment an API is mounted under, below this prefix. */\nexport const PO_API_ROUTE_PREFIX = '/api/plugins';\n/** Selects the hub API bundle that owns the named cockpit session. */\nexport const PO_HUB_API_SESSION_QUERY_PARAM = 'hubSession';\n\n/** Trusted caller headers written only by the cockpit-to-session proxy. */\nexport const PO_API_CALLER_LOCALITY_HEADER = 'x-po-api-caller-locality';\nexport const PO_API_CALLER_DEVICE_ID_HEADER = 'x-po-api-caller-device-id';\nexport const PO_API_CALLER_STEP_UP_HEADER = 'x-po-api-caller-step-up';\nexport const PO_API_CALLER_HEADERS = [\n PO_API_CALLER_LOCALITY_HEADER,\n PO_API_CALLER_DEVICE_ID_HEADER,\n PO_API_CALLER_STEP_UP_HEADER,\n] as const;\n\nexport type PoApiCallerStepUp = 'not-required' | 'verified' | 'unavailable';\nexport type PoApiCaller =\n | { locality: 'local'; stepUp: 'not-required' }\n | { locality: 'remote'; deviceId: string; stepUp: PoApiCallerStepUp };\n\n/** Reads the proxy-authenticated caller identity, rejecting partial or contradictory stamps. */\nexport function poApiCallerFrom(headers: Headers): PoApiCaller | undefined {\n const locality = headers.get(PO_API_CALLER_LOCALITY_HEADER);\n const deviceId = headers.get(PO_API_CALLER_DEVICE_ID_HEADER);\n const stepUp = headers.get(PO_API_CALLER_STEP_UP_HEADER);\n if (locality === 'local') {\n return deviceId === null && stepUp === 'not-required' ? { locality, stepUp } : undefined;\n }\n if (\n locality === 'remote' &&\n deviceId !== null &&\n deviceId !== '' &&\n (stepUp === 'not-required' || stepUp === 'verified' || stepUp === 'unavailable')\n ) {\n return { locality, deviceId, stepUp };\n }\n return undefined;\n}\n/**\n * A browser-reachable OAuth redirect the host serves on its own listener.\n *\n * A package brokering third-party OAuth cannot use a loopback redirect when the\n * operator's browser is on another machine: `127.0.0.1` resolves to whichever\n * machine the browser runs on. The host owns a listener that is reachable from\n * wherever the cockpit is being used, so it lends that instead of the package\n * opening a port of its own.\n */\nexport interface PoOAuthRedirect {\n /** Absolute URL to register as the redirect target, already origin-correct. */\n readonly redirectUri: string;\n /**\n * Accept redirects carrying this state. Must complete before the\n * authorization URL is surfaced, or the redirect races its own reservation.\n */\n reserve(state: string, timeoutMs?: number): Promise<void>;\n /** Resolves once the redirect carrying this state arrives. */\n wait(state: string, timeoutMs?: number): Promise<{ code: string; state: string }>;\n /** Drops a reservation whose flow ended without a redirect. */\n cancel(state: string): void;\n}\n\n/** An exact, host-owned receipt address. Provider IDs are not event cursor positions. */\nexport interface PoRequestReceiptKey {\n namespace: string;\n activationId: string;\n requestId: string;\n}\n\nexport interface PoRequestReceipt extends PoRequestReceiptKey {\n fingerprint: string;\n destination: string;\n transactionId: string;\n outcome: 'reserved' | 'admitted' | 'rejected' | 'uncertain';\n}\n\nexport interface PoRequestReceiptReservation extends PoRequestReceiptKey {\n /** Lowercase SHA-256 of the authoritative request text, never the full transcript. */\n fingerprint: string;\n destination: string;\n transactionId: string;\n}\n\nexport type PoRequestReceiptReserveResult =\n | { kind: 'reserved'; token: string }\n | { kind: 'existing'; receipt: PoRequestReceipt }\n | { kind: 'conflict'; receipt: PoRequestReceipt };\n\n/** A global-only receipt capability. A reservation is not an execution receipt. */\nexport interface PoRequestReceipts {\n reserve(request: PoRequestReceiptReservation): Promise<PoRequestReceiptReserveResult>;\n lookup(key: PoRequestReceiptKey): Promise<PoRequestReceipt | undefined>;\n finish(\n request: PoRequestReceiptKey & { token: string; outcome: 'admitted' | 'rejected' | 'uncertain' },\n ): Promise<PoRequestReceipt>;\n}\n\n/** Permit returned for expensive local work. Calling it releases the slot. */\nexport interface PoHostExecutionPermit {\n (): void;\n attachProcess?(pid: number): Promise<void>;\n}\n\n/** Host-wide admission for expensive local work. Release only after the owned process exits. */\nexport interface PoHostExecutionBudget {\n acquire(signal?: AbortSignal): Promise<PoHostExecutionPermit>;\n getSnapshot(): Readonly<{ running: number; queued: number; limit: number }>;\n}\n\n/** Synchronous host-owned exclusion across media APIs mounted at different scopes. */\nexport interface PoHostMediaArbitration {\n register(busy: () => boolean): () => void;\n available(busy: () => boolean): boolean;\n}\n\n/** One host's paired agent registrations, shared across its global and session mounts. */\nexport interface PoPeerAgentRegistry {\n register(sessionId: string, agent: { fetch(request: Request): Promise<Response> }, hubToken: string): () => void;\n get(sessionId: string): { fetch(request: Request): Promise<Response>; hubToken: string } | undefined;\n}\n\n/** One agent that edits files: a hub session or an in-process child run. */\nexport interface PoEditPresenceAgent {\n /** `session:<id>` or `run:<runId>`. Unique across the host. */\n readonly key: string;\n /** Read when a note is rendered, so a name registered after the edit still shows. */\n readonly label: () => string;\n /** Hub session id other agents can reach with intercom. */\n readonly contact: string;\n readonly isLive: () => boolean;\n}\n\nexport interface PoEditPresenceEntry {\n readonly agent: PoEditPresenceAgent;\n /** `@file` tag of the bytes this agent's last successful edit or write left behind. */\n readonly tag: string;\n readonly at: number;\n}\n\n/**\n * Host-wide record of the last edit each live agent made to a file, keyed by realpath then agent key.\n * Owners delete their entries when they dispose, so no callback outlives its session or run.\n */\nexport type PoEditPresenceLedger = Map<string, Map<string, PoEditPresenceEntry>>;\n\n/** Why shareFile rejects while the host has no public tunnel origin. */\nexport const PO_SHARE_FILE_REMOTE_OFF_MESSAGE =\n 'Remote access is off, so Po cannot share files with remote MCP servers. Turn it on and retry.';\n\n/**\n * A file published at a short-lived public tunnel URL: 10 minutes, 3 downloads, and gone\n * when the tunnel revision changes. Call revoke as soon as the consumer is done with it.\n */\nexport interface PoSharedFile {\n /** Bearer link; never log or persist it. */\n url: string;\n fileName: string;\n mimeType: string;\n size: number;\n /** Expiry as epoch milliseconds. */\n expiresAt: number;\n maxDownloads: number;\n /** Idempotent. */\n revoke(): void;\n}\n\n/** What the host tells an API about itself when it starts. */\nexport interface PoApiContext {\n scope: PoApiScope;\n /** Stable, opaque workspace id, shared by every session and member checkout of the workspace. */\n workspaceId?: string;\n /**\n * The admitted workspace root for a workspace mount. For a session mount it is the checkout\n * the session runs in; read sessionContext for both roots. Absent from global mounts.\n */\n workspaceRoot?: string;\n /** The session's baseline context; present on session mounts whose host knows its workspace. */\n sessionContext?: PoSessionContext;\n /** Explicit host home, never selected by a remote request. */\n homeDirectory?: string;\n /** The session this host serves; absent for a hub-scoped API. */\n sessionId?: string;\n /** The session's working directory; absent for a hub-scoped API. */\n cwd?: string;\n /** Session environment admitted by the server, never supplied by remote clients. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** Shared only with child processes in this session, never with remote API clients. */\n internalToken?: string;\n /** Shared only with the cockpit hub for privileged cross-session coordination. */\n hubToken?: string;\n /**\n * Resolves a hub-issued opaque repository id to an admitted canonical root.\n * Hub APIs must never accept a browser-supplied filesystem path instead.\n */\n resolveRepository?(repositoryId: string): string | undefined;\n /** Reads the admitted repository's sync projection without exposing its state path. */\n readRepositorySync?(\n repositoryId: string,\n ): Promise<PoRepositorySyncView | undefined> | PoRepositorySyncView | undefined;\n /** Admitted workspaces available to this mount. */\n repositories?(): readonly { id: string; name: string; path: string; active: boolean }[];\n /** Publish a successful config write to the owning mount's refresh lifecycle. */\n configurationChanged?(): void;\n /**\n * Borrows the hub's OAuth redirect surface. Undefined when the hub cannot\n * currently serve one, in which case the package keeps its own behaviour.\n */\n oauthRedirect?(): PoOAuthRedirect | undefined;\n /** Canonical in-process lifecycle for sessions created by this host. */\n sessionService?: PoHubSessionService;\n /** Trusted in-process storage capability. APIs must retain their mount's session authorization. */\n sessionStorage?: PoSessionStorageService;\n /** Host-bound, authenticated inter-session event endpoint for this session. */\n sessionCommunication?: PoSessionCommunicationEndpoint;\n /** Same-process events shared by session APIs and hub channels. */\n directEvents?: PoDirectEventBus;\n /**\n * Publishes this session's activity line to every page's rail; undefined clears it.\n * Session mounts only. The last publisher wins.\n */\n publishActivity?(activity: PoSessionActivity | undefined): void;\n /** Trusted in-process dispatch to an explicitly selected mounted API. No browser authentication is performed here. */\n requestApi?(mount: PoApiMount, basePath: string, request: Request): Promise<Response>;\n /** Present only on a session mounted by an authenticated Desktop host. */\n computerUse?: PoComputerUseSessionAccess;\n /** Deliver a typed method to the channel serving a session this mount reaches, retaining the caller's connection identity. */\n receiveChannel?(sessionId: string, frameType: string, payload: unknown, connectionId: string): boolean;\n /** Host-owned replay evidence, supplied only on the global mount. Never exposed to browsers or agents. */\n requestReceipts?: PoRequestReceipts;\n /** One host's exclusive media activity, shared across global and session scopes. */\n mediaArbitration?: PoHostMediaArbitration;\n /** One host-wide heavy-job budget, not a separate budget for every session. */\n executionBudget?: PoHostExecutionBudget;\n /** One host-wide edit presence ledger, shared by every session mount. */\n editPresence?: PoEditPresenceLedger;\n /** Paired agents belonging to this host only. */\n peerAgents?: PoPeerAgentRegistry;\n /** Machine-owned Remote Control service, mounted only by Po's own global server plugin. */\n remoteControl?: { fetch(request: Request): Promise<Response> };\n /**\n * Publishes a file from this session's cwd or attachments at a short-lived tunnel URL.\n * Session mounts only; rejects with PO_SHARE_FILE_REMOTE_OFF_MESSAGE while remote access is off.\n * The host asks no consent: the caller must obtain it before passing the URL on.\n */\n shareFile?(path: string, label: string): Promise<PoSharedFile>;\n onNotice(message: string): void;\n}\n\n/**\n * One running surface. The host strips the mount prefix before calling, so\n * routes are declared relative ('/runners/:id/log') and a package never\n * repeats where it was mounted.\n */\nexport interface PoApiHandler {\n fetch(request: Request): Response | Promise<Response>;\n close(): void;\n}\n\nexport interface PoApi {\n /** Segment under /api/plugins/; globally unique across loaded packages. */\n basePath: string;\n start(context: PoApiContext): PoApiHandler;\n}\n"],"mappings":";AAgCA,MAAa,gBAAuC;CAAC;CAAU;CAAa;AAAS;;AA6CrF,SAAgB,eAAe,OAAsD;CACnF,IAAI,MAAM,UAAU,UAAU,OAAO;CACrC,IAAI,MAAM,UAAU,aAAa,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE;CACjG,IAAI,CAAC,MAAM,aAAa,MAAM,IAAI,MAAM,qDAAqD;CAC7F,OAAO,mBAAmB,mBAAmB,MAAM,WAAW,EAAE,YAAY,mBAAmB,MAAM,SAAS,EAAE;AAClH;;AASA,SAAgB,kBAAkB,UAA6C;CAC7E,IAAI,aAAa,WAAW,OAAO,EAAE,OAAO,SAAS;CACrD,MAAM,QAAQ,4DAA4D,KAAK,QAAQ;CACvF,IAAI,CAAC,OAAO,OAAO,KAAA;CACnB,IAAI;EACF,MAAM,cAAc,mBAAmB,MAAM,EAAE;EAC/C,OAAO,MAAM,OAAO,KAAA,IAChB;GAAE,OAAO;GAAa;EAAY,IAClC;GAAE,OAAO;GAAW;GAAa,WAAW,mBAAmB,MAAM,EAAE;EAAE;CAC/E,QAAQ;EACN;CACF;AACF;;AAGA,MAAa,sBAAsB;;AAEnC,MAAa,iCAAiC;;AAG9C,MAAa,gCAAgC;AAC7C,MAAa,iCAAiC;AAC9C,MAAa,+BAA+B;AAC5C,MAAa,wBAAwB;CACnC;CACA;CACA;AACF;;AAQA,SAAgB,gBAAgB,SAA2C;CACzE,MAAM,WAAW,QAAQ,IAAI,6BAA6B;CAC1D,MAAM,WAAW,QAAQ,IAAI,8BAA8B;CAC3D,MAAM,SAAS,QAAQ,IAAI,4BAA4B;CACvD,IAAI,aAAa,SACf,OAAO,aAAa,QAAQ,WAAW,iBAAiB;EAAE;EAAU;CAAO,IAAI,KAAA;CAEjF,IACE,aAAa,YACb,aAAa,QACb,aAAa,OACZ,WAAW,kBAAkB,WAAW,cAAc,WAAW,gBAElE,OAAO;EAAE;EAAU;EAAU;CAAO;AAGxC;;AA4GA,MAAa,mCACX"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/schemas/platform.ts
|
|
2
|
+
const PO_FS_SERVICE = "po/fs";
|
|
3
|
+
const PO_SHELL_SERVICE = "po/shell";
|
|
4
|
+
const PO_SQLITE_SERVICE = "po/sqlite";
|
|
5
|
+
const PO_SESSION_STORAGE_SERVICE = "po/session-storage";
|
|
6
|
+
function readPoFs(context) {
|
|
7
|
+
return context.get(PO_FS_SERVICE);
|
|
8
|
+
}
|
|
9
|
+
function requirePoFs(context) {
|
|
10
|
+
const service = readPoFs(context);
|
|
11
|
+
if (!service) throw new Error(`The '${PO_FS_SERVICE}' service is unavailable. Start a Po server first.`);
|
|
12
|
+
return service;
|
|
13
|
+
}
|
|
14
|
+
function requirePoShell(context) {
|
|
15
|
+
const service = context.get(PO_SHELL_SERVICE);
|
|
16
|
+
if (!service) throw new Error(`The '${PO_SHELL_SERVICE}' service is unavailable. Start a Po server first.`);
|
|
17
|
+
return service;
|
|
18
|
+
}
|
|
19
|
+
function requirePoSqlite(context) {
|
|
20
|
+
const service = context.get(PO_SQLITE_SERVICE);
|
|
21
|
+
if (!service) throw new Error(`The '${PO_SQLITE_SERVICE}' service is unavailable. Start a Po server first.`);
|
|
22
|
+
return service;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.PO_FS_SERVICE = PO_FS_SERVICE;
|
|
26
|
+
exports.PO_SESSION_STORAGE_SERVICE = PO_SESSION_STORAGE_SERVICE;
|
|
27
|
+
exports.PO_SHELL_SERVICE = PO_SHELL_SERVICE;
|
|
28
|
+
exports.PO_SQLITE_SERVICE = PO_SQLITE_SERVICE;
|
|
29
|
+
exports.readPoFs = readPoFs;
|
|
30
|
+
exports.requirePoFs = requirePoFs;
|
|
31
|
+
exports.requirePoShell = requirePoShell;
|
|
32
|
+
exports.requirePoSqlite = requirePoSqlite;
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=platform.cjs.map
|