@pellux/goodvibes-sdk 0.25.7 → 0.25.10

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.
Files changed (130) hide show
  1. package/README.md +4 -0
  2. package/dist/_internal/contracts/artifacts/operator-contract.json +100 -4
  3. package/dist/_internal/contracts/generated/foundation-metadata.d.ts +2 -2
  4. package/dist/_internal/contracts/generated/foundation-metadata.js +2 -2
  5. package/dist/_internal/contracts/generated/operator-contract.d.ts.map +1 -1
  6. package/dist/_internal/contracts/generated/operator-contract.js +100 -4
  7. package/dist/_internal/contracts/generated/operator-method-ids.d.ts +1 -1
  8. package/dist/_internal/contracts/generated/operator-method-ids.d.ts.map +1 -1
  9. package/dist/_internal/contracts/generated/operator-method-ids.js +1 -0
  10. package/dist/_internal/daemon/context.d.ts +1 -0
  11. package/dist/_internal/daemon/context.d.ts.map +1 -1
  12. package/dist/_internal/daemon/media-route-types.d.ts +10 -0
  13. package/dist/_internal/daemon/media-route-types.d.ts.map +1 -1
  14. package/dist/_internal/daemon/media-routes.d.ts +1 -1
  15. package/dist/_internal/daemon/media-routes.d.ts.map +1 -1
  16. package/dist/_internal/daemon/media-routes.js +91 -10
  17. package/dist/_internal/daemon/operator.d.ts +1 -1
  18. package/dist/_internal/daemon/operator.d.ts.map +1 -1
  19. package/dist/_internal/daemon/operator.js +2 -0
  20. package/dist/_internal/platform/adapters/ntfy/index.js +13 -2
  21. package/dist/_internal/platform/adapters/types.d.ts +2 -0
  22. package/dist/_internal/platform/adapters/types.d.ts.map +1 -1
  23. package/dist/_internal/platform/batch/index.d.ts +4 -0
  24. package/dist/_internal/platform/batch/index.d.ts.map +1 -0
  25. package/dist/_internal/platform/batch/index.js +2 -0
  26. package/dist/_internal/platform/batch/manager.d.ts +41 -0
  27. package/dist/_internal/platform/batch/manager.d.ts.map +1 -0
  28. package/dist/_internal/platform/batch/manager.js +404 -0
  29. package/dist/_internal/platform/batch/types.d.ts +89 -0
  30. package/dist/_internal/platform/batch/types.d.ts.map +1 -0
  31. package/dist/_internal/platform/batch/types.js +10 -0
  32. package/dist/_internal/platform/channels/builtin/plugins.d.ts.map +1 -1
  33. package/dist/_internal/platform/channels/builtin/plugins.js +1 -0
  34. package/dist/_internal/platform/channels/reply-pipeline.d.ts +9 -1
  35. package/dist/_internal/platform/channels/reply-pipeline.d.ts.map +1 -1
  36. package/dist/_internal/platform/channels/reply-pipeline.js +156 -6
  37. package/dist/_internal/platform/cloudflare/client.d.ts +3 -0
  38. package/dist/_internal/platform/cloudflare/client.d.ts.map +1 -0
  39. package/dist/_internal/platform/cloudflare/client.js +9 -0
  40. package/dist/_internal/platform/cloudflare/config.d.ts +8 -0
  41. package/dist/_internal/platform/cloudflare/config.d.ts.map +1 -0
  42. package/dist/_internal/platform/cloudflare/config.js +48 -0
  43. package/dist/_internal/platform/cloudflare/constants.d.ts +18 -0
  44. package/dist/_internal/platform/cloudflare/constants.d.ts.map +1 -0
  45. package/dist/_internal/platform/cloudflare/constants.js +36 -0
  46. package/dist/_internal/platform/cloudflare/discovery.d.ts +23 -0
  47. package/dist/_internal/platform/cloudflare/discovery.d.ts.map +1 -0
  48. package/dist/_internal/platform/cloudflare/discovery.js +57 -0
  49. package/dist/_internal/platform/cloudflare/index.d.ts +6 -0
  50. package/dist/_internal/platform/cloudflare/index.d.ts.map +1 -0
  51. package/dist/_internal/platform/cloudflare/index.js +4 -0
  52. package/dist/_internal/platform/cloudflare/manager.d.ts +30 -0
  53. package/dist/_internal/platform/cloudflare/manager.d.ts.map +1 -0
  54. package/dist/_internal/platform/cloudflare/manager.js +671 -0
  55. package/dist/_internal/platform/cloudflare/resources.d.ts +79 -0
  56. package/dist/_internal/platform/cloudflare/resources.d.ts.map +1 -0
  57. package/dist/_internal/platform/cloudflare/resources.js +353 -0
  58. package/dist/_internal/platform/cloudflare/types.d.ts +689 -0
  59. package/dist/_internal/platform/cloudflare/types.d.ts.map +1 -0
  60. package/dist/_internal/platform/cloudflare/types.js +10 -0
  61. package/dist/_internal/platform/cloudflare/utils.d.ts +14 -0
  62. package/dist/_internal/platform/cloudflare/utils.d.ts.map +1 -0
  63. package/dist/_internal/platform/cloudflare/utils.js +222 -0
  64. package/dist/_internal/platform/cloudflare/worker-source.d.ts +2 -0
  65. package/dist/_internal/platform/cloudflare/worker-source.d.ts.map +1 -0
  66. package/dist/_internal/platform/cloudflare/worker-source.js +165 -0
  67. package/dist/_internal/platform/config/schema-domain-core.d.ts +6 -0
  68. package/dist/_internal/platform/config/schema-domain-core.d.ts.map +1 -1
  69. package/dist/_internal/platform/config/schema-domain-core.js +30 -0
  70. package/dist/_internal/platform/config/schema-domain-runtime.d.ts +43 -0
  71. package/dist/_internal/platform/config/schema-domain-runtime.d.ts.map +1 -1
  72. package/dist/_internal/platform/config/schema-domain-runtime.js +287 -0
  73. package/dist/_internal/platform/config/schema-types.d.ts +57 -2
  74. package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
  75. package/dist/_internal/platform/config/schema.d.ts.map +1 -1
  76. package/dist/_internal/platform/config/schema.js +3 -0
  77. package/dist/_internal/platform/control-plane/method-catalog-media.d.ts.map +1 -1
  78. package/dist/_internal/platform/control-plane/method-catalog-media.js +17 -0
  79. package/dist/_internal/platform/control-plane/routes/operator.d.ts +1 -1
  80. package/dist/_internal/platform/control-plane/routes/operator.d.ts.map +1 -1
  81. package/dist/_internal/platform/control-plane/routes/operator.js +2 -0
  82. package/dist/_internal/platform/daemon/facade-composition.d.ts +2 -0
  83. package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
  84. package/dist/_internal/platform/daemon/facade-composition.js +10 -0
  85. package/dist/_internal/platform/daemon/http/batch-routes.d.ts +8 -0
  86. package/dist/_internal/platform/daemon/http/batch-routes.d.ts.map +1 -0
  87. package/dist/_internal/platform/daemon/http/batch-routes.js +113 -0
  88. package/dist/_internal/platform/daemon/http/cloudflare-routes.d.ts +7 -0
  89. package/dist/_internal/platform/daemon/http/cloudflare-routes.d.ts.map +1 -0
  90. package/dist/_internal/platform/daemon/http/cloudflare-routes.js +201 -0
  91. package/dist/_internal/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  92. package/dist/_internal/platform/daemon/http/router-route-contexts.js +1 -0
  93. package/dist/_internal/platform/daemon/http/router.d.ts +5 -1
  94. package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
  95. package/dist/_internal/platform/daemon/http/router.js +30 -0
  96. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts +2 -0
  97. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  98. package/dist/_internal/platform/daemon/surface-actions.d.ts +6 -0
  99. package/dist/_internal/platform/daemon/surface-actions.d.ts.map +1 -1
  100. package/dist/_internal/platform/daemon/surface-actions.js +13 -0
  101. package/dist/_internal/platform/daemon/surface-delivery.d.ts +3 -0
  102. package/dist/_internal/platform/daemon/surface-delivery.d.ts.map +1 -1
  103. package/dist/_internal/platform/daemon/surface-delivery.js +42 -6
  104. package/dist/_internal/platform/daemon/types.d.ts +2 -0
  105. package/dist/_internal/platform/daemon/types.d.ts.map +1 -1
  106. package/dist/_internal/platform/providers/anthropic.d.ts +13 -1
  107. package/dist/_internal/platform/providers/anthropic.d.ts.map +1 -1
  108. package/dist/_internal/platform/providers/anthropic.js +219 -1
  109. package/dist/_internal/platform/providers/interface.d.ts +48 -0
  110. package/dist/_internal/platform/providers/interface.d.ts.map +1 -1
  111. package/dist/_internal/platform/providers/openai.d.ts +13 -1
  112. package/dist/_internal/platform/providers/openai.d.ts.map +1 -1
  113. package/dist/_internal/platform/providers/openai.js +189 -1
  114. package/dist/_internal/platform/version.js +1 -1
  115. package/dist/_internal/platform/voice/index.d.ts +1 -1
  116. package/dist/_internal/platform/voice/index.d.ts.map +1 -1
  117. package/dist/_internal/platform/voice/providers/elevenlabs.d.ts.map +1 -1
  118. package/dist/_internal/platform/voice/providers/elevenlabs.js +150 -4
  119. package/dist/_internal/platform/voice/service.d.ts +2 -1
  120. package/dist/_internal/platform/voice/service.d.ts.map +1 -1
  121. package/dist/_internal/platform/voice/service.js +7 -0
  122. package/dist/_internal/platform/voice/types.d.ts +18 -1
  123. package/dist/_internal/platform/voice/types.d.ts.map +1 -1
  124. package/dist/index.d.ts +2 -0
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +1 -0
  127. package/dist/workers.d.ts +43 -0
  128. package/dist/workers.d.ts.map +1 -0
  129. package/dist/workers.js +156 -0
  130. package/package.json +6 -1
