@agimon-ai/po-core 0.0.0-alpha.21 → 0.0.0-alpha.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -149
- package/NOTICE +1 -1
- package/README.md +40 -3
- package/dist/agentModel.cjs +4 -0
- package/dist/agentModel.d.mts +3 -1
- package/dist/agentModel.mjs +3 -1
- package/dist/apiContracts.cjs +631 -326
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +1252 -149
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +626 -323
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/approval.cjs +17 -0
- package/dist/approval.d.mts +5 -0
- package/dist/approval.mjs +4 -0
- package/dist/backgroundWork.cjs +5 -0
- package/dist/backgroundWork.d.mts +2 -2
- package/dist/backgroundWork.mjs +1 -1
- package/dist/bundlePublicationWorker.cjs +30 -0
- package/dist/bundlePublicationWorker.cjs.map +1 -0
- package/dist/bundlePublicationWorker.d.mts +1 -0
- package/dist/bundlePublicationWorker.mjs +28 -0
- package/dist/bundlePublicationWorker.mjs.map +1 -0
- package/dist/childSession.d.mts +3 -2
- package/dist/clientDevices.cjs +4 -0
- package/dist/clientDevices.d.mts +3 -0
- package/dist/clientDevices.mjs +1 -0
- package/dist/clientMetadata.cjs +13 -0
- package/dist/clientMetadata.d.mts +4 -0
- package/dist/clientMetadata.mjs +3 -0
- package/dist/codemode.cjs +7 -0
- package/dist/codemode.d.mts +2 -0
- package/dist/codemode.mjs +1 -0
- package/dist/contextDetailStore.cjs +20 -12
- package/dist/contextDetailStore.cjs.map +1 -1
- package/dist/contextDetailStore.d.mts +7 -4
- package/dist/contextDetailStore.d.mts.map +1 -1
- package/dist/contextDetailStore.mjs +19 -11
- package/dist/contextDetailStore.mjs.map +1 -1
- package/dist/contextProjection.cjs +68 -8
- package/dist/contextProjection.cjs.map +1 -1
- package/dist/contextProjection.d.mts +34 -10
- package/dist/contextProjection.d.mts.map +1 -1
- package/dist/contextProjection.mjs +65 -9
- package/dist/contextProjection.mjs.map +1 -1
- package/dist/delegation.cjs +3 -0
- package/dist/delegation.d.mts +2 -2
- package/dist/delegation.mjs +1 -1
- package/dist/executionBudget.cjs +13 -5
- package/dist/executionBudget.cjs.map +1 -1
- package/dist/executionBudget.d.mts.map +1 -1
- package/dist/executionBudget.mjs +13 -5
- package/dist/executionBudget.mjs.map +1 -1
- package/dist/extensionFile.cjs +1 -2
- package/dist/extensionFile.d.mts +4 -4
- package/dist/extensionFile.mjs +3 -3
- package/dist/headless.cjs +22 -0
- package/dist/headless.d.mts +6 -2
- package/dist/headless.mjs +5 -1
- package/dist/headlessHub.cjs +941 -137
- package/dist/headlessHub.cjs.map +1 -1
- package/dist/headlessHub.d.mts +133 -25
- package/dist/headlessHub.d.mts.map +1 -1
- package/dist/headlessHub.mjs +938 -135
- package/dist/headlessHub.mjs.map +1 -1
- package/dist/headlessProtocol.cjs +331 -74
- package/dist/headlessProtocol.cjs.map +1 -1
- package/dist/headlessProtocol.d.mts +29 -3
- package/dist/headlessProtocol.d.mts.map +1 -1
- package/dist/headlessProtocol.mjs +335 -79
- package/dist/headlessProtocol.mjs.map +1 -1
- package/dist/headlessServer.cjs +1057 -219
- package/dist/headlessServer.cjs.map +1 -1
- package/dist/headlessServer.d.mts +140 -14
- package/dist/headlessServer.d.mts.map +1 -1
- package/dist/headlessServer.mjs +1057 -219
- package/dist/headlessServer.mjs.map +1 -1
- package/dist/headlessSessionHost.d.mts +65 -24
- package/dist/headlessSessionHost.d.mts.map +1 -1
- package/dist/headlessSessionManager.cjs +23 -16
- package/dist/headlessSessionManager.cjs.map +1 -1
- package/dist/headlessSessionManager.d.mts +1 -1
- package/dist/headlessSessionManager.d.mts.map +1 -1
- package/dist/headlessSessionManager.mjs +23 -16
- package/dist/headlessSessionManager.mjs.map +1 -1
- package/dist/help.cjs +6 -0
- package/dist/help.d.mts +2 -2
- package/dist/help.mjs +2 -2
- package/dist/history.cjs +7 -0
- package/dist/history.d.mts +5 -3
- package/dist/history.mjs +5 -2
- package/dist/historyOwnership.cjs +100 -71
- package/dist/historyOwnership.cjs.map +1 -1
- package/dist/historyOwnership.d.mts.map +1 -1
- package/dist/historyOwnership.mjs +103 -75
- package/dist/historyOwnership.mjs.map +1 -1
- package/dist/hubChannel.cjs +32 -0
- package/dist/hubChannel.d.mts +5 -3
- package/dist/hubChannel.mjs +5 -3
- package/dist/images.cjs +15 -0
- package/dist/images.d.mts +2 -0
- package/dist/images.mjs +1 -0
- package/dist/index.cjs +27 -0
- package/dist/index.d.mts +7 -3
- package/dist/index.mjs +7 -3
- package/dist/inputTemplate.cjs +5 -0
- package/dist/inputTemplate.d.mts +3 -0
- package/dist/inputTemplate.mjs +1 -0
- package/dist/interop/piCodingAgent.mjs +1 -0
- package/dist/lintReview.cjs +4 -0
- package/dist/lintReview.d.mts +2 -0
- package/dist/lintReview.mjs +1 -0
- package/dist/locale.cjs +19 -0
- package/dist/locale.d.mts +3 -0
- package/dist/locale.mjs +3 -0
- package/dist/machineApi.cjs +30 -81
- package/dist/machineApi.cjs.map +1 -1
- package/dist/machineApi.d.mts +1 -1
- package/dist/machineApi.d.mts.map +1 -1
- package/dist/machineApi.mjs +30 -79
- package/dist/machineApi.mjs.map +1 -1
- package/dist/main.cjs +6 -1
- package/dist/main.d.mts +3 -3
- package/dist/main.mjs +3 -3
- package/dist/mcp.cjs +7 -0
- package/dist/mcp.d.mts +2 -0
- package/dist/mcp.mjs +1 -0
- package/dist/mcpProjection.cjs +1 -0
- package/dist/mcpProjection.d.mts +2 -2
- package/dist/mcpProjection.mjs +1 -1
- package/dist/mcpSchemaCost.cjs +10 -10
- package/dist/mcpSchemaCost.cjs.map +1 -1
- package/dist/mcpSchemaCost.mjs +9 -9
- package/dist/mcpSchemaCost.mjs.map +1 -1
- package/dist/modelGateway.cjs +33 -0
- package/dist/modelGateway.d.mts +13 -0
- package/dist/modelGateway.mjs +10 -0
- package/dist/moduleResolution.cjs +18 -18
- package/dist/moduleResolution.cjs.map +1 -1
- package/dist/moduleResolution.d.mts +4 -4
- package/dist/moduleResolution.d.mts.map +1 -1
- package/dist/moduleResolution.mjs +17 -17
- package/dist/moduleResolution.mjs.map +1 -1
- package/dist/native.cjs +99 -13
- package/dist/native.d.mts +26 -9
- package/dist/native.mjs +20 -4
- package/dist/nodePlatform.cjs +42 -4
- package/dist/nodePlatform.cjs.map +1 -1
- package/dist/nodePlatform.d.mts +5 -0
- package/dist/nodePlatform.d.mts.map +1 -1
- package/dist/nodePlatform.mjs +42 -5
- package/dist/nodePlatform.mjs.map +1 -1
- package/dist/notification.cjs +1 -0
- package/dist/notification.d.mts +2 -2
- package/dist/notification.mjs +1 -1
- package/dist/operationHook.cjs +3 -0
- package/dist/operationHook.d.mts +2 -0
- package/dist/operationHook.mjs +1 -0
- package/dist/packageApi.cjs +9 -0
- package/dist/packageApi.d.mts +4 -2
- package/dist/packageApi.mjs +3 -2
- package/dist/packageApiServer.cjs +148 -40
- package/dist/packageApiServer.cjs.map +1 -1
- package/dist/packageApiServer.d.mts +34 -6
- package/dist/packageApiServer.d.mts.map +1 -1
- package/dist/packageApiServer.mjs +140 -36
- package/dist/packageApiServer.mjs.map +1 -1
- package/dist/pairingPage.cjs +6 -0
- package/dist/pairingPage.d.mts +2 -0
- package/dist/pairingPage.mjs +1 -0
- package/dist/personTimeZone.cjs +7 -0
- package/dist/personTimeZone.d.mts +2 -0
- package/dist/personTimeZone.mjs +1 -0
- package/dist/piSettings.cjs +2 -0
- package/dist/piSettings.d.mts +3 -3
- package/dist/piSettings.mjs +3 -3
- package/dist/platform.cjs +47 -2
- package/dist/platform.d.mts +11 -6
- package/dist/platform.mjs +11 -6
- package/dist/pluginProtocol.cjs +15 -0
- package/dist/pluginProtocol.d.mts +2 -2
- package/dist/pluginProtocol.mjs +1 -1
- package/dist/po-runtime-identity.json +1 -0
- package/dist/protocolTransport.cjs +7 -0
- package/dist/protocolTransport.d.mts +3 -0
- package/dist/protocolTransport.mjs +3 -0
- package/dist/providerAuth.cjs +8 -0
- package/dist/providerAuth.d.mts +4 -0
- package/dist/providerAuth.mjs +3 -0
- package/dist/remoteChildSession.cjs +6 -0
- package/dist/remoteChildSession.d.mts +3 -0
- package/dist/remoteChildSession.mjs +1 -0
- package/dist/remoteContract.cjs +42 -0
- package/dist/remoteContract.d.mts +4 -0
- package/dist/remoteContract.mjs +3 -0
- package/dist/remoteOrigin.cjs +4 -0
- package/dist/remoteOrigin.d.mts +2 -0
- package/dist/remoteOrigin.mjs +1 -0
- package/dist/runtimeContextApi.cjs +1 -1
- package/dist/runtimeContextApi.cjs.map +1 -1
- package/dist/runtimeContextApi.mjs +1 -1
- package/dist/runtimeContextApi.mjs.map +1 -1
- package/dist/runtimeCordisHost.cjs +9 -8
- package/dist/runtimeCordisHost.cjs.map +1 -1
- package/dist/runtimeCordisHost.d.mts +1 -1
- package/dist/runtimeCordisHost.d.mts.map +1 -1
- package/dist/runtimeCordisHost.mjs +3 -2
- package/dist/runtimeCordisHost.mjs.map +1 -1
- package/dist/runtimeEnvironment.cjs +6 -0
- package/dist/runtimeEnvironment.d.mts +2 -0
- package/dist/runtimeEnvironment.mjs +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts +1 -0
- package/dist/runtimeHeadlessSessionManager.d.mts.map +1 -1
- package/dist/runtimeIdentity.cjs.map +1 -1
- package/dist/runtimeIdentity.d.mts +1 -1
- package/dist/runtimeIdentity.mjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.cjs +4 -4
- package/dist/runtimeLogSinkTelemetry.cjs.map +1 -1
- package/dist/runtimeLogSinkTelemetry.d.mts +4 -3
- package/dist/runtimeLogSinkTelemetry.d.mts.map +1 -1
- package/dist/runtimeLogSinkTelemetry.mjs +4 -4
- package/dist/runtimeLogSinkTelemetry.mjs.map +1 -1
- package/dist/runtimePackages.cjs +27 -22
- package/dist/runtimePackages.cjs.map +1 -1
- package/dist/runtimePackages.d.mts +9 -1
- package/dist/runtimePackages.d.mts.map +1 -1
- package/dist/runtimePackages.mjs +26 -21
- package/dist/runtimePackages.mjs.map +1 -1
- package/dist/runtimePiSettings.cjs +2 -0
- package/dist/runtimePiSettings.d.mts +3 -3
- package/dist/runtimePiSettings.mjs +3 -3
- package/dist/runtimeTransition.cjs.map +1 -1
- package/dist/runtimeTransition.d.mts +7 -7
- package/dist/runtimeTransition.d.mts.map +1 -1
- package/dist/runtimeTransition.mjs.map +1 -1
- package/dist/sandboxIdentity.cjs +5 -0
- package/dist/sandboxIdentity.d.mts +2 -0
- package/dist/sandboxIdentity.mjs +1 -0
- package/dist/server.d.mts +3 -3
- package/dist/serverPlugin.cjs +45 -6
- package/dist/serverPlugin.d.mts +18 -5
- package/dist/serverPlugin.mjs +16 -3
- package/dist/serverTelemetry.cjs +2 -2
- package/dist/serverTelemetry.cjs.map +1 -1
- package/dist/serverTelemetry.d.mts +2 -1
- package/dist/serverTelemetry.d.mts.map +1 -1
- package/dist/serverTelemetry.mjs +1 -1
- package/dist/serverTelemetry.mjs.map +1 -1
- package/dist/sessionFilesApi.cjs +17 -6
- package/dist/sessionFilesApi.cjs.map +1 -1
- package/dist/sessionFilesApi.d.mts.map +1 -1
- package/dist/sessionFilesApi.mjs +17 -6
- package/dist/sessionFilesApi.mjs.map +1 -1
- package/dist/sessionMcpContract.cjs +18 -0
- package/dist/sessionMcpContract.d.mts +5 -0
- package/dist/sessionMcpContract.mjs +1 -0
- package/dist/sessionProtocol.cjs +24 -2
- package/dist/sessionProtocol.d.mts +6 -5
- package/dist/sessionProtocol.mjs +6 -5
- package/dist/skills.cjs +4 -0
- package/dist/skills.d.mts +2 -1
- package/dist/skills.mjs +3 -1
- package/dist/sqliteSessionStorage.cjs +20 -13
- package/dist/sqliteSessionStorage.cjs.map +1 -1
- package/dist/sqliteSessionStorage.d.mts +3 -3
- package/dist/sqliteSessionStorage.d.mts.map +1 -1
- package/dist/sqliteSessionStorage.mjs +19 -12
- package/dist/sqliteSessionStorage.mjs.map +1 -1
- package/dist/src/constants/agentSettled.d.mts +5 -0
- package/dist/src/constants/agentSettled.d.mts.map +1 -0
- package/dist/src/constants/cloud.cjs +11 -0
- package/dist/src/constants/cloud.cjs.map +1 -0
- package/dist/src/constants/cloud.d.mts +9 -0
- package/dist/src/constants/cloud.d.mts.map +1 -0
- package/dist/src/constants/cloud.mjs +11 -0
- package/dist/src/constants/cloud.mjs.map +1 -0
- package/dist/src/constants/fixedCore.cjs +38 -0
- package/dist/src/constants/fixedCore.cjs.map +1 -0
- package/dist/src/constants/fixedCore.d.mts +12 -0
- package/dist/src/constants/fixedCore.d.mts.map +1 -0
- package/dist/src/constants/fixedCore.mjs +38 -0
- package/dist/src/constants/fixedCore.mjs.map +1 -0
- package/dist/src/constants/globalSettings.cjs +10 -0
- package/dist/src/constants/globalSettings.cjs.map +1 -0
- package/dist/src/constants/globalSettings.d.mts +8 -0
- package/dist/src/constants/globalSettings.d.mts.map +1 -0
- package/dist/src/constants/globalSettings.mjs +10 -0
- package/dist/src/constants/globalSettings.mjs.map +1 -0
- package/dist/src/constants/modelGateway.cjs +48 -0
- package/dist/src/constants/modelGateway.cjs.map +1 -0
- package/dist/src/constants/modelGateway.d.mts +29 -0
- package/dist/src/constants/modelGateway.d.mts.map +1 -0
- package/dist/src/constants/modelGateway.mjs +42 -0
- package/dist/src/constants/modelGateway.mjs.map +1 -0
- package/dist/src/constants/nativeHost.cjs +11 -1
- package/dist/src/constants/nativeHost.cjs.map +1 -1
- package/dist/src/constants/nativeHost.d.mts +1 -1
- package/dist/src/constants/nativeHost.d.mts.map +1 -1
- package/dist/src/constants/nativeHost.mjs +11 -1
- package/dist/src/constants/nativeHost.mjs.map +1 -1
- package/dist/src/constants/remote.cjs +26 -14
- package/dist/src/constants/remote.cjs.map +1 -1
- package/dist/src/constants/remote.d.mts +105 -0
- package/dist/src/constants/remote.d.mts.map +1 -0
- package/dist/src/constants/remote.mjs +18 -10
- package/dist/src/constants/remote.mjs.map +1 -1
- package/dist/src/constants/sessionFiles.cjs +3 -0
- package/dist/src/constants/sessionFiles.cjs.map +1 -1
- package/dist/src/constants/sessionFiles.d.mts +9 -0
- package/dist/src/constants/sessionFiles.d.mts.map +1 -0
- package/dist/src/constants/sessionFiles.mjs +3 -1
- package/dist/src/constants/sessionFiles.mjs.map +1 -1
- package/dist/src/constants/template.cjs +13 -0
- package/dist/src/constants/template.cjs.map +1 -0
- package/dist/src/constants/template.d.mts +9 -0
- package/dist/src/constants/template.d.mts.map +1 -0
- package/dist/src/constants/template.mjs +11 -0
- package/dist/src/constants/template.mjs.map +1 -0
- package/dist/src/extensions/extensionFile.cjs +9 -10
- package/dist/src/extensions/extensionFile.cjs.map +1 -1
- package/dist/src/extensions/extensionFile.d.mts +16 -8
- package/dist/src/extensions/extensionFile.d.mts.map +1 -1
- package/dist/src/extensions/extensionFile.mjs +10 -10
- package/dist/src/extensions/extensionFile.mjs.map +1 -1
- package/dist/src/extensions/serverPlugin.cjs +55 -7
- package/dist/src/extensions/serverPlugin.cjs.map +1 -1
- package/dist/src/extensions/serverPlugin.d.mts +1 -1
- package/dist/src/extensions/serverPlugin.d.mts.map +1 -1
- package/dist/src/extensions/serverPlugin.mjs +53 -5
- package/dist/src/extensions/serverPlugin.mjs.map +1 -1
- package/dist/src/extensions/webPlugin.cjs +25 -2
- package/dist/src/extensions/webPlugin.cjs.map +1 -1
- package/dist/src/extensions/webPlugin.d.mts +10 -2
- package/dist/src/extensions/webPlugin.d.mts.map +1 -1
- package/dist/src/extensions/webPlugin.mjs +21 -2
- package/dist/src/extensions/webPlugin.mjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.cjs +299 -132
- package/dist/src/pi/piSessionRuntime.cjs.map +1 -1
- package/dist/src/pi/piSessionRuntime.d.mts +45 -9
- package/dist/src/pi/piSessionRuntime.d.mts.map +1 -1
- package/dist/src/pi/piSessionRuntime.mjs +299 -133
- package/dist/src/pi/piSessionRuntime.mjs.map +1 -1
- package/dist/src/schemas/agentModel.cjs +1 -1
- package/dist/src/schemas/agentModel.cjs.map +1 -1
- package/dist/src/schemas/agentModel.d.mts +1 -1
- package/dist/src/schemas/agentModel.mjs +1 -1
- package/dist/src/schemas/agentModel.mjs.map +1 -1
- package/dist/src/schemas/agentRun.cjs +16 -0
- package/dist/src/schemas/agentRun.cjs.map +1 -0
- package/dist/src/schemas/agentRun.d.mts +48 -0
- package/dist/src/schemas/agentRun.d.mts.map +1 -0
- package/dist/src/schemas/agentRun.mjs +14 -0
- package/dist/src/schemas/agentRun.mjs.map +1 -0
- package/dist/src/schemas/apiContracts.d.mts +2 -2
- package/dist/src/schemas/apiContracts.d.mts.map +1 -1
- package/dist/src/schemas/approval.cjs +21 -0
- package/dist/src/schemas/approval.cjs.map +1 -0
- package/dist/src/schemas/approval.d.mts +82 -0
- package/dist/src/schemas/approval.d.mts.map +1 -0
- package/dist/src/schemas/approval.mjs +15 -0
- package/dist/src/schemas/approval.mjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.cjs +103 -0
- package/dist/src/schemas/approvalPrompt.cjs.map +1 -0
- package/dist/src/schemas/approvalPrompt.d.mts +83 -0
- package/dist/src/schemas/approvalPrompt.d.mts.map +1 -0
- package/dist/src/schemas/approvalPrompt.mjs +99 -0
- package/dist/src/schemas/approvalPrompt.mjs.map +1 -0
- package/dist/src/schemas/askUser.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.cjs +24 -2
- package/dist/src/schemas/backgroundWork.cjs.map +1 -1
- package/dist/src/schemas/backgroundWork.d.mts +11 -1
- package/dist/src/schemas/backgroundWork.d.mts.map +1 -1
- package/dist/src/schemas/backgroundWork.mjs +20 -3
- package/dist/src/schemas/backgroundWork.mjs.map +1 -1
- package/dist/src/schemas/brain.cjs +43 -0
- package/dist/src/schemas/brain.cjs.map +1 -0
- package/dist/src/schemas/brain.d.mts +107 -0
- package/dist/src/schemas/brain.d.mts.map +1 -0
- package/dist/src/schemas/brain.mjs +43 -0
- package/dist/src/schemas/brain.mjs.map +1 -0
- package/dist/src/schemas/childProcess.cjs +2 -1
- package/dist/src/schemas/childProcess.cjs.map +1 -1
- package/dist/src/schemas/childProcess.d.mts +1 -1
- package/dist/src/schemas/childProcess.d.mts.map +1 -1
- package/dist/src/schemas/childProcess.mjs +2 -1
- package/dist/src/schemas/childProcess.mjs.map +1 -1
- package/dist/src/schemas/childReport.cjs +42 -0
- package/dist/src/schemas/childReport.cjs.map +1 -0
- package/dist/src/schemas/childReport.d.mts +96 -0
- package/dist/src/schemas/childReport.d.mts.map +1 -0
- package/dist/src/schemas/childReport.mjs +35 -0
- package/dist/src/schemas/childReport.mjs.map +1 -0
- package/dist/src/schemas/clientDevices.d.mts +25 -0
- package/dist/src/schemas/clientDevices.d.mts.map +1 -0
- package/dist/src/schemas/clientMetadata.d.mts +27 -0
- package/dist/src/schemas/clientMetadata.d.mts.map +1 -0
- package/dist/src/schemas/codemode.cjs +34 -0
- package/dist/src/schemas/codemode.cjs.map +1 -0
- package/dist/src/schemas/codemode.d.mts +162 -0
- package/dist/src/schemas/codemode.d.mts.map +1 -0
- package/dist/src/schemas/codemode.mjs +30 -0
- package/dist/src/schemas/codemode.mjs.map +1 -0
- package/dist/src/schemas/delegation.cjs +35 -3
- package/dist/src/schemas/delegation.cjs.map +1 -1
- package/dist/src/schemas/delegation.d.mts +23 -0
- package/dist/src/schemas/delegation.d.mts.map +1 -1
- package/dist/src/schemas/delegation.mjs +33 -4
- package/dist/src/schemas/delegation.mjs.map +1 -1
- package/dist/src/schemas/extensionFile.d.mts +11 -5
- package/dist/src/schemas/extensionFile.d.mts.map +1 -1
- package/dist/src/schemas/federation.cjs +50 -0
- package/dist/src/schemas/federation.cjs.map +1 -0
- package/dist/src/schemas/federation.d.mts +376 -0
- package/dist/src/schemas/federation.d.mts.map +1 -0
- package/dist/src/schemas/federation.mjs +44 -0
- package/dist/src/schemas/federation.mjs.map +1 -0
- package/dist/src/schemas/headless.cjs +153 -5
- package/dist/src/schemas/headless.cjs.map +1 -1
- package/dist/src/schemas/headless.d.mts +409 -20
- package/dist/src/schemas/headless.d.mts.map +1 -1
- package/dist/src/schemas/headless.mjs +143 -6
- package/dist/src/schemas/headless.mjs.map +1 -1
- package/dist/src/schemas/help.cjs +22 -3
- package/dist/src/schemas/help.cjs.map +1 -1
- package/dist/src/schemas/help.d.mts +70 -3
- package/dist/src/schemas/help.d.mts.map +1 -1
- package/dist/src/schemas/help.mjs +17 -4
- package/dist/src/schemas/help.mjs.map +1 -1
- package/dist/src/schemas/home.cjs +35 -12
- package/dist/src/schemas/home.cjs.map +1 -1
- package/dist/src/schemas/home.d.mts +6 -0
- package/dist/src/schemas/home.d.mts.map +1 -1
- package/dist/src/schemas/home.mjs +34 -13
- package/dist/src/schemas/home.mjs.map +1 -1
- package/dist/src/schemas/hostServiceContracts.cjs +39 -0
- package/dist/src/schemas/hostServiceContracts.cjs.map +1 -0
- package/dist/src/schemas/hostServiceContracts.d.mts +26 -0
- package/dist/src/schemas/hostServiceContracts.d.mts.map +1 -0
- package/dist/src/schemas/hostServiceContracts.mjs +39 -0
- package/dist/src/schemas/hostServiceContracts.mjs.map +1 -0
- package/dist/src/schemas/hostServices.cjs +14 -0
- package/dist/src/schemas/hostServices.cjs.map +1 -0
- package/dist/src/schemas/hostServices.d.mts +45 -0
- package/dist/src/schemas/hostServices.d.mts.map +1 -0
- package/dist/src/schemas/hostServices.mjs +12 -0
- package/dist/src/schemas/hostServices.mjs.map +1 -0
- package/dist/src/schemas/hostTeam.cjs +15 -0
- package/dist/src/schemas/hostTeam.cjs.map +1 -0
- package/dist/src/schemas/hostTeam.d.mts +64 -0
- package/dist/src/schemas/hostTeam.d.mts.map +1 -0
- package/dist/src/schemas/hostTeam.mjs +13 -0
- package/dist/src/schemas/hostTeam.mjs.map +1 -0
- package/dist/src/schemas/httpApiContracts.cjs +282 -18
- package/dist/src/schemas/httpApiContracts.cjs.map +1 -1
- package/dist/src/schemas/httpApiContracts.mjs +282 -18
- package/dist/src/schemas/httpApiContracts.mjs.map +1 -1
- package/dist/src/schemas/hubChannel.cjs +132 -0
- package/dist/src/schemas/hubChannel.cjs.map +1 -1
- package/dist/src/schemas/hubChannel.d.mts +366 -15
- package/dist/src/schemas/hubChannel.d.mts.map +1 -1
- package/dist/src/schemas/hubChannel.mjs +116 -1
- package/dist/src/schemas/hubChannel.mjs.map +1 -1
- package/dist/src/schemas/humanIdentity.cjs +16 -0
- package/dist/src/schemas/humanIdentity.cjs.map +1 -0
- package/dist/src/schemas/humanIdentity.d.mts +39 -0
- package/dist/src/schemas/humanIdentity.d.mts.map +1 -0
- package/dist/src/schemas/humanIdentity.mjs +14 -0
- package/dist/src/schemas/humanIdentity.mjs.map +1 -0
- package/dist/src/schemas/identity.cjs +34 -0
- package/dist/src/schemas/identity.cjs.map +1 -0
- package/dist/src/schemas/identity.d.mts +193 -0
- package/dist/src/schemas/identity.d.mts.map +1 -0
- package/dist/src/schemas/identity.mjs +30 -0
- package/dist/src/schemas/identity.mjs.map +1 -0
- package/dist/src/schemas/lang.cjs +34 -0
- package/dist/src/schemas/lang.cjs.map +1 -0
- package/dist/src/schemas/lang.d.mts +37 -0
- package/dist/src/schemas/lang.d.mts.map +1 -0
- package/dist/src/schemas/lang.mjs +27 -0
- package/dist/src/schemas/lang.mjs.map +1 -0
- package/dist/src/schemas/leader.cjs +1 -1
- package/dist/src/schemas/leader.cjs.map +1 -1
- package/dist/src/schemas/leader.d.mts +1 -1
- package/dist/src/schemas/leader.d.mts.map +1 -1
- package/dist/src/schemas/leader.mjs +1 -1
- package/dist/src/schemas/leader.mjs.map +1 -1
- package/dist/src/schemas/lintReview.cjs +14 -0
- package/dist/src/schemas/lintReview.cjs.map +1 -0
- package/dist/src/schemas/lintReview.d.mts +75 -0
- package/dist/src/schemas/lintReview.d.mts.map +1 -0
- package/dist/src/schemas/lintReview.mjs +13 -0
- package/dist/src/schemas/lintReview.mjs.map +1 -0
- package/dist/src/schemas/locale.cjs +116 -0
- package/dist/src/schemas/locale.cjs.map +1 -0
- package/dist/src/schemas/locale.d.mts +40 -0
- package/dist/src/schemas/locale.d.mts.map +1 -0
- package/dist/src/schemas/locale.mjs +108 -0
- package/dist/src/schemas/locale.mjs.map +1 -0
- package/dist/src/schemas/mcp.cjs +17 -0
- package/dist/src/schemas/mcp.cjs.map +1 -0
- package/dist/src/schemas/mcp.d.mts +112 -0
- package/dist/src/schemas/mcp.d.mts.map +1 -0
- package/dist/src/schemas/mcp.mjs +13 -0
- package/dist/src/schemas/mcp.mjs.map +1 -0
- package/dist/src/schemas/mcpFacet.cjs.map +1 -1
- package/dist/src/schemas/mcpFacet.d.mts +4 -3
- package/dist/src/schemas/mcpFacet.d.mts.map +1 -1
- package/dist/src/schemas/mcpFacet.mjs.map +1 -1
- package/dist/src/schemas/mcpProjection.cjs +11 -1
- package/dist/src/schemas/mcpProjection.cjs.map +1 -1
- package/dist/src/schemas/mcpProjection.d.mts +10 -4
- package/dist/src/schemas/mcpProjection.d.mts.map +1 -1
- package/dist/src/schemas/mcpProjection.mjs +11 -2
- package/dist/src/schemas/mcpProjection.mjs.map +1 -1
- package/dist/src/schemas/mcpSession.d.mts +1 -1
- package/dist/src/schemas/modelGateway.cjs +143 -0
- package/dist/src/schemas/modelGateway.cjs.map +1 -0
- package/dist/src/schemas/modelGateway.d.mts +150 -0
- package/dist/src/schemas/modelGateway.d.mts.map +1 -0
- package/dist/src/schemas/modelGateway.mjs +135 -0
- package/dist/src/schemas/modelGateway.mjs.map +1 -0
- package/dist/src/schemas/narration.d.mts.map +1 -1
- package/dist/src/schemas/notification.cjs +59 -5
- package/dist/src/schemas/notification.cjs.map +1 -1
- package/dist/src/schemas/notification.d.mts +26 -0
- package/dist/src/schemas/notification.d.mts.map +1 -1
- package/dist/src/schemas/notification.mjs +59 -6
- package/dist/src/schemas/notification.mjs.map +1 -1
- package/dist/src/schemas/operationHook.cjs +180 -0
- package/dist/src/schemas/operationHook.cjs.map +1 -0
- package/dist/src/schemas/operationHook.d.mts +141 -0
- package/dist/src/schemas/operationHook.d.mts.map +1 -0
- package/dist/src/schemas/operationHook.mjs +180 -0
- package/dist/src/schemas/operationHook.mjs.map +1 -0
- package/dist/src/schemas/packageApi.cjs +76 -7
- package/dist/src/schemas/packageApi.cjs.map +1 -1
- package/dist/src/schemas/packageApi.d.mts +174 -30
- package/dist/src/schemas/packageApi.d.mts.map +1 -1
- package/dist/src/schemas/packageApi.mjs +70 -8
- package/dist/src/schemas/packageApi.mjs.map +1 -1
- package/dist/src/schemas/personTimeZone.cjs +29 -0
- package/dist/src/schemas/personTimeZone.cjs.map +1 -0
- package/dist/src/schemas/personTimeZone.d.mts +33 -0
- package/dist/src/schemas/personTimeZone.d.mts.map +1 -0
- package/dist/src/schemas/personTimeZone.mjs +25 -0
- package/dist/src/schemas/personTimeZone.mjs.map +1 -0
- package/dist/src/schemas/platform.cjs +48 -0
- package/dist/src/schemas/platform.cjs.map +1 -1
- package/dist/src/schemas/platform.d.mts +355 -11
- package/dist/src/schemas/platform.d.mts.map +1 -1
- package/dist/src/schemas/platform.mjs +34 -1
- package/dist/src/schemas/platform.mjs.map +1 -1
- package/dist/src/schemas/pluginCatalog.cjs +42 -0
- package/dist/src/schemas/pluginCatalog.cjs.map +1 -0
- package/dist/src/schemas/pluginCatalog.d.mts +67 -0
- package/dist/src/schemas/pluginCatalog.d.mts.map +1 -0
- package/dist/src/schemas/pluginCatalog.mjs +39 -0
- package/dist/src/schemas/pluginCatalog.mjs.map +1 -0
- package/dist/src/schemas/pluginContributions.cjs.map +1 -1
- package/dist/src/schemas/pluginContributions.d.mts +5 -2
- package/dist/src/schemas/pluginContributions.d.mts.map +1 -1
- package/dist/src/schemas/pluginContributions.mjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.cjs +110 -10
- package/dist/src/schemas/pluginProtocol.cjs.map +1 -1
- package/dist/src/schemas/pluginProtocol.d.mts +63 -5
- package/dist/src/schemas/pluginProtocol.d.mts.map +1 -1
- package/dist/src/schemas/pluginProtocol.mjs +96 -11
- package/dist/src/schemas/pluginProtocol.mjs.map +1 -1
- package/dist/src/schemas/profileIdentity.cjs +3 -3
- package/dist/src/schemas/profileIdentity.cjs.map +1 -1
- package/dist/src/schemas/profileIdentity.d.mts +2 -2
- package/dist/src/schemas/profileIdentity.mjs +3 -3
- package/dist/src/schemas/profileIdentity.mjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.cjs +4 -8
- package/dist/src/schemas/protocolChannelsContract.cjs.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.d.mts +16 -22
- package/dist/src/schemas/protocolChannelsContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolChannelsContract.mjs +5 -9
- package/dist/src/schemas/protocolChannelsContract.mjs.map +1 -1
- package/dist/src/schemas/protocolContracts.cjs +193 -133
- package/dist/src/schemas/protocolContracts.cjs.map +1 -1
- package/dist/src/schemas/protocolContracts.d.mts +136 -32
- package/dist/src/schemas/protocolContracts.d.mts.map +1 -1
- package/dist/src/schemas/protocolContracts.mjs +186 -132
- package/dist/src/schemas/protocolContracts.mjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.cjs +109 -27
- package/dist/src/schemas/protocolHubContract.cjs.map +1 -1
- package/dist/src/schemas/protocolHubContract.d.mts +292 -134
- package/dist/src/schemas/protocolHubContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolHubContract.mjs +103 -30
- package/dist/src/schemas/protocolHubContract.mjs.map +1 -1
- package/dist/src/schemas/protocolService.cjs +12 -0
- package/dist/src/schemas/protocolService.cjs.map +1 -0
- package/dist/src/schemas/protocolService.d.mts +22 -0
- package/dist/src/schemas/protocolService.d.mts.map +1 -0
- package/dist/src/schemas/protocolService.mjs +11 -0
- package/dist/src/schemas/protocolService.mjs.map +1 -0
- package/dist/src/schemas/protocolSessionContract.cjs +7 -11
- package/dist/src/schemas/protocolSessionContract.cjs.map +1 -1
- package/dist/src/schemas/protocolSessionContract.d.mts +303 -299
- package/dist/src/schemas/protocolSessionContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolSessionContract.mjs +9 -13
- package/dist/src/schemas/protocolSessionContract.mjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.cjs +5 -6
- package/dist/src/schemas/protocolThreadContract.cjs.map +1 -1
- package/dist/src/schemas/protocolThreadContract.d.mts +12 -16
- package/dist/src/schemas/protocolThreadContract.d.mts.map +1 -1
- package/dist/src/schemas/protocolThreadContract.mjs +6 -7
- package/dist/src/schemas/protocolThreadContract.mjs.map +1 -1
- package/dist/src/schemas/remoteGateway.cjs +14 -0
- package/dist/src/schemas/remoteGateway.cjs.map +1 -0
- package/dist/src/schemas/remoteGateway.d.mts +19 -0
- package/dist/src/schemas/remoteGateway.d.mts.map +1 -0
- package/dist/src/schemas/remoteGateway.mjs +12 -0
- package/dist/src/schemas/remoteGateway.mjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.cjs +9 -0
- package/dist/src/schemas/remoteOrigin.cjs.map +1 -0
- package/dist/src/schemas/remoteOrigin.d.mts +16 -0
- package/dist/src/schemas/remoteOrigin.d.mts.map +1 -0
- package/dist/src/schemas/remoteOrigin.mjs +8 -0
- package/dist/src/schemas/remoteOrigin.mjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.cjs +14 -0
- package/dist/src/schemas/sandboxIdentity.cjs.map +1 -0
- package/dist/src/schemas/sandboxIdentity.d.mts +23 -0
- package/dist/src/schemas/sandboxIdentity.d.mts.map +1 -0
- package/dist/src/schemas/sandboxIdentity.mjs +12 -0
- package/dist/src/schemas/sandboxIdentity.mjs.map +1 -0
- package/dist/src/schemas/serverBundle.cjs +13 -0
- package/dist/src/schemas/serverBundle.cjs.map +1 -0
- package/dist/src/schemas/serverBundle.d.mts +29 -1
- package/dist/src/schemas/serverBundle.d.mts.map +1 -1
- package/dist/src/schemas/serverBundle.mjs +13 -0
- package/dist/src/schemas/serverBundle.mjs.map +1 -0
- package/dist/src/schemas/serverPlugin.cjs +5 -3
- package/dist/src/schemas/serverPlugin.cjs.map +1 -1
- package/dist/src/schemas/serverPlugin.d.mts +2 -2
- package/dist/src/schemas/serverPlugin.d.mts.map +1 -1
- package/dist/src/schemas/serverPlugin.mjs +5 -3
- package/dist/src/schemas/serverPlugin.mjs.map +1 -1
- package/dist/src/schemas/serverScope.cjs +21 -3
- package/dist/src/schemas/serverScope.cjs.map +1 -1
- package/dist/src/schemas/serverScope.d.mts +17 -1
- package/dist/src/schemas/serverScope.d.mts.map +1 -1
- package/dist/src/schemas/serverScope.mjs +21 -4
- package/dist/src/schemas/serverScope.mjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.cjs +17 -11
- package/dist/src/schemas/sessionApiContracts.cjs.map +1 -1
- package/dist/src/schemas/sessionApiContracts.mjs +18 -11
- package/dist/src/schemas/sessionApiContracts.mjs.map +1 -1
- package/dist/src/schemas/sessionLifecycle.cjs +12 -0
- package/dist/src/schemas/sessionLifecycle.cjs.map +1 -0
- package/dist/src/schemas/sessionLifecycle.d.mts +33 -0
- package/dist/src/schemas/sessionLifecycle.d.mts.map +1 -0
- package/dist/src/schemas/sessionLifecycle.mjs +11 -0
- package/dist/src/schemas/sessionLifecycle.mjs.map +1 -0
- package/dist/src/schemas/sessionProtocol.cjs +13 -0
- package/dist/src/schemas/sessionProtocol.cjs.map +1 -1
- package/dist/src/schemas/sessionProtocol.d.mts +57 -15
- package/dist/src/schemas/sessionProtocol.d.mts.map +1 -1
- package/dist/src/schemas/sessionProtocol.mjs +12 -1
- package/dist/src/schemas/sessionProtocol.mjs.map +1 -1
- package/dist/src/schemas/sharedModels.cjs +9 -0
- package/dist/src/schemas/sharedModels.cjs.map +1 -0
- package/dist/src/schemas/sharedModels.d.mts +33 -0
- package/dist/src/schemas/sharedModels.d.mts.map +1 -0
- package/dist/src/schemas/sharedModels.mjs +8 -0
- package/dist/src/schemas/sharedModels.mjs.map +1 -0
- package/dist/src/schemas/skills.cjs +1 -1
- package/dist/src/schemas/skills.cjs.map +1 -1
- package/dist/src/schemas/skills.d.mts +1 -1
- package/dist/src/schemas/skills.mjs +1 -1
- package/dist/src/schemas/skills.mjs.map +1 -1
- package/dist/src/schemas/space.cjs +33 -0
- package/dist/src/schemas/space.cjs.map +1 -0
- package/dist/src/schemas/space.d.mts +90 -0
- package/dist/src/schemas/space.d.mts.map +1 -0
- package/dist/src/schemas/space.mjs +29 -0
- package/dist/src/schemas/space.mjs.map +1 -0
- package/dist/src/schemas/toolSurface.cjs.map +1 -1
- package/dist/src/schemas/toolSurface.d.mts +2 -2
- package/dist/src/schemas/toolSurface.d.mts.map +1 -1
- package/dist/src/schemas/toolSurface.mjs.map +1 -1
- package/dist/src/schemas/userFeedback.cjs +22 -0
- package/dist/src/schemas/userFeedback.cjs.map +1 -0
- package/dist/src/schemas/userFeedback.d.mts +30 -0
- package/dist/src/schemas/userFeedback.d.mts.map +1 -0
- package/dist/src/schemas/userFeedback.mjs +18 -0
- package/dist/src/schemas/userFeedback.mjs.map +1 -0
- package/dist/src/schemas/voiceReloadHandoff.cjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.cjs.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.d.mts +5 -5
- package/dist/src/schemas/voiceReloadHandoff.d.mts.map +1 -1
- package/dist/src/schemas/voiceReloadHandoff.mjs +3 -3
- package/dist/src/schemas/voiceReloadHandoff.mjs.map +1 -1
- package/dist/src/schemas/workflow.cjs +217 -0
- package/dist/src/schemas/workflow.cjs.map +1 -0
- package/dist/src/schemas/workflow.d.mts +593 -0
- package/dist/src/schemas/workflow.d.mts.map +1 -0
- package/dist/src/schemas/workflow.mjs +188 -0
- package/dist/src/schemas/workflow.mjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.cjs +13 -0
- package/dist/src/schemas/workspaceRegistry.cjs.map +1 -0
- package/dist/src/schemas/workspaceRegistry.d.mts +45 -0
- package/dist/src/schemas/workspaceRegistry.d.mts.map +1 -0
- package/dist/src/schemas/workspaceRegistry.mjs +11 -0
- package/dist/src/schemas/workspaceRegistry.mjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.cjs +14 -0
- package/dist/src/schemas/workspaceSandboxes.cjs.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts +85 -0
- package/dist/src/schemas/workspaceSandboxes.d.mts.map +1 -0
- package/dist/src/schemas/workspaceSandboxes.mjs +12 -0
- package/dist/src/schemas/workspaceSandboxes.mjs.map +1 -0
- package/dist/src/server/conversationEvents.cjs +345 -0
- package/dist/src/server/conversationEvents.cjs.map +1 -0
- package/dist/src/server/conversationEvents.mjs +345 -0
- package/dist/src/server/conversationEvents.mjs.map +1 -0
- package/dist/src/server/directHarnessRuntime.cjs +1326 -549
- package/dist/src/server/directHarnessRuntime.cjs.map +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts +1 -1
- package/dist/src/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/server/directHarnessRuntime.mjs +1308 -532
- package/dist/src/server/directHarnessRuntime.mjs.map +1 -1
- package/dist/src/server/largeFrameLink.cjs +22 -37
- package/dist/src/server/largeFrameLink.cjs.map +1 -1
- package/dist/src/server/largeFrameLink.mjs +22 -37
- package/dist/src/server/largeFrameLink.mjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.cjs +2 -1
- package/dist/src/server/mcpBundleLoader.cjs.map +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts +1 -1
- package/dist/src/server/mcpBundleLoader.d.mts.map +1 -1
- package/dist/src/server/mcpBundleLoader.mjs +2 -1
- package/dist/src/server/mcpBundleLoader.mjs.map +1 -1
- package/dist/src/server/providerRoutes.cjs +74 -0
- package/dist/src/server/providerRoutes.cjs.map +1 -0
- package/dist/src/server/providerRoutes.d.mts +20 -0
- package/dist/src/server/providerRoutes.d.mts.map +1 -0
- package/dist/src/server/providerRoutes.mjs +74 -0
- package/dist/src/server/providerRoutes.mjs.map +1 -0
- package/dist/src/server/providerRuntime.cjs +41 -0
- package/dist/src/server/providerRuntime.cjs.map +1 -0
- package/dist/src/server/providerRuntime.d.mts +12 -0
- package/dist/src/server/providerRuntime.d.mts.map +1 -0
- package/dist/src/server/providerRuntime.mjs +39 -0
- package/dist/src/server/providerRuntime.mjs.map +1 -0
- package/dist/src/server/serverPackages.cjs +29 -7
- package/dist/src/server/serverPackages.cjs.map +1 -1
- package/dist/src/server/serverPackages.d.mts +9 -3
- package/dist/src/server/serverPackages.d.mts.map +1 -1
- package/dist/src/server/serverPackages.mjs +29 -7
- package/dist/src/server/serverPackages.mjs.map +1 -1
- package/dist/src/server/serverScope.cjs +434 -34
- package/dist/src/server/serverScope.cjs.map +1 -1
- package/dist/src/server/serverScope.d.mts +72 -8
- package/dist/src/server/serverScope.d.mts.map +1 -1
- package/dist/src/server/serverScope.mjs +435 -35
- package/dist/src/server/serverScope.mjs.map +1 -1
- package/dist/src/server/threadJournals.cjs.map +1 -1
- package/dist/src/server/threadJournals.mjs.map +1 -1
- package/dist/src/services/approvalGate/index.cjs +179 -0
- package/dist/src/services/approvalGate/index.cjs.map +1 -0
- package/dist/src/services/approvalGate/index.d.mts +30 -0
- package/dist/src/services/approvalGate/index.d.mts.map +1 -0
- package/dist/src/services/approvalGate/index.mjs +174 -0
- package/dist/src/services/approvalGate/index.mjs.map +1 -0
- package/dist/src/services/approvalGate/type.d.mts +36 -0
- package/dist/src/services/approvalGate/type.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.cjs +103 -39
- package/dist/src/services/bundlePublication/index.cjs.map +1 -1
- package/dist/src/services/bundlePublication/index.d.mts +11 -0
- package/dist/src/services/bundlePublication/index.d.mts.map +1 -0
- package/dist/src/services/bundlePublication/index.mjs +101 -39
- package/dist/src/services/bundlePublication/index.mjs.map +1 -1
- package/dist/src/services/chatgptImages/index.cjs +56 -11
- package/dist/src/services/chatgptImages/index.cjs.map +1 -1
- package/dist/src/services/chatgptImages/index.mjs +56 -11
- package/dist/src/services/chatgptImages/index.mjs.map +1 -1
- package/dist/src/services/chatgptLogin/index.cjs +2 -2
- package/dist/src/services/chatgptLogin/index.cjs.map +1 -1
- package/dist/src/services/chordAdapter/index.cjs +456 -0
- package/dist/src/services/chordAdapter/index.cjs.map +1 -0
- package/dist/src/services/chordAdapter/index.d.mts +13 -0
- package/dist/src/services/chordAdapter/index.d.mts.map +1 -0
- package/dist/src/services/chordAdapter/index.mjs +453 -0
- package/dist/src/services/chordAdapter/index.mjs.map +1 -0
- package/dist/src/services/chordAdapter/type.d.mts +24 -0
- package/dist/src/services/chordAdapter/type.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.cjs +75 -0
- package/dist/src/services/clientDevices/index.cjs.map +1 -0
- package/dist/src/services/clientDevices/index.d.mts +7 -0
- package/dist/src/services/clientDevices/index.d.mts.map +1 -0
- package/dist/src/services/clientDevices/index.mjs +74 -0
- package/dist/src/services/clientDevices/index.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs +96 -0
- package/dist/src/services/clientMetadata/_lib/codec.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts +16 -0
- package/dist/src/services/clientMetadata/_lib/codec.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs +89 -0
- package/dist/src/services/clientMetadata/_lib/codec.mjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs +63 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.cjs.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts +10 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.d.mts.map +1 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs +62 -0
- package/dist/src/services/clientMetadata/_lib/deviceLabel.mjs.map +1 -0
- package/dist/src/services/contextUsage/index.cjs +0 -9
- package/dist/src/services/contextUsage/index.cjs.map +1 -1
- package/dist/src/services/contextUsage/index.mjs +1 -9
- package/dist/src/services/contextUsage/index.mjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.cjs +1 -0
- package/dist/src/services/durableNavigation/docs.cjs.map +1 -1
- package/dist/src/services/durableNavigation/docs.mjs +1 -0
- package/dist/src/services/durableNavigation/docs.mjs.map +1 -1
- package/dist/src/services/durableNavigation/index.cjs.map +1 -1
- package/dist/src/services/durableNavigation/index.mjs.map +1 -1
- package/dist/src/services/durableQueue/docs.cjs +1 -0
- package/dist/src/services/durableQueue/docs.cjs.map +1 -1
- package/dist/src/services/durableQueue/docs.mjs +1 -0
- package/dist/src/services/durableQueue/docs.mjs.map +1 -1
- package/dist/src/services/durableQueue/index.cjs +157 -69
- package/dist/src/services/durableQueue/index.cjs.map +1 -1
- package/dist/src/services/durableQueue/index.mjs +156 -70
- package/dist/src/services/durableQueue/index.mjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.cjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.cjs.map +1 -1
- package/dist/src/services/durableRequestReceipts/docs.mjs +1 -0
- package/dist/src/services/durableRequestReceipts/docs.mjs.map +1 -1
- package/dist/src/services/durableResumeSnapshots/docs.cjs +49 -0
- package/dist/src/services/durableResumeSnapshots/docs.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs +48 -0
- package/dist/src/services/durableResumeSnapshots/docs.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.cjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs +392 -0
- package/dist/src/services/durableResumeSnapshots/index.mjs.map +1 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts +27 -0
- package/dist/src/services/durableResumeSnapshots/type.d.mts.map +1 -0
- package/dist/src/services/durableSession/docs.cjs +13 -1
- package/dist/src/services/durableSession/docs.cjs.map +1 -1
- package/dist/src/services/durableSession/docs.d.mts +9 -1
- package/dist/src/services/durableSession/docs.d.mts.map +1 -1
- package/dist/src/services/durableSession/docs.mjs +13 -1
- package/dist/src/services/durableSession/docs.mjs.map +1 -1
- package/dist/src/services/durableSession/index.cjs.map +1 -1
- package/dist/src/services/durableSession/index.d.mts +1 -1
- package/dist/src/services/durableSession/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.cjs +1 -0
- package/dist/src/services/durableSubagents/docs.cjs.map +1 -1
- package/dist/src/services/durableSubagents/docs.mjs +1 -0
- package/dist/src/services/durableSubagents/docs.mjs.map +1 -1
- package/dist/src/services/durableSubagents/extension.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.cjs +29 -3
- package/dist/src/services/durableSubagents/index.cjs.map +1 -1
- package/dist/src/services/durableSubagents/index.mjs +29 -4
- package/dist/src/services/durableSubagents/index.mjs.map +1 -1
- package/dist/src/services/durableSubagents/tasks.cjs.map +1 -1
- package/dist/src/services/edgeModelRuntime/index.cjs +377 -0
- package/dist/src/services/edgeModelRuntime/index.cjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts +24 -0
- package/dist/src/services/edgeModelRuntime/index.d.mts.map +1 -0
- package/dist/src/services/edgeModelRuntime/index.mjs +374 -0
- package/dist/src/services/edgeModelRuntime/index.mjs.map +1 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts +39 -0
- package/dist/src/services/edgeModelRuntime/type.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.cjs +53 -0
- package/dist/src/services/editPresence/index.cjs.map +1 -0
- package/dist/src/services/editPresence/index.d.mts +6 -0
- package/dist/src/services/editPresence/index.d.mts.map +1 -0
- package/dist/src/services/editPresence/index.mjs +53 -0
- package/dist/src/services/editPresence/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs +63 -0
- package/dist/src/services/fileAccess/accessibleFile.cjs.map +1 -0
- package/dist/src/services/fileAccess/accessibleFile.d.mts +1 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs +60 -0
- package/dist/src/services/fileAccess/accessibleFile.mjs.map +1 -0
- package/dist/src/services/fileAccess/core.cjs +87 -0
- package/dist/src/services/fileAccess/core.cjs.map +1 -0
- package/dist/src/services/fileAccess/core.mjs +78 -0
- package/dist/src/services/fileAccess/core.mjs.map +1 -0
- package/dist/src/services/fileAccess/index.cjs +34 -0
- package/dist/src/services/fileAccess/index.cjs.map +1 -0
- package/dist/src/services/fileAccess/index.d.mts +23 -0
- package/dist/src/services/fileAccess/index.d.mts.map +1 -0
- package/dist/src/services/fileAccess/index.mjs +29 -0
- package/dist/src/services/fileAccess/index.mjs.map +1 -0
- package/dist/src/services/fileAccess/type.d.mts +1 -0
- package/dist/src/services/grantLedger/index.cjs +56 -0
- package/dist/src/services/grantLedger/index.cjs.map +1 -0
- package/dist/src/services/grantLedger/index.mjs +55 -0
- package/dist/src/services/grantLedger/index.mjs.map +1 -0
- package/dist/src/services/guardedFile/index.cjs +36 -0
- package/dist/src/services/guardedFile/index.cjs.map +1 -0
- package/dist/src/services/guardedFile/index.d.mts +9 -0
- package/dist/src/services/guardedFile/index.d.mts.map +1 -0
- package/dist/src/services/guardedFile/index.mjs +33 -0
- package/dist/src/services/guardedFile/index.mjs.map +1 -0
- package/dist/src/services/headlessClient/index.cjs +85 -3
- package/dist/src/services/headlessClient/index.cjs.map +1 -1
- package/dist/src/services/headlessClient/index.mjs +86 -4
- package/dist/src/services/headlessClient/index.mjs.map +1 -1
- package/dist/src/services/hostServices/index.cjs +157 -0
- package/dist/src/services/hostServices/index.cjs.map +1 -0
- package/dist/src/services/hostServices/index.d.mts +33 -0
- package/dist/src/services/hostServices/index.d.mts.map +1 -0
- package/dist/src/services/hostServices/index.mjs +157 -0
- package/dist/src/services/hostServices/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/index.cjs +120 -0
- package/dist/src/services/inputTemplate/index.cjs.map +1 -0
- package/dist/src/services/inputTemplate/index.d.mts +10 -0
- package/dist/src/services/inputTemplate/index.d.mts.map +1 -0
- package/dist/src/services/inputTemplate/index.mjs +118 -0
- package/dist/src/services/inputTemplate/index.mjs.map +1 -0
- package/dist/src/services/inputTemplate/type.d.mts +17 -0
- package/dist/src/services/inputTemplate/type.d.mts.map +1 -0
- package/dist/src/services/json/core.cjs.map +1 -1
- package/dist/src/services/json/core.d.mts +1 -1
- package/dist/src/services/json/core.mjs.map +1 -1
- package/dist/src/services/json/sync.cjs +2 -2
- package/dist/src/services/json/sync.cjs.map +1 -1
- package/dist/src/services/json/sync.d.mts.map +1 -1
- package/dist/src/services/json/sync.mjs +1 -1
- package/dist/src/services/json/sync.mjs.map +1 -1
- package/dist/src/services/kernel/index.cjs.map +1 -1
- package/dist/src/services/kernel/index.d.mts +1 -1
- package/dist/src/services/kernel/index.mjs.map +1 -1
- package/dist/src/services/loginFlow/index.cjs +7 -1
- package/dist/src/services/loginFlow/index.cjs.map +1 -1
- package/dist/src/services/loginFlow/index.mjs +7 -1
- package/dist/src/services/loginFlow/index.mjs.map +1 -1
- package/dist/src/services/modelDispatch/index.cjs +200 -0
- package/dist/src/services/modelDispatch/index.cjs.map +1 -0
- package/dist/src/services/modelDispatch/index.mjs +197 -0
- package/dist/src/services/modelDispatch/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/index.cjs +88 -0
- package/dist/src/services/modelFallback/index.cjs.map +1 -0
- package/dist/src/services/modelFallback/index.d.mts +16 -0
- package/dist/src/services/modelFallback/index.d.mts.map +1 -0
- package/dist/src/services/modelFallback/index.mjs +86 -0
- package/dist/src/services/modelFallback/index.mjs.map +1 -0
- package/dist/src/services/modelFallback/type.d.mts +16 -0
- package/dist/src/services/modelFallback/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.cjs +394 -0
- package/dist/src/services/modelGatewayContainer/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts +16 -0
- package/dist/src/services/modelGatewayContainer/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayContainer/index.mjs +393 -0
- package/dist/src/services/modelGatewayContainer/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts +28 -0
- package/dist/src/services/modelGatewayContainer/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts +18 -0
- package/dist/src/services/modelGatewayExecutor/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs +160 -0
- package/dist/src/services/modelGatewayExecutor/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts +36 -0
- package/dist/src/services/modelGatewayExecutor/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.cjs +292 -0
- package/dist/src/services/modelGatewayHost/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayHost/index.d.mts +13 -0
- package/dist/src/services/modelGatewayHost/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayHost/index.mjs +292 -0
- package/dist/src/services/modelGatewayHost/index.mjs.map +1 -0
- package/dist/src/services/modelGatewayHost/type.d.mts +61 -0
- package/dist/src/services/modelGatewayHost/type.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.cjs +170 -0
- package/dist/src/services/modelGatewayWire/index.cjs.map +1 -0
- package/dist/src/services/modelGatewayWire/index.d.mts +30 -0
- package/dist/src/services/modelGatewayWire/index.d.mts.map +1 -0
- package/dist/src/services/modelGatewayWire/index.mjs +163 -0
- package/dist/src/services/modelGatewayWire/index.mjs.map +1 -0
- package/dist/src/services/nativeChildTools/index.cjs +307 -9
- package/dist/src/services/nativeChildTools/index.cjs.map +1 -1
- package/dist/src/services/nativeChildTools/index.d.mts +11 -0
- package/dist/src/services/nativeChildTools/index.d.mts.map +1 -0
- package/dist/src/services/nativeChildTools/index.mjs +298 -3
- package/dist/src/services/nativeChildTools/index.mjs.map +1 -1
- package/dist/src/services/nodeHost/index.cjs +4 -2
- package/dist/src/services/nodeHost/index.cjs.map +1 -1
- package/dist/src/services/nodeHost/index.d.mts +2 -0
- package/dist/src/services/nodeHost/index.d.mts.map +1 -1
- package/dist/src/services/nodeHost/index.mjs +3 -1
- package/dist/src/services/nodeHost/index.mjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.cjs +26 -29
- package/dist/src/services/nodeModelDependencies/index.cjs.map +1 -1
- package/dist/src/services/nodeModelDependencies/index.mjs +18 -20
- package/dist/src/services/nodeModelDependencies/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.cjs +1 -0
- package/dist/src/services/openSessionRegistry/index.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/index.d.mts +1 -1
- package/dist/src/services/openSessionRegistry/index.mjs +1 -0
- package/dist/src/services/openSessionRegistry/index.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts +26 -0
- package/dist/src/services/openSessionRegistry/openSessionRecords.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs +44 -4
- package/dist/src/services/openSessionRegistry/openSessionRecords.mjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.cjs +9 -4
- package/dist/src/services/openSessionRegistry/sync.cjs.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/openSessionRegistry/sync.mjs +8 -3
- package/dist/src/services/openSessionRegistry/sync.mjs.map +1 -1
- package/dist/src/services/operationDispatch/index.cjs +263 -0
- package/dist/src/services/operationDispatch/index.cjs.map +1 -0
- package/dist/src/services/operationDispatch/index.mjs +263 -0
- package/dist/src/services/operationDispatch/index.mjs.map +1 -0
- package/dist/src/services/packageApiHarness/index.cjs +2 -1
- package/dist/src/services/packageApiHarness/index.cjs.map +1 -1
- package/dist/src/services/packageApiHarness/index.d.mts +2 -1
- package/dist/src/services/packageApiHarness/index.d.mts.map +1 -1
- package/dist/src/services/packageApiHarness/index.mjs +2 -1
- package/dist/src/services/packageApiHarness/index.mjs.map +1 -1
- package/dist/src/services/packageContentRevision/index.cjs +173 -0
- package/dist/src/services/packageContentRevision/index.cjs.map +1 -0
- package/dist/src/services/packageContentRevision/index.d.mts +39 -0
- package/dist/src/services/packageContentRevision/index.d.mts.map +1 -0
- package/dist/src/services/packageContentRevision/index.mjs +168 -0
- package/dist/src/services/packageContentRevision/index.mjs.map +1 -0
- package/dist/src/services/packageResource/index.cjs +12 -8
- package/dist/src/services/packageResource/index.cjs.map +1 -1
- package/dist/src/services/packageResource/index.d.mts.map +1 -1
- package/dist/src/services/packageResource/index.mjs +12 -8
- package/dist/src/services/packageResource/index.mjs.map +1 -1
- package/dist/src/services/pairingPage/index.cjs +85 -24
- package/dist/src/services/pairingPage/index.cjs.map +1 -1
- package/dist/src/services/pairingPage/index.d.mts +23 -0
- package/dist/src/services/pairingPage/index.d.mts.map +1 -0
- package/dist/src/services/pairingPage/index.mjs +86 -25
- package/dist/src/services/pairingPage/index.mjs.map +1 -1
- package/dist/src/services/piArgs/index.cjs +2 -2
- package/dist/src/services/piArgs/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.cjs +344 -56
- package/dist/src/services/piExtensionHost/index.cjs.map +1 -1
- package/dist/src/services/piExtensionHost/index.d.mts +3 -1
- package/dist/src/services/piExtensionHost/index.d.mts.map +1 -1
- package/dist/src/services/piExtensionHost/index.mjs +325 -37
- package/dist/src/services/piExtensionHost/index.mjs.map +1 -1
- package/dist/src/services/piMessages/index.cjs +16 -0
- package/dist/src/services/piMessages/index.cjs.map +1 -1
- package/dist/src/services/piMessages/index.d.mts +12 -0
- package/dist/src/services/piMessages/index.d.mts.map +1 -0
- package/dist/src/services/piMessages/index.mjs +16 -1
- package/dist/src/services/piMessages/index.mjs.map +1 -1
- package/dist/src/services/piSettings/core.cjs +18 -5
- package/dist/src/services/piSettings/core.cjs.map +1 -1
- package/dist/src/services/piSettings/core.d.mts +6 -1
- package/dist/src/services/piSettings/core.d.mts.map +1 -1
- package/dist/src/services/piSettings/core.mjs +18 -6
- package/dist/src/services/piSettings/core.mjs.map +1 -1
- package/dist/src/services/piSettings/sync.cjs +31 -2
- package/dist/src/services/piSettings/sync.cjs.map +1 -1
- package/dist/src/services/piSettings/sync.d.mts +3 -0
- package/dist/src/services/piSettings/sync.d.mts.map +1 -1
- package/dist/src/services/piSettings/sync.mjs +31 -3
- package/dist/src/services/piSettings/sync.mjs.map +1 -1
- package/dist/src/services/piSummary/index.cjs +2 -2
- package/dist/src/services/piSummary/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.cjs +81 -0
- package/dist/src/services/platformFiles/index.cjs.map +1 -1
- package/dist/src/services/platformFiles/index.d.mts +12 -1
- package/dist/src/services/platformFiles/index.d.mts.map +1 -1
- package/dist/src/services/platformFiles/index.mjs +76 -1
- package/dist/src/services/platformFiles/index.mjs.map +1 -1
- package/dist/src/services/platformFiles/rootBoundReplace.cjs +110 -0
- package/dist/src/services/platformFiles/rootBoundReplace.cjs.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts +21 -0
- package/dist/src/services/platformFiles/rootBoundReplace.d.mts.map +1 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs +106 -0
- package/dist/src/services/platformFiles/rootBoundReplace.mjs.map +1 -0
- package/dist/src/services/poPackage/core.cjs.map +1 -1
- package/dist/src/services/poPackage/core.d.mts +1 -1
- package/dist/src/services/poPackage/core.mjs.map +1 -1
- package/dist/src/services/poPackage/sync.cjs +2 -2
- package/dist/src/services/poPackage/sync.cjs.map +1 -1
- package/dist/src/services/poPackage/sync.d.mts.map +1 -1
- package/dist/src/services/poPackage/sync.mjs +1 -1
- package/dist/src/services/poPackage/sync.mjs.map +1 -1
- package/dist/src/services/poTelemetry/index.cjs +69 -0
- package/dist/src/services/poTelemetry/index.cjs.map +1 -0
- package/dist/src/services/poTelemetry/index.d.mts +7 -0
- package/dist/src/services/poTelemetry/index.d.mts.map +1 -0
- package/dist/src/services/poTelemetry/index.mjs +66 -0
- package/dist/src/services/poTelemetry/index.mjs.map +1 -0
- package/dist/src/services/portableConfig/index.cjs +136 -0
- package/dist/src/services/portableConfig/index.cjs.map +1 -0
- package/dist/src/services/portableConfig/index.d.mts +30 -0
- package/dist/src/services/portableConfig/index.d.mts.map +1 -0
- package/dist/src/services/portableConfig/index.mjs +130 -0
- package/dist/src/services/portableConfig/index.mjs.map +1 -0
- package/dist/src/services/providerAuth/index.cjs +6 -10
- package/dist/src/services/providerAuth/index.cjs.map +1 -1
- package/dist/src/services/providerAuth/index.mjs +5 -7
- package/dist/src/services/providerAuth/index.mjs.map +1 -1
- package/dist/src/services/providerImages/fitter.cjs +48 -0
- package/dist/src/services/providerImages/fitter.cjs.map +1 -0
- package/dist/src/services/providerImages/fitter.mjs +47 -0
- package/dist/src/services/providerImages/fitter.mjs.map +1 -0
- package/dist/src/services/providerImages/index.cjs +21 -0
- package/dist/src/services/providerImages/index.cjs.map +1 -0
- package/dist/src/services/providerImages/index.d.mts +3 -0
- package/dist/src/services/providerImages/index.mjs +21 -0
- package/dist/src/services/providerImages/index.mjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.cjs +228 -0
- package/dist/src/services/runtimeEnvironment/index.cjs.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts +37 -0
- package/dist/src/services/runtimeEnvironment/index.d.mts.map +1 -0
- package/dist/src/services/runtimeEnvironment/index.mjs +219 -0
- package/dist/src/services/runtimeEnvironment/index.mjs.map +1 -0
- package/dist/src/services/runtimeIdentity/sync.cjs +2 -2
- package/dist/src/services/runtimeIdentity/sync.cjs.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.d.mts.map +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs +1 -1
- package/dist/src/services/runtimeIdentity/sync.mjs.map +1 -1
- package/dist/src/services/scopeInput/index.cjs +49 -0
- package/dist/src/services/scopeInput/index.cjs.map +1 -0
- package/dist/src/services/scopeInput/index.mjs +47 -0
- package/dist/src/services/scopeInput/index.mjs.map +1 -0
- package/dist/src/services/serialRunner/index.cjs +3 -0
- package/dist/src/services/serialRunner/index.cjs.map +1 -1
- package/dist/src/services/serialRunner/index.d.mts +2 -0
- package/dist/src/services/serialRunner/index.d.mts.map +1 -1
- package/dist/src/services/serialRunner/index.mjs +3 -1
- package/dist/src/services/serialRunner/index.mjs.map +1 -1
- package/dist/src/services/serverHost/index.cjs +12 -2
- package/dist/src/services/serverHost/index.cjs.map +1 -1
- package/dist/src/services/serverHost/index.d.mts +3 -1
- package/dist/src/services/serverHost/index.d.mts.map +1 -1
- package/dist/src/services/serverHost/index.mjs +12 -2
- package/dist/src/services/serverHost/index.mjs.map +1 -1
- package/dist/src/services/sessionAccess/index.cjs +168 -0
- package/dist/src/services/sessionAccess/index.cjs.map +1 -0
- package/dist/src/services/sessionAccess/index.d.mts +11 -0
- package/dist/src/services/sessionAccess/index.d.mts.map +1 -0
- package/dist/src/services/sessionAccess/index.mjs +163 -0
- package/dist/src/services/sessionAccess/index.mjs.map +1 -0
- package/dist/src/services/sessionAccess/type.d.mts +32 -0
- package/dist/src/services/sessionAccess/type.d.mts.map +1 -0
- package/dist/src/services/sessionAttachments/index.cjs +13 -13
- package/dist/src/services/sessionAttachments/index.cjs.map +1 -1
- package/dist/src/services/sessionAttachments/index.d.mts +3 -1
- package/dist/src/services/sessionAttachments/index.d.mts.map +1 -1
- package/dist/src/services/sessionAttachments/index.mjs +12 -12
- package/dist/src/services/sessionAttachments/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/index.cjs +35 -13
- package/dist/src/services/sessionFiles/index.cjs.map +1 -1
- package/dist/src/services/sessionFiles/index.d.mts +10 -1
- package/dist/src/services/sessionFiles/index.d.mts.map +1 -1
- package/dist/src/services/sessionFiles/index.mjs +34 -14
- package/dist/src/services/sessionFiles/index.mjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.cjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.cjs.map +1 -1
- package/dist/src/services/sessionFiles/sessionDirectory.mjs +3 -3
- package/dist/src/services/sessionFiles/sessionDirectory.mjs.map +1 -1
- package/dist/src/services/sessionLifecycle/index.cjs +293 -0
- package/dist/src/services/sessionLifecycle/index.cjs.map +1 -0
- package/dist/src/services/sessionLifecycle/index.mjs +293 -0
- package/dist/src/services/sessionLifecycle/index.mjs.map +1 -0
- package/dist/src/services/sessionLifecycle/type.d.mts +32 -0
- package/dist/src/services/sessionLifecycle/type.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs +60 -0
- package/dist/src/services/sessionMcpRoutePaths/index.cjs.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts +31 -0
- package/dist/src/services/sessionMcpRoutePaths/index.d.mts.map +1 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs +45 -0
- package/dist/src/services/sessionMcpRoutePaths/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.cjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts +6 -0
- package/dist/src/services/sessionWorkspaceMove/index.d.mts.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs +81 -0
- package/dist/src/services/sessionWorkspaceMove/index.mjs.map +1 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts +16 -0
- package/dist/src/services/sessionWorkspaceMove/type.d.mts.map +1 -0
- package/dist/src/services/skillPrompt/index.cjs +14 -4
- package/dist/src/services/skillPrompt/index.cjs.map +1 -1
- package/dist/src/services/skillPrompt/index.mjs +14 -5
- package/dist/src/services/skillPrompt/index.mjs.map +1 -1
- package/dist/src/services/skillRelations/index.cjs +113 -0
- package/dist/src/services/skillRelations/index.cjs.map +1 -0
- package/dist/src/services/skillRelations/index.d.mts +32 -0
- package/dist/src/services/skillRelations/index.d.mts.map +1 -0
- package/dist/src/services/skillRelations/index.mjs +111 -0
- package/dist/src/services/skillRelations/index.mjs.map +1 -0
- package/dist/src/services/sqliteSessionHistory/index.cjs +38 -10
- package/dist/src/services/sqliteSessionHistory/index.cjs.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.d.mts +13 -0
- package/dist/src/services/sqliteSessionHistory/index.d.mts.map +1 -1
- package/dist/src/services/sqliteSessionHistory/index.mjs +37 -10
- package/dist/src/services/sqliteSessionHistory/index.mjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.cjs +12 -12
- package/dist/src/services/sqliteTranscriptReader/index.cjs.map +1 -1
- package/dist/src/services/sqliteTranscriptReader/index.d.mts +2 -2
- package/dist/src/services/sqliteTranscriptReader/index.mjs +3 -3
- package/dist/src/services/sqliteTranscriptReader/index.mjs.map +1 -1
- package/dist/src/services/telemetry/index.cjs +591 -0
- package/dist/src/services/telemetry/index.cjs.map +1 -0
- package/dist/src/services/telemetry/index.d.mts +7 -0
- package/dist/src/services/telemetry/index.d.mts.map +1 -0
- package/dist/src/services/telemetry/index.mjs +587 -0
- package/dist/src/services/telemetry/index.mjs.map +1 -0
- package/dist/src/services/toolContinuation/index.cjs +84 -0
- package/dist/src/services/toolContinuation/index.cjs.map +1 -0
- package/dist/src/services/toolContinuation/index.mjs +83 -0
- package/dist/src/services/toolContinuation/index.mjs.map +1 -0
- package/dist/src/services/traceContext/index.cjs.map +1 -1
- package/dist/src/services/traceContext/index.mjs.map +1 -1
- package/dist/src/services/transcriptPages/index.cjs +169 -8
- package/dist/src/services/transcriptPages/index.cjs.map +1 -1
- package/dist/src/services/transcriptPages/index.mjs +165 -9
- package/dist/src/services/transcriptPages/index.mjs.map +1 -1
- package/dist/src/services/verifiedArchive/index.cjs +181 -0
- package/dist/src/services/verifiedArchive/index.cjs.map +1 -0
- package/dist/src/services/verifiedArchive/index.d.mts +38 -0
- package/dist/src/services/verifiedArchive/index.d.mts.map +1 -0
- package/dist/src/services/verifiedArchive/index.mjs +173 -0
- package/dist/src/services/verifiedArchive/index.mjs.map +1 -0
- package/dist/src/services/voiceReloadHandoff/index.cjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.cjs.map +1 -1
- package/dist/src/services/voiceReloadHandoff/index.d.mts +1 -1
- package/dist/src/services/voiceReloadHandoff/index.mjs +5 -5
- package/dist/src/services/voiceReloadHandoff/index.mjs.map +1 -1
- package/dist/src/services/workspaceLookup/index.cjs +34 -0
- package/dist/src/services/workspaceLookup/index.cjs.map +1 -0
- package/dist/src/services/workspaceLookup/index.d.mts +6 -0
- package/dist/src/services/workspaceLookup/index.d.mts.map +1 -0
- package/dist/src/services/workspaceLookup/index.mjs +34 -0
- package/dist/src/services/workspaceLookup/index.mjs.map +1 -0
- package/dist/src/services/workspaceRegistry/index.cjs +2 -0
- package/dist/src/services/workspaceRegistry/index.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/index.d.mts +3 -3
- package/dist/src/services/workspaceRegistry/index.mjs +4 -2
- package/dist/src/services/workspaceRegistry/index.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.cjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.d.mts +4 -4
- package/dist/src/services/workspaceRegistry/sync.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/sync.mjs +18 -6
- package/dist/src/services/workspaceRegistry/sync.mjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs +60 -8
- package/dist/src/services/workspaceRegistry/workspaceRecords.cjs.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts +20 -0
- package/dist/src/services/workspaceRegistry/workspaceRecords.d.mts.map +1 -1
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs +58 -9
- package/dist/src/services/workspaceRegistry/workspaceRecords.mjs.map +1 -1
- package/dist/src/services/workspaceSandboxes/index.cjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.cjs.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts +9 -0
- package/dist/src/services/workspaceSandboxes/index.d.mts.map +1 -0
- package/dist/src/services/workspaceSandboxes/index.mjs +33 -0
- package/dist/src/services/workspaceSandboxes/index.mjs.map +1 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs +65 -27
- package/dist/src/systems/child/adapters/headlessChildSessionService.cjs.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts +19 -0
- package/dist/src/systems/child/adapters/headlessChildSessionService.d.mts.map +1 -1
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs +65 -30
- package/dist/src/systems/child/adapters/headlessChildSessionService.mjs.map +1 -1
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs +328 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.cjs.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts +35 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.d.mts.map +1 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs +325 -0
- package/dist/src/systems/child/adapters/remoteChildSessionService.mjs.map +1 -0
- package/dist/src/systems/child/services/childSession/index.cjs +60 -32
- package/dist/src/systems/child/services/childSession/index.cjs.map +1 -1
- package/dist/src/systems/child/services/childSession/index.d.mts +5 -0
- package/dist/src/systems/child/services/childSession/index.d.mts.map +1 -1
- package/dist/src/systems/child/services/childSession/index.mjs +60 -32
- package/dist/src/systems/child/services/childSession/index.mjs.map +1 -1
- package/dist/src/systems/child/types/childSession.cjs.map +1 -1
- package/dist/src/systems/child/types/childSession.d.mts +34 -18
- package/dist/src/systems/child/types/childSession.d.mts.map +1 -1
- package/dist/src/systems/child/types/childSession.mjs.map +1 -1
- package/dist/src/systems/child/types/childSessionInput.d.mts +17 -0
- package/dist/src/systems/child/types/childSessionInput.d.mts.map +1 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts +85 -0
- package/dist/src/systems/child/types/remoteChildSession.d.mts.map +1 -0
- package/dist/src/systems/main/adapters/headlessHost.cjs +614 -82
- package/dist/src/systems/main/adapters/headlessHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.d.mts +60 -12
- package/dist/src/systems/main/adapters/headlessHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessHost.mjs +612 -81
- package/dist/src/systems/main/adapters/headlessHost.mjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs +866 -184
- package/dist/src/systems/main/adapters/headlessSessionHost.cjs.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts +23 -3
- package/dist/src/systems/main/adapters/headlessSessionHost.d.mts.map +1 -1
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs +845 -167
- package/dist/src/systems/main/adapters/headlessSessionHost.mjs.map +1 -1
- package/dist/src/systems/main/types/headlessHost.d.mts +14 -5
- package/dist/src/systems/main/types/headlessHost.d.mts.map +1 -1
- package/dist/src/testing/pi/testHost.cjs +1 -0
- package/dist/src/testing/pi/testHost.cjs.map +1 -1
- package/dist/src/testing/pi/testHost.mjs +1 -0
- package/dist/src/testing/pi/testHost.mjs.map +1 -1
- package/dist/src/types/kernel.d.mts +3 -3
- package/dist/src/types/remote.d.mts +53 -29
- package/dist/src/types/remote.d.mts.map +1 -1
- package/dist/src/types/server/agentSessionForward.d.mts +14 -0
- package/dist/src/types/server/agentSessionForward.d.mts.map +1 -0
- package/dist/src/types/server/auth.d.mts +104 -0
- package/dist/src/types/server/auth.d.mts.map +1 -0
- package/dist/src/types/server/directHarnessRuntime.d.mts +144 -19
- package/dist/src/types/server/directHarnessRuntime.d.mts.map +1 -1
- package/dist/src/types/server/sessionMcp.d.mts +34 -0
- package/dist/src/types/server/sessionMcp.d.mts.map +1 -0
- package/dist/src/types/telemetry.d.mts +64 -0
- package/dist/src/types/telemetry.d.mts.map +1 -0
- package/dist/src/web/hostSlots.cjs +199 -0
- package/dist/src/web/hostSlots.cjs.map +1 -0
- package/dist/src/web/hostSlots.d.mts +196 -0
- package/dist/src/web/hostSlots.d.mts.map +1 -0
- package/dist/src/web/hostSlots.mjs +195 -0
- package/dist/src/web/hostSlots.mjs.map +1 -0
- package/dist/src/web/models/globalStore.cjs +2 -2
- package/dist/src/web/models/globalStore.cjs.map +1 -1
- package/dist/src/web/models/globalStore.d.mts +2 -2
- package/dist/src/web/models/globalStore.d.mts.map +1 -1
- package/dist/src/web/models/globalStore.mjs +2 -2
- package/dist/src/web/models/globalStore.mjs.map +1 -1
- package/dist/src/web/models/sessionStore.cjs +1 -1
- package/dist/src/web/models/sessionStore.cjs.map +1 -1
- package/dist/src/web/models/sessionStore.mjs +1 -1
- package/dist/src/web/models/sessionStore.mjs.map +1 -1
- package/dist/src/web/schemas/onboarding.cjs +17 -0
- package/dist/src/web/schemas/onboarding.cjs.map +1 -0
- package/dist/src/web/schemas/onboarding.d.mts +6 -0
- package/dist/src/web/schemas/onboarding.d.mts.map +1 -0
- package/dist/src/web/schemas/onboarding.mjs +17 -0
- package/dist/src/web/schemas/onboarding.mjs.map +1 -0
- package/dist/src/web/schemas/template.cjs +20 -8
- package/dist/src/web/schemas/template.cjs.map +1 -1
- package/dist/src/web/schemas/template.d.mts +6 -2
- package/dist/src/web/schemas/template.d.mts.map +1 -1
- package/dist/src/web/schemas/template.mjs +20 -8
- package/dist/src/web/schemas/template.mjs.map +1 -1
- package/dist/src/web/services/apiClient/index.cjs +13 -2
- package/dist/src/web/services/apiClient/index.cjs.map +1 -1
- package/dist/src/web/services/apiClient/index.d.mts +3 -2
- package/dist/src/web/services/apiClient/index.d.mts.map +1 -1
- package/dist/src/web/services/apiClient/index.mjs +13 -2
- package/dist/src/web/services/apiClient/index.mjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.cjs +1 -1
- package/dist/src/web/services/apiPaths/index.cjs.map +1 -1
- package/dist/src/web/services/apiPaths/index.d.mts +1 -1
- package/dist/src/web/services/apiPaths/index.mjs +1 -1
- package/dist/src/web/services/apiPaths/index.mjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.cjs +4 -4
- package/dist/src/web/services/apiRoutes/index.cjs.map +1 -1
- package/dist/src/web/services/apiRoutes/index.d.mts +2 -2
- package/dist/src/web/services/apiRoutes/index.mjs +4 -4
- package/dist/src/web/services/apiRoutes/index.mjs.map +1 -1
- package/dist/src/web/services/htmlInspect.cjs +277 -0
- package/dist/src/web/services/htmlInspect.cjs.map +1 -0
- package/dist/src/web/services/htmlInspect.d.mts +75 -0
- package/dist/src/web/services/htmlInspect.d.mts.map +1 -0
- package/dist/src/web/services/htmlInspect.mjs +272 -0
- package/dist/src/web/services/htmlInspect.mjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.cjs +60 -0
- package/dist/src/web/services/hubRevisions/index.cjs.map +1 -0
- package/dist/src/web/services/hubRevisions/index.d.mts +13 -0
- package/dist/src/web/services/hubRevisions/index.d.mts.map +1 -0
- package/dist/src/web/services/hubRevisions/index.mjs +57 -0
- package/dist/src/web/services/hubRevisions/index.mjs.map +1 -0
- package/dist/src/web/services/i18n/index.cjs +94 -0
- package/dist/src/web/services/i18n/index.cjs.map +1 -0
- package/dist/src/web/services/i18n/index.d.mts +18 -0
- package/dist/src/web/services/i18n/index.d.mts.map +1 -0
- package/dist/src/web/services/i18n/index.mjs +87 -0
- package/dist/src/web/services/i18n/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs +28 -0
- package/dist/src/web/services/nativeByteCodec/index.cjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts +10 -0
- package/dist/src/web/services/nativeByteCodec/index.d.mts.map +1 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs +26 -0
- package/dist/src/web/services/nativeByteCodec/index.mjs.map +1 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts +8 -0
- package/dist/src/web/services/nativeByteCodec/type.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.cjs +39 -0
- package/dist/src/web/services/railSteps/index.cjs.map +1 -0
- package/dist/src/web/services/railSteps/index.d.mts +17 -0
- package/dist/src/web/services/railSteps/index.d.mts.map +1 -0
- package/dist/src/web/services/railSteps/index.mjs +39 -0
- package/dist/src/web/services/railSteps/index.mjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.cjs.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts +18 -0
- package/dist/src/web/services/testing/settingsDirectory.d.mts.map +1 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs +164 -0
- package/dist/src/web/services/testing/settingsDirectory.mjs.map +1 -0
- package/dist/src/web/services/testing/templateRail.cjs +84 -6
- package/dist/src/web/services/testing/templateRail.cjs.map +1 -1
- package/dist/src/web/services/testing/templateRail.d.mts +8 -1
- package/dist/src/web/services/testing/templateRail.d.mts.map +1 -1
- package/dist/src/web/services/testing/templateRail.mjs +83 -7
- package/dist/src/web/services/testing/templateRail.mjs.map +1 -1
- package/dist/src/web/types/extensionFile.d.mts +11 -4
- package/dist/src/web/types/extensionFile.d.mts.map +1 -1
- package/dist/src/web/types/nativeTemplate.d.mts +170 -7
- package/dist/src/web/types/nativeTemplate.d.mts.map +1 -1
- package/dist/src/web/types/template.d.mts +133 -17
- package/dist/src/web/types/template.d.mts.map +1 -1
- package/dist/src/web/types/webPlugin.d.mts +535 -38
- package/dist/src/web/types/webPlugin.d.mts.map +1 -1
- package/dist/telemetry.cjs +7 -0
- package/dist/telemetry.d.mts +4 -0
- package/dist/telemetry.mjs +3 -0
- package/dist/transition.d.mts +2 -2
- package/dist/transitionClassifier.cjs +9 -9
- package/dist/transitionClassifier.cjs.map +1 -1
- package/dist/transitionClassifier.d.mts +1 -1
- package/dist/transitionClassifier.mjs +9 -9
- package/dist/transitionClassifier.mjs.map +1 -1
- package/dist/userFeedback.cjs +7 -0
- package/dist/userFeedback.d.mts +2 -0
- package/dist/userFeedback.mjs +1 -0
- package/dist/vendor/upm/_chunks/main.mjs +1 -1
- package/dist/verifiedArchive.cjs +11 -0
- package/dist/verifiedArchive.d.mts +2 -0
- package/dist/verifiedArchive.mjs +1 -0
- package/dist/web.cjs +89 -32
- package/dist/web.d.mts +22 -9
- package/dist/web.mjs +16 -5
- package/dist/webCompositions.cjs +87 -17
- package/dist/webCompositions.cjs.map +1 -1
- package/dist/webCompositions.d.mts +22 -6
- package/dist/webCompositions.d.mts.map +1 -1
- package/dist/webCompositions.mjs +87 -18
- package/dist/webCompositions.mjs.map +1 -1
- package/dist/webTesting.cjs +4 -0
- package/dist/webTesting.d.mts +3 -2
- package/dist/webTesting.mjs +3 -2
- package/dist/workflow.cjs +32 -0
- package/dist/workflow.d.mts +2 -0
- package/dist/workflow.mjs +1 -0
- package/dist/workspaceRegistry.cjs +7 -0
- package/dist/workspaceRegistry.d.mts +3 -0
- package/dist/workspaceRegistry.mjs +3 -0
- package/dist/workspaceSandboxes.cjs +7 -0
- package/dist/workspaceSandboxes.d.mts +3 -0
- package/dist/workspaceSandboxes.mjs +3 -0
- package/locales/vi.json +4 -0
- package/locales/zh-CN.json +4 -0
- package/package.json +164 -51
- package/dist/authorTools.cjs +0 -5
- package/dist/authorTools.d.mts +0 -2
- package/dist/authorTools.mjs +0 -1
- package/dist/cockpitContainer.cjs +0 -4
- package/dist/cockpitContainer.d.mts +0 -2
- package/dist/cockpitContainer.mjs +0 -1
- package/dist/remoteApi.cjs +0 -45
- package/dist/remoteApi.cjs.map +0 -1
- package/dist/remoteApi.d.mts +0 -7
- package/dist/remoteApi.d.mts.map +0 -1
- package/dist/remoteApi.mjs +0 -44
- package/dist/remoteApi.mjs.map +0 -1
- package/dist/remoteRuntime.cjs +0 -475
- package/dist/remoteRuntime.cjs.map +0 -1
- package/dist/remoteRuntime.d.mts +0 -37
- package/dist/remoteRuntime.d.mts.map +0 -1
- package/dist/remoteRuntime.mjs +0 -473
- package/dist/remoteRuntime.mjs.map +0 -1
- package/dist/sandboxHarness.cjs +0 -6
- package/dist/sandboxHarness.d.mts +0 -2
- package/dist/sandboxHarness.mjs +0 -1
- package/dist/sessionMcp.cjs +0 -6
- package/dist/sessionMcp.d.mts +0 -5
- package/dist/sessionMcp.mjs +0 -3
- package/dist/src/constants/authorTools.cjs +0 -10
- package/dist/src/constants/authorTools.cjs.map +0 -1
- package/dist/src/constants/authorTools.d.mts +0 -6
- package/dist/src/constants/authorTools.d.mts.map +0 -1
- package/dist/src/constants/authorTools.mjs +0 -8
- package/dist/src/constants/authorTools.mjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.cjs +0 -31
- package/dist/src/schemas/cockpitContainer.cjs.map +0 -1
- package/dist/src/schemas/cockpitContainer.d.mts +0 -80
- package/dist/src/schemas/cockpitContainer.d.mts.map +0 -1
- package/dist/src/schemas/cockpitContainer.mjs +0 -30
- package/dist/src/schemas/cockpitContainer.mjs.map +0 -1
- package/dist/src/schemas/httpApiContracts.d.mts +0 -78
- package/dist/src/schemas/httpApiContracts.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.cjs +0 -29
- package/dist/src/schemas/sandboxHarness.cjs.map +0 -1
- package/dist/src/schemas/sandboxHarness.d.mts +0 -39
- package/dist/src/schemas/sandboxHarness.d.mts.map +0 -1
- package/dist/src/schemas/sandboxHarness.mjs +0 -26
- package/dist/src/schemas/sandboxHarness.mjs.map +0 -1
- package/dist/src/server/devProxyForward.cjs +0 -141
- package/dist/src/server/devProxyForward.cjs.map +0 -1
- package/dist/src/server/devProxyForward.mjs +0 -139
- package/dist/src/server/devProxyForward.mjs.map +0 -1
- package/dist/src/server/devProxyRoutes.cjs +0 -97
- package/dist/src/server/devProxyRoutes.cjs.map +0 -1
- package/dist/src/server/devProxyRoutes.mjs +0 -97
- package/dist/src/server/devProxyRoutes.mjs.map +0 -1
- package/dist/src/server/devProxySocket.cjs +0 -93
- package/dist/src/server/devProxySocket.cjs.map +0 -1
- package/dist/src/server/devProxySocket.d.mts +0 -25
- package/dist/src/server/devProxySocket.d.mts.map +0 -1
- package/dist/src/server/devProxySocket.mjs +0 -93
- package/dist/src/server/devProxySocket.mjs.map +0 -1
- package/dist/src/server/remoteRoutes.cjs +0 -463
- package/dist/src/server/remoteRoutes.cjs.map +0 -1
- package/dist/src/server/remoteRoutes.mjs +0 -463
- package/dist/src/server/remoteRoutes.mjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.cjs +0 -585
- package/dist/src/server/sessionMcpHandler.cjs.map +0 -1
- package/dist/src/server/sessionMcpHandler.d.mts +0 -50
- package/dist/src/server/sessionMcpHandler.d.mts.map +0 -1
- package/dist/src/server/sessionMcpHandler.mjs +0 -582
- package/dist/src/server/sessionMcpHandler.mjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.cjs +0 -822
- package/dist/src/server/sessionMcpRoutes.cjs.map +0 -1
- package/dist/src/server/sessionMcpRoutes.mjs +0 -816
- package/dist/src/server/sessionMcpRoutes.mjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.cjs +0 -168
- package/dist/src/services/devProxyPolicy/index.cjs.map +0 -1
- package/dist/src/services/devProxyPolicy/index.mjs +0 -165
- package/dist/src/services/devProxyPolicy/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.cjs +0 -59
- package/dist/src/services/devProxyStore/devProxyRecords.cjs.map +0 -1
- package/dist/src/services/devProxyStore/devProxyRecords.mjs +0 -56
- package/dist/src/services/devProxyStore/devProxyRecords.mjs.map +0 -1
- package/dist/src/services/devProxyStore/index.cjs +0 -13
- package/dist/src/services/devProxyStore/index.cjs.map +0 -1
- package/dist/src/services/devProxyStore/index.mjs +0 -10
- package/dist/src/services/devProxyStore/index.mjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.cjs +0 -66
- package/dist/src/services/devProxyStore/sync.cjs.map +0 -1
- package/dist/src/services/devProxyStore/sync.mjs +0 -63
- package/dist/src/services/devProxyStore/sync.mjs.map +0 -1
- package/dist/src/services/deviceAuth/index.cjs +0 -146
- package/dist/src/services/deviceAuth/index.cjs.map +0 -1
- package/dist/src/services/deviceAuth/index.d.mts +0 -9
- package/dist/src/services/deviceAuth/index.d.mts.map +0 -1
- package/dist/src/services/deviceAuth/index.mjs +0 -146
- package/dist/src/services/deviceAuth/index.mjs.map +0 -1
- package/dist/src/services/deviceSessions/index.cjs +0 -147
- package/dist/src/services/deviceSessions/index.cjs.map +0 -1
- package/dist/src/services/deviceSessions/index.d.mts +0 -18
- package/dist/src/services/deviceSessions/index.d.mts.map +0 -1
- package/dist/src/services/deviceSessions/index.mjs +0 -141
- package/dist/src/services/deviceSessions/index.mjs.map +0 -1
- package/dist/src/services/deviceTrust/index.cjs +0 -294
- package/dist/src/services/deviceTrust/index.cjs.map +0 -1
- package/dist/src/services/deviceTrust/index.mjs +0 -282
- package/dist/src/services/deviceTrust/index.mjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.cjs +0 -58
- package/dist/src/services/loopbackAddress/index.cjs.map +0 -1
- package/dist/src/services/loopbackAddress/index.mjs +0 -56
- package/dist/src/services/loopbackAddress/index.mjs.map +0 -1
- package/dist/src/services/pairingFlow/index.cjs +0 -145
- package/dist/src/services/pairingFlow/index.cjs.map +0 -1
- package/dist/src/services/pairingFlow/index.d.mts +0 -44
- package/dist/src/services/pairingFlow/index.d.mts.map +0 -1
- package/dist/src/services/pairingFlow/index.mjs +0 -145
- package/dist/src/services/pairingFlow/index.mjs.map +0 -1
- package/dist/src/services/publicFileShares/index.cjs +0 -192
- package/dist/src/services/publicFileShares/index.cjs.map +0 -1
- package/dist/src/services/publicFileShares/index.d.mts +0 -16
- package/dist/src/services/publicFileShares/index.d.mts.map +0 -1
- package/dist/src/services/publicFileShares/index.mjs +0 -188
- package/dist/src/services/publicFileShares/index.mjs.map +0 -1
- package/dist/src/services/remoteAccess/index.cjs +0 -567
- package/dist/src/services/remoteAccess/index.cjs.map +0 -1
- package/dist/src/services/remoteAccess/index.d.mts +0 -122
- package/dist/src/services/remoteAccess/index.d.mts.map +0 -1
- package/dist/src/services/remoteAccess/index.mjs +0 -567
- package/dist/src/services/remoteAccess/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.cjs +0 -151
- package/dist/src/services/remoteAccessSettings/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessSettings/index.mjs +0 -149
- package/dist/src/services/remoteAccessSettings/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.cjs +0 -15
- package/dist/src/services/remoteAccessStore/index.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/index.d.mts +0 -2
- package/dist/src/services/remoteAccessStore/index.mjs +0 -12
- package/dist/src/services/remoteAccessStore/index.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs +0 -98
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs +0 -88
- package/dist/src/services/remoteAccessStore/remoteAccessRecords.mjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.cjs +0 -111
- package/dist/src/services/remoteAccessStore/sync.cjs.map +0 -1
- package/dist/src/services/remoteAccessStore/sync.mjs +0 -108
- package/dist/src/services/remoteAccessStore/sync.mjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.cjs +0 -200
- package/dist/src/services/remoteGuardPolicy/index.cjs.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.d.mts +0 -7
- package/dist/src/services/remoteGuardPolicy/index.d.mts.map +0 -1
- package/dist/src/services/remoteGuardPolicy/index.mjs +0 -196
- package/dist/src/services/remoteGuardPolicy/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.cjs +0 -115
- package/dist/src/services/sessionMcpActivity/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpActivity/index.mjs +0 -111
- package/dist/src/services/sessionMcpActivity/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.cjs +0 -473
- package/dist/src/services/sessionMcpAuthorization/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.d.mts +0 -125
- package/dist/src/services/sessionMcpAuthorization/index.d.mts.map +0 -1
- package/dist/src/services/sessionMcpAuthorization/index.mjs +0 -469
- package/dist/src/services/sessionMcpAuthorization/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.cjs +0 -217
- package/dist/src/services/sessionMcpConversations/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpConversations/index.mjs +0 -212
- package/dist/src/services/sessionMcpConversations/index.mjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs +0 -86
- package/dist/src/services/sessionMcpRegistrationStore/index.cjs.map +0 -1
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs +0 -83
- package/dist/src/services/sessionMcpRegistrationStore/index.mjs.map +0 -1
- package/dist/src/services/testMode/index.cjs +0 -162
- package/dist/src/services/testMode/index.cjs.map +0 -1
- package/dist/src/services/testMode/index.d.mts +0 -17
- package/dist/src/services/testMode/index.d.mts.map +0 -1
- package/dist/src/services/testMode/index.mjs +0 -155
- package/dist/src/services/testMode/index.mjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.cjs +0 -58
- package/dist/src/services/tunnelOutput/index.cjs.map +0 -1
- package/dist/src/services/tunnelOutput/index.mjs +0 -54
- package/dist/src/services/tunnelOutput/index.mjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.cjs +0 -487
- package/dist/src/services/tunnelProcess/index.cjs.map +0 -1
- package/dist/src/services/tunnelProcess/index.mjs +0 -481
- package/dist/src/services/tunnelProcess/index.mjs.map +0 -1
- package/dist/src/services/webauthn/index.cjs +0 -262
- package/dist/src/services/webauthn/index.cjs.map +0 -1
- package/dist/src/services/webauthn/index.d.mts +0 -39
- package/dist/src/services/webauthn/index.d.mts.map +0 -1
- package/dist/src/services/webauthn/index.mjs +0 -262
- package/dist/src/services/webauthn/index.mjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.cjs +0 -184
- package/dist/src/services/webauthnPolicy/index.cjs.map +0 -1
- package/dist/src/services/webauthnPolicy/index.d.mts +0 -41
- package/dist/src/services/webauthnPolicy/index.d.mts.map +0 -1
- package/dist/src/services/webauthnPolicy/index.mjs +0 -177
- package/dist/src/services/webauthnPolicy/index.mjs.map +0 -1
- package/dist/testMode.cjs +0 -4
- package/dist/testMode.d.mts +0 -2
- package/dist/testMode.mjs +0 -1
|
@@ -1,38 +1,57 @@
|
|
|
1
1
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
const require_core = require("../../../services/piSettings/core.cjs");
|
|
3
|
+
const require_locale = require("../../../schemas/locale.cjs");
|
|
3
4
|
const require_agentModel = require("../../../schemas/agentModel.cjs");
|
|
5
|
+
const require_serverScope = require("../../../schemas/serverScope.cjs");
|
|
6
|
+
const require_index = require("../../../services/approvalGate/index.cjs");
|
|
4
7
|
const require_backgroundWork = require("../../../schemas/backgroundWork.cjs");
|
|
5
8
|
require("../../../../backgroundWork.cjs");
|
|
6
|
-
const require_index = require("../../../services/chatgptAuth/index.cjs");
|
|
9
|
+
const require_index$1 = require("../../../services/chatgptAuth/index.cjs");
|
|
7
10
|
const require_childSession = require("../../child/types/childSession.cjs");
|
|
11
|
+
const require_codemode = require("../../../schemas/codemode.cjs");
|
|
12
|
+
require("../../../../codemode.cjs");
|
|
13
|
+
const require_contextContributions = require("../../../schemas/contextContributions.cjs");
|
|
14
|
+
const require_index$2 = require("../../../services/contextContributions/index.cjs");
|
|
8
15
|
const require_runtimeCordisHost = require("../../../../runtimeCordisHost.cjs");
|
|
9
16
|
require("../../../../cordisHost.cjs");
|
|
10
17
|
const require_headless = require("../../../schemas/headless.cjs");
|
|
18
|
+
require("../../../../headless.cjs");
|
|
19
|
+
const require_help = require("../../../schemas/help.cjs");
|
|
20
|
+
const require_contextProjection = require("../../../../contextProjection.cjs");
|
|
11
21
|
const require_docs = require("../../../services/durableSession/docs.cjs");
|
|
22
|
+
const require_index$3 = require("../../../services/transcriptPages/index.cjs");
|
|
23
|
+
const require_hubChannel = require("../../../schemas/hubChannel.cjs");
|
|
24
|
+
require("../../../../hubChannel.cjs");
|
|
12
25
|
const require_runtimeProtocol = require("../../../../runtimeProtocol.cjs");
|
|
13
|
-
const
|
|
26
|
+
const require_lang = require("../../../schemas/lang.cjs");
|
|
27
|
+
const require_platform = require("../../../schemas/platform.cjs");
|
|
28
|
+
const require_humanIdentity = require("../../../schemas/humanIdentity.cjs");
|
|
29
|
+
const require_serverBundle = require("../../../schemas/serverBundle.cjs");
|
|
30
|
+
const require_index$4 = require("../../../services/sessionFiles/index.cjs");
|
|
31
|
+
const require_contextDetailStore = require("../../../../contextDetailStore.cjs");
|
|
32
|
+
const require_serverTelemetry = require("../../../../serverTelemetry.cjs");
|
|
33
|
+
const require_index$5 = require("../../../services/skillPrompt/index.cjs");
|
|
14
34
|
const require_headlessHost = require("./headlessHost.cjs");
|
|
15
|
-
const
|
|
35
|
+
const require_personTimeZone = require("../../../schemas/personTimeZone.cjs");
|
|
36
|
+
const require_workflow = require("../../../schemas/workflow.cjs");
|
|
37
|
+
const require_index$6 = require("../../../services/durableSubagents/index.cjs");
|
|
38
|
+
const require_index$7 = require("../../../services/toolContinuation/index.cjs");
|
|
16
39
|
const require_directHarnessRuntime = require("../../../server/directHarnessRuntime.cjs");
|
|
17
40
|
const require_harnessErrorMessage = require("../../../server/harnessErrorMessage.cjs");
|
|
18
|
-
const require_index$
|
|
19
|
-
const require_index$
|
|
41
|
+
const require_index$8 = require("../../../services/chatgptImages/index.cjs");
|
|
42
|
+
const require_index$9 = require("../../../services/chatgptWebSearch/index.cjs");
|
|
20
43
|
const require_contextDetail = require("../../../../contextDetail.cjs");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const require_index$
|
|
24
|
-
const require_index$
|
|
25
|
-
const require_index$
|
|
26
|
-
const require_index$8 = require("../../../services/piSummary/index.cjs");
|
|
27
|
-
const require_serverTelemetry = require("../../../../serverTelemetry.cjs");
|
|
28
|
-
const require_index$9 = require("../../../services/sessionFiles/index.cjs");
|
|
29
|
-
const require_index$10 = require("../../../services/toolPrompt/index.cjs");
|
|
44
|
+
const require_index$10 = require("../../../services/headlessClient/index.cjs");
|
|
45
|
+
const require_index$11 = require("../../../services/nodeModelDependencies/index.cjs");
|
|
46
|
+
const require_index$12 = require("../../../services/piArgs/index.cjs");
|
|
47
|
+
const require_index$13 = require("../../../services/piSummary/index.cjs");
|
|
48
|
+
const require_index$14 = require("../../../services/toolPrompt/index.cjs");
|
|
30
49
|
const require_headlessChildSessionService = require("../../child/adapters/headlessChildSessionService.cjs");
|
|
31
50
|
let node_crypto = require("node:crypto");
|
|
32
51
|
let node_path = require("node:path");
|
|
33
52
|
node_path = require_runtime.__toESM(node_path, 1);
|
|
34
|
-
let typebox_value = require("typebox/value");
|
|
35
53
|
let dist_interop_chordContext_mjs = require("../../../../../dist/interop/chordContext.mjs");
|
|
54
|
+
let typebox_value = require("typebox/value");
|
|
36
55
|
let node_async_hooks = require("node:async_hooks");
|
|
37
56
|
let _earendil_works_pi_ai = require("@earendil-works/pi-ai");
|
|
38
57
|
let _earendil_works_pi_ai_api_simple_options = require("@earendil-works/pi-ai/api/simple-options");
|
|
@@ -40,27 +59,82 @@ let _earendil_works_pi_ai_api_simple_options = require("@earendil-works/pi-ai/ap
|
|
|
40
59
|
const EXTERNAL_OPERATION = "external";
|
|
41
60
|
const REMOTE_TOOL_WAIT_MS = 3e4;
|
|
42
61
|
const PROMPT_PREPARATION_FAILED_EVENT = "po_server.system_prompt_preparation_failed";
|
|
62
|
+
const MAX_AUXILIARY_IMAGES = 4;
|
|
63
|
+
const MAX_AUXILIARY_IMAGE_BYTES = 5242880;
|
|
64
|
+
const AUXILIARY_IMAGE_TYPES = /* @__PURE__ */ new Set([
|
|
65
|
+
"image/png",
|
|
66
|
+
"image/jpeg",
|
|
67
|
+
"image/webp"
|
|
68
|
+
]);
|
|
69
|
+
/** Slash commands renamed away, so they fail with the new name instead of reaching the model as text. */
|
|
70
|
+
const RETIRED_COMMANDS = { minor: "mode" };
|
|
43
71
|
function isRecord(value) {
|
|
44
72
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45
73
|
}
|
|
46
|
-
|
|
47
|
-
|
|
74
|
+
/**
|
|
75
|
+
* A section key for a name, inside pi-durable's `[a-z0-9_-]` key alphabet. Any other character, `_` included,
|
|
76
|
+
* becomes `_<hex>_`, so two names never share a key and kebab-case names stay readable.
|
|
77
|
+
*/
|
|
78
|
+
function sectionName(name) {
|
|
79
|
+
return name.replace(/[^a-z0-9-]/gu, (char) => `_${char.codePointAt(0).toString(16)}_`);
|
|
80
|
+
}
|
|
81
|
+
/** The section of one skill, context resource or mode, so one plugin adding or removing it never resends the rest. */
|
|
82
|
+
const promptSection = {
|
|
83
|
+
skill: (name) => `po-skill-${sectionName(name)}`,
|
|
84
|
+
context: (name) => `po-context-${sectionName(name)}`,
|
|
85
|
+
mode: (name) => `po-mode-${sectionName(name)}`
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Context resources as prompt sections, in resource order; a name repeated by another package is numbered.
|
|
89
|
+
*
|
|
90
|
+
* Deliberately unwrapped. A generic "this is data, not instructions" fence here would also wrap
|
|
91
|
+
* po/profile-config, which carries the operator's persona and *is* authoritative instruction, and demoting it
|
|
92
|
+
* would be worse than the anonymity it fixes. A resource whose body is untrusted owns its own boundary, the way
|
|
93
|
+
* po-goal fences a user objective in escaped <goal_objective>.
|
|
94
|
+
*/
|
|
95
|
+
function contextSections(resources) {
|
|
96
|
+
const seen = /* @__PURE__ */ new Map();
|
|
97
|
+
return resources.filter((resource) => resource.kind !== "skill" && resource.kind !== "prompt").map((resource) => {
|
|
98
|
+
const count = (seen.get(resource.name) ?? 0) + 1;
|
|
99
|
+
seen.set(resource.name, count);
|
|
100
|
+
const key = promptSection.context(resource.name);
|
|
101
|
+
return [count === 1 ? key : `${key}_${count}`, resource.text];
|
|
102
|
+
});
|
|
48
103
|
}
|
|
49
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Every committed section the prompt can fill for these resources, base sections first. Listing one that stays empty
|
|
106
|
+
* is harmless: a section with no text is never shown. Mode sections are not listed: they ride each request's tail.
|
|
107
|
+
*/
|
|
108
|
+
function systemPromptSectionKeys(resources) {
|
|
109
|
+
return [
|
|
110
|
+
"po",
|
|
111
|
+
"po-tools",
|
|
112
|
+
...new Set(resources.filter(({ kind }) => kind === "skill").map(({ name }) => promptSection.skill(name))),
|
|
113
|
+
...contextSections(resources).map(([key]) => key),
|
|
114
|
+
"po-session",
|
|
115
|
+
"po-hooks"
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Restores the last accepted live selection from journal projections, falling back on launch configuration.
|
|
120
|
+
* Saved state keys come back too, such as approved plugins and extensions; a key the launch sets, like `mode`, wins.
|
|
121
|
+
*/
|
|
50
122
|
function restoreHeadlessSelection(entries, fallback) {
|
|
51
123
|
let projected;
|
|
52
124
|
for (let index = entries.length - 1; index >= 0 && projected === void 0; index -= 1) {
|
|
53
125
|
const entry = entries[index];
|
|
54
126
|
if (!isRecord(entry) || entry.type !== "custom" || !isRecord(entry.data)) continue;
|
|
55
127
|
if (projected === void 0 && entry.customType === "po-context") {
|
|
56
|
-
const selection = entry.data
|
|
57
|
-
if (
|
|
58
|
-
const domains = stringArray(selection.domains);
|
|
59
|
-
if (domains === void 0 || selection.profile !== void 0 && typeof selection.profile !== "string") continue;
|
|
128
|
+
const selection = require_contextProjection.readProjectedSelection(entry.data);
|
|
129
|
+
if (selection === void 0) continue;
|
|
60
130
|
projected = {
|
|
61
|
-
|
|
62
|
-
domains,
|
|
63
|
-
|
|
131
|
+
preset: selection.preset,
|
|
132
|
+
domains: selection.domains,
|
|
133
|
+
profile: selection.profile,
|
|
134
|
+
...selection.state === void 0 ? {} : { state: {
|
|
135
|
+
...selection.state,
|
|
136
|
+
...fallback.state
|
|
137
|
+
} }
|
|
64
138
|
};
|
|
65
139
|
}
|
|
66
140
|
}
|
|
@@ -75,7 +149,7 @@ function isJsonValue(value) {
|
|
|
75
149
|
if (Array.isArray(value)) return value.every(isJsonValue);
|
|
76
150
|
return isRecord(value) && Object.values(value).every(isJsonValue);
|
|
77
151
|
}
|
|
78
|
-
function
|
|
152
|
+
function assertJsonMessageData(value) {
|
|
79
153
|
const seen = /* @__PURE__ */ new Set();
|
|
80
154
|
const visit = (item, depth) => {
|
|
81
155
|
if (depth > 128) throw new TypeError("Message data is too deeply nested.");
|
|
@@ -87,8 +161,13 @@ function boundedJsonCopy(value) {
|
|
|
87
161
|
seen.delete(item);
|
|
88
162
|
};
|
|
89
163
|
visit(value, 0);
|
|
164
|
+
}
|
|
165
|
+
const MAX_MESSAGE_CHARACTERS = 16777216;
|
|
166
|
+
const MAX_CANONICAL_MESSAGE_CHARACTERS = 268435456;
|
|
167
|
+
function boundedJsonCopy(value, limit = MAX_MESSAGE_CHARACTERS) {
|
|
168
|
+
assertJsonMessageData(value);
|
|
90
169
|
const encoded = JSON.stringify(value);
|
|
91
|
-
if (encoded.length >
|
|
170
|
+
if (encoded.length > limit) throw new TypeError("Message data exceeds the serialization limit.");
|
|
92
171
|
return JSON.parse(encoded);
|
|
93
172
|
}
|
|
94
173
|
function isSummaryMessage(value) {
|
|
@@ -188,30 +267,21 @@ function modelMetadata(model) {
|
|
|
188
267
|
api: model.api,
|
|
189
268
|
name: model.name,
|
|
190
269
|
...baseUrl ? { baseUrl } : {},
|
|
191
|
-
compat: Object.freeze(compat)
|
|
270
|
+
compat: Object.freeze(compat),
|
|
271
|
+
input: Object.freeze([...model.input])
|
|
192
272
|
});
|
|
193
273
|
}
|
|
194
274
|
function mapResources(resources) {
|
|
195
275
|
const skills = [];
|
|
196
|
-
const advertised = [];
|
|
197
276
|
const promptTemplates = [];
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
const skill = require_headlessHost.headlessHarnessSkill(resource);
|
|
201
|
-
skills.push(skill);
|
|
202
|
-
if (resource.path !== void 0 && !advertised.some((entry) => entry.name === skill.name)) advertised.push(skill);
|
|
203
|
-
} else if (resource.kind === "prompt") promptTemplates.push({
|
|
277
|
+
for (const resource of resources) if (resource.kind === "skill") skills.push(require_headlessHost.headlessHarnessSkill(resource));
|
|
278
|
+
else if (resource.kind === "prompt") promptTemplates.push({
|
|
204
279
|
name: resource.name,
|
|
205
280
|
content: resource.text
|
|
206
281
|
});
|
|
207
|
-
else context.push(resource.text);
|
|
208
282
|
return {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
promptTemplates
|
|
212
|
-
},
|
|
213
|
-
context,
|
|
214
|
-
advertised
|
|
283
|
+
skills,
|
|
284
|
+
promptTemplates
|
|
215
285
|
};
|
|
216
286
|
}
|
|
217
287
|
function toolAdapter(tool, executionContext, reportedErrors) {
|
|
@@ -224,14 +294,20 @@ function toolAdapter(tool, executionContext, reportedErrors) {
|
|
|
224
294
|
...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines },
|
|
225
295
|
...tool.executionMode === void 0 ? {} : { executionMode: tool.executionMode === "parallel" ? "parallel" : "sequential" },
|
|
226
296
|
async execute(toolCallId, parameters, onUpdate, _toolContext, _invocation, context) {
|
|
297
|
+
const continuation = _invocation?.toolContinuation;
|
|
227
298
|
const result = await tool.execute(toolCallId, parameters, context.abortSignal, (partial) => onUpdate({
|
|
228
299
|
content: partial.content,
|
|
229
300
|
details: partial.details
|
|
230
|
-
}),
|
|
231
|
-
|
|
301
|
+
}), {
|
|
302
|
+
...executionContext(),
|
|
303
|
+
...continuation ? { toolContinuation: continuation } : {}
|
|
304
|
+
});
|
|
305
|
+
const sequence = require_index$7.isBashSequenceEnvelope(tool.name, parameters);
|
|
306
|
+
if (result.isError === true && !sequence) reportedErrors.add(toolCallId);
|
|
232
307
|
return {
|
|
233
|
-
content: result.content,
|
|
234
|
-
details: result.details
|
|
308
|
+
content: require_headless.dropInvalidImages(result.content),
|
|
309
|
+
details: result.details,
|
|
310
|
+
...sequence && result.isError === true ? { isError: true } : {}
|
|
235
311
|
};
|
|
236
312
|
}
|
|
237
313
|
};
|
|
@@ -254,13 +330,15 @@ function eventHook(event) {
|
|
|
254
330
|
navigation_end: "session_tree"
|
|
255
331
|
}[event];
|
|
256
332
|
}
|
|
257
|
-
function emitTo(listeners, frame) {
|
|
333
|
+
function emitTo(listeners, frame, onError) {
|
|
258
334
|
const snapshot = [...listeners];
|
|
259
335
|
for (const listener of snapshot) try {
|
|
260
336
|
listener(frame);
|
|
261
|
-
} catch {
|
|
337
|
+
} catch (error) {
|
|
338
|
+
onError(error);
|
|
339
|
+
}
|
|
262
340
|
}
|
|
263
|
-
function createHeadlessCompositionPublisher(runtime, host, environment, groups, readSystemPrompt, alive) {
|
|
341
|
+
function createHeadlessCompositionPublisher(runtime, host, environment, groups, readSystemPrompt, readRequestedProfile, alive) {
|
|
264
342
|
let countTokens;
|
|
265
343
|
let contextRevision = 0;
|
|
266
344
|
let publishedContext;
|
|
@@ -277,10 +355,11 @@ function createHeadlessCompositionPublisher(runtime, host, environment, groups,
|
|
|
277
355
|
};
|
|
278
356
|
const context = require_contextProjection.projectContext({
|
|
279
357
|
revision: contextRevision + 1,
|
|
280
|
-
|
|
281
|
-
...selection.profile === void 0 ? {} : { profile: selection.profile },
|
|
358
|
+
preset: selection.preset,
|
|
359
|
+
...selection.profile === void 0 ? { requestedProfile: readRequestedProfile() } : { profile: selection.profile },
|
|
282
360
|
groups: groups(selection),
|
|
283
361
|
domains: selection.domains,
|
|
362
|
+
...selection.state === void 0 ? {} : { state: selection.state },
|
|
284
363
|
sources: inventory.sources,
|
|
285
364
|
skills: inventory.skills,
|
|
286
365
|
attribution: inventory.attribution,
|
|
@@ -356,6 +435,17 @@ async function repositoryInstructions(platform, repoRoot, agentDir, files) {
|
|
|
356
435
|
await env.cleanup(dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
357
436
|
}
|
|
358
437
|
}
|
|
438
|
+
/** A workflow's instructions file. Unreadable fails the step session rather than running it without them. */
|
|
439
|
+
async function readWorkflowInstructions(platform, cwd, filePath) {
|
|
440
|
+
const env = platform.env(cwd);
|
|
441
|
+
try {
|
|
442
|
+
const result = await env.readTextFile(filePath, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
443
|
+
if (!result.ok) throw new Error(`Workflow instructions ${filePath} could not be read: ${result.error.message}`, { cause: result.error });
|
|
444
|
+
return result.value;
|
|
445
|
+
} finally {
|
|
446
|
+
await env.cleanup(dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
359
449
|
/** Create the gated, same-process host used by direct-headless startup tests. */
|
|
360
450
|
/**
|
|
361
451
|
* Composes one server session's host.
|
|
@@ -364,25 +454,34 @@ async function repositoryInstructions(platform, repoRoot, agentDir, files) {
|
|
|
364
454
|
* registered under its id for them to read instead of `process.env`, and released with it.
|
|
365
455
|
*/
|
|
366
456
|
async function createHeadlessSessionHost(options) {
|
|
457
|
+
if (options.workflowContext !== void 0 && (options.parentSessionId !== options.workflowContext.run.ownerSessionId || options.sessionProvenance !== "workflow")) throw new Error("Workflow context requires a step session owned by its workflow session.");
|
|
458
|
+
if (options.resume === true && options.sessionProvenance === "workflow" && options.workflowContext === void 0) throw new Error("Workflow step sessions cannot be resumed without their creation-only workflow context.");
|
|
459
|
+
const initialEnvironment = options.environment;
|
|
367
460
|
let releaseEnvironment;
|
|
368
461
|
try {
|
|
369
462
|
options = {
|
|
370
463
|
...options,
|
|
371
|
-
environment: await require_index$
|
|
464
|
+
environment: await require_index$4.prepareSessionEnvironment(options)
|
|
372
465
|
};
|
|
373
466
|
releaseEnvironment = require_runtimeCordisHost.registerPoSessionEnvironment(options.sessionId, options.environment);
|
|
374
467
|
return await composeHeadlessSessionHost(options, releaseEnvironment);
|
|
375
468
|
} catch (error) {
|
|
376
469
|
require_contextDetailStore.removeContextDetail(options.sessionId, options.environment);
|
|
470
|
+
if (initialEnvironment !== options.environment) require_contextDetailStore.removeContextDetail(options.sessionId, initialEnvironment);
|
|
377
471
|
releaseEnvironment?.();
|
|
378
472
|
throw error;
|
|
379
473
|
}
|
|
380
474
|
}
|
|
381
475
|
async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
382
|
-
const parsed = require_index$
|
|
383
|
-
const models = await (options.modelDependencies ?? require_index$
|
|
384
|
-
const { agentDir, modelRuntime
|
|
476
|
+
const parsed = require_index$12.validateDirectHeadlessArgs(options.agentArgs);
|
|
477
|
+
const models = await (options.modelDependencies ?? require_index$11.createNodeModelDependencies)(options);
|
|
478
|
+
const { agentDir, modelRuntime } = models;
|
|
385
479
|
const { platform } = options;
|
|
480
|
+
const workflowInstructions = options.workflowContext?.instructions;
|
|
481
|
+
const projectContextFiles = workflowInstructions === void 0 ? models.projectContextFiles : [{
|
|
482
|
+
path: workflowInstructions,
|
|
483
|
+
content: await readWorkflowInstructions(platform, options.cwd, workflowInstructions)
|
|
484
|
+
}];
|
|
386
485
|
const instructions = await repositoryInstructions(platform, options.repoRoot, agentDir, projectContextFiles);
|
|
387
486
|
for (const override of options.providerOverrides?.() ?? []) {
|
|
388
487
|
if (!override.name.trim() || override.name !== override.name.trim()) throw new Error("Invalid native provider identity.");
|
|
@@ -391,12 +490,18 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
391
490
|
if (modelRuntime.getRegisteredNativeProvider(override.name)) continue;
|
|
392
491
|
modelRuntime.registerProvider(override.name, { baseUrl: override.baseUrl });
|
|
393
492
|
}
|
|
493
|
+
try {
|
|
494
|
+
await options.registerModelProviders?.(modelRuntime);
|
|
495
|
+
} catch (error) {
|
|
496
|
+
options.onNotice?.(`Consumer model providers failed to register: ${require_harnessErrorMessage.harnessErrorMessage(error)}`);
|
|
497
|
+
}
|
|
394
498
|
const resolved = await models.resolveModel(parsed);
|
|
395
499
|
if (parsed.apiKey !== void 0) await modelRuntime.setRuntimeApiKey(resolved.model.provider, parsed.apiKey);
|
|
396
500
|
const reportedToolErrors = /* @__PURE__ */ new Set();
|
|
397
501
|
let promptPreparationFailed = false;
|
|
398
502
|
let promptPreparationError;
|
|
399
503
|
let headlessReady = false;
|
|
504
|
+
let sessionStarted = false;
|
|
400
505
|
let toolGuidance = [];
|
|
401
506
|
const initialSystemPrompt = [parsed.systemPrompt, ...parsed.appendSystemPrompt ?? []].filter(Boolean).join("\n\n");
|
|
402
507
|
/**
|
|
@@ -404,7 +509,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
404
509
|
*
|
|
405
510
|
* The server had none of this: its prompt began at the --system-prompt flag, so a
|
|
406
511
|
* repository's own instructions reached a terminal session and never a cockpit one.
|
|
407
|
-
* Mirrors @earendil-works/pi-coding-agent@0.86.0 dist/core/system-prompt.js:21-27
|
|
512
|
+
* Mirrors @earendil-works/pi-coding-agent@0.86.0 dist/core/system-prompt.js:21-27 (earendil-deps-ignore)
|
|
408
513
|
* (the customPrompt branch, which is the shape this host matches). `buildSystemPrompt`
|
|
409
514
|
* is not exported and the package exports map has no wildcard, so the four literals
|
|
410
515
|
* below are copied; re-diff them against that file on upgrade.
|
|
@@ -423,6 +528,200 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
423
528
|
return `<project_context>\n\nProject-specific instructions and guidelines:\n\n${projectContextFiles.map(({ path: filePath, content }) => `<project_instructions path="${filePath}">\n${content}\n</project_instructions>\n`).join("\n")}\n</project_context>`;
|
|
424
529
|
})();
|
|
425
530
|
const workingDirectoryLine = `Current working directory: ${options.cwd.replace(/\\/g, "/")}`;
|
|
531
|
+
let deviceTimeZone;
|
|
532
|
+
let profileTimeZone;
|
|
533
|
+
let deviceLocale;
|
|
534
|
+
const readPersonTimeZone = () => profileTimeZone !== void 0 ? {
|
|
535
|
+
timeZone: profileTimeZone,
|
|
536
|
+
source: "profile"
|
|
537
|
+
} : deviceTimeZone !== void 0 ? {
|
|
538
|
+
timeZone: deviceTimeZone,
|
|
539
|
+
source: "device"
|
|
540
|
+
} : void 0;
|
|
541
|
+
const personTimeZone = {
|
|
542
|
+
read: readPersonTimeZone,
|
|
543
|
+
setProfile(timeZone) {
|
|
544
|
+
profileTimeZone = require_personTimeZone.isTimeZone(timeZone) ? timeZone : void 0;
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
const { countTokens } = await import("gpt-tokenizer");
|
|
548
|
+
let promptSnapshot;
|
|
549
|
+
let promptTexts = {};
|
|
550
|
+
const contribution = (entries, section, owner, text, start = 0, operation = "base") => {
|
|
551
|
+
entries.push({
|
|
552
|
+
id: `contribution-${entries.length + 1}`,
|
|
553
|
+
section,
|
|
554
|
+
owner,
|
|
555
|
+
operation,
|
|
556
|
+
attribution: owner.sources.length > 1 ? "shared" : "exact",
|
|
557
|
+
span: {
|
|
558
|
+
start,
|
|
559
|
+
end: start + text.length
|
|
560
|
+
},
|
|
561
|
+
tokens: countTokens(text)
|
|
562
|
+
});
|
|
563
|
+
};
|
|
564
|
+
const savePrompt = (texts, entries, stage) => {
|
|
565
|
+
const visible = Object.entries(texts).filter(([, text]) => text);
|
|
566
|
+
if (promptSnapshot?.stage === stage && JSON.stringify(promptTexts) === JSON.stringify(Object.fromEntries(visible)) && JSON.stringify(promptSnapshot.contributions) === JSON.stringify(entries)) return;
|
|
567
|
+
const previous = new Map(promptSnapshot?.sections.map((section) => [section.key, section.fingerprint]));
|
|
568
|
+
promptTexts = Object.fromEntries(visible);
|
|
569
|
+
promptSnapshot = {
|
|
570
|
+
revision: (promptSnapshot?.revision ?? 0) + 1,
|
|
571
|
+
stage,
|
|
572
|
+
estimator: "gpt-tokenizer",
|
|
573
|
+
totalTokens: countTokens(visible.map(([, text]) => text).join("\n\n")),
|
|
574
|
+
sections: visible.map(([key, text]) => {
|
|
575
|
+
const fingerprint = (0, node_crypto.createHash)("sha256").update(text).digest("hex");
|
|
576
|
+
return {
|
|
577
|
+
key,
|
|
578
|
+
placement: key.startsWith(promptSection.mode("")) ? "request-tail" : "committed",
|
|
579
|
+
fingerprint,
|
|
580
|
+
tokens: countTokens(text),
|
|
581
|
+
changed: previous.get(key) !== fingerprint
|
|
582
|
+
};
|
|
583
|
+
}),
|
|
584
|
+
removed: [...previous.keys()].filter((key) => !Object.hasOwn(promptTexts, key)),
|
|
585
|
+
contributions: entries
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
const inspectPrompt = () => {
|
|
589
|
+
if (!headlessHost) return void 0;
|
|
590
|
+
if (builtSystemPrompt === void 0) {
|
|
591
|
+
const entries = [];
|
|
592
|
+
const parts = composeSystemPromptParts(headlessHost.appliedResources, entries);
|
|
593
|
+
savePrompt(parts, entries, "base");
|
|
594
|
+
}
|
|
595
|
+
return structuredClone(promptSnapshot);
|
|
596
|
+
};
|
|
597
|
+
const readPromptText = (input) => {
|
|
598
|
+
const snapshot = inspectPrompt();
|
|
599
|
+
if (snapshot?.revision !== input.revision) return void 0;
|
|
600
|
+
if (input.contribution !== void 0) {
|
|
601
|
+
const entry = snapshot.contributions.find(({ id }) => id === input.contribution);
|
|
602
|
+
return entry?.span ? promptTexts[entry.section]?.slice(entry.span.start, entry.span.end) : void 0;
|
|
603
|
+
}
|
|
604
|
+
return input.section === void 0 ? void 0 : promptTexts[input.section];
|
|
605
|
+
};
|
|
606
|
+
const previewPrompt = (input) => {
|
|
607
|
+
const snapshot = inspectPrompt();
|
|
608
|
+
if (snapshot?.revision !== input.revision) return void 0;
|
|
609
|
+
const rejected = [];
|
|
610
|
+
const edits = /* @__PURE__ */ new Map();
|
|
611
|
+
for (const change of input.changes) {
|
|
612
|
+
const entry = snapshot.contributions.find(({ id }) => id === change.contribution);
|
|
613
|
+
const previous = entry ? edits.get(entry.section) ?? [] : [];
|
|
614
|
+
const span = entry?.span;
|
|
615
|
+
const reason = !span ? "Contribution span unavailable" : change.operation === "replace" && typeof change.text !== "string" ? "Replacement text required" : previous.some((edit) => span.start < edit.end && span.end > edit.start) ? "Overlapping contribution changes" : void 0;
|
|
616
|
+
if (reason) {
|
|
617
|
+
rejected.push({
|
|
618
|
+
contribution: change.contribution,
|
|
619
|
+
reason
|
|
620
|
+
});
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
previous.push({
|
|
624
|
+
...span,
|
|
625
|
+
text: change.operation === "exclude" ? "" : change.text
|
|
626
|
+
});
|
|
627
|
+
edits.set(entry.section, previous);
|
|
628
|
+
}
|
|
629
|
+
const candidate = { ...promptTexts };
|
|
630
|
+
for (const [key, changes] of edits) for (const edit of changes.sort((a, b) => b.start - a.start)) candidate[key] = candidate[key].slice(0, edit.start) + edit.text + candidate[key].slice(edit.end);
|
|
631
|
+
const changed = snapshot.sections.filter(({ key }) => candidate[key] !== promptTexts[key]);
|
|
632
|
+
const totalTokens = countTokens(snapshot.sections.map(({ key }) => candidate[key]).filter(Boolean).join("\n\n"));
|
|
633
|
+
return {
|
|
634
|
+
revision: snapshot.revision,
|
|
635
|
+
totalTokens,
|
|
636
|
+
deltaTokens: totalTokens - snapshot.totalTokens,
|
|
637
|
+
sections: snapshot.sections.map(({ key, tokens }) => ({
|
|
638
|
+
key,
|
|
639
|
+
tokens: countTokens(candidate[key]),
|
|
640
|
+
deltaTokens: countTokens(candidate[key]) - tokens
|
|
641
|
+
})),
|
|
642
|
+
firstChangedCommitted: changed.find(({ placement }) => placement === "committed")?.key ?? null,
|
|
643
|
+
tailOnly: changed.length > 0 && changed.every(({ placement }) => placement === "request-tail"),
|
|
644
|
+
rejected
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
/** The base prompt as named parts, in prompt order. */
|
|
648
|
+
const composeSystemPromptParts = (resources, entries) => {
|
|
649
|
+
const hasLoader = toolGuidance.some((entry) => entry.name === "load_skill") || headlessHost?.hasSkillLoader() === true;
|
|
650
|
+
const skills = require_headlessHost.systemPromptSkills(resources, hasLoader).flatMap((resource) => {
|
|
651
|
+
const text = require_index$5.formatSkillForSystemPrompt(require_headlessHost.headlessHarnessSkill(resource), !hasLoader);
|
|
652
|
+
return text ? [[promptSection.skill(resource.name), text]] : [];
|
|
653
|
+
});
|
|
654
|
+
const join = (parts) => parts.filter(Boolean).join("\n\n");
|
|
655
|
+
const parts = {
|
|
656
|
+
po: join([initialSystemPrompt, projectContextBlock]),
|
|
657
|
+
"po-tools": require_index$14.formatToolPrompt(toolGuidance),
|
|
658
|
+
...Object.fromEntries(skills),
|
|
659
|
+
...Object.fromEntries(contextSections(resources)),
|
|
660
|
+
"po-session": join([
|
|
661
|
+
workingDirectoryLine,
|
|
662
|
+
require_personTimeZone.personTimeZoneLine(readPersonTimeZone()),
|
|
663
|
+
require_locale.personLocaleLine(deviceLocale),
|
|
664
|
+
options.environment["PO_SESSION_TEMP_DIR"] ? `Session temporary folder: ${options.environment[require_index$4.PO_SESSION_TEMP_DIR]}\nUse this folder for generated scratch files outside the workspace. Keep workspace edits in place and save important deliverables in session artifacts. Temporary files may be removed by the operating system.` : ""
|
|
665
|
+
])
|
|
666
|
+
};
|
|
667
|
+
if (entries) {
|
|
668
|
+
const core = {
|
|
669
|
+
kind: "core",
|
|
670
|
+
sources: ["@agimon-ai/po-core"],
|
|
671
|
+
name: null
|
|
672
|
+
};
|
|
673
|
+
for (const key of ["po", "po-session"]) if (parts[key]) contribution(entries, key, core, parts[key]);
|
|
674
|
+
const skillResources = require_headlessHost.systemPromptSkills(resources, hasLoader);
|
|
675
|
+
const resolvedSkills = new Map(skillResources.map((resource) => [promptSection.skill(resource.name), resource]));
|
|
676
|
+
for (const [key, resource] of resolvedSkills) {
|
|
677
|
+
const text = parts[key];
|
|
678
|
+
if (text) contribution(entries, key, {
|
|
679
|
+
kind: "resource",
|
|
680
|
+
sources: [resource.source],
|
|
681
|
+
name: resource.name
|
|
682
|
+
}, text);
|
|
683
|
+
}
|
|
684
|
+
const contexts = resources.filter((resource) => resource.kind !== "skill" && resource.kind !== "prompt");
|
|
685
|
+
contextSections(resources).forEach(([key, text], index) => {
|
|
686
|
+
const resource = contexts[index];
|
|
687
|
+
if (text) contribution(entries, key, {
|
|
688
|
+
kind: "resource",
|
|
689
|
+
sources: [resource.source],
|
|
690
|
+
name: resource.name
|
|
691
|
+
}, text);
|
|
692
|
+
});
|
|
693
|
+
const tools = headlessHost?.inspectCapabilities().capabilities.filter((entry) => entry.kind === "tool" && entry.active) ?? [];
|
|
694
|
+
const sources = (name) => tools.filter((entry) => entry.name === name).map((entry) => entry.source);
|
|
695
|
+
let offset = 17;
|
|
696
|
+
for (const tool of toolGuidance.filter((entry) => (entry.promptSnippet ?? "").trim())) {
|
|
697
|
+
const text = `- ${tool.name}: ${tool.promptSnippet}`;
|
|
698
|
+
contribution(entries, "po-tools", {
|
|
699
|
+
kind: "tool",
|
|
700
|
+
sources: sources(tool.name),
|
|
701
|
+
name: tool.name
|
|
702
|
+
}, text, offset);
|
|
703
|
+
offset += text.length + 1;
|
|
704
|
+
}
|
|
705
|
+
const guidelines = [...new Set(toolGuidance.flatMap((tool) => tool.promptGuidelines ?? []).filter((line) => line.trim()))];
|
|
706
|
+
offset = (toolGuidance.some((tool) => (tool.promptSnippet ?? "").trim()) ? offset + 1 : 0) + 12;
|
|
707
|
+
for (const line of guidelines) {
|
|
708
|
+
const owners = toolGuidance.filter((tool) => tool.promptGuidelines?.includes(line));
|
|
709
|
+
const text = `- ${line}`;
|
|
710
|
+
contribution(entries, "po-tools", {
|
|
711
|
+
kind: "tool",
|
|
712
|
+
sources: [...new Set(owners.flatMap((tool) => sources(tool.name)))],
|
|
713
|
+
name: owners.length === 1 ? owners[0].name : null
|
|
714
|
+
}, text, offset);
|
|
715
|
+
if (owners.length > 1) entries[entries.length - 1] = {
|
|
716
|
+
...entries.at(-1),
|
|
717
|
+
attribution: "shared"
|
|
718
|
+
};
|
|
719
|
+
offset += text.length + 1;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
return parts;
|
|
723
|
+
};
|
|
724
|
+
const joinPromptSections = (sections) => Object.values(sections).filter(Boolean).join("\n\n");
|
|
426
725
|
/**
|
|
427
726
|
* Everything the prompt is made of before a package has had a say.
|
|
428
727
|
*
|
|
@@ -430,19 +729,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
430
729
|
* pure; the hook pass that follows it there is not, which is why the context
|
|
431
730
|
* panel is shown this rather than a prompt built for the panel's sake.
|
|
432
731
|
*/
|
|
433
|
-
const composeSystemPrompt = (resources) =>
|
|
434
|
-
const mapped = mapResources(resources);
|
|
435
|
-
const skills = toolGuidance.some((entry) => entry.name === "load_skill") ? "" : require_index$1.formatSkillsForSystemPrompt(mapped.advertised).trim();
|
|
436
|
-
return [
|
|
437
|
-
initialSystemPrompt,
|
|
438
|
-
projectContextBlock,
|
|
439
|
-
require_index$10.formatToolPrompt(toolGuidance),
|
|
440
|
-
skills,
|
|
441
|
-
...mapped.context,
|
|
442
|
-
workingDirectoryLine,
|
|
443
|
-
options.environment["PO_SESSION_TEMP_DIR"] ? `Session temporary folder: ${options.environment[require_index$9.PO_SESSION_TEMP_DIR]}\nUse this folder for generated scratch files outside the workspace. Keep workspace edits in place and save important deliverables in session artifacts. Temporary files may be removed by the operating system.` : ""
|
|
444
|
-
].filter(Boolean).join("\n\n");
|
|
445
|
-
};
|
|
732
|
+
const composeSystemPrompt = (resources) => joinPromptSections(composeSystemPromptParts(resources));
|
|
446
733
|
/** The last prompt a turn actually built, once one has. */
|
|
447
734
|
let builtSystemPrompt;
|
|
448
735
|
/**
|
|
@@ -468,6 +755,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
468
755
|
};
|
|
469
756
|
const beforeTool = async (event, context) => {
|
|
470
757
|
if (!headlessReady || !headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
758
|
+
if (require_index$7.isBashSequenceEnvelope(event.toolName, event.args)) return void 0;
|
|
471
759
|
const patches = await headlessHost.dispatchHook("tool_call", event, context.abortSignal);
|
|
472
760
|
let args = event.args;
|
|
473
761
|
let block;
|
|
@@ -492,6 +780,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
492
780
|
};
|
|
493
781
|
const afterTool = async (event, context) => {
|
|
494
782
|
if (!headlessReady || !headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
783
|
+
if (require_index$7.isBashSequenceEnvelope(event.toolName, event.args)) return void 0;
|
|
495
784
|
const original = reportedToolErrors.delete(event.toolCallId) ? {
|
|
496
785
|
...event,
|
|
497
786
|
isError: true
|
|
@@ -533,9 +822,41 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
533
822
|
};
|
|
534
823
|
};
|
|
535
824
|
const selectionCommand = new node_async_hooks.AsyncLocalStorage();
|
|
825
|
+
let headlessHost;
|
|
536
826
|
const runtime = await require_directHarnessRuntime.createDirectHarnessRuntime({
|
|
827
|
+
resolveHumanIdentity: (actor) => mcpServiceRoot ? require_humanIdentity.readPoHumanIdentity(mcpServiceRoot)?.resolve(actor) ?? Promise.resolve(void 0) : Promise.resolve(void 0),
|
|
828
|
+
systemPromptSections: () => headlessHost ? systemPromptSectionKeys(headlessHost.appliedResources) : [],
|
|
829
|
+
isTailSection: (key) => key.startsWith(promptSection.mode("")),
|
|
830
|
+
onSystemPromptOrder: (keys) => {
|
|
831
|
+
if (!promptSnapshot) return;
|
|
832
|
+
const sections = keys.flatMap((key) => promptSnapshot.sections.filter((section) => section.key === key));
|
|
833
|
+
promptSnapshot = {
|
|
834
|
+
...promptSnapshot,
|
|
835
|
+
sections,
|
|
836
|
+
totalTokens: countTokens(sections.map(({ key }) => promptTexts[key]).join("\n\n"))
|
|
837
|
+
};
|
|
838
|
+
},
|
|
537
839
|
cwd: options.cwd,
|
|
538
840
|
sessionId: options.sessionId,
|
|
841
|
+
onFullHistoryRead: (sessionId, entryCount) => {
|
|
842
|
+
require_serverTelemetry.observe(Promise.resolve().then(() => options.telemetry?.recordEvent?.("po_server.history_full_read", {
|
|
843
|
+
session_id: sessionId,
|
|
844
|
+
entry_count: entryCount
|
|
845
|
+
})));
|
|
846
|
+
},
|
|
847
|
+
onQueueDiagnostics: (diagnostics) => {
|
|
848
|
+
if (diagnostics.max_depth < 8 && diagnostics.duration_ms < 100 && diagnostics.max_estimated_bytes < 1e6) return;
|
|
849
|
+
require_serverTelemetry.observe(Promise.resolve().then(() => options.telemetry?.recordEvent?.("po_server.streaming_queue", diagnostics)));
|
|
850
|
+
},
|
|
851
|
+
onStatsScan: (sessionId, entryCount, pageCount, durationMs, outcome) => {
|
|
852
|
+
require_serverTelemetry.observe(Promise.resolve().then(() => options.telemetry?.recordEvent?.("po_server.stats_scan", {
|
|
853
|
+
session_id: sessionId,
|
|
854
|
+
entry_count: entryCount,
|
|
855
|
+
page_count: pageCount,
|
|
856
|
+
duration_ms: durationMs,
|
|
857
|
+
outcome
|
|
858
|
+
})));
|
|
859
|
+
},
|
|
539
860
|
...options.initialFastMode === void 0 ? {} : { initialFastMode: options.initialFastMode },
|
|
540
861
|
...options.initialAgentLocked === void 0 ? {} : { initialAgentLocked: options.initialAgentLocked },
|
|
541
862
|
...options.parentSessionId === void 0 ? {} : { parentSessionId: options.parentSessionId },
|
|
@@ -545,6 +866,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
545
866
|
models: modelRuntime,
|
|
546
867
|
model: resolved.model,
|
|
547
868
|
...resolved.thinkingLevel === void 0 ? {} : { thinkingLevel: resolved.thinkingLevel },
|
|
869
|
+
operationModelPrompt: options.operationModelPrompt,
|
|
548
870
|
beforeModelRequest: async ({ phase }) => {
|
|
549
871
|
if (!headlessReady || !headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
550
872
|
if (phase === "turn" && options.inheritedSelection) await headlessHost.inheritSelection(await options.inheritedSelection());
|
|
@@ -618,20 +940,83 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
618
940
|
let stage = "resources";
|
|
619
941
|
try {
|
|
620
942
|
if (!headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
621
|
-
|
|
622
|
-
|
|
943
|
+
const entries = [];
|
|
944
|
+
const base = composeSystemPromptParts(await headlessHost.readResources(), entries);
|
|
945
|
+
let prompt = joinPromptSections(base);
|
|
946
|
+
const appended = /* @__PURE__ */ new Map([["po-hooks", ""]]);
|
|
947
|
+
let rewritten = false;
|
|
623
948
|
stage = "before_agent_start hooks";
|
|
624
|
-
|
|
625
|
-
|
|
949
|
+
await headlessHost.dispatchHook("before_agent_start", { systemPrompt: prompt }, void 0, (hook, patch, source) => {
|
|
950
|
+
if (!isRecord(patch) || typeof patch.systemPrompt !== "string") return;
|
|
951
|
+
if (patch.systemPrompt.startsWith(prompt)) {
|
|
952
|
+
const text = patch.systemPrompt.slice(prompt.length);
|
|
953
|
+
const attribution = hook.when?.attribution;
|
|
954
|
+
const key = attribution?.kind === "mode" && attribution.name ? promptSection.mode(attribution.name) : "po-hooks";
|
|
955
|
+
const section = rewritten ? "po" : key;
|
|
956
|
+
const start = rewritten ? prompt.length : (appended.get(key) ?? "").length;
|
|
957
|
+
contribution(entries, section, {
|
|
958
|
+
kind: "hook",
|
|
959
|
+
sources: [source],
|
|
960
|
+
name: hook.name ?? null
|
|
961
|
+
}, text, start, "append");
|
|
962
|
+
appended.set(key, (appended.get(key) ?? "") + text);
|
|
963
|
+
} else {
|
|
964
|
+
rewritten = true;
|
|
965
|
+
for (let index = 0; index < entries.length; index++) entries[index] = {
|
|
966
|
+
...entries[index],
|
|
967
|
+
attribution: "unavailable",
|
|
968
|
+
span: null
|
|
969
|
+
};
|
|
970
|
+
contribution(entries, "po", {
|
|
971
|
+
kind: "hook",
|
|
972
|
+
sources: [source],
|
|
973
|
+
name: hook.name ?? null
|
|
974
|
+
}, patch.systemPrompt, 0, "rewrite");
|
|
975
|
+
}
|
|
976
|
+
prompt = patch.systemPrompt;
|
|
977
|
+
});
|
|
978
|
+
const sections = rewritten ? { po: prompt } : Object.fromEntries([...Object.entries(base), ...[...appended].map(([key, text]) => [key, text.trim()])].filter(([, text]) => text));
|
|
979
|
+
if (!rewritten) for (let index = 0; index < entries.length; index++) {
|
|
980
|
+
const entry = entries[index];
|
|
981
|
+
if (entry.operation !== "append" || !entry.span) continue;
|
|
982
|
+
const raw = appended.get(entry.section) ?? "";
|
|
983
|
+
const leading = raw.length - raw.trimStart().length;
|
|
984
|
+
const length = sections[entry.section]?.length ?? 0;
|
|
985
|
+
entries[index] = {
|
|
986
|
+
...entry,
|
|
987
|
+
span: {
|
|
988
|
+
start: Math.min(length, Math.max(0, entry.span.start - leading)),
|
|
989
|
+
end: Math.min(length, Math.max(0, entry.span.end - leading))
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
for (let index = 0; index < entries.length; index++) {
|
|
994
|
+
const entry = entries[index];
|
|
995
|
+
if (entry.span) entries[index] = {
|
|
996
|
+
...entry,
|
|
997
|
+
tokens: countTokens((sections[entry.section] ?? "").slice(entry.span.start, entry.span.end))
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
const expectedIdentity = options.workflowContext?.identity;
|
|
1001
|
+
if (expectedIdentity !== void 0) {
|
|
1002
|
+
stage = "workflow profile admission";
|
|
1003
|
+
const admission = mcpServiceRoot === void 0 ? void 0 : require_workflow.readPoWorkflowProfileAdmission(mcpServiceRoot);
|
|
1004
|
+
if (admission === void 0) throw new Error("Workflow identity admission requires a po-profile version that provides po/workflow-profile-admission. Upgrade po-profile, then reopen this session.");
|
|
1005
|
+
await admission.assertReady(expectedIdentity);
|
|
1006
|
+
}
|
|
1007
|
+
savePrompt(sections, entries, "effective");
|
|
626
1008
|
promptPreparationFailed = false;
|
|
627
1009
|
promptPreparationError = void 0;
|
|
628
1010
|
if (prompt !== builtSystemPrompt) {
|
|
629
1011
|
builtSystemPrompt = prompt;
|
|
630
1012
|
try {
|
|
631
1013
|
await publishComposition();
|
|
632
|
-
} catch {
|
|
1014
|
+
} catch (error) {
|
|
1015
|
+
if (options.onNotice) options.onNotice(`Composition publication failed: ${require_harnessErrorMessage.harnessErrorMessage(error)}`);
|
|
1016
|
+
else throw error;
|
|
1017
|
+
}
|
|
633
1018
|
}
|
|
634
|
-
return
|
|
1019
|
+
return sections;
|
|
635
1020
|
} catch (error) {
|
|
636
1021
|
promptPreparationFailed = true;
|
|
637
1022
|
promptPreparationError = error;
|
|
@@ -646,7 +1031,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
646
1031
|
if (!headlessReady || !headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
647
1032
|
return headlessHost.listCommands();
|
|
648
1033
|
},
|
|
649
|
-
dispatchCommand: async (text) => {
|
|
1034
|
+
dispatchCommand: async (text, clientMetadata) => {
|
|
650
1035
|
if (!headlessReady || !headlessHost) throw new Error("Headless capabilities are not installed.");
|
|
651
1036
|
const match = /^\/(\S+)(?:\s+([\s\S]*))?$/.exec(text);
|
|
652
1037
|
if (!match) {
|
|
@@ -656,16 +1041,19 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
656
1041
|
}
|
|
657
1042
|
const name = match[1];
|
|
658
1043
|
const args = match[2] ?? "";
|
|
1044
|
+
if (!headlessHost.status.ready) await headlessHost.settled();
|
|
659
1045
|
if (!headlessHost.listCommands().some((entry) => entry.name === name)) {
|
|
660
1046
|
headlessHost.assertActive();
|
|
1047
|
+
const renamed = Object.hasOwn(RETIRED_COMMANDS, name) ? RETIRED_COMMANDS[name] : void 0;
|
|
1048
|
+
if (renamed !== void 0) throw new Error(`/${name} was renamed to /${renamed}`);
|
|
661
1049
|
return false;
|
|
662
1050
|
}
|
|
663
1051
|
await selectionCommand.run([
|
|
664
|
-
"
|
|
1052
|
+
"preset",
|
|
665
1053
|
"domains",
|
|
666
1054
|
"profile",
|
|
667
|
-
"
|
|
668
|
-
].includes(name), () => headlessHost.dispatchCommand(name, args));
|
|
1055
|
+
"mode"
|
|
1056
|
+
].includes(name), () => headlessHost.dispatchCommand(name, args, clientMetadata));
|
|
669
1057
|
return true;
|
|
670
1058
|
},
|
|
671
1059
|
guardModelRequest: () => {
|
|
@@ -684,16 +1072,20 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
684
1072
|
groupingRoot: options.groupingRoot ?? options.repoRoot,
|
|
685
1073
|
parentSessionId: options.parentSessionId,
|
|
686
1074
|
sessionProvenance: options.sessionProvenance,
|
|
1075
|
+
interaction: options.interaction,
|
|
687
1076
|
files: {
|
|
688
1077
|
agentDirectory: node_path.default.resolve(require_core.piAgentDirectory(options.environment, options.platform.homeDirectory)),
|
|
689
|
-
...options.environment["PO_SESSION_TEMP_DIR"] === void 0 ? {} : { temporaryDirectory: options.environment[require_index$
|
|
1078
|
+
...options.environment["PO_SESSION_TEMP_DIR"] === void 0 ? {} : { temporaryDirectory: options.environment[require_index$4.PO_SESSION_TEMP_DIR] },
|
|
1079
|
+
...options.environment["PO_SESSION_ARTIFACT_DIR"] === void 0 ? {} : { artifactDirectory: options.environment[require_index$4.PO_SESSION_ARTIFACT_DIR] }
|
|
690
1080
|
}
|
|
691
1081
|
});
|
|
692
1082
|
}, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
693
1083
|
const agent = await runtime.lane.agent(dist_interop_chordContext_mjs.BACKGROUND_CONTEXT);
|
|
1084
|
+
const model = agent.model ? modelRuntime.getModel(agent.model.provider, agent.model.modelId) : void 0;
|
|
1085
|
+
const latest = await require_index$3.findNewestDurableEntry(runtime.scanEntries.bind(runtime), dist_interop_chordContext_mjs.BACKGROUND_CONTEXT, (entry) => entry.type === "custom" && entry.customType === "po-context");
|
|
694
1086
|
return {
|
|
695
|
-
model
|
|
696
|
-
entries:
|
|
1087
|
+
model,
|
|
1088
|
+
entries: latest ? [latest] : []
|
|
697
1089
|
};
|
|
698
1090
|
})().catch(async (error) => {
|
|
699
1091
|
await runtime.dispose().catch((disposeError) => options.onNotice?.(`Session runtime failed to close: ${String(disposeError)}`));
|
|
@@ -708,7 +1100,8 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
708
1100
|
checkoutRoot: options.repoRoot,
|
|
709
1101
|
cwd: options.cwd,
|
|
710
1102
|
...options.parentSessionId === void 0 ? {} : { parentSessionId: options.parentSessionId },
|
|
711
|
-
...options.sessionProvenance === void 0 ? {} : { provenance: options.sessionProvenance }
|
|
1103
|
+
...options.sessionProvenance === void 0 ? {} : { provenance: options.sessionProvenance },
|
|
1104
|
+
...options.interaction === void 0 ? {} : { interaction: options.interaction }
|
|
712
1105
|
});
|
|
713
1106
|
const entries = opened.entries;
|
|
714
1107
|
const listeners = /* @__PURE__ */ new Set();
|
|
@@ -718,7 +1111,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
718
1111
|
let backgroundWorkBinding;
|
|
719
1112
|
let latestSelection = options.selection;
|
|
720
1113
|
const initialSelection = restoreHeadlessSelection(entries, options.selection);
|
|
721
|
-
let
|
|
1114
|
+
let requestedProfile = options.requestedProfile;
|
|
722
1115
|
let mcpServiceRoot;
|
|
723
1116
|
let mcpLifecycle = new AbortController();
|
|
724
1117
|
const chatgptLifecycle = new AbortController();
|
|
@@ -726,16 +1119,21 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
726
1119
|
let client;
|
|
727
1120
|
let disposed = false;
|
|
728
1121
|
let disposePromise;
|
|
1122
|
+
let closeReason;
|
|
729
1123
|
let publishComposition = async () => {
|
|
730
1124
|
throw new Error("Direct headless composition publisher is not installed.");
|
|
731
1125
|
};
|
|
732
|
-
const
|
|
1126
|
+
const emitFrame = (frame) => emitTo(listeners, frame, (error) => {
|
|
1127
|
+
if (mcpServiceRoot) mcpServiceRoot.logger.warn("Session frame listener failed", error);
|
|
1128
|
+
else if (options.onNotice) options.onNotice(`Session frame listener failed: ${require_harnessErrorMessage.harnessErrorMessage(error)}`);
|
|
1129
|
+
else throw error;
|
|
1130
|
+
});
|
|
1131
|
+
const readAppliedContext = (signal) => {
|
|
733
1132
|
signal.throwIfAborted();
|
|
734
1133
|
const host = headlessHost;
|
|
735
1134
|
if (!host || disposed) throw new Error("Session context is unavailable.");
|
|
736
1135
|
const status = host.status;
|
|
737
1136
|
if (!status.ready || status.requestedRevision !== status.appliedRevision) throw new Error("Session context is unavailable.");
|
|
738
|
-
if (instructions instanceof Error) throw instructions;
|
|
739
1137
|
const selection = host.context.selection;
|
|
740
1138
|
const persona = host.appliedResources.find(({ name, kind }) => name === "po/profile-config" && kind === "context")?.text;
|
|
741
1139
|
signal.throwIfAborted();
|
|
@@ -753,18 +1151,28 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
753
1151
|
selection: {
|
|
754
1152
|
profile: selection.profile ?? null,
|
|
755
1153
|
domains: [...selection.domains],
|
|
756
|
-
|
|
1154
|
+
preset: selection.preset,
|
|
757
1155
|
activeLayers: [...selection.activeLayers],
|
|
758
|
-
|
|
1156
|
+
modes: [...selection.state?.["mode"] ?? []]
|
|
759
1157
|
},
|
|
760
|
-
instructions,
|
|
761
1158
|
persona: persona ?? null
|
|
762
1159
|
};
|
|
763
1160
|
};
|
|
1161
|
+
const readMcpContext = (signal) => {
|
|
1162
|
+
const snapshot = readAppliedContext(signal);
|
|
1163
|
+
if (instructions instanceof Error) throw instructions;
|
|
1164
|
+
return {
|
|
1165
|
+
...snapshot,
|
|
1166
|
+
instructions
|
|
1167
|
+
};
|
|
1168
|
+
};
|
|
1169
|
+
let appliedChildTools = [];
|
|
1170
|
+
let bindChildTools = () => appliedChildTools;
|
|
764
1171
|
const childHookRegistry = require_headlessChildSessionService.createPoChildSessionHookRegistry();
|
|
765
|
-
const childSessionProvider = require_headlessChildSessionService.createHeadlessChildSessionServiceProvider({
|
|
1172
|
+
const childSessionProvider = (options.childSessions ?? require_headlessChildSessionService.createHeadlessChildSessionServiceProvider)({
|
|
766
1173
|
runtime,
|
|
767
1174
|
cwd: options.cwd,
|
|
1175
|
+
fs: platform.env(options.cwd),
|
|
768
1176
|
subscribeMcpTool: (listener) => {
|
|
769
1177
|
return mcpServiceRoot?.on("internal/service", (name) => {
|
|
770
1178
|
if (name === "po/child-session-mcp-tool") listener();
|
|
@@ -777,20 +1185,48 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
777
1185
|
mcpTool: () => {
|
|
778
1186
|
if (disposed || !headlessReady || !headlessHost?.status.ready) return void 0;
|
|
779
1187
|
return mcpServiceRoot?.get(require_childSession.PO_CHILD_SESSION_MCP_TOOL_SERVICE);
|
|
1188
|
+
},
|
|
1189
|
+
parentTools: () => {
|
|
1190
|
+
if (disposed || !headlessReady || !headlessHost?.status.ready) return void 0;
|
|
1191
|
+
return {
|
|
1192
|
+
tools: appliedChildTools,
|
|
1193
|
+
bindChild: bindChildTools,
|
|
1194
|
+
allows: (name) => headlessHost.allowsTool(name)
|
|
1195
|
+
};
|
|
780
1196
|
}
|
|
781
1197
|
});
|
|
1198
|
+
const settleHost = async () => {
|
|
1199
|
+
if (!disposed && headlessReady && !promptPreparationFailed && headlessHost?.status.ready === false) await headlessHost.settled();
|
|
1200
|
+
};
|
|
782
1201
|
const completeAuxiliaryModel = async (reference, request) => {
|
|
1202
|
+
await settleHost();
|
|
783
1203
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
784
1204
|
request.signal?.throwIfAborted();
|
|
785
1205
|
const separator = reference.indexOf("/");
|
|
786
1206
|
const model = separator > 0 ? modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) : void 0;
|
|
787
1207
|
if (!model || !modelRuntime.hasConfiguredAuth(model.provider)) throw new Error(`Model is not configured: ${reference}`);
|
|
788
1208
|
if (!runtime.completeModel) throw new Error("The runtime does not support auxiliary model requests.");
|
|
1209
|
+
const images = request.images ?? [];
|
|
1210
|
+
if (images.length > 0) {
|
|
1211
|
+
if (!model.input.includes("image")) throw new Error(`Model does not accept images: ${reference}`);
|
|
1212
|
+
if (images.length > MAX_AUXILIARY_IMAGES) throw new Error(`At most ${MAX_AUXILIARY_IMAGES} images per request.`);
|
|
1213
|
+
for (const image of images) {
|
|
1214
|
+
if (!AUXILIARY_IMAGE_TYPES.has(image.mimeType)) throw new Error(`Unsupported image type: ${image.mimeType}`);
|
|
1215
|
+
if (Math.ceil(image.data.length * .75) > MAX_AUXILIARY_IMAGE_BYTES) throw new Error("Image exceeds 5 MiB.");
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
789
1218
|
const response = await runtime.completeModel(model, {
|
|
790
1219
|
systemPrompt: request.systemPrompt,
|
|
791
1220
|
messages: [{
|
|
792
1221
|
role: "user",
|
|
793
|
-
content: request.input
|
|
1222
|
+
content: images.length === 0 ? request.input : [{
|
|
1223
|
+
type: "text",
|
|
1224
|
+
text: request.input
|
|
1225
|
+
}, ...images.map((image) => ({
|
|
1226
|
+
type: "image",
|
|
1227
|
+
data: image.data,
|
|
1228
|
+
mimeType: image.mimeType
|
|
1229
|
+
}))],
|
|
794
1230
|
timestamp: Date.now()
|
|
795
1231
|
}],
|
|
796
1232
|
...request.tools ? { tools: [...request.tools] } : {}
|
|
@@ -798,10 +1234,15 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
798
1234
|
signal: request.signal,
|
|
799
1235
|
maxTokens: request.maxTokens,
|
|
800
1236
|
cacheRetention: request.cacheRetention,
|
|
801
|
-
reasoningEffort: "none",
|
|
1237
|
+
reasoningEffort: model.reasoning && request.thinkingLevel && request.thinkingLevel !== "off" ? request.thinkingLevel : "none",
|
|
802
1238
|
maxRetries: 0
|
|
803
1239
|
});
|
|
1240
|
+
if (request.recordUsage) await runtime.recordUsage(response.usage, { details: {
|
|
1241
|
+
purpose: "auxiliary_completion",
|
|
1242
|
+
model: reference
|
|
1243
|
+
} });
|
|
804
1244
|
request.signal?.throwIfAborted();
|
|
1245
|
+
if (request.recordUsage && response.stopReason === "length") throw new Error("Auxiliary model request exceeded its output limit.");
|
|
805
1246
|
if (response.stopReason === "error" || response.stopReason === "aborted") throw new Error(response.errorMessage ?? `Model stopped: ${response.stopReason}`);
|
|
806
1247
|
return response;
|
|
807
1248
|
};
|
|
@@ -818,11 +1259,51 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
818
1259
|
timestamp: Date.now()
|
|
819
1260
|
};
|
|
820
1261
|
};
|
|
1262
|
+
async function* entriesNewestFirst(query) {
|
|
1263
|
+
const limit = query?.limit;
|
|
1264
|
+
if (limit !== void 0 && (!Number.isSafeInteger(limit) || limit < 0)) throw new TypeError("History limit must be a non-negative safe integer.");
|
|
1265
|
+
if (limit === 0) return;
|
|
1266
|
+
let count = 0;
|
|
1267
|
+
for await (const entry of require_index$3.durableEntriesNewestFirst(runtime.scanEntries.bind(runtime), dist_interop_chordContext_mjs.BACKGROUND_CONTEXT)) {
|
|
1268
|
+
if (query?.type && entry.type !== query.type) continue;
|
|
1269
|
+
if (query?.customType && (entry.type !== "custom" || entry.customType !== query.customType)) continue;
|
|
1270
|
+
yield entry;
|
|
1271
|
+
if (++count === limit) return;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
821
1274
|
const executionContext = (selection) => ({
|
|
822
1275
|
cwd: options.cwd,
|
|
1276
|
+
readRuntimeSetup: () => {
|
|
1277
|
+
const snapshot = readAppliedContext(mcpLifecycle.signal);
|
|
1278
|
+
const loaded = mcpServiceRoot && require_serverScope.readPoServerScope(mcpServiceRoot)?.loadedPackages?.();
|
|
1279
|
+
if (!loaded) throw new Error("Loaded session package identities are unavailable.");
|
|
1280
|
+
const isolate = mcpServiceRoot && require_platform.readPoIsolate(mcpServiceRoot);
|
|
1281
|
+
const namespaces = mcpServiceRoot && isolate ? (require_codemode.readPoCodemode(mcpServiceRoot)?.list() ?? []).filter((namespace) => isolate.liveObjects || namespace.portable === true) : [];
|
|
1282
|
+
return {
|
|
1283
|
+
revision: snapshot.session.revision,
|
|
1284
|
+
selection: {
|
|
1285
|
+
...snapshot.selection,
|
|
1286
|
+
modes: snapshot.selection.modes ?? []
|
|
1287
|
+
},
|
|
1288
|
+
persona: snapshot.persona,
|
|
1289
|
+
packages: loaded.filter((entry) => headlessHost.isSourceActive(entry.packageName)),
|
|
1290
|
+
capabilities: [...headlessHost.inspectCapabilities().capabilities.filter((entry) => entry.active).map(({ source, name, kind }) => ({
|
|
1291
|
+
source,
|
|
1292
|
+
name,
|
|
1293
|
+
kind
|
|
1294
|
+
})), ...namespaces.map(({ name, declarations }) => ({
|
|
1295
|
+
source: require_codemode.PO_CODEMODE_SERVICE,
|
|
1296
|
+
name,
|
|
1297
|
+
kind: "namespace",
|
|
1298
|
+
declarations
|
|
1299
|
+
}))]
|
|
1300
|
+
};
|
|
1301
|
+
},
|
|
823
1302
|
repoRoot: options.repoRoot,
|
|
824
1303
|
sessionId: runtime.sessionId,
|
|
1304
|
+
isBotSession: async () => require_hubChannel.parseStoredBot((await runtime.session.snapshot(require_docs.SessionMetadataDoc, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT))?.bot) !== void 0,
|
|
825
1305
|
...sessionContext === void 0 ? {} : { sessionContext },
|
|
1306
|
+
...options.interaction === void 0 ? {} : { interaction: options.interaction },
|
|
826
1307
|
environment: options.environment,
|
|
827
1308
|
client: client.client,
|
|
828
1309
|
model: currentModel === void 0 ? void 0 : modelMetadata(currentModel),
|
|
@@ -832,19 +1313,21 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
832
1313
|
},
|
|
833
1314
|
async getAvailableModels() {
|
|
834
1315
|
if (disposed) throw new Error("The session is closed.");
|
|
835
|
-
return (await modelRuntime.getAvailable()).filter((model) => modelRuntime.hasConfiguredAuth(model.provider)).map(({ provider, id }) => ({
|
|
1316
|
+
return (await modelRuntime.getAvailable()).filter((model) => modelRuntime.hasConfiguredAuth(model.provider)).map(({ provider, id, input }) => ({
|
|
836
1317
|
provider,
|
|
837
|
-
id
|
|
1318
|
+
id,
|
|
1319
|
+
input: [...input]
|
|
838
1320
|
}));
|
|
839
1321
|
},
|
|
840
1322
|
selection,
|
|
841
1323
|
imageGeneration: {
|
|
842
1324
|
available: () => !disposed && modelRuntime.isUsingSubscription("po-chatgpt"),
|
|
843
1325
|
async generate(request) {
|
|
1326
|
+
await settleHost();
|
|
844
1327
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
845
|
-
return require_index$
|
|
846
|
-
available: () => modelRuntime.isUsingSubscription(require_index.CHATGPT_AUTH_PROVIDER_ID),
|
|
847
|
-
getAuth: (signal) => modelRuntime.getAuth(require_index.CHATGPT_AUTH_PROVIDER_ID, { signal })
|
|
1328
|
+
return require_index$8.createChatgptImageClient({
|
|
1329
|
+
available: () => modelRuntime.isUsingSubscription(require_index$1.CHATGPT_AUTH_PROVIDER_ID),
|
|
1330
|
+
getAuth: (signal) => modelRuntime.getAuth(require_index$1.CHATGPT_AUTH_PROVIDER_ID, { signal })
|
|
848
1331
|
}).generate({
|
|
849
1332
|
...request,
|
|
850
1333
|
signal: request.signal ? AbortSignal.any([request.signal, chatgptLifecycle.signal]) : chatgptLifecycle.signal
|
|
@@ -854,10 +1337,11 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
854
1337
|
webSearch: {
|
|
855
1338
|
available: () => !disposed && modelRuntime.isUsingSubscription("po-chatgpt"),
|
|
856
1339
|
async search(request) {
|
|
1340
|
+
await settleHost();
|
|
857
1341
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
858
|
-
return require_index$
|
|
859
|
-
available: () => modelRuntime.isUsingSubscription(require_index.CHATGPT_AUTH_PROVIDER_ID),
|
|
860
|
-
getAuth: (signal) => modelRuntime.getAuth(require_index.CHATGPT_AUTH_PROVIDER_ID, { signal })
|
|
1342
|
+
return require_index$9.createChatgptWebSearchClient({
|
|
1343
|
+
available: () => modelRuntime.isUsingSubscription(require_index$1.CHATGPT_AUTH_PROVIDER_ID),
|
|
1344
|
+
getAuth: (signal) => modelRuntime.getAuth(require_index$1.CHATGPT_AUTH_PROVIDER_ID, { signal })
|
|
861
1345
|
}).search({
|
|
862
1346
|
...request,
|
|
863
1347
|
sessionId: runtime.sessionId,
|
|
@@ -872,14 +1356,19 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
872
1356
|
return separator > 0 && !!modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) && modelRuntime.hasConfiguredAuth(reference.slice(0, separator));
|
|
873
1357
|
},
|
|
874
1358
|
async summarize(reference, request) {
|
|
1359
|
+
await settleHost();
|
|
875
1360
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
876
1361
|
request.signal?.throwIfAborted();
|
|
877
1362
|
const separator = reference.indexOf("/");
|
|
878
1363
|
const model = separator > 0 ? modelRuntime.getModel(reference.slice(0, separator), reference.slice(separator + 1)) : void 0;
|
|
879
1364
|
if (!model || !modelRuntime.hasConfiguredAuth(model.provider)) throw new Error(`Model is not configured: ${reference}`);
|
|
880
1365
|
if (!runtime.completeModel) throw new Error("The runtime does not support auxiliary model requests.");
|
|
881
|
-
|
|
882
|
-
if (!Array.isArray(messages) || !messages.every(isSummaryMessage)) throw new TypeError("Summary requests require supported native messages.");
|
|
1366
|
+
assertJsonMessageData(request.messages);
|
|
1367
|
+
if (!Array.isArray(request.messages) || !request.messages.every(isSummaryMessage)) throw new TypeError("Summary requests require supported native messages.");
|
|
1368
|
+
const messages = boundedJsonCopy(request.messages.map((message) => "content" in message && Array.isArray(message.content) ? {
|
|
1369
|
+
...message,
|
|
1370
|
+
content: message.content.filter((part) => !isRecord(part) || part.type !== "image" && part.type !== "thinking")
|
|
1371
|
+
} : message), MAX_CANONICAL_MESSAGE_CHARACTERS);
|
|
883
1372
|
if (typeof request.instructions !== "string" || request.previousSummary !== void 0 && typeof request.previousSummary !== "string") throw new TypeError("Summary instructions and previous summary must be strings.");
|
|
884
1373
|
if (request.thinkingLevel !== void 0 && ![
|
|
885
1374
|
"off",
|
|
@@ -892,7 +1381,17 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
892
1381
|
].includes(request.thinkingLevel)) throw new TypeError("Unsupported summary thinking level.");
|
|
893
1382
|
let summaryFailure;
|
|
894
1383
|
let overflowed = false;
|
|
895
|
-
const attempt = (target) => require_index$
|
|
1384
|
+
const attempt = (target) => require_index$13.summarize(messages, target, request.signal, request.instructions, request.previousSummary, request.thinkingLevel, (_model, context, options) => {
|
|
1385
|
+
const size = JSON.stringify(context).length;
|
|
1386
|
+
if (size > MAX_MESSAGE_CHARACTERS) {
|
|
1387
|
+
summaryFailure = Object.assign(/* @__PURE__ */ new RangeError("Summary input exceeds the serialization limit."), {
|
|
1388
|
+
code: "SUMMARY_INPUT_TOO_LARGE",
|
|
1389
|
+
phase: "summary_input",
|
|
1390
|
+
size,
|
|
1391
|
+
limit: MAX_MESSAGE_CHARACTERS
|
|
1392
|
+
});
|
|
1393
|
+
throw summaryFailure;
|
|
1394
|
+
}
|
|
896
1395
|
const stream = (0, _earendil_works_pi_ai.createAssistantMessageEventStream)();
|
|
897
1396
|
const maxTokens = target.maxTokens > 0 ? (0, _earendil_works_pi_ai_api_simple_options.clampMaxTokensToContext)(target, context, target.maxTokens) : options?.maxTokens;
|
|
898
1397
|
runtime.completeModel(target, context, {
|
|
@@ -939,7 +1438,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
939
1438
|
summary = await attempt(model);
|
|
940
1439
|
} catch (error) {
|
|
941
1440
|
const widest = overflowed && !request.signal?.aborted ? (await modelRuntime.getAvailable()).reduce((best, item) => item.contextWindow > best.contextWindow ? item : best, model) : model;
|
|
942
|
-
if (widest === model) throw error;
|
|
1441
|
+
if (widest === model) throw summaryFailure ?? error;
|
|
943
1442
|
summaryFailure = void 0;
|
|
944
1443
|
summary = await attempt(widest);
|
|
945
1444
|
}
|
|
@@ -964,6 +1463,12 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
964
1463
|
};
|
|
965
1464
|
} },
|
|
966
1465
|
session: {
|
|
1466
|
+
get started() {
|
|
1467
|
+
return sessionStarted && !disposed;
|
|
1468
|
+
},
|
|
1469
|
+
get closeReason() {
|
|
1470
|
+
return closeReason;
|
|
1471
|
+
},
|
|
967
1472
|
setFastMode: (enabled) => runtime.setFastMode(enabled),
|
|
968
1473
|
async readModelSettings() {
|
|
969
1474
|
const selected = (await runtime.lane.agent(dist_interop_chordContext_mjs.BACKGROUND_CONTEXT)).model;
|
|
@@ -979,46 +1484,60 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
979
1484
|
if (settings.thinkingLevel !== void 0) await runtime.setThinkingLevel(settings.thinkingLevel);
|
|
980
1485
|
},
|
|
981
1486
|
async forkSource() {
|
|
982
|
-
const {
|
|
983
|
-
return {
|
|
1487
|
+
for await (const entry of entriesNewestFirst({ limit: 1 })) return {
|
|
984
1488
|
kind: "fork",
|
|
985
|
-
|
|
1489
|
+
entryId: String(entry.id)
|
|
986
1490
|
};
|
|
1491
|
+
return { kind: "fork" };
|
|
987
1492
|
},
|
|
1493
|
+
entriesNewestFirst,
|
|
1494
|
+
customSnapshot: (customType, validator) => runtime.customSnapshot(customType, validator),
|
|
1495
|
+
tokenSnapshot: (customTypes) => runtime.tokenSnapshot(customTypes),
|
|
988
1496
|
entries: async (query) => {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
return entries;
|
|
1497
|
+
const entries = [];
|
|
1498
|
+
for await (const entry of entriesNewestFirst(query)) entries.push(entry);
|
|
1499
|
+
return query?.limit === void 0 ? entries.reverse() : entries;
|
|
992
1500
|
},
|
|
993
1501
|
async appendMessage(message) {
|
|
994
1502
|
return runtime.appendMessage(informationalMessage(message));
|
|
995
1503
|
},
|
|
996
|
-
async
|
|
1504
|
+
async appendMessageOnce(message, requestId) {
|
|
1505
|
+
if (disposed) throw new Error("The session is closed.");
|
|
1506
|
+
if (typeof requestId !== "string" || !requestId.trim()) throw new TypeError("Custom message requestId must be a non-empty string.");
|
|
1507
|
+
return runtime.appendMessage(informationalMessage(message), requestId);
|
|
1508
|
+
},
|
|
1509
|
+
async admitMessage(message, delivery = "followUp", requestId = (0, node_crypto.randomUUID)()) {
|
|
997
1510
|
try {
|
|
1511
|
+
await settleHost();
|
|
998
1512
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
999
|
-
if (delivery !== "steer" && delivery !== "followUp") throw new TypeError("Custom message delivery must be steer or
|
|
1000
|
-
if (
|
|
1513
|
+
if (delivery !== "steer" && delivery !== "followUp" && delivery !== "nextTurn") throw new TypeError("Custom message delivery must be steer, followUp or nextTurn.");
|
|
1514
|
+
if (typeof requestId !== "string" || !requestId.trim()) throw new TypeError("Custom message requestId must be a non-empty string.");
|
|
1001
1515
|
const submission = await runtime.submitInternalMessage(informationalMessage(message), delivery, requestId);
|
|
1002
1516
|
submission.settled.catch((error) => client.client.notify({
|
|
1003
1517
|
body: error instanceof Error ? error.message : String(error),
|
|
1004
1518
|
level: "error"
|
|
1005
1519
|
}));
|
|
1006
1520
|
if ("admitted" in submission) await submission.admitted;
|
|
1521
|
+
return {
|
|
1522
|
+
requestId,
|
|
1523
|
+
settled: submission.settled
|
|
1524
|
+
};
|
|
1007
1525
|
} catch (error) {
|
|
1008
1526
|
throw new require_headless.PoHeadlessPromptAdmissionError(error);
|
|
1009
1527
|
}
|
|
1010
1528
|
},
|
|
1011
1529
|
registerCheckpointBoundary(callback) {
|
|
1012
1530
|
if (!runtime.registerCheckpointBoundary) throw new Error("Native checkpoint boundaries are unavailable.");
|
|
1531
|
+
const checkpointOptions = (options) => options?.resetContext && { resetContext: { retainedMessages: boundedJsonCopy(options.resetContext.retainedMessages) } };
|
|
1013
1532
|
const registration = runtime.registerCheckpointBoundary(async (boundary) => {
|
|
1014
1533
|
if (disposed || !headlessReady || !headlessHost?.status.ready) return;
|
|
1015
1534
|
await callback({
|
|
1016
1535
|
signal: boundary.signal,
|
|
1017
|
-
appendMessage: (message) => boundary.appendMessage(informationalMessage(message))
|
|
1536
|
+
appendMessage: (message, options) => boundary.appendMessage(informationalMessage(message), checkpointOptions(options))
|
|
1018
1537
|
});
|
|
1019
1538
|
});
|
|
1020
1539
|
return {
|
|
1021
|
-
appendMessage: (message) => disposed || !headlessReady || !headlessHost?.status.ready ? Promise.resolve(void 0) : registration.appendMessage(informationalMessage(message)),
|
|
1540
|
+
appendMessage: (message, options) => disposed || !headlessReady || !headlessHost?.status.ready ? Promise.resolve(void 0) : registration.appendMessage(informationalMessage(message), checkpointOptions(options)),
|
|
1022
1541
|
dispose: () => registration.dispose()
|
|
1023
1542
|
};
|
|
1024
1543
|
},
|
|
@@ -1027,12 +1546,12 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1027
1546
|
if (disposed || !headlessReady || promptPreparationFailed || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready.");
|
|
1028
1547
|
};
|
|
1029
1548
|
assertReadable();
|
|
1030
|
-
const messages = boundedJsonCopy(await runtime.getContextMessages());
|
|
1549
|
+
const messages = boundedJsonCopy(await runtime.getContextMessages(), MAX_CANONICAL_MESSAGE_CHARACTERS);
|
|
1031
1550
|
assertReadable();
|
|
1032
1551
|
return messages;
|
|
1033
1552
|
},
|
|
1034
1553
|
async contextUsage() {
|
|
1035
|
-
const usage =
|
|
1554
|
+
const usage = await runtime.getContextUsage();
|
|
1036
1555
|
return usage ? {
|
|
1037
1556
|
tokens: usage.tokens,
|
|
1038
1557
|
contextWindow: usage.contextWindow
|
|
@@ -1040,6 +1559,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1040
1559
|
},
|
|
1041
1560
|
setLabel: (entryId, label) => runtime.setLabel(entryId, label),
|
|
1042
1561
|
async appendCustomEntry(type, data) {
|
|
1562
|
+
require_contextProjection.assertPackageEntryType(type);
|
|
1043
1563
|
await runtime.appendCustomEntry(type, data);
|
|
1044
1564
|
},
|
|
1045
1565
|
async prompt(text, delivery) {
|
|
@@ -1058,26 +1578,32 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1058
1578
|
throw new require_headless.PoHeadlessPromptAdmissionError(error);
|
|
1059
1579
|
}
|
|
1060
1580
|
},
|
|
1061
|
-
abort: () => runtime.abort(),
|
|
1581
|
+
abort: (expectedOperationId) => runtime.abort(expectedOperationId),
|
|
1062
1582
|
compact: (instructions) => runtime.compact(instructions),
|
|
1063
1583
|
async activity() {
|
|
1064
1584
|
const state = await runtime.readState();
|
|
1585
|
+
const isIdle = (!state.isStreaming || state.operationId === "settling") && !state.isCompacting;
|
|
1065
1586
|
return {
|
|
1066
1587
|
hasPendingMessages: Number(state.pendingMessageCount) > 0,
|
|
1067
|
-
isIdle
|
|
1588
|
+
isIdle,
|
|
1589
|
+
...isIdle || typeof state.operationId !== "string" ? {} : { operationId: state.operationId }
|
|
1068
1590
|
};
|
|
1069
1591
|
},
|
|
1070
1592
|
setName: (name) => runtime.setName(name)
|
|
1071
1593
|
},
|
|
1072
|
-
shutdown: () => stop()
|
|
1594
|
+
shutdown: () => options.requestShutdown ? options.requestShutdown() : stop()
|
|
1073
1595
|
});
|
|
1074
|
-
client = require_index$
|
|
1596
|
+
client = require_index$10.createHeadlessClient({
|
|
1075
1597
|
appendCustomEntry: async (type, data) => {
|
|
1076
1598
|
await runtime.appendCustomEntry(type, data);
|
|
1077
1599
|
},
|
|
1078
|
-
emitFrame
|
|
1600
|
+
emitFrame
|
|
1601
|
+
});
|
|
1602
|
+
if (require_contextProjection.findRetiredSessionEntries(entries)) client.client.notify({
|
|
1603
|
+
body: (mcpServiceRoot && require_lang.readPoLang(mcpServiceRoot))?.t(deviceLocale, "core.notifications.retiredSession", "This session was saved by an older Po. Its preset and modes were not restored. Choose them again with /preset and /mode.") ?? "This session was saved by an older Po. Its preset and modes were not restored. Choose them again with /preset and /mode.",
|
|
1604
|
+
level: "warning"
|
|
1079
1605
|
});
|
|
1080
|
-
const unsubscribePresentation = runtime.onPresentationFrame(
|
|
1606
|
+
const unsubscribePresentation = runtime.onPresentationFrame(emitFrame);
|
|
1081
1607
|
let logicalRunActive = false;
|
|
1082
1608
|
let runMessages = [];
|
|
1083
1609
|
let requiredServerPackages = [];
|
|
@@ -1161,7 +1687,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1161
1687
|
const nextUiResources = /* @__PURE__ */ new Map();
|
|
1162
1688
|
for (const loaded of options.mcpPlugins ?? []) {
|
|
1163
1689
|
const selection = headlessHost.context.selection;
|
|
1164
|
-
if (!loaded.declaration.owners.some((owner) =>
|
|
1690
|
+
if (!loaded.declaration.owners.some((owner) => require_serverBundle.isOwnerSelected(owner, selection))) continue;
|
|
1165
1691
|
const scope = typeof loaded.plugin.session === "function" ? await loaded.plugin.session(pluginContext) : loaded.plugin.session;
|
|
1166
1692
|
lifecycle.signal.throwIfAborted();
|
|
1167
1693
|
const resources = scope.uiResources ?? [];
|
|
@@ -1220,18 +1746,29 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1220
1746
|
};
|
|
1221
1747
|
const applyToolSurface = async (tools) => {
|
|
1222
1748
|
toolSurfaceReady = false;
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1749
|
+
const presence = {
|
|
1750
|
+
caller: "main",
|
|
1751
|
+
...options.interaction === void 0 ? {} : { interaction: options.interaction }
|
|
1752
|
+
};
|
|
1753
|
+
const modelTools = tools.filter((tool) => require_headless.isPoHeadlessToolModelVisible(tool) && !require_index.isApprovalUnavailable(tool.approval, presence));
|
|
1754
|
+
const packageTools = modelTools.map((tool) => toolAdapter({
|
|
1225
1755
|
...tool,
|
|
1226
|
-
description: require_headlessHost.
|
|
1227
|
-
}
|
|
1756
|
+
description: require_headlessHost.describeSkillTool(tool, headlessHost?.appliedResources ?? [])
|
|
1757
|
+
}, () => ({
|
|
1758
|
+
...headlessHost.context,
|
|
1759
|
+
caller: "main"
|
|
1760
|
+
}), reportedToolErrors));
|
|
1228
1761
|
const packageNames = headlessHost?.declaredToolNames ?? new Set(packageTools.map((tool) => tool.name));
|
|
1229
1762
|
const piTools = (piHost?.tools ?? []).filter((tool) => !packageNames.has(tool.name) && headlessHost?.allowsTool(tool.name) !== false).map((tool) => ({
|
|
1230
1763
|
...tool,
|
|
1231
1764
|
async execute(...args) {
|
|
1232
1765
|
headlessHost.assertActive();
|
|
1233
1766
|
if (!toolSurfaceReady || !headlessHost.allowsTool(tool.name)) throw new Error(`Tool '${tool.name}' is no longer active`);
|
|
1234
|
-
|
|
1767
|
+
const result = await tool.execute(...args);
|
|
1768
|
+
return Array.isArray(result.content) ? {
|
|
1769
|
+
...result,
|
|
1770
|
+
content: require_headless.dropInvalidImages(result.content)
|
|
1771
|
+
} : result;
|
|
1235
1772
|
}
|
|
1236
1773
|
}));
|
|
1237
1774
|
const piNames = new Set(piTools.map((tool) => tool.name));
|
|
@@ -1241,6 +1778,20 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1241
1778
|
...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines }
|
|
1242
1779
|
}))];
|
|
1243
1780
|
await runtime.replaceTools([...piTools, ...packageTools]);
|
|
1781
|
+
const borrowableModelTools = modelTools.filter((tool) => !tool.mainAgentOnly && !require_index.isApprovalUnavailable(tool.approval, { caller: "child" }));
|
|
1782
|
+
const adaptChild = (callerToolNames) => {
|
|
1783
|
+
const names = callerToolNames === void 0 ? void 0 : Object.freeze([...callerToolNames]);
|
|
1784
|
+
return borrowableModelTools.map((tool) => toolAdapter({
|
|
1785
|
+
...tool,
|
|
1786
|
+
description: require_headlessHost.describeSkillTool(tool, headlessHost?.appliedResources ?? [])
|
|
1787
|
+
}, () => ({
|
|
1788
|
+
...headlessHost.context,
|
|
1789
|
+
caller: "child",
|
|
1790
|
+
...names === void 0 ? {} : { callerToolNames: names }
|
|
1791
|
+
}), reportedToolErrors));
|
|
1792
|
+
};
|
|
1793
|
+
bindChildTools = adaptChild;
|
|
1794
|
+
appliedChildTools = adaptChild();
|
|
1244
1795
|
const next = /* @__PURE__ */ new Map();
|
|
1245
1796
|
for (const tool of piTools) next.set(tool.name, {
|
|
1246
1797
|
descriptor: {
|
|
@@ -1255,13 +1806,13 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1255
1806
|
descriptor: {
|
|
1256
1807
|
name: tool.name,
|
|
1257
1808
|
label: tool.label ?? tool.name,
|
|
1258
|
-
description: tool
|
|
1809
|
+
description: require_headlessHost.describeSkillTool(tool, headlessHost?.appliedResources ?? []),
|
|
1259
1810
|
parameters: tool.parameters,
|
|
1260
1811
|
...tool.annotations === void 0 ? {} : { annotations: tool.annotations },
|
|
1261
1812
|
...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },
|
|
1262
1813
|
...tool._meta === void 0 ? {} : { _meta: tool._meta }
|
|
1263
1814
|
},
|
|
1264
|
-
execute: (toolCallId, parameters, signal, onUpdate) => tool.execute(toolCallId, parameters, signal, onUpdate, headlessHost.context)
|
|
1815
|
+
execute: (toolCallId, parameters, signal, onUpdate, execution) => tool.execute(toolCallId, parameters, signal, onUpdate, execution ?? headlessHost.context)
|
|
1265
1816
|
});
|
|
1266
1817
|
toolGuidance = nextToolGuidance;
|
|
1267
1818
|
appliedSessionTools = next;
|
|
@@ -1295,8 +1846,11 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1295
1846
|
for (const listener of backgroundWorkListeners) listener(active);
|
|
1296
1847
|
};
|
|
1297
1848
|
let admittedToolSurface;
|
|
1849
|
+
let candidates = options.candidates;
|
|
1298
1850
|
const preparePackages = (root) => {
|
|
1299
1851
|
mcpServiceRoot = root;
|
|
1852
|
+
options.bindSessionLifecycle?.(root);
|
|
1853
|
+
if (options.workflowContext !== void 0) root.provide(require_workflow.PO_WORKFLOW_CONTEXT_SERVICE, options.workflowContext);
|
|
1300
1854
|
backgroundWorkBinding = root.inject([require_backgroundWork.PO_BACKGROUND_WORK_SERVICE], (context) => {
|
|
1301
1855
|
const service = require_backgroundWork.readPoBackgroundWorkService(context);
|
|
1302
1856
|
if (service === void 0) return void 0;
|
|
@@ -1305,7 +1859,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1305
1859
|
if (disposed || !active) return;
|
|
1306
1860
|
try {
|
|
1307
1861
|
const snapshot = service.snapshot(options.sessionId);
|
|
1308
|
-
publishBackgroundWork(snapshot.items.
|
|
1862
|
+
publishBackgroundWork(snapshot.items.some(require_backgroundWork.awaitsCompletion) ? true : snapshot.errors.length > 0 ? null : false);
|
|
1309
1863
|
} catch {
|
|
1310
1864
|
publishBackgroundWork(null);
|
|
1311
1865
|
}
|
|
@@ -1321,48 +1875,86 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1321
1875
|
root.plugin((context) => {
|
|
1322
1876
|
context.provide(require_childSession.PO_CHILD_SESSION_SERVICE, childSessionProvider.get());
|
|
1323
1877
|
context.provide(require_childSession.PO_CHILD_SESSION_HOOK_REGISTRY_SERVICE, childHookRegistry);
|
|
1878
|
+
context.provide(require_personTimeZone.PO_PERSON_TIME_ZONE_SERVICE, personTimeZone);
|
|
1879
|
+
context.provide(require_lang.PO_PERSON_LOCALE_SERVICE, { read: () => deviceLocale });
|
|
1880
|
+
context.provide(require_contextContributions.PO_CONTEXT_CONTRIBUTIONS_SERVICE, require_index$2.createPoContextContributionsService((0, node_crypto.randomUUID)()));
|
|
1324
1881
|
context.effect(() => () => childSessionProvider.close(), "headless child session service lifetime");
|
|
1325
1882
|
});
|
|
1326
1883
|
if (headlessHost !== void 0) throw new Error("Direct headless packages were prepared more than once.");
|
|
1327
|
-
if (models.piExtensions !== void 0)
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1884
|
+
if (models.piExtensions !== void 0) {
|
|
1885
|
+
let historyMiB = 0;
|
|
1886
|
+
piHost = models.piExtensions({
|
|
1887
|
+
runtime,
|
|
1888
|
+
getModel: () => currentModel,
|
|
1889
|
+
getThinkingLevel: () => resolved.thinkingLevel ?? "off",
|
|
1890
|
+
client: () => client?.client,
|
|
1891
|
+
onActiveToolsChanged: scheduleToolReapply,
|
|
1892
|
+
onHistorySize: (bytes) => {
|
|
1893
|
+
const mib = Math.floor(bytes / 1048576);
|
|
1894
|
+
if (mib === historyMiB) return;
|
|
1895
|
+
historyMiB = mib;
|
|
1896
|
+
require_serverTelemetry.observe(Promise.resolve().then(() => options.telemetry?.recordEvent?.("po_server.pi_history_size", {
|
|
1897
|
+
session_id: options.sessionId,
|
|
1898
|
+
bytes
|
|
1899
|
+
})));
|
|
1900
|
+
},
|
|
1901
|
+
serverServices: {
|
|
1902
|
+
sessionId: options.sessionId,
|
|
1903
|
+
get: (name) => root.get(name)
|
|
1904
|
+
},
|
|
1905
|
+
...options.onNotice === void 0 ? {} : { onNotice: options.onNotice }
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1339
1908
|
headlessHost = new require_headlessHost.HeadlessHost(root, {
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1909
|
+
inspectPrompt,
|
|
1910
|
+
readPromptText,
|
|
1911
|
+
previewPrompt,
|
|
1912
|
+
scheduleSelection: (change, apply, scheduling) => {
|
|
1913
|
+
const applySelection = async (next) => {
|
|
1914
|
+
if (next.axis !== "profile") return apply(next);
|
|
1915
|
+
if (options.operationModelPrompt) throw new Error("The session has a pinned profile.");
|
|
1916
|
+
const previousRequest = requestedProfile;
|
|
1917
|
+
requestedProfile = next.profile ?? null;
|
|
1918
|
+
try {
|
|
1919
|
+
await apply(next);
|
|
1920
|
+
} catch (error) {
|
|
1921
|
+
requestedProfile = previousRequest;
|
|
1922
|
+
throw error;
|
|
1923
|
+
}
|
|
1924
|
+
await publishComposition();
|
|
1925
|
+
};
|
|
1926
|
+
if (!selectionCommand.getStore() && !scheduling?.atToolBoundary) return applySelection(change);
|
|
1927
|
+
const previous = headlessHost.context.selection.state?.["mode"] ?? [];
|
|
1343
1928
|
return runtime.runAtToolBoundary(() => selectionCommand.run(false, () => {
|
|
1344
|
-
if (change.axis !== "state" || change.key !== "
|
|
1929
|
+
if (change.axis !== "state" || change.key !== "mode") return applySelection(change);
|
|
1345
1930
|
const removed = previous.filter((name) => !change.values.includes(name));
|
|
1346
1931
|
const added = change.values.filter((name) => !previous.includes(name));
|
|
1347
|
-
const current = headlessHost.context.selection.state?.["
|
|
1932
|
+
const current = headlessHost.context.selection.state?.["mode"] ?? [];
|
|
1348
1933
|
return apply({
|
|
1349
1934
|
...change,
|
|
1350
1935
|
values: [.../* @__PURE__ */ new Set([...current.filter((name) => !removed.includes(name)), ...added])]
|
|
1351
1936
|
});
|
|
1352
1937
|
}));
|
|
1353
1938
|
},
|
|
1354
|
-
candidates
|
|
1939
|
+
candidates,
|
|
1355
1940
|
toolSurface: () => admittedToolSurface,
|
|
1356
1941
|
selection: initialSelection,
|
|
1357
1942
|
selectionOverrides: [.../* @__PURE__ */ new Set([...options.selectionOverrides ?? [], ...[
|
|
1358
|
-
"
|
|
1943
|
+
"preset",
|
|
1359
1944
|
"domains",
|
|
1360
1945
|
"profile"
|
|
1361
1946
|
].filter((axis) => JSON.stringify(initialSelection[axis]) !== JSON.stringify(options.selection[axis]))])],
|
|
1362
1947
|
context: executionContext,
|
|
1363
1948
|
resolveSelection: options.resolveSelection,
|
|
1949
|
+
...options.extensionLayers === void 0 ? {} : { extensionLayers: options.extensionLayers },
|
|
1364
1950
|
validateSelection: (selection) => {
|
|
1365
|
-
|
|
1951
|
+
if (options.workflowContext !== void 0) {
|
|
1952
|
+
if (selection.state?.["mode"]?.includes(require_help.PO_HELP_WHEN.state["mode"])) throw new Error("Help mode cannot be activated in a workflow step session.");
|
|
1953
|
+
const expected = options.workflowContext.identity;
|
|
1954
|
+
const expectedProfile = expected?.kind === "profile" ? expected.profile : void 0;
|
|
1955
|
+
if (expected !== void 0 && selection.profile !== expectedProfile) throw new Error("The selected profile does not match the workflow step identity.");
|
|
1956
|
+
}
|
|
1957
|
+
for (const packageName of requiredServerPackages) if (!candidates.some((entry) => entry.packageName === packageName && entry.scopes.includes("session") && entry.owners.some((owner) => require_serverBundle.isOwnerSelected(owner, selection))) || !installedServerPackages.includes(packageName)) throw new Error(`Required headless package '${packageName}' is unavailable. Run po sync, then reopen this session.`);
|
|
1366
1958
|
},
|
|
1367
1959
|
...options.allowedTools === void 0 ? {} : { allowedTools: () => options.allowedTools },
|
|
1368
1960
|
applyTools: async (tools) => {
|
|
@@ -1371,11 +1963,11 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1371
1963
|
},
|
|
1372
1964
|
applyResources: async (next) => {
|
|
1373
1965
|
const mapped = mapResources(next);
|
|
1374
|
-
const packageNames = new Set((mapped.
|
|
1966
|
+
const packageNames = new Set((mapped.skills ?? []).map((skill) => skill.name));
|
|
1375
1967
|
const piSkills = (piHost?.skills ?? []).filter((skill) => !packageNames.has(skill.name));
|
|
1376
|
-
const mergedSkills = [...piSkills, ...mapped.
|
|
1377
|
-
await runtime.replaceResources(piSkills.length === 0 ? mapped
|
|
1378
|
-
...mapped
|
|
1968
|
+
const mergedSkills = [...piSkills, ...mapped.skills ?? []];
|
|
1969
|
+
await runtime.replaceResources(piSkills.length === 0 ? mapped : {
|
|
1970
|
+
...mapped,
|
|
1379
1971
|
skills: mergedSkills
|
|
1380
1972
|
});
|
|
1381
1973
|
appliedSkills = new Map(mergedSkills.map((skill) => {
|
|
@@ -1390,16 +1982,22 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1390
1982
|
}];
|
|
1391
1983
|
}));
|
|
1392
1984
|
surfaceRevision += 1;
|
|
1393
|
-
if (appliedPackageTools.some((tool) => tool.name === "load_skill")) await applyLatestTools();
|
|
1985
|
+
if (appliedPackageTools.some((tool) => tool.name === "load_skill" || tool.name === "search_skills")) await applyLatestTools();
|
|
1394
1986
|
},
|
|
1395
1987
|
onApplied: async (selection) => {
|
|
1396
1988
|
options.publishSelectionStatus?.((source, text) => client.client.setStatus(source, text), selection);
|
|
1397
1989
|
latestSelection = selection;
|
|
1398
1990
|
for (const listener of selectionListeners) listener(selection);
|
|
1399
1991
|
},
|
|
1992
|
+
onSelectionStep: options.telemetry?.recordEvent ? (phase, durationMs, packageName) => options.telemetry?.recordEvent?.("po_server.session_selection_step", {
|
|
1993
|
+
session_id: runtime.sessionId,
|
|
1994
|
+
phase,
|
|
1995
|
+
duration_ms: durationMs,
|
|
1996
|
+
...packageName === void 0 ? {} : { "selection.package": packageName }
|
|
1997
|
+
}) : void 0,
|
|
1400
1998
|
onError: (error, source) => options.onNotice?.(`Headless ${source ?? "host"} failed: ${require_harnessErrorMessage.harnessErrorMessage(error)}`)
|
|
1401
1999
|
});
|
|
1402
|
-
publishComposition = createHeadlessCompositionPublisher(runtime, headlessHost, options.environment, (selection) => options.contextGroups?.(root, selection) ?? [], readSystemPrompt, () => !disposed);
|
|
2000
|
+
publishComposition = createHeadlessCompositionPublisher(runtime, headlessHost, options.environment, (selection) => options.contextGroups?.(root, selection) ?? [], readSystemPrompt, () => requestedProfile, () => !disposed);
|
|
1403
2001
|
headlessHost.subscribeSelection(async (selection) => {
|
|
1404
2002
|
if (!headlessReady || !headlessHost?.status.ready) return;
|
|
1405
2003
|
try {
|
|
@@ -1414,28 +2012,53 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1414
2012
|
if (headlessHost === void 0) throw new Error("Direct headless host was not prepared.");
|
|
1415
2013
|
const host = headlessHost;
|
|
1416
2014
|
const assertLive = () => {
|
|
2015
|
+
options.startupSignal?.throwIfAborted();
|
|
1417
2016
|
if (disposed) throw new Error("The session was closed while it was starting.");
|
|
1418
2017
|
};
|
|
2018
|
+
const timed = async (phase, run) => {
|
|
2019
|
+
const started = performance.now();
|
|
2020
|
+
try {
|
|
2021
|
+
return await run();
|
|
2022
|
+
} finally {
|
|
2023
|
+
const durationMs = Math.round(performance.now() - started);
|
|
2024
|
+
require_serverTelemetry.observe(Promise.resolve().then(() => options.telemetry?.recordEvent?.("po_server.session_activation_phase", {
|
|
2025
|
+
session_id: runtime.sessionId,
|
|
2026
|
+
phase,
|
|
2027
|
+
duration_ms: durationMs
|
|
2028
|
+
})));
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
assertLive();
|
|
1419
2032
|
requiredServerPackages = await options.requiredServerPackages?.() ?? [];
|
|
1420
2033
|
installedServerPackages = installedPackages;
|
|
1421
2034
|
assertLive();
|
|
1422
2035
|
host.setAvailableSources(installedPackages);
|
|
1423
2036
|
if (piHost !== void 0) try {
|
|
1424
|
-
await piHost.load();
|
|
2037
|
+
await timed("pi_extensions", () => piHost.load());
|
|
1425
2038
|
} catch (error) {
|
|
1426
2039
|
options.onNotice?.(`Pi extensions failed to load: ${error instanceof Error ? error.message : String(error)}`);
|
|
1427
2040
|
}
|
|
1428
2041
|
assertLive();
|
|
1429
|
-
await host.select(initialSelection);
|
|
2042
|
+
await timed("initial_selection", () => host.select(initialSelection));
|
|
1430
2043
|
assertLive();
|
|
1431
2044
|
if (!host.status.ready) throw new Error(`Session capabilities failed to start: ${host.status.error ?? "selection is not ready"}`);
|
|
2045
|
+
await timed("session_start", () => host.dispatchHook("session_start", {}, options.startupSignal));
|
|
2046
|
+
assertLive();
|
|
2047
|
+
if (options.admitStartup !== void 0) await timed("admission", options.admitStartup);
|
|
2048
|
+
assertLive();
|
|
2049
|
+
sessionStarted = true;
|
|
1432
2050
|
headlessReady = true;
|
|
1433
|
-
|
|
2051
|
+
try {
|
|
2052
|
+
await timed("mcp_surface", prepareMcpSurface);
|
|
2053
|
+
} catch (error) {
|
|
2054
|
+
options.onNotice?.(`MCP tools failed to start: ${error instanceof Error ? error.message : String(error)}`);
|
|
2055
|
+
}
|
|
1434
2056
|
assertLive();
|
|
1435
|
-
await runtime.recover();
|
|
2057
|
+
await timed("recovery", () => runtime.recover());
|
|
1436
2058
|
assertLive();
|
|
1437
|
-
await host.dispatchHook("
|
|
1438
|
-
|
|
2059
|
+
await timed("session_ready", () => host.dispatchHook("session_ready", {}, options.startupSignal));
|
|
2060
|
+
assertLive();
|
|
2061
|
+
await timed("composition", () => publishComposition());
|
|
1439
2062
|
const children = childSessionProvider.get();
|
|
1440
2063
|
for (const run of await children.stored?.() ?? []) {
|
|
1441
2064
|
if (run.settled) continue;
|
|
@@ -1445,17 +2068,18 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1445
2068
|
} catch (error) {
|
|
1446
2069
|
options.onNotice?.(`Child run ${runId} could not resume: ${require_harnessErrorMessage.harnessErrorMessage(error)}`);
|
|
1447
2070
|
assertLive();
|
|
1448
|
-
const conversationId = await require_index$
|
|
2071
|
+
const conversationId = await require_index$6.abandonSubagent(runtime.harness, runId, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT).catch((abandonError) => {
|
|
1449
2072
|
options.onNotice?.(`Child run ${runId} could not be stopped: ${require_harnessErrorMessage.harnessErrorMessage(abandonError)}`);
|
|
1450
2073
|
});
|
|
1451
2074
|
if (conversationId !== void 0) runtime.closeLane(conversationId);
|
|
1452
2075
|
}
|
|
1453
2076
|
}
|
|
1454
2077
|
assertLive();
|
|
1455
|
-
(await runtime.admitResume()).settled.catch((error) => options.onNotice?.(`Session resume failed: ${require_harnessErrorMessage.harnessErrorMessage(error)}`));
|
|
2078
|
+
(await timed("resume_admission", () => runtime.admitResume())).settled.catch((error) => options.onNotice?.(`Session resume failed: ${require_harnessErrorMessage.harnessErrorMessage(error)}`));
|
|
1456
2079
|
assertLive();
|
|
1457
2080
|
};
|
|
1458
|
-
const dispose = () => {
|
|
2081
|
+
const dispose = (closeOptions) => {
|
|
2082
|
+
if (disposePromise === void 0) closeReason = closeOptions?.reason;
|
|
1459
2083
|
disposePromise ??= (async () => {
|
|
1460
2084
|
if (disposed) return;
|
|
1461
2085
|
const wasReady = headlessReady;
|
|
@@ -1521,12 +2145,13 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1521
2145
|
if (applied === void 0) throw new Error(`Tool '${invocation.name}' is not active`);
|
|
1522
2146
|
if (!typebox_value.Value.Check(applied.descriptor.parameters, invocation.arguments)) throw new Error(`Invalid arguments for tool '${invocation.name}': ${require_runtimeProtocol.validationDetails(applied.descriptor.parameters, invocation.arguments)}`);
|
|
1523
2147
|
const signals = [invocation.signal, lifecycleSignal].filter((signal) => signal !== void 0);
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1526
|
-
return runtime.runExternalOperation(async () => {
|
|
1527
|
-
signal
|
|
2148
|
+
const admissionSignal = signals.length === 0 ? void 0 : AbortSignal.any(signals);
|
|
2149
|
+
admissionSignal?.throwIfAborted();
|
|
2150
|
+
return runtime.runExternalOperation(async (operationSignal) => {
|
|
2151
|
+
const signal = AbortSignal.any([...signals, operationSignal]);
|
|
2152
|
+
signal.throwIfAborted();
|
|
1528
2153
|
await invocation.authorize?.();
|
|
1529
|
-
signal
|
|
2154
|
+
signal.throwIfAborted();
|
|
1530
2155
|
if (disposed || !headlessReady || !ready() || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready. Retry in a few seconds.");
|
|
1531
2156
|
if (invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);
|
|
1532
2157
|
const toolCallId = `external-${(0, node_crypto.randomUUID)()}`;
|
|
@@ -1534,7 +2159,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1534
2159
|
toolCallId,
|
|
1535
2160
|
toolName: invocation.name,
|
|
1536
2161
|
args: invocation.arguments
|
|
1537
|
-
},
|
|
2162
|
+
}, (0, dist_interop_chordContext_mjs.withAbortSignal)(signal, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT));
|
|
1538
2163
|
if (before?.block !== void 0) return {
|
|
1539
2164
|
content: [{
|
|
1540
2165
|
type: "text",
|
|
@@ -1545,7 +2170,7 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1545
2170
|
const args = before?.args ?? invocation.arguments;
|
|
1546
2171
|
if (!typebox_value.Value.Check(applied.descriptor.parameters, args)) throw new Error(`A tool hook produced invalid arguments for '${invocation.name}': ${require_runtimeProtocol.validationDetails(applied.descriptor.parameters, args)}`);
|
|
1547
2172
|
await invocation.authorize?.();
|
|
1548
|
-
signal
|
|
2173
|
+
signal.throwIfAborted();
|
|
1549
2174
|
if (disposed || !headlessReady || !ready() || !headlessHost?.status.ready) throw new Error("Headless capability preparation is not ready. Retry in a few seconds.");
|
|
1550
2175
|
if (invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);
|
|
1551
2176
|
const startEvent = {
|
|
@@ -1556,12 +2181,12 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1556
2181
|
toolName: invocation.name,
|
|
1557
2182
|
args
|
|
1558
2183
|
};
|
|
1559
|
-
|
|
2184
|
+
emitFrame(startEvent);
|
|
1560
2185
|
await headlessHost.dispatchHook("tool_execution_start", startEvent);
|
|
1561
2186
|
let result;
|
|
1562
2187
|
try {
|
|
1563
2188
|
result = await applied.execute(toolCallId, args, signal, (partial) => {
|
|
1564
|
-
|
|
2189
|
+
emitFrame({
|
|
1565
2190
|
type: "tool_execution_update",
|
|
1566
2191
|
runId: EXTERNAL_OPERATION,
|
|
1567
2192
|
turnId: EXTERNAL_OPERATION,
|
|
@@ -1570,9 +2195,20 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1570
2195
|
partialResult: partial
|
|
1571
2196
|
});
|
|
1572
2197
|
invocation.onUpdate?.(partial);
|
|
1573
|
-
},
|
|
2198
|
+
}, {
|
|
1574
2199
|
...headlessHost.context,
|
|
1575
|
-
mcpSkills: invocation.mcpSkills
|
|
2200
|
+
...invocation.mcpSkills === void 0 ? {} : { mcpSkills: invocation.mcpSkills },
|
|
2201
|
+
toolContinuation: require_index$7.createToolContinuation({
|
|
2202
|
+
toolName: invocation.name,
|
|
2203
|
+
parameters: applied.descriptor.parameters,
|
|
2204
|
+
beforeTool,
|
|
2205
|
+
afterTool,
|
|
2206
|
+
authorize: invocation.authorize,
|
|
2207
|
+
lifecycleSignal,
|
|
2208
|
+
assertAvailable() {
|
|
2209
|
+
if (disposed || !headlessReady || !ready() || !headlessHost?.status.ready || invocation.revision !== readRevision() || readTools().get(invocation.name) !== applied) throw new Error(`Tool '${invocation.name}' is no longer active`);
|
|
2210
|
+
}
|
|
2211
|
+
})
|
|
1576
2212
|
});
|
|
1577
2213
|
} catch (error) {
|
|
1578
2214
|
result = {
|
|
@@ -1583,14 +2219,14 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1583
2219
|
isError: true
|
|
1584
2220
|
};
|
|
1585
2221
|
}
|
|
1586
|
-
const patch = signal
|
|
2222
|
+
const patch = signal.aborted ? void 0 : await afterTool({
|
|
1587
2223
|
toolCallId,
|
|
1588
2224
|
toolName: invocation.name,
|
|
1589
2225
|
args,
|
|
1590
2226
|
content: result.content,
|
|
1591
2227
|
...isJsonValue(result.details) ? { details: result.details } : {},
|
|
1592
2228
|
isError: result.isError === true
|
|
1593
|
-
},
|
|
2229
|
+
}, (0, dist_interop_chordContext_mjs.withAbortSignal)(signal, dist_interop_chordContext_mjs.BACKGROUND_CONTEXT));
|
|
1594
2230
|
const patched = {
|
|
1595
2231
|
content: patch?.content ?? result.content,
|
|
1596
2232
|
...patch?.content !== void 0 || patch?.isError !== void 0 || result.structuredContent === void 0 ? {} : { structuredContent: result.structuredContent },
|
|
@@ -1608,11 +2244,11 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1608
2244
|
isError: patched.isError,
|
|
1609
2245
|
terminate: patch?.terminate ?? false
|
|
1610
2246
|
};
|
|
1611
|
-
|
|
2247
|
+
emitFrame(endEvent);
|
|
1612
2248
|
await headlessHost.dispatchHook("tool_execution_end", endEvent);
|
|
1613
2249
|
return patched;
|
|
1614
2250
|
}, {
|
|
1615
|
-
signal,
|
|
2251
|
+
signal: admissionSignal,
|
|
1616
2252
|
waitMs
|
|
1617
2253
|
});
|
|
1618
2254
|
};
|
|
@@ -1672,13 +2308,36 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1672
2308
|
};
|
|
1673
2309
|
return {
|
|
1674
2310
|
runtime,
|
|
2311
|
+
translate(key, fallback) {
|
|
2312
|
+
return (mcpServiceRoot && require_lang.readPoLang(mcpServiceRoot))?.t(deviceLocale, key, fallback) ?? fallback;
|
|
2313
|
+
},
|
|
2314
|
+
async runIfIdle(action) {
|
|
2315
|
+
let released = false;
|
|
2316
|
+
await runtime.runIfIdle(() => {
|
|
2317
|
+
const work = mcpServiceRoot === void 0 ? void 0 : require_backgroundWork.readPoBackgroundWorkService(mcpServiceRoot)?.snapshot(options.sessionId);
|
|
2318
|
+
if (work !== void 0 && (work.items.length > 0 || work.errors.length > 0)) return;
|
|
2319
|
+
action();
|
|
2320
|
+
released = true;
|
|
2321
|
+
});
|
|
2322
|
+
return released;
|
|
2323
|
+
},
|
|
2324
|
+
async readMessages(limit) {
|
|
2325
|
+
const entries = [];
|
|
2326
|
+
for await (const entry of entriesNewestFirst({
|
|
2327
|
+
type: "message",
|
|
2328
|
+
limit
|
|
2329
|
+
})) entries.push(entry);
|
|
2330
|
+
return entries;
|
|
2331
|
+
},
|
|
1675
2332
|
async readExecutionState() {
|
|
1676
2333
|
const state = await runtime.readState();
|
|
2334
|
+
const usage = await runtime.getSessionUsage?.();
|
|
1677
2335
|
const backgroundWork = mcpServiceRoot === void 0 ? void 0 : require_backgroundWork.readPoBackgroundWorkService(mcpServiceRoot)?.snapshot(options.sessionId);
|
|
1678
2336
|
return {
|
|
1679
2337
|
isIdle: state.isIdle === true,
|
|
1680
2338
|
hasPendingMessages: Number(state.pendingMessageCount) > 0,
|
|
1681
|
-
...backgroundWork === void 0 ? {} : { backgroundWork }
|
|
2339
|
+
...backgroundWork === void 0 ? {} : { backgroundWork },
|
|
2340
|
+
...usage === void 0 ? {} : { usage }
|
|
1682
2341
|
};
|
|
1683
2342
|
},
|
|
1684
2343
|
...sessionContext === void 0 ? {} : { sessionContext },
|
|
@@ -1689,8 +2348,21 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1689
2348
|
mcpSurface,
|
|
1690
2349
|
preparePackages,
|
|
1691
2350
|
activatePackages,
|
|
2351
|
+
async reloadPackages(next, installedPackages) {
|
|
2352
|
+
if (headlessHost === void 0 || disposed) throw new Error("The session is not running.");
|
|
2353
|
+
candidates = next;
|
|
2354
|
+
installedServerPackages = installedPackages;
|
|
2355
|
+
headlessHost.replaceCandidates(next);
|
|
2356
|
+
headlessHost.setAvailableSources(installedPackages);
|
|
2357
|
+
await headlessHost.select({});
|
|
2358
|
+
},
|
|
2359
|
+
async refreshSelection(axes) {
|
|
2360
|
+
if (headlessHost === void 0 || disposed) throw new Error("The session is not running.");
|
|
2361
|
+
await headlessHost.select({}, { refresh: axes });
|
|
2362
|
+
},
|
|
1692
2363
|
canDispatch: () => !disposed && headlessReady && !promptPreparationFailed && headlessHost?.status.ready === true,
|
|
1693
2364
|
childThread: (runId) => childSessionProvider.get().thread(runId),
|
|
2365
|
+
takeNotificationLocalization: (ref) => client?.takeNotificationLocalization(ref),
|
|
1694
2366
|
onPresentationFrame(listener) {
|
|
1695
2367
|
listeners.add(listener);
|
|
1696
2368
|
client?.replay(listener);
|
|
@@ -1712,12 +2384,22 @@ async function composeHeadlessSessionHost(options, releaseEnvironment) {
|
|
|
1712
2384
|
respondToExtensionUi(frame) {
|
|
1713
2385
|
return client?.receive(frame) ?? false;
|
|
1714
2386
|
},
|
|
2387
|
+
setDeviceTimeZone(timeZone) {
|
|
2388
|
+
if (require_personTimeZone.isTimeZone(timeZone)) deviceTimeZone = timeZone;
|
|
2389
|
+
},
|
|
2390
|
+
setDeviceLocale(locale) {
|
|
2391
|
+
deviceLocale = require_locale.canonicalLocale(locale);
|
|
2392
|
+
},
|
|
1715
2393
|
dispose
|
|
1716
2394
|
};
|
|
1717
2395
|
}
|
|
1718
2396
|
//#endregion
|
|
2397
|
+
exports.RETIRED_COMMANDS = RETIRED_COMMANDS;
|
|
1719
2398
|
exports.createHeadlessSessionHost = createHeadlessSessionHost;
|
|
2399
|
+
exports.promptSection = promptSection;
|
|
1720
2400
|
exports.restoreHeadlessSelection = restoreHeadlessSelection;
|
|
1721
|
-
exports.
|
|
2401
|
+
exports.systemPromptSectionKeys = systemPromptSectionKeys;
|
|
2402
|
+
exports.toolAdapter = toolAdapter;
|
|
2403
|
+
exports.validateDirectHeadlessArgs = require_index$12.validateDirectHeadlessArgs;
|
|
1722
2404
|
|
|
1723
2405
|
//# sourceMappingURL=headlessSessionHost.cjs.map
|