@@ -1,3 +1,3 @@
1
1
  import type { DaemonApiRouteHandlers } from './context.js';
2
- export declare function dispatchOperatorRoutes(req: Request, handlers: Pick<DaemonApiRouteHandlers, 'getStatus' | 'getCurrentAuth' | 'getControlPlaneSnapshot' | 'getOperatorContract' | 'getControlPlaneWeb' | 'getControlPlaneRecentEvents' | 'getControlPlaneMessages' | 'getControlPlaneClients' | 'getTelemetrySnapshot' | 'getTelemetryEvents' | 'getTelemetryErrors' | 'getTelemetryTraces' | 'getTelemetryMetrics' | 'createTelemetryEventStream' | 'getTelemetryOtlpTraces' | 'getTelemetryOtlpLogs' | 'getTelemetryOtlpMetrics' | 'getGatewayMethods' | 'getGatewayEvents' | 'getGatewayMethod' | 'invokeGatewayMethod' | 'createControlPlaneEventStream' | 'getRoutesSnapshot' | 'getSurfaces' | 'getChannelAccounts' | 'getChannelSurfaceAccounts' | 'getChannelAccount' | 'postChannelAccountAction' | 'getChannelSetupSchema' | 'getChannelDoctor' | 'getChannelRepairActions' | 'getChannelLifecycle' | 'postChannelLifecycleMigrate' | 'getChannelCapabilities' | 'getChannelSurfaceCapabilities' | 'getChannelTools' | 'getChannelSurfaceTools' | 'getChannelAgentTools' | 'getChannelSurfaceAgentTools' | 'postChannelTool' | 'getChannelActions' | 'getChannelSurfaceActions' | 'postChannelAction' | 'postChannelResolveTarget' | 'postChannelAuthorize' | 'postChannelAllowlistResolve' | 'postChannelAllowlistEdit' | 'getChannelPolicies' | 'postChannelPolicy' | 'getChannelPolicyAudit' | 'getChannelStatus' | 'getChannelDirectory' | 'getWatchers' | 'postWatcher' | 'patchWatcher' | 'watcherAction' | 'deleteWatcher' | 'getServiceStatus' | 'installService' | 'startService' | 'stopService' | 'restartService' | 'uninstallService' | 'getRouteBindings' | 'postRouteBinding' | 'patchRouteBinding' | 'deleteRouteBinding' | 'getApprovals' | 'approvalAction' | 'getRemote' | 'getHealth' | 'getAccounts' | 'getProviders' | 'getProvider' | 'getProviderUsage' | 'getSettings' | 'getContinuity' | 'getWorktrees' | 'getIntelligence' | 'getLocalAuth' | 'postLocalAuthUser' | 'deleteLocalAuthUser' | 'postLocalAuthPassword' | 'deleteLocalAuthSession' | 'deleteBootstrapFile' | 'getPanels' | 'postPanelOpen' | 'getEvents' | 'getConfig' | 'postConfig' | 'getReview' | 'getIntegrationSession' | 'getIntegrationTasks' | 'getIntegrationAutomation' | 'getIntegrationSessions' | 'getAutomationHeartbeat' | 'postAutomationHeartbeat' | 'getMemoryDoctor' | 'getMemoryVectorStats' | 'postMemoryVectorRebuild' | 'postMemoryEmbeddingDefault' | 'getKnowledgeStatus' | 'getKnowledgeSources' | 'getKnowledgeNodes' | 'getKnowledgeIssues' | 'getKnowledgeItem' | 'getKnowledgeConnectors' | 'getKnowledgeConnector' | 'getKnowledgeConnectorDoctor' | 'getKnowledgeProjectionTargets' | 'getKnowledgeGraphqlSchema' | 'getKnowledgeExtractions' | 'getKnowledgeUsage' | 'getKnowledgeCandidates' | 'getKnowledgeCandidate' | 'getKnowledgeReports' | 'getKnowledgeReport' | 'getKnowledgeExtraction' | 'getKnowledgeSourceExtraction' | 'getKnowledgeJobs' | 'getKnowledgeJob' | 'getKnowledgeJobRuns' | 'getKnowledgeSchedules' | 'getKnowledgeSchedule' | 'postKnowledgeIngestUrl' | 'postKnowledgeIngestArtifact' | 'postKnowledgeImportBookmarks' | 'postKnowledgeImportUrls' | 'postKnowledgeIngestConnector' | 'postKnowledgeSearch' | 'postKnowledgePacket' | 'postKnowledgeDecideCandidate' | 'postKnowledgeRunJob' | 'postKnowledgeLint' | 'postKnowledgeReindex' | 'postKnowledgeSaveSchedule' | 'deleteKnowledgeSchedule' | 'postKnowledgeSetScheduleEnabled' | 'postKnowledgeRenderProjection' | 'postKnowledgeMaterializeProjection' | 'executeKnowledgeGraphql' | 'getVoiceStatus' | 'getVoiceProviders' | 'getVoiceVoices' | 'postVoiceTts' | 'postVoiceStt' | 'postVoiceRealtimeSession' | 'getWebSearchProviders' | 'postWebSearch' | 'getArtifacts' | 'postArtifact' | 'getArtifact' | 'getArtifactContent' | 'getMediaProviders' | 'postMediaAnalyze' | 'postMediaTransform' | 'postMediaGenerate' | 'getMultimodalStatus' | 'getMultimodalProviders' | 'postMultimodalAnalyze' | 'postMultimodalPacket' | 'postMultimodalWriteback' | 'getRemoteNodeHostContract'>): Promise<Response | null>;
2
+ export declare function dispatchOperatorRoutes(req: Request, handlers: Pick<DaemonApiRouteHandlers, 'getStatus' | 'getCurrentAuth' | 'getControlPlaneSnapshot' | 'getOperatorContract' | 'getControlPlaneWeb' | 'getControlPlaneRecentEvents' | 'getControlPlaneMessages' | 'getControlPlaneClients' | 'getTelemetrySnapshot' | 'getTelemetryEvents' | 'getTelemetryErrors' | 'getTelemetryTraces' | 'getTelemetryMetrics' | 'createTelemetryEventStream' | 'getTelemetryOtlpTraces' | 'getTelemetryOtlpLogs' | 'getTelemetryOtlpMetrics' | 'getGatewayMethods' | 'getGatewayEvents' | 'getGatewayMethod' | 'invokeGatewayMethod' | 'createControlPlaneEventStream' | 'getRoutesSnapshot' | 'getSurfaces' | 'getChannelAccounts' | 'getChannelSurfaceAccounts' | 'getChannelAccount' | 'postChannelAccountAction' | 'getChannelSetupSchema' | 'getChannelDoctor' | 'getChannelRepairActions' | 'getChannelLifecycle' | 'postChannelLifecycleMigrate' | 'getChannelCapabilities' | 'getChannelSurfaceCapabilities' | 'getChannelTools' | 'getChannelSurfaceTools' | 'getChannelAgentTools' | 'getChannelSurfaceAgentTools' | 'postChannelTool' | 'getChannelActions' | 'getChannelSurfaceActions' | 'postChannelAction' | 'postChannelResolveTarget' | 'postChannelAuthorize' | 'postChannelAllowlistResolve' | 'postChannelAllowlistEdit' | 'getChannelPolicies' | 'postChannelPolicy' | 'getChannelPolicyAudit' | 'getChannelStatus' | 'getChannelDirectory' | 'getWatchers' | 'postWatcher' | 'patchWatcher' | 'watcherAction' | 'deleteWatcher' | 'getServiceStatus' | 'installService' | 'startService' | 'stopService' | 'restartService' | 'uninstallService' | 'getRouteBindings' | 'postRouteBinding' | 'patchRouteBinding' | 'deleteRouteBinding' | 'getApprovals' | 'approvalAction' | 'getRemote' | 'getHealth' | 'getAccounts' | 'getProviders' | 'getProvider' | 'getProviderUsage' | 'getSettings' | 'getContinuity' | 'getWorktrees' | 'getIntelligence' | 'getLocalAuth' | 'postLocalAuthUser' | 'deleteLocalAuthUser' | 'postLocalAuthPassword' | 'deleteLocalAuthSession' | 'deleteBootstrapFile' | 'getPanels' | 'postPanelOpen' | 'getEvents' | 'getConfig' | 'postConfig' | 'getReview' | 'getIntegrationSession' | 'getIntegrationTasks' | 'getIntegrationAutomation' | 'getIntegrationSessions' | 'getAutomationHeartbeat' | 'postAutomationHeartbeat' | 'getMemoryDoctor' | 'getMemoryVectorStats' | 'postMemoryVectorRebuild' | 'postMemoryEmbeddingDefault' | 'getKnowledgeStatus' | 'getKnowledgeSources' | 'getKnowledgeNodes' | 'getKnowledgeIssues' | 'getKnowledgeItem' | 'getKnowledgeConnectors' | 'getKnowledgeConnector' | 'getKnowledgeConnectorDoctor' | 'getKnowledgeProjectionTargets' | 'getKnowledgeGraphqlSchema' | 'getKnowledgeExtractions' | 'getKnowledgeUsage' | 'getKnowledgeCandidates' | 'getKnowledgeCandidate' | 'getKnowledgeReports' | 'getKnowledgeReport' | 'getKnowledgeExtraction' | 'getKnowledgeSourceExtraction' | 'getKnowledgeJobs' | 'getKnowledgeJob' | 'getKnowledgeJobRuns' | 'getKnowledgeSchedules' | 'getKnowledgeSchedule' | 'postKnowledgeIngestUrl' | 'postKnowledgeIngestArtifact' | 'postKnowledgeImportBookmarks' | 'postKnowledgeImportUrls' | 'postKnowledgeIngestConnector' | 'postKnowledgeSearch' | 'postKnowledgePacket' | 'postKnowledgeDecideCandidate' | 'postKnowledgeRunJob' | 'postKnowledgeLint' | 'postKnowledgeReindex' | 'postKnowledgeSaveSchedule' | 'deleteKnowledgeSchedule' | 'postKnowledgeSetScheduleEnabled' | 'postKnowledgeRenderProjection' | 'postKnowledgeMaterializeProjection' | 'executeKnowledgeGraphql' | 'getVoiceStatus' | 'getVoiceProviders' | 'getVoiceVoices' | 'postVoiceTts' | 'postVoiceTtsStream' | 'postVoiceStt' | 'postVoiceRealtimeSession' | 'getWebSearchProviders' | 'postWebSearch' | 'getArtifacts' | 'postArtifact' | 'getArtifact' | 'getArtifactContent' | 'getMediaProviders' | 'postMediaAnalyze' | 'postMediaTransform' | 'postMediaGenerate' | 'getMultimodalStatus' | 'getMultimodalProviders' | 'postMultimodalAnalyze' | 'postMultimodalPacket' | 'postMultimodalWriteback' | 'getRemoteNodeHostContract'>): Promise<Response | null>;
3
3
  //# sourceMappingURL=operator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/control-plane/routes/operator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,IAAI,CACZ,sBAAsB,EACpB,WAAW,GACX,gBAAgB,GAChB,yBAAyB,GACzB,qBAAqB,GACrB,oBAAoB,GACpB,6BAA6B,GAC7B,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,GACpB,qBAAqB,GACrB,4BAA4B,GAC5B,wBAAwB,GACxB,sBAAsB,GACtB,yBAAyB,GACzB,mBAAmB,GACnB,kBA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,GAC7B,+BAA+B,GAC/B,2BAA2B,GAC3B,yBAAyB,GACzB,mBAAmB,GACnB,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,8BAA8B,GAC9B,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,6BAA6B,GAC7B,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,qBAAqB,GACrB,qBAAqB,GACrB,8BAA8B,GAC9B,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,2BAA2B,GAC3B,yBAAyB,GACzB,iCAAiC,GACjC,+BAA+B,GAC/B,oCAAoC,GACpC,yBAAyB,GACzB,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,0BAA0B,GAC1B,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,cAAc,GACd,aAAa,GACb,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,qBAAqB,GACrB,wBAAwB,GACxB,uBAAuB,GACvB,sBAAsB,GACtB,yBAAyB,GACzB,2BAA2B,CAC9B,GACA,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA2R1B"}
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/control-plane/routes/operator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,IAAI,CACZ,sBAAsB,EACpB,WAAW,GACX,gBAAgB,GAChB,yBAAyB,GACzB,qBAAqB,GACrB,oBAAoB,GACpB,6BAA6B,GAC7B,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,o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AoB,GACpB,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,kBAAkB,GAClB,wBAAwB,GACxB,uBAAuB,GACvB,6BAA6B,GAC7B,+BAA+B,GAC/B,2BAA2B,GAC3B,yBAAyB,GACzB,mBAAmB,GACnB,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,8BAA8B,GAC9B,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,6BAA6B,GAC7B,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,qBAAqB,GACrB,qBAAqB,GACrB,8BAA8B,GAC9B,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,2BAA2B,GAC3B,yBAAyB,GACzB,iCAAiC,GACjC,+BAA+B,GAC/B,oCAAoC,GACpC,yBAAyB,GACzB,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,oBAAoB,GACpB,cAAc,GACd,0BAA0B,GAC1B,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,cAAc,GACd,aAAa,GACb,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,qBAAqB,GACrB,wBAAwB,GACxB,uBAAuB,GACvB,sBAAsB,GACtB,yBAAyB,GACzB,2BAA2B,CAC9B,GACA,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA4R1B"}
@@ -328,6 +328,8 @@ export async function dispatchOperatorRoutes(req, handlers) {
328
328
  return handlers.getVoiceProviders();
329
329
  if (pathname === '/api/voice/voices' && method === 'GET')
330
330
  return handlers.getVoiceVoices(url);
331
+ if (pathname === '/api/voice/tts/stream' && method === 'POST')
332
+ return handlers.postVoiceTtsStream(req);
331
333
  if (pathname === '/api/voice/tts' && method === 'POST')
332
334
  return handlers.postVoiceTts(req);
333
335
  if (pathname === '/api/voice/stt' && method === 'POST')
@@ -33,6 +33,8 @@ export declare function configureDaemonSessionContinuation(options: {
33
33
  readonly queueSurfaceReplyFromBinding: (binding: import('@pellux/goodvibes-sdk/platform/automation/routes').AutomationRouteBinding | undefined, input: {
34
34
  readonly agentId: string;
35
35
  readonly task: string;
36
+ readonly agentTask?: string;
37
+ readonly workflowChainId?: string;
36
38
  readonly sessionId?: string;
37
39
  }) => void;
38
40
  }): void;
@@ -1 +1 @@
1
- {"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiBrD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAI3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAIpE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,EACvC,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA2FvG;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,EACpB,qBAAqB,CAAC,EAAE,aAAa,GACpC,2BAA2B,CAoI7B;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,CAgK3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ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AAE,aAAa,GACpC,2BAA2B,CAoI7B;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,CAuK3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,yBAAyB,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzK,QAAQ,CAAC,4BAA4B,EAAE,CAAC,OAAO,EAAE,OAAO,kDAAkD,EAAE,sBAAsB,GAAG,SAAS,EAAE,KAAK,EAAE;QACrJ,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAC7B,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAsBP"}
@@ -12,6 +12,7 @@ import { DaemonSurfaceDeliveryHelper } from './surface-delivery.js';
12
12
  import { DaemonSurfaceActionHelper } from './surface-actions.js';
13
13
  import { DaemonTransportEventsHelper } from './transport-events.js';
14
14
  import { DaemonHttpRouter } from './http/router.js';
15
+ import { DaemonBatchManager } from '../batch/index.js';
15
16
  import { CompanionChatManager } from '../companion/companion-chat-manager.js';
16
17
  import { findModelDefinition, findModelDefinitionForProvider } from '../providers/registry-models.js';
17
18
  import { getBaseModelId } from '../providers/registry-helpers.js';
@@ -295,6 +296,7 @@ export function createDaemonFacadeCollaborators(options) {
295
296
  surfaceDeliveryEnabled: options.surfaceDeliveryEnabled,
296
297
  signWebhookPayload: options.signWebhookPayload,
297
298
  handleApprovalAction: options.handleApprovalAction,
299
+ resolveDefaultProviderModel: options.resolveDefaultProviderModel,
298
300
  });
299
301
  const controlPlaneHelper = new DaemonControlPlaneHelper({
300
302
  authToken: options.authToken,
@@ -317,6 +319,11 @@ export function createDaemonFacadeCollaborators(options) {
317
319
  port: runtime.port,
318
320
  tlsState: options.tlsState,
319
321
  });
322
+ const batchManager = new DaemonBatchManager({
323
+ configManager: runtime.configManager,
324
+ providerRegistry: runtime.runtimeServices.providerRegistry,
325
+ });
326
+ batchManager.start();
320
327
  const httpRouter = new DaemonHttpRouter({
321
328
  configManager: runtime.configManager,
322
329
  serviceRegistry: runtime.serviceRegistry,
@@ -348,6 +355,7 @@ export function createDaemonFacadeCollaborators(options) {
348
355
  runtimeBus: runtime.runtimeBus,
349
356
  runtimeStore: runtime.runtimeStore,
350
357
  runtimeDispatch: runtime.runtimeDispatch,
358
+ batchManager,
351
359
  githubWebhookSecret: runtime.githubWebhookSecret,
352
360
  authToken: options.authToken,
353
361
  buildSurfaceAdapterContext: () => surfaceActionHelper.buildSurfaceAdapterContext(),
@@ -425,6 +433,8 @@ export function configureDaemonSessionContinuation(options) {
425
433
  options.queueSurfaceReplyFromBinding(routeBinding, {
426
434
  agentId: spawned.id,
427
435
  task: input.body,
436
+ agentTask: task,
437
+ ...(typeof spawned.wrfcId === 'string' && spawned.wrfcId.length > 0 ? { workflowChainId: spawned.wrfcId } : {}),
428
438
  sessionId,
429
439
  });
430
440
  return { agentId: spawned.id };
@@ -0,0 +1,8 @@
1
+ import type { DaemonBatchManager } from '../../batch/index.js';
2
+ export interface DaemonBatchRouteContext {
3
+ readonly batchManager: DaemonBatchManager;
4
+ readonly parseJsonBody: (req: Request) => Promise<Record<string, unknown> | Response>;
5
+ readonly parseOptionalJsonBody: (req: Request) => Promise<Record<string, unknown> | null | Response>;
6
+ }
7
+ export declare function dispatchBatchRoutes(req: Request, context: DaemonBatchRouteContext): Promise<Response | null>;
8
+ //# sourceMappingURL=batch-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-routes.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/daemon/http/batch-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACtF,QAAQ,CAAC,qBAAqB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;CACtG;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAgD1B"}
@@ -0,0 +1,113 @@
1
+ import { DaemonBatchError } from '../../batch/index.js';
2
+ export async function dispatchBatchRoutes(req, context) {
3
+ const url = new URL(req.url);
4
+ const { pathname } = url;
5
+ if ((pathname === '/api/batch' || pathname === '/api/batch/config' || pathname === '/api/batch/runtime') && req.method === 'GET') {
6
+ return Response.json(await context.batchManager.describeRuntime());
7
+ }
8
+ if (pathname === '/api/batch/jobs' && req.method === 'GET') {
9
+ const limit = Number(url.searchParams.get('limit') ?? 100);
10
+ return Response.json({ jobs: await context.batchManager.listJobs(Number.isFinite(limit) ? limit : 100) });
11
+ }
12
+ if (pathname === '/api/batch/jobs' && req.method === 'POST') {
13
+ const bodyOrErr = await context.parseJsonBody(req);
14
+ if (bodyOrErr instanceof Response)
15
+ return bodyOrErr;
16
+ return handleBatchError(async () => {
17
+ const job = await context.batchManager.createJob(parseCreateJobInput(bodyOrErr));
18
+ return Response.json({ job }, { status: 202 });
19
+ });
20
+ }
21
+ const jobMatch = pathname.match(/^\/api\/batch\/jobs\/([^/]+)$/);
22
+ if (jobMatch && req.method === 'GET') {
23
+ const job = await context.batchManager.getJob(decodeURIComponent(jobMatch[1]));
24
+ if (!job)
25
+ return Response.json({ error: 'Batch job not found', code: 'BATCH_JOB_NOT_FOUND' }, { status: 404 });
26
+ return Response.json({ job });
27
+ }
28
+ const cancelMatch = pathname.match(/^\/api\/batch\/jobs\/([^/]+)\/cancel$/);
29
+ if (cancelMatch && req.method === 'POST') {
30
+ return handleBatchError(async () => {
31
+ const job = await context.batchManager.cancelJob(decodeURIComponent(cancelMatch[1]));
32
+ return Response.json({ job });
33
+ });
34
+ }
35
+ if (pathname === '/api/batch/tick' && req.method === 'POST') {
36
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
37
+ if (bodyOrErr instanceof Response)
38
+ return bodyOrErr;
39
+ const body = bodyOrErr ?? {};
40
+ return handleBatchError(async () => {
41
+ const result = await context.batchManager.tick({ forceSubmit: body['force'] === true });
42
+ return Response.json(result);
43
+ });
44
+ }
45
+ return null;
46
+ }
47
+ async function handleBatchError(run) {
48
+ try {
49
+ return await run();
50
+ }
51
+ catch (error) {
52
+ if (error instanceof DaemonBatchError) {
53
+ return Response.json({ error: error.message, code: error.code }, { status: error.status });
54
+ }
55
+ const message = error instanceof Error ? error.message : String(error);
56
+ return Response.json({ error: message, code: 'BATCH_ERROR' }, { status: 500 });
57
+ }
58
+ }
59
+ function parseCreateJobInput(body) {
60
+ const request = toRecord(body['request']);
61
+ const source = toRecord(body['source']);
62
+ const metadata = toStringRecord(body['metadata']);
63
+ const input = {
64
+ ...(typeof body['provider'] === 'string' ? { provider: body['provider'] } : {}),
65
+ ...(typeof body['model'] === 'string' ? { model: body['model'] } : {}),
66
+ request: {
67
+ messages: Array.isArray(request['messages']) ? request['messages'] : [],
68
+ ...(Array.isArray(request['tools']) ? { tools: request['tools'] } : {}),
69
+ ...(typeof request['systemPrompt'] === 'string' ? { systemPrompt: request['systemPrompt'] } : {}),
70
+ ...(typeof request['maxTokens'] === 'number' ? { maxTokens: request['maxTokens'] } : {}),
71
+ ...(request['reasoningEffort'] === 'instant' || request['reasoningEffort'] === 'low' || request['reasoningEffort'] === 'medium' || request['reasoningEffort'] === 'high'
72
+ ? { reasoningEffort: request['reasoningEffort'] }
73
+ : {}),
74
+ ...(typeof request['reasoningSummary'] === 'boolean' ? { reasoningSummary: request['reasoningSummary'] } : {}),
75
+ },
76
+ ...(body['executionMode'] === 'batch' || body['executionMode'] === 'live' ? { executionMode: body['executionMode'] } : {}),
77
+ ...(Object.keys(source).length > 0
78
+ ? {
79
+ source: {
80
+ kind: parseSourceKind(source['kind']),
81
+ ...(typeof source['id'] === 'string' ? { id: source['id'] } : {}),
82
+ },
83
+ }
84
+ : {}),
85
+ ...(metadata ? { metadata } : {}),
86
+ ...(typeof body['flush'] === 'boolean' ? { flush: body['flush'] } : {}),
87
+ };
88
+ return input;
89
+ }
90
+ function parseSourceKind(value) {
91
+ if (value === 'daemon-api' ||
92
+ value === 'cloudflare-worker' ||
93
+ value === 'cloudflare-queue' ||
94
+ value === 'automation' ||
95
+ value === 'client') {
96
+ return value;
97
+ }
98
+ return 'daemon-api';
99
+ }
100
+ function toRecord(value) {
101
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
102
+ ? value
103
+ : {};
104
+ }
105
+ function toStringRecord(value) {
106
+ const record = toRecord(value);
107
+ const result = {};
108
+ for (const [key, entry] of Object.entries(record)) {
109
+ if (typeof entry === 'string')
110
+ result[key] = entry;
111
+ }
112
+ return Object.keys(result).length > 0 ? result : undefined;
113
+ }
@@ -0,0 +1,7 @@
1
+ import type { CloudflareControlPlaneOptions } from '../../cloudflare/types.js';
2
+ export interface DaemonCloudflareRouteContext extends CloudflareControlPlaneOptions {
3
+ readonly parseJsonBody: (req: Request) => Promise<Record<string, unknown> | Response>;
4
+ readonly parseOptionalJsonBody: (req: Request) => Promise<Record<string, unknown> | null | Response>;
5
+ }
6
+ export declare function dispatchCloudflareRoutes(req: Request, context: DaemonCloudflareRouteContext): Promise<Response | null>;
7
+ //# sourceMappingURL=cloudflare-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare-routes.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/daemon/http/cloudflare-routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,6BAA6B,EAQ9B,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,4BAA6B,SAAQ,6BAA6B;IACjF,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACtF,QAAQ,CAAC,qBAAqB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;CACtG;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CA2D1B"}
@@ -0,0 +1,201 @@
1
+ import { CloudflareControlPlaneManager } from '../../cloudflare/manager.js';
2
+ import { CloudflareControlPlaneError } from '../../cloudflare/types.js';
3
+ export async function dispatchCloudflareRoutes(req, context) {
4
+ const url = new URL(req.url);
5
+ const { pathname } = url;
6
+ if (!pathname.startsWith('/api/cloudflare'))
7
+ return null;
8
+ const manager = new CloudflareControlPlaneManager(context);
9
+ if ((pathname === '/api/cloudflare' || pathname === '/api/cloudflare/status') && req.method === 'GET') {
10
+ return handleCloudflareError(async () => Response.json(await manager.describeStatus()));
11
+ }
12
+ if (pathname === '/api/cloudflare/token/requirements' && req.method === 'GET') {
13
+ const components = parseComponentsFromSearch(url.searchParams);
14
+ return handleCloudflareError(async () => Response.json(manager.tokenRequirements({ components, includeBootstrap: url.searchParams.get('bootstrap') === 'true' })));
15
+ }
16
+ if (pathname === '/api/cloudflare/token/requirements' && req.method === 'POST') {
17
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
18
+ if (bodyOrErr instanceof Response)
19
+ return bodyOrErr;
20
+ return handleCloudflareError(async () => Response.json(manager.tokenRequirements(parseTokenRequirementsInput(bodyOrErr ?? {}))));
21
+ }
22
+ if (pathname === '/api/cloudflare/token/create' && req.method === 'POST') {
23
+ const bodyOrErr = await context.parseJsonBody(req);
24
+ if (bodyOrErr instanceof Response)
25
+ return bodyOrErr;
26
+ return handleCloudflareError(async () => Response.json(await manager.createOperationalToken(parseOperationalTokenInput(bodyOrErr)), { status: 201 }));
27
+ }
28
+ if (pathname === '/api/cloudflare/discover' && req.method === 'POST') {
29
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
30
+ if (bodyOrErr instanceof Response)
31
+ return bodyOrErr;
32
+ return handleCloudflareError(async () => Response.json(await manager.discover(parseDiscoverInput(bodyOrErr ?? {}))));
33
+ }
34
+ if (pathname === '/api/cloudflare/validate' && req.method === 'POST') {
35
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
36
+ if (bodyOrErr instanceof Response)
37
+ return bodyOrErr;
38
+ return handleCloudflareError(async () => Response.json(await manager.validate(parseValidateInput(bodyOrErr ?? {}))));
39
+ }
40
+ if (pathname === '/api/cloudflare/provision' && req.method === 'POST') {
41
+ const bodyOrErr = await context.parseJsonBody(req);
42
+ if (bodyOrErr instanceof Response)
43
+ return bodyOrErr;
44
+ return handleCloudflareError(async () => Response.json(await manager.provision(parseProvisionInput(bodyOrErr)), { status: 202 }));
45
+ }
46
+ if (pathname === '/api/cloudflare/verify' && req.method === 'POST') {
47
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
48
+ if (bodyOrErr instanceof Response)
49
+ return bodyOrErr;
50
+ return handleCloudflareError(async () => Response.json(await manager.verify(parseVerifyInput(bodyOrErr ?? {}))));
51
+ }
52
+ if (pathname === '/api/cloudflare/disable' && req.method === 'POST') {
53
+ const bodyOrErr = await context.parseOptionalJsonBody(req);
54
+ if (bodyOrErr instanceof Response)
55
+ return bodyOrErr;
56
+ return handleCloudflareError(async () => Response.json(await manager.disable(parseDisableInput(bodyOrErr ?? {}))));
57
+ }
58
+ return null;
59
+ }
60
+ async function handleCloudflareError(run) {
61
+ try {
62
+ return await run();
63
+ }
64
+ catch (error) {
65
+ if (error instanceof CloudflareControlPlaneError) {
66
+ return Response.json({ error: error.message, code: error.code }, { status: error.status });
67
+ }
68
+ const message = error instanceof Error ? error.message : String(error);
69
+ return Response.json({ error: message, code: 'CLOUDFLARE_ERROR' }, { status: 500 });
70
+ }
71
+ }
72
+ function parseValidateInput(body) {
73
+ return {
74
+ ...(typeof body['accountId'] === 'string' ? { accountId: body['accountId'] } : {}),
75
+ ...(typeof body['apiToken'] === 'string' ? { apiToken: body['apiToken'] } : {}),
76
+ ...(typeof body['apiTokenRef'] === 'string' ? { apiTokenRef: body['apiTokenRef'] } : {}),
77
+ };
78
+ }
79
+ function parseProvisionInput(body) {
80
+ return {
81
+ ...parseValidateInput(body),
82
+ ...(parseComponents(body) ? { components: parseComponents(body) } : {}),
83
+ ...(typeof body['workerName'] === 'string' ? { workerName: body['workerName'] } : {}),
84
+ ...(typeof body['workerSubdomain'] === 'string' ? { workerSubdomain: body['workerSubdomain'] } : {}),
85
+ ...(typeof body['workerHostname'] === 'string' ? { workerHostname: body['workerHostname'] } : {}),
86
+ ...(typeof body['workerBaseUrl'] === 'string' ? { workerBaseUrl: body['workerBaseUrl'] } : {}),
87
+ ...(typeof body['daemonBaseUrl'] === 'string' ? { daemonBaseUrl: body['daemonBaseUrl'] } : {}),
88
+ ...(typeof body['daemonHostname'] === 'string' ? { daemonHostname: body['daemonHostname'] } : {}),
89
+ ...(typeof body['zoneId'] === 'string' ? { zoneId: body['zoneId'] } : {}),
90
+ ...(typeof body['zoneName'] === 'string' ? { zoneName: body['zoneName'] } : {}),
91
+ ...(typeof body['queueName'] === 'string' ? { queueName: body['queueName'] } : {}),
92
+ ...(typeof body['deadLetterQueueName'] === 'string' ? { deadLetterQueueName: body['deadLetterQueueName'] } : {}),
93
+ ...(typeof body['tunnelName'] === 'string' ? { tunnelName: body['tunnelName'] } : {}),
94
+ ...(typeof body['tunnelId'] === 'string' ? { tunnelId: body['tunnelId'] } : {}),
95
+ ...(typeof body['tunnelServiceUrl'] === 'string' ? { tunnelServiceUrl: body['tunnelServiceUrl'] } : {}),
96
+ ...(typeof body['tunnelTokenRef'] === 'string' ? { tunnelTokenRef: body['tunnelTokenRef'] } : {}),
97
+ ...(typeof body['accessAppId'] === 'string' ? { accessAppId: body['accessAppId'] } : {}),
98
+ ...(typeof body['accessServiceTokenId'] === 'string' ? { accessServiceTokenId: body['accessServiceTokenId'] } : {}),
99
+ ...(typeof body['accessServiceTokenRef'] === 'string' ? { accessServiceTokenRef: body['accessServiceTokenRef'] } : {}),
100
+ ...(typeof body['kvNamespaceName'] === 'string' ? { kvNamespaceName: body['kvNamespaceName'] } : {}),
101
+ ...(typeof body['kvNamespaceId'] === 'string' ? { kvNamespaceId: body['kvNamespaceId'] } : {}),
102
+ ...(typeof body['durableObjectNamespaceName'] === 'string' ? { durableObjectNamespaceName: body['durableObjectNamespaceName'] } : {}),
103
+ ...(typeof body['durableObjectNamespaceId'] === 'string' ? { durableObjectNamespaceId: body['durableObjectNamespaceId'] } : {}),
104
+ ...(typeof body['r2BucketName'] === 'string' ? { r2BucketName: body['r2BucketName'] } : {}),
105
+ ...(typeof body['secretsStoreName'] === 'string' ? { secretsStoreName: body['secretsStoreName'] } : {}),
106
+ ...(typeof body['secretsStoreId'] === 'string' ? { secretsStoreId: body['secretsStoreId'] } : {}),
107
+ ...(typeof body['workerCron'] === 'string' ? { workerCron: body['workerCron'] } : {}),
108
+ ...(typeof body['operatorToken'] === 'string' ? { operatorToken: body['operatorToken'] } : {}),
109
+ ...(typeof body['operatorTokenRef'] === 'string' ? { operatorTokenRef: body['operatorTokenRef'] } : {}),
110
+ ...(typeof body['workerClientToken'] === 'string' ? { workerClientToken: body['workerClientToken'] } : {}),
111
+ ...(typeof body['workerClientTokenRef'] === 'string' ? { workerClientTokenRef: body['workerClientTokenRef'] } : {}),
112
+ ...(typeof body['storeApiToken'] === 'boolean' ? { storeApiToken: body['storeApiToken'] } : {}),
113
+ ...(typeof body['storeOperatorToken'] === 'boolean' ? { storeOperatorToken: body['storeOperatorToken'] } : {}),
114
+ ...(typeof body['storeWorkerClientToken'] === 'boolean' ? { storeWorkerClientToken: body['storeWorkerClientToken'] } : {}),
115
+ ...(typeof body['returnGeneratedSecrets'] === 'boolean' ? { returnGeneratedSecrets: body['returnGeneratedSecrets'] } : {}),
116
+ ...(typeof body['enableWorkersDev'] === 'boolean' ? { enableWorkersDev: body['enableWorkersDev'] } : {}),
117
+ ...(typeof body['queueJobPayloads'] === 'boolean' ? { queueJobPayloads: body['queueJobPayloads'] } : {}),
118
+ ...(typeof body['verify'] === 'boolean' ? { verify: body['verify'] } : {}),
119
+ ...(typeof body['persistConfig'] === 'boolean' ? { persistConfig: body['persistConfig'] } : {}),
120
+ ...(body['batchMode'] === 'off' || body['batchMode'] === 'explicit' || body['batchMode'] === 'eligible-by-default'
121
+ ? { batchMode: body['batchMode'] }
122
+ : {}),
123
+ };
124
+ }
125
+ function parseTokenRequirementsInput(body) {
126
+ return {
127
+ ...(parseComponents(body) ? { components: parseComponents(body) } : {}),
128
+ ...(typeof body['includeBootstrap'] === 'boolean' ? { includeBootstrap: body['includeBootstrap'] } : {}),
129
+ };
130
+ }
131
+ function parseOperationalTokenInput(body) {
132
+ return {
133
+ ...parseTokenRequirementsInput(body),
134
+ ...(typeof body['accountId'] === 'string' ? { accountId: body['accountId'] } : {}),
135
+ ...(typeof body['zoneId'] === 'string' ? { zoneId: body['zoneId'] } : {}),
136
+ ...(typeof body['zoneName'] === 'string' ? { zoneName: body['zoneName'] } : {}),
137
+ ...(typeof body['bootstrapToken'] === 'string' ? { bootstrapToken: body['bootstrapToken'] } : {}),
138
+ ...(typeof body['tokenName'] === 'string' ? { tokenName: body['tokenName'] } : {}),
139
+ ...(typeof body['expiresOn'] === 'string' ? { expiresOn: body['expiresOn'] } : {}),
140
+ ...(typeof body['persistConfig'] === 'boolean' ? { persistConfig: body['persistConfig'] } : {}),
141
+ ...(typeof body['storeApiToken'] === 'boolean' ? { storeApiToken: body['storeApiToken'] } : {}),
142
+ ...(typeof body['returnGeneratedToken'] === 'boolean' ? { returnGeneratedToken: body['returnGeneratedToken'] } : {}),
143
+ };
144
+ }
145
+ function parseDiscoverInput(body) {
146
+ return {
147
+ ...parseValidateInput(body),
148
+ ...(parseComponents(body) ? { components: parseComponents(body) } : {}),
149
+ ...(typeof body['zoneId'] === 'string' ? { zoneId: body['zoneId'] } : {}),
150
+ ...(typeof body['zoneName'] === 'string' ? { zoneName: body['zoneName'] } : {}),
151
+ ...(typeof body['includeResources'] === 'boolean' ? { includeResources: body['includeResources'] } : {}),
152
+ };
153
+ }
154
+ function parseVerifyInput(body) {
155
+ return {
156
+ ...(typeof body['workerBaseUrl'] === 'string' ? { workerBaseUrl: body['workerBaseUrl'] } : {}),
157
+ ...(typeof body['workerClientToken'] === 'string' ? { workerClientToken: body['workerClientToken'] } : {}),
158
+ ...(typeof body['workerClientTokenRef'] === 'string' ? { workerClientTokenRef: body['workerClientTokenRef'] } : {}),
159
+ };
160
+ }
161
+ function parseDisableInput(body) {
162
+ return {
163
+ ...parseValidateInput(body),
164
+ ...(typeof body['workerName'] === 'string' ? { workerName: body['workerName'] } : {}),
165
+ ...(typeof body['disableWorkerSubdomain'] === 'boolean' ? { disableWorkerSubdomain: body['disableWorkerSubdomain'] } : {}),
166
+ ...(typeof body['disableCron'] === 'boolean' ? { disableCron: body['disableCron'] } : {}),
167
+ ...(typeof body['persistConfig'] === 'boolean' ? { persistConfig: body['persistConfig'] } : {}),
168
+ };
169
+ }
170
+ function parseComponents(body) {
171
+ const value = body['components'];
172
+ if (!value || typeof value !== 'object' || Array.isArray(value))
173
+ return undefined;
174
+ const input = value;
175
+ return {
176
+ ...(typeof input['workers'] === 'boolean' ? { workers: input['workers'] } : {}),
177
+ ...(typeof input['queues'] === 'boolean' ? { queues: input['queues'] } : {}),
178
+ ...(typeof input['zeroTrustTunnel'] === 'boolean' ? { zeroTrustTunnel: input['zeroTrustTunnel'] } : {}),
179
+ ...(typeof input['zeroTrustAccess'] === 'boolean' ? { zeroTrustAccess: input['zeroTrustAccess'] } : {}),
180
+ ...(typeof input['dns'] === 'boolean' ? { dns: input['dns'] } : {}),
181
+ ...(typeof input['kv'] === 'boolean' ? { kv: input['kv'] } : {}),
182
+ ...(typeof input['durableObjects'] === 'boolean' ? { durableObjects: input['durableObjects'] } : {}),
183
+ ...(typeof input['secretsStore'] === 'boolean' ? { secretsStore: input['secretsStore'] } : {}),
184
+ ...(typeof input['r2'] === 'boolean' ? { r2: input['r2'] } : {}),
185
+ };
186
+ }
187
+ function parseComponentsFromSearch(params) {
188
+ const body = {};
189
+ const components = {};
190
+ for (const key of ['workers', 'queues', 'zeroTrustTunnel', 'zeroTrustAccess', 'dns', 'kv', 'durableObjects', 'secretsStore', 'r2']) {
191
+ const value = params.get(key);
192
+ if (value === 'true')
193
+ components[key] = true;
194
+ if (value === 'false')
195
+ components[key] = false;
196
+ }
197
+ if (Object.keys(components).length === 0)
198
+ return undefined;
199
+ body['components'] = components;
200
+ return parseComponents(body);
201
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"router-route-contexts.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/daemon/http/router-route-contexts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEjI,OAAO,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AC;IAC5C,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;CAC3D,GAAG,2BAA2B,CAwF9B;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,qBAAqB,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC;IAC7E,QAAQ,CAAC,YAAY,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;IAC7D,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC7C,GAAG,uBAAuB,CA4D1B;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,6BAA6B,GAAG,6BAA6B,CAEhH"}
@@ -154,6 +154,7 @@ export function buildMediaRouteContext(input) {
154
154
  getStatus: (enabled) => input.voiceService.getStatus(enabled),
155
155
  listVoices: (providerId) => input.voiceService.listVoices(providerId),
156
156
  synthesize: (providerId, body) => input.voiceService.synthesize(providerId, body),
157
+ synthesizeStream: (providerId, body) => input.voiceService.synthesizeStream(providerId, body),
157
158
  transcribe: (providerId, body) => input.voiceService.transcribe(providerId, body),
158
159
  openRealtimeSession: (providerId, body) => input.voiceService.openRealtimeSession(providerId, body),
159
160
  },
@@ -18,6 +18,7 @@ import type { MultimodalService } from '../../multimodal/index.js';
18
18
  import type { IntegrationHelperService } from '../../runtime/integration/helpers.js';
19
19
  import type { DomainDispatch, RuntimeStore } from '../../runtime/store/index.js';
20
20
  import type { RuntimeEventBus } from '../../runtime/events/index.js';
21
+ import type { DaemonBatchManager } from '../../batch/index.js';
21
22
  import type { MemoryEmbeddingProviderRegistry, MemoryRegistry } from '../../state/index.js';
22
23
  import type { GenericWebhookAdapterContext, SurfaceAdapterContext } from '../../adapters/index.js';
23
24
  import type { PlatformServiceManager } from '../service-manager.js';
@@ -54,6 +55,7 @@ interface DaemonHttpRouterContext {
54
55
  readonly runtimeBus: RuntimeEventBus;
55
56
  readonly runtimeStore: RuntimeStore | null;
56
57
  readonly runtimeDispatch: DomainDispatch | null;
58
+ readonly batchManager?: DaemonBatchManager | null;
57
59
  readonly githubWebhookSecret: string | null;
58
60
  readonly authToken: () => string | null;
59
61
  readonly buildSurfaceAdapterContext: () => SurfaceAdapterContext;
@@ -92,6 +94,8 @@ interface DaemonHttpRouterContext {
92
94
  readonly queueSurfaceReplyFromBinding: (binding: import('@pellux/goodvibes-sdk/platform/automation/routes').AutomationRouteBinding | undefined, input: {
93
95
  readonly agentId: string;
94
96
  readonly task: string;
97
+ readonly agentTask?: string;
98
+ readonly workflowChainId?: string;
95
99
  readonly sessionId?: string;
96
100
  }) => void;
97
101
  readonly surfaceDeliveryEnabled: (surface: 'slack' | 'discord' | 'ntfy' | 'webhook' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix') => boolean;
@@ -125,7 +129,7 @@ interface DaemonHttpRouterContext {
125
129
  * Without this, the production router always passes undefined and the secrets
126
130
  * tier is permanently dead on live code paths.
127
131
  */
128
- readonly secretsManager?: Pick<import('../../config/secrets.js').SecretsManager, 'get'> | null;
132
+ readonly secretsManager?: Pick<import('../../config/secrets.js').SecretsManager, 'get' | 'set' | 'getGlobalHome'> | null;
129
133
  readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => import('../../tools/agent/index.js').AgentRecord | Response;
130
134
  }
131
135
  export declare class DaemonHttpRouter {
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/daemon/http/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;YAWG,WAAW;YA6BX,mBAAmB;IAQ3B,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAInD,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIrD,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIlD,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;CAG5D"}
@@ -26,6 +26,8 @@ import { AppError } from '../../types/errors.js';
26
26
  import { VERSION } from '../../version.js';
27
27
  import { dispatchCompanionChatRoutes } from '../../companion/companion-chat-routes.js';
28
28
  import { dispatchProviderRoutes } from './provider-routes.js';
29
+ import { dispatchBatchRoutes } from './batch-routes.js';
30
+ import { dispatchCloudflareRoutes } from './cloudflare-routes.js';
29
31
  export class DaemonHttpRouter {
30
32
  context;
31
33
  telemetryApi;
@@ -40,6 +42,7 @@ export class DaemonHttpRouter {
40
42
  }
41
43
  dispose() {
42
44
  this.telemetryApi?.dispose();
45
+ this.context.batchManager?.dispose();
43
46
  }
44
47
  async handleRequest(req) {
45
48
  return correlationCtx.run({ requestId: req.headers.get('x-request-id') ?? crypto.randomUUID() }, async () => {
@@ -115,6 +118,33 @@ export class DaemonHttpRouter {
115
118
  });
116
119
  }
117
120
  async dispatchApiRoutes(req) {
121
+ const url = new URL(req.url);
122
+ if (url.pathname.startsWith('/api/batch')) {
123
+ if (!this.context.batchManager) {
124
+ return Response.json({ error: 'Batch manager is not available', code: 'BATCH_MANAGER_UNAVAILABLE' }, { status: 503 });
125
+ }
126
+ const batchResponse = await dispatchBatchRoutes(req, {
127
+ batchManager: this.context.batchManager,
128
+ parseJsonBody: (request) => this.parseJsonBody(request),
129
+ parseOptionalJsonBody: (request) => this.parseOptionalJsonBody(request),
130
+ });
131
+ if (batchResponse)
132
+ return batchResponse;
133
+ }
134
+ if (url.pathname.startsWith('/api/cloudflare')) {
135
+ const adminError = this.context.requireAdmin(req);
136
+ if (adminError)
137
+ return adminError;
138
+ const cloudflareResponse = await dispatchCloudflareRoutes(req, {
139
+ configManager: this.context.configManager,
140
+ secretsManager: this.context.secretsManager,
141
+ authToken: this.context.authToken,
142
+ parseJsonBody: (request) => this.parseJsonBody(request),
143
+ parseOptionalJsonBody: (request) => this.parseOptionalJsonBody(request),
144
+ });
145
+ if (cloudflareResponse)
146
+ return cloudflareResponse;
147
+ }
118
148
  // Companion chat routes — scoped to /api/companion/chat/..., session-isolated.
119
149
  // Handled before the main API router so they never touch the global control-plane feed.
120
150
  // Provider discovery + model-switching routes
@@ -230,6 +230,8 @@ export interface DaemonRuntimeRouteContext extends Omit<SdkDaemonRuntimeRouteCon
230
230
  readonly queueSurfaceReplyFromBinding: (binding: AutomationRouteBinding | undefined, input: {
231
231
  readonly agentId: string;
232
232
  readonly task: string;
233
+ readonly agentTask?: string;
234
+ readonly workflowChainId?: string;
233
235
  readonly sessionId?: string;
234
236
  }) => void;
235
237
  readonly surfaceDeliveryEnabled: (surface: 'slack' | 'discord' | 'ntfy' | 'webhook' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix') => boolean;