@pellux/goodvibes-sdk 0.21.30 → 0.21.34

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 (307) hide show
  1. package/dist/_internal/contracts/zod-schemas/accounts.d.ts +9 -9
  2. package/dist/_internal/contracts/zod-schemas/auth.d.ts +1 -1
  3. package/dist/_internal/daemon/context.d.ts +1 -0
  4. package/dist/_internal/daemon/context.d.ts.map +1 -1
  5. package/dist/_internal/daemon/error-response.js +22 -22
  6. package/dist/_internal/daemon/integration-route-types.d.ts +2 -1
  7. package/dist/_internal/daemon/integration-route-types.d.ts.map +1 -1
  8. package/dist/_internal/daemon/knowledge-routes.js +5 -5
  9. package/dist/_internal/daemon/media-routes.d.ts.map +1 -1
  10. package/dist/_internal/daemon/media-routes.js +4 -3
  11. package/dist/_internal/daemon/operator.d.ts +1 -1
  12. package/dist/_internal/daemon/operator.d.ts.map +1 -1
  13. package/dist/_internal/daemon/operator.js +2 -0
  14. package/dist/_internal/daemon/runtime-route-types.d.ts +2 -1
  15. package/dist/_internal/daemon/runtime-route-types.d.ts.map +1 -1
  16. package/dist/_internal/daemon/runtime-routes.d.ts +1 -1
  17. package/dist/_internal/daemon/runtime-routes.d.ts.map +1 -1
  18. package/dist/_internal/daemon/runtime-routes.js +1 -0
  19. package/dist/_internal/daemon/telemetry-routes.d.ts.map +1 -1
  20. package/dist/_internal/daemon/telemetry-routes.js +13 -12
  21. package/dist/_internal/errors/daemon-error-contract.d.ts +17 -0
  22. package/dist/_internal/errors/daemon-error-contract.d.ts.map +1 -1
  23. package/dist/_internal/errors/daemon-error-contract.js +17 -1
  24. package/dist/_internal/errors/index.d.ts +2 -1
  25. package/dist/_internal/errors/index.d.ts.map +1 -1
  26. package/dist/_internal/errors/index.js +1 -0
  27. package/dist/_internal/platform/artifacts/store.d.ts.map +1 -1
  28. package/dist/_internal/platform/artifacts/store.js +2 -1
  29. package/dist/_internal/platform/automation/scheduler-capacity.d.ts +29 -0
  30. package/dist/_internal/platform/automation/scheduler-capacity.d.ts.map +1 -0
  31. package/dist/_internal/platform/automation/scheduler-capacity.js +31 -0
  32. package/dist/_internal/platform/channels/delivery/shared.d.ts.map +1 -1
  33. package/dist/_internal/platform/channels/delivery/shared.js +3 -2
  34. package/dist/_internal/platform/channels/delivery/strategies-bridge.d.ts.map +1 -1
  35. package/dist/_internal/platform/channels/delivery/strategies-bridge.js +3 -2
  36. package/dist/_internal/platform/channels/delivery/strategies-core.d.ts.map +1 -1
  37. package/dist/_internal/platform/channels/delivery/strategies-core.js +5 -4
  38. package/dist/_internal/platform/channels/delivery/strategies-enterprise.d.ts.map +1 -1
  39. package/dist/_internal/platform/channels/delivery/strategies-enterprise.js +4 -3
  40. package/dist/_internal/platform/config/manager.d.ts.map +1 -1
  41. package/dist/_internal/platform/config/manager.js +2 -1
  42. package/dist/_internal/platform/config/schema-domain-runtime.d.ts +6 -0
  43. package/dist/_internal/platform/config/schema-domain-runtime.d.ts.map +1 -1
  44. package/dist/_internal/platform/config/schema-domain-runtime.js +22 -0
  45. package/dist/_internal/platform/config/schema-types.d.ts +16 -2
  46. package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
  47. package/dist/_internal/platform/config/schema.d.ts.map +1 -1
  48. package/dist/_internal/platform/config/schema.js +1 -0
  49. package/dist/_internal/platform/config/service-registry.d.ts.map +1 -1
  50. package/dist/_internal/platform/config/service-registry.js +2 -1
  51. package/dist/_internal/platform/control-plane/gateway-web-ui.d.ts +0 -1
  52. package/dist/_internal/platform/control-plane/gateway-web-ui.d.ts.map +1 -1
  53. package/dist/_internal/platform/control-plane/gateway-web-ui.js +7 -6
  54. package/dist/_internal/platform/control-plane/session-broker.d.ts.map +1 -1
  55. package/dist/_internal/platform/control-plane/session-broker.js +12 -4
  56. package/dist/_internal/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
  57. package/dist/_internal/platform/core/orchestrator-tool-runtime.js +6 -6
  58. package/dist/_internal/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  59. package/dist/_internal/platform/core/orchestrator-turn-loop.js +10 -2
  60. package/dist/_internal/platform/daemon/facade-composition.d.ts +4 -131
  61. package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
  62. package/dist/_internal/platform/daemon/facade-composition.js +9 -10
  63. package/dist/_internal/platform/daemon/facade-types.d.ts +141 -0
  64. package/dist/_internal/platform/daemon/facade-types.d.ts.map +1 -0
  65. package/dist/_internal/platform/daemon/facade-types.js +1 -0
  66. package/dist/_internal/platform/daemon/http/rate-limiter.d.ts +23 -0
  67. package/dist/_internal/platform/daemon/http/rate-limiter.d.ts.map +1 -0
  68. package/dist/_internal/platform/daemon/http/rate-limiter.js +71 -0
  69. package/dist/_internal/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  70. package/dist/_internal/platform/daemon/http/router-route-contexts.js +2 -1
  71. package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
  72. package/dist/_internal/platform/daemon/http/router.js +70 -65
  73. package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  74. package/dist/_internal/platform/daemon/http-listener.d.ts +1 -0
  75. package/dist/_internal/platform/daemon/http-listener.d.ts.map +1 -1
  76. package/dist/_internal/platform/daemon/http-listener.js +53 -73
  77. package/dist/_internal/platform/daemon/surface-delivery.d.ts.map +1 -1
  78. package/dist/_internal/platform/daemon/surface-delivery.js +6 -5
  79. package/dist/_internal/platform/discovery/mcp-scanner.d.ts.map +1 -1
  80. package/dist/_internal/platform/discovery/mcp-scanner.js +28 -22
  81. package/dist/_internal/platform/discovery/scanner.d.ts.map +1 -1
  82. package/dist/_internal/platform/discovery/scanner.js +38 -22
  83. package/dist/_internal/platform/export/session-export.d.ts +0 -1
  84. package/dist/_internal/platform/export/session-export.d.ts.map +1 -1
  85. package/dist/_internal/platform/export/session-export.js +1 -33
  86. package/dist/_internal/platform/hooks/runners/http.d.ts.map +1 -1
  87. package/dist/_internal/platform/hooks/runners/http.js +2 -1
  88. package/dist/_internal/platform/integrations/delivery.d.ts +3 -1
  89. package/dist/_internal/platform/integrations/delivery.d.ts.map +1 -1
  90. package/dist/_internal/platform/integrations/delivery.js +3 -2
  91. package/dist/_internal/platform/integrations/discord.d.ts.map +1 -1
  92. package/dist/_internal/platform/integrations/discord.js +6 -5
  93. package/dist/_internal/platform/integrations/ntfy.d.ts.map +1 -1
  94. package/dist/_internal/platform/integrations/ntfy.js +3 -2
  95. package/dist/_internal/platform/integrations/webhooks.d.ts.map +1 -1
  96. package/dist/_internal/platform/integrations/webhooks.js +2 -1
  97. package/dist/_internal/platform/intelligence/lsp/binary-downloader.d.ts.map +1 -1
  98. package/dist/_internal/platform/intelligence/lsp/binary-downloader.js +4 -3
  99. package/dist/_internal/platform/knowledge/store.d.ts.map +1 -1
  100. package/dist/_internal/platform/knowledge/store.js +50 -25
  101. package/dist/_internal/platform/mcp/client.d.ts.map +1 -1
  102. package/dist/_internal/platform/mcp/client.js +3 -2
  103. package/dist/_internal/platform/media/builtin-generation-providers.d.ts.map +1 -1
  104. package/dist/_internal/platform/media/builtin-generation-providers.js +4 -3
  105. package/dist/_internal/platform/media/builtin-image-understanding.d.ts.map +1 -1
  106. package/dist/_internal/platform/media/builtin-image-understanding.js +5 -4
  107. package/dist/_internal/platform/providers/anthropic-compat.d.ts.map +1 -1
  108. package/dist/_internal/platform/providers/anthropic-compat.js +5 -3
  109. package/dist/_internal/platform/providers/anthropic.d.ts.map +1 -1
  110. package/dist/_internal/platform/providers/anthropic.js +10 -7
  111. package/dist/_internal/platform/providers/builtin-catalog.d.ts.map +1 -1
  112. package/dist/_internal/platform/providers/builtin-catalog.js +3 -2
  113. package/dist/_internal/platform/providers/catalogue.d.ts +56 -0
  114. package/dist/_internal/platform/providers/catalogue.d.ts.map +1 -0
  115. package/dist/_internal/platform/providers/catalogue.js +111 -0
  116. package/dist/_internal/platform/providers/context-discovery.d.ts.map +1 -1
  117. package/dist/_internal/platform/providers/context-discovery.js +2 -1
  118. package/dist/_internal/platform/providers/credentials.d.ts +12 -0
  119. package/dist/_internal/platform/providers/credentials.d.ts.map +1 -0
  120. package/dist/_internal/platform/providers/credentials.js +54 -0
  121. package/dist/_internal/platform/providers/gemini.d.ts.map +1 -1
  122. package/dist/_internal/platform/providers/gemini.js +6 -5
  123. package/dist/_internal/platform/providers/github-copilot.d.ts.map +1 -1
  124. package/dist/_internal/platform/providers/github-copilot.js +2 -1
  125. package/dist/_internal/platform/providers/health.d.ts +15 -0
  126. package/dist/_internal/platform/providers/health.d.ts.map +1 -0
  127. package/dist/_internal/platform/providers/health.js +32 -0
  128. package/dist/_internal/platform/providers/llama-cpp.d.ts.map +1 -1
  129. package/dist/_internal/platform/providers/llama-cpp.js +5 -3
  130. package/dist/_internal/platform/providers/lm-studio.d.ts.map +1 -1
  131. package/dist/_internal/platform/providers/lm-studio.js +5 -3
  132. package/dist/_internal/platform/providers/model-benchmarks.d.ts.map +1 -1
  133. package/dist/_internal/platform/providers/model-benchmarks.js +2 -1
  134. package/dist/_internal/platform/providers/model-catalog-cache.d.ts.map +1 -1
  135. package/dist/_internal/platform/providers/model-catalog-cache.js +2 -1
  136. package/dist/_internal/platform/providers/model-limits.d.ts.map +1 -1
  137. package/dist/_internal/platform/providers/model-limits.js +2 -1
  138. package/dist/_internal/platform/providers/ollama.d.ts.map +1 -1
  139. package/dist/_internal/platform/providers/ollama.js +5 -3
  140. package/dist/_internal/platform/providers/openai-codex.d.ts.map +1 -1
  141. package/dist/_internal/platform/providers/openai-codex.js +4 -2
  142. package/dist/_internal/platform/providers/openai-compat.d.ts.map +1 -1
  143. package/dist/_internal/platform/providers/openai-compat.js +3 -2
  144. package/dist/_internal/platform/providers/provider-not-found-error.d.ts +3 -1
  145. package/dist/_internal/platform/providers/provider-not-found-error.d.ts.map +1 -1
  146. package/dist/_internal/platform/providers/provider-not-found-error.js +3 -4
  147. package/dist/_internal/platform/providers/well-known-endpoints.d.ts +53 -0
  148. package/dist/_internal/platform/providers/well-known-endpoints.d.ts.map +1 -0
  149. package/dist/_internal/platform/providers/well-known-endpoints.js +52 -0
  150. package/dist/_internal/platform/runtime/auth/oauth-core.d.ts.map +1 -1
  151. package/dist/_internal/platform/runtime/auth/oauth-core.js +2 -1
  152. package/dist/_internal/platform/runtime/contracts/index.d.ts.map +1 -1
  153. package/dist/_internal/platform/runtime/contracts/index.js +1 -5
  154. package/dist/_internal/platform/runtime/contracts/migrations/schemas.d.ts +57 -0
  155. package/dist/_internal/platform/runtime/contracts/migrations/schemas.d.ts.map +1 -0
  156. package/dist/_internal/platform/runtime/contracts/migrations/schemas.js +157 -0
  157. package/dist/_internal/platform/runtime/correlation.d.ts +44 -0
  158. package/dist/_internal/platform/runtime/correlation.d.ts.map +1 -0
  159. package/dist/_internal/platform/runtime/correlation.js +40 -0
  160. package/dist/_internal/platform/runtime/emitters/security.d.ts +32 -0
  161. package/dist/_internal/platform/runtime/emitters/security.d.ts.map +1 -1
  162. package/dist/_internal/platform/runtime/emitters/security.js +26 -0
  163. package/dist/_internal/platform/runtime/emitters/tools.d.ts +11 -2
  164. package/dist/_internal/platform/runtime/emitters/tools.d.ts.map +1 -1
  165. package/dist/_internal/platform/runtime/emitters/tools.js +27 -0
  166. package/dist/_internal/platform/runtime/emitters/transport.d.ts +27 -0
  167. package/dist/_internal/platform/runtime/emitters/transport.d.ts.map +1 -1
  168. package/dist/_internal/platform/runtime/emitters/transport.js +19 -0
  169. package/dist/_internal/platform/runtime/emitters/turn.d.ts +22 -1
  170. package/dist/_internal/platform/runtime/emitters/turn.d.ts.map +1 -1
  171. package/dist/_internal/platform/runtime/emitters/turn.js +9 -0
  172. package/dist/_internal/platform/runtime/events/index.d.ts +45 -0
  173. package/dist/_internal/platform/runtime/events/index.d.ts.map +1 -1
  174. package/dist/_internal/platform/runtime/events/index.js +108 -14
  175. package/dist/_internal/platform/runtime/events/ops.d.ts +8 -0
  176. package/dist/_internal/platform/runtime/events/ops.d.ts.map +1 -1
  177. package/dist/_internal/platform/runtime/events/security.d.ts +47 -0
  178. package/dist/_internal/platform/runtime/events/security.d.ts.map +1 -1
  179. package/dist/_internal/platform/runtime/events/tools.d.ts +14 -2
  180. package/dist/_internal/platform/runtime/events/tools.d.ts.map +1 -1
  181. package/dist/_internal/platform/runtime/events/transport.d.ts +31 -0
  182. package/dist/_internal/platform/runtime/events/transport.d.ts.map +1 -1
  183. package/dist/_internal/platform/runtime/events/turn.d.ts +25 -1
  184. package/dist/_internal/platform/runtime/events/turn.d.ts.map +1 -1
  185. package/dist/_internal/platform/runtime/events/workspace.d.ts +16 -0
  186. package/dist/_internal/platform/runtime/events/workspace.d.ts.map +1 -1
  187. package/dist/_internal/platform/runtime/llm-observability.d.ts +43 -0
  188. package/dist/_internal/platform/runtime/llm-observability.d.ts.map +1 -0
  189. package/dist/_internal/platform/runtime/llm-observability.js +107 -0
  190. package/dist/_internal/platform/runtime/metrics.d.ts +49 -0
  191. package/dist/_internal/platform/runtime/metrics.d.ts.map +1 -0
  192. package/dist/_internal/platform/runtime/metrics.js +114 -0
  193. package/dist/_internal/platform/runtime/ops/control-plane.d.ts +5 -2
  194. package/dist/_internal/platform/runtime/ops/control-plane.d.ts.map +1 -1
  195. package/dist/_internal/platform/runtime/ops/control-plane.js +5 -4
  196. package/dist/_internal/platform/runtime/permissions/divergence-dashboard.d.ts +3 -1
  197. package/dist/_internal/platform/runtime/permissions/divergence-dashboard.d.ts.map +1 -1
  198. package/dist/_internal/platform/runtime/permissions/divergence-dashboard.js +3 -2
  199. package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts +3 -1
  200. package/dist/_internal/platform/runtime/permissions/policy-loader.d.ts.map +1 -1
  201. package/dist/_internal/platform/runtime/permissions/policy-loader.js +3 -2
  202. package/dist/_internal/platform/runtime/permissions/policy-signer.d.ts.map +1 -1
  203. package/dist/_internal/platform/runtime/permissions/policy-signer.js +7 -2
  204. package/dist/_internal/platform/runtime/permissions/simulation.d.ts +3 -1
  205. package/dist/_internal/platform/runtime/permissions/simulation.d.ts.map +1 -1
  206. package/dist/_internal/platform/runtime/permissions/simulation.js +3 -2
  207. package/dist/_internal/platform/runtime/remote/transport-contract.d.ts +14 -2
  208. package/dist/_internal/platform/runtime/remote/transport-contract.d.ts.map +1 -1
  209. package/dist/_internal/platform/runtime/remote/transport-contract.js +7 -5
  210. package/dist/_internal/platform/runtime/store/helpers/reducers/sync.d.ts.map +1 -1
  211. package/dist/_internal/platform/runtime/store/helpers/reducers/sync.js +12 -1
  212. package/dist/_internal/platform/runtime/tasks/manager.d.ts +7 -3
  213. package/dist/_internal/platform/runtime/tasks/manager.d.ts.map +1 -1
  214. package/dist/_internal/platform/runtime/tasks/manager.js +7 -6
  215. package/dist/_internal/platform/runtime/telemetry/api-helpers.d.ts +14 -0
  216. package/dist/_internal/platform/runtime/telemetry/api-helpers.d.ts.map +1 -1
  217. package/dist/_internal/platform/runtime/telemetry/api-helpers.js +59 -0
  218. package/dist/_internal/platform/runtime/telemetry/api.d.ts.map +1 -1
  219. package/dist/_internal/platform/runtime/telemetry/api.js +9 -2
  220. package/dist/_internal/platform/runtime/telemetry/exporters/otlp.d.ts.map +1 -1
  221. package/dist/_internal/platform/runtime/telemetry/exporters/otlp.js +19 -6
  222. package/dist/_internal/platform/runtime/telemetry/exporters/queue.d.ts.map +1 -1
  223. package/dist/_internal/platform/runtime/telemetry/exporters/queue.js +11 -4
  224. package/dist/_internal/platform/runtime/telemetry/meter.d.ts.map +1 -1
  225. package/dist/_internal/platform/runtime/telemetry/meter.js +7 -3
  226. package/dist/_internal/platform/runtime/telemetry/redaction-config.d.ts +9 -0
  227. package/dist/_internal/platform/runtime/telemetry/redaction-config.d.ts.map +1 -0
  228. package/dist/_internal/platform/runtime/telemetry/redaction-config.js +52 -0
  229. package/dist/_internal/platform/runtime/tools/phases/budget.d.ts.map +1 -1
  230. package/dist/_internal/platform/runtime/tools/phases/budget.js +3 -2
  231. package/dist/_internal/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
  232. package/dist/_internal/platform/runtime/transports/daemon-http-client.js +138 -17
  233. package/dist/_internal/platform/scheduler/scheduler.d.ts.map +1 -1
  234. package/dist/_internal/platform/scheduler/scheduler.js +6 -2
  235. package/dist/_internal/platform/sessions/manager.d.ts.map +1 -1
  236. package/dist/_internal/platform/sessions/manager.js +6 -2
  237. package/dist/_internal/platform/state/memory-embedding-http.d.ts.map +1 -1
  238. package/dist/_internal/platform/state/memory-embedding-http.js +3 -2
  239. package/dist/_internal/platform/state/project-index.d.ts.map +1 -1
  240. package/dist/_internal/platform/state/project-index.js +6 -4
  241. package/dist/_internal/platform/tools/agent/index.d.ts.map +1 -1
  242. package/dist/_internal/platform/tools/agent/index.js +2 -1
  243. package/dist/_internal/platform/tools/analyze/git-modes.d.ts.map +1 -1
  244. package/dist/_internal/platform/tools/analyze/git-modes.js +2 -1
  245. package/dist/_internal/platform/tools/edit/core.d.ts.map +1 -1
  246. package/dist/_internal/platform/tools/edit/core.js +2 -1
  247. package/dist/_internal/platform/tools/exec/runtime.d.ts.map +1 -1
  248. package/dist/_internal/platform/tools/exec/runtime.js +3 -2
  249. package/dist/_internal/platform/tools/fetch/runtime.d.ts.map +1 -1
  250. package/dist/_internal/platform/tools/fetch/runtime.js +4 -2
  251. package/dist/_internal/platform/tools/read/index.d.ts.map +1 -1
  252. package/dist/_internal/platform/tools/read/index.js +2 -1
  253. package/dist/_internal/platform/tools/registry-tool/index.d.ts.map +1 -1
  254. package/dist/_internal/platform/tools/registry-tool/index.js +2 -1
  255. package/dist/_internal/platform/tools/state/index.d.ts.map +1 -1
  256. package/dist/_internal/platform/tools/state/index.js +2 -1
  257. package/dist/_internal/platform/tools/task/index.d.ts.map +1 -1
  258. package/dist/_internal/platform/tools/task/index.js +2 -1
  259. package/dist/_internal/platform/tools/team/index.d.ts.map +1 -1
  260. package/dist/_internal/platform/tools/team/index.js +2 -1
  261. package/dist/_internal/platform/tools/web-search/index.d.ts.map +1 -1
  262. package/dist/_internal/platform/tools/web-search/index.js +2 -1
  263. package/dist/_internal/platform/tools/worklist/index.d.ts.map +1 -1
  264. package/dist/_internal/platform/tools/worklist/index.js +2 -1
  265. package/dist/_internal/platform/types/errors.d.ts +12 -10
  266. package/dist/_internal/platform/types/errors.d.ts.map +1 -1
  267. package/dist/_internal/platform/types/errors.js +21 -20
  268. package/dist/_internal/platform/utils/error-display.d.ts.map +1 -1
  269. package/dist/_internal/platform/utils/error-display.js +6 -4
  270. package/dist/_internal/platform/utils/fetch-with-timeout.d.ts +17 -0
  271. package/dist/_internal/platform/utils/fetch-with-timeout.d.ts.map +1 -1
  272. package/dist/_internal/platform/utils/fetch-with-timeout.js +59 -0
  273. package/dist/_internal/platform/utils/record-coerce.d.ts +11 -0
  274. package/dist/_internal/platform/utils/record-coerce.d.ts.map +1 -0
  275. package/dist/_internal/platform/utils/record-coerce.js +12 -0
  276. package/dist/_internal/platform/utils/redaction.js +1 -1
  277. package/dist/_internal/platform/utils/ring-buffer.d.ts +54 -0
  278. package/dist/_internal/platform/utils/ring-buffer.d.ts.map +1 -0
  279. package/dist/_internal/platform/utils/ring-buffer.js +96 -0
  280. package/dist/_internal/platform/utils/shell-split.d.ts +11 -0
  281. package/dist/_internal/platform/utils/shell-split.d.ts.map +1 -0
  282. package/dist/_internal/platform/utils/shell-split.js +83 -0
  283. package/dist/_internal/platform/version.js +1 -1
  284. package/dist/_internal/platform/voice/providers/deepgram.d.ts.map +1 -1
  285. package/dist/_internal/platform/voice/providers/deepgram.js +2 -1
  286. package/dist/_internal/platform/voice/providers/elevenlabs.d.ts.map +1 -1
  287. package/dist/_internal/platform/voice/providers/elevenlabs.js +5 -4
  288. package/dist/_internal/platform/voice/providers/google.d.ts.map +1 -1
  289. package/dist/_internal/platform/voice/providers/google.js +5 -4
  290. package/dist/_internal/platform/voice/providers/microsoft.d.ts.map +1 -1
  291. package/dist/_internal/platform/voice/providers/microsoft.js +2 -1
  292. package/dist/_internal/platform/voice/providers/openai.d.ts.map +1 -1
  293. package/dist/_internal/platform/voice/providers/openai.js +4 -3
  294. package/dist/_internal/platform/voice/providers/shared.d.ts.map +1 -1
  295. package/dist/_internal/platform/voice/providers/shared.js +2 -1
  296. package/dist/_internal/platform/voice/providers/vydra.d.ts.map +1 -1
  297. package/dist/_internal/platform/voice/providers/vydra.js +3 -2
  298. package/dist/_internal/platform/watchers/registry.d.ts.map +1 -1
  299. package/dist/_internal/platform/watchers/registry.js +3 -2
  300. package/dist/_internal/platform/workflow/trigger-executor.d.ts.map +1 -1
  301. package/dist/_internal/platform/workflow/trigger-executor.js +5 -3
  302. package/dist/_internal/platform/workspace/daemon-home.d.ts.map +1 -1
  303. package/dist/_internal/platform/workspace/daemon-home.js +6 -2
  304. package/dist/_internal/platform/workspace/workspace-swap-manager.d.ts +1 -0
  305. package/dist/_internal/platform/workspace/workspace-swap-manager.d.ts.map +1 -1
  306. package/dist/_internal/platform/workspace/workspace-swap-manager.js +14 -2
  307. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { logger } from '../utils/logger.js';
4
4
  import { summarizeError } from '../utils/error-display.js';
5
+ import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
5
6
  const ZEROEVAL_URL = 'https://api.zeroeval.com/leaderboard/models/full?justCanonicals=true';
6
7
  const FETCH_TIMEOUT_MS = 20_000;
7
8
  const CACHE_TTL_MS = 86_400_000;
@@ -221,7 +222,7 @@ export class BenchmarkStore {
221
222
  const controller = new AbortController();
222
223
  const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
223
224
  try {
224
- const response = await fetch(ZEROEVAL_URL, {
225
+ const response = await instrumentedFetch(ZEROEVAL_URL, {
225
226
  signal: controller.signal,
226
227
  headers: { Accept: 'application/json' },
227
228
  });
@@ -1 +1 @@
1
- {"version":3,"file":"model-catalog-cache.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/model-catalog-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAgBvD,UAAU,gBAAgB;IACxB,OAAO,EAAE,CAAC,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AA8BD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AA4FD,iBAAS,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAepE;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAc1F;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAqB5D;AAED,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,CAAC"}
1
+ {"version":3,"file":"model-catalog-cache.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/model-catalog-cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiBvD,UAAU,gBAAgB;IACxB,OAAO,EAAE,CAAC,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AA8BD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AA4FD,iBAAS,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAepE;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAc1F;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAqB5D;AAED,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,CAAC"}
@@ -2,6 +2,7 @@ import fs from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { logger } from '../utils/logger.js';
4
4
  import { summarizeError } from '../utils/error-display.js';
5
+ import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
5
6
  const MODELS_DEV_URL = 'https://models.dev/api.json';
6
7
  const CATALOG_FETCH_TIMEOUT_MS = 30_000;
7
8
  const CATALOG_TTL_MS = 86_400_000; // 24 hours
@@ -141,7 +142,7 @@ export async function fetchCatalog() {
141
142
  const controller = new AbortController();
142
143
  const timer = setTimeout(() => controller.abort(), CATALOG_FETCH_TIMEOUT_MS);
143
144
  try {
144
- const response = await fetch(MODELS_DEV_URL, {
145
+ const response = await instrumentedFetch(MODELS_DEV_URL, {
145
146
  signal: controller.signal,
146
147
  headers: { Accept: 'application/json' },
147
148
  });
@@ -1 +1 @@
1
- {"version":3,"file":"model-limits.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/model-limits.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4ClE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AA6GD,qBAAa,kBAAkB;IAIjB,OAAO,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MAAM,CAAA;KAAE,GAAG,IAAI;IAWpG,sBAAsB,CAAC,QAAQ,EAAE,eAAe,GAAG,QAAQ,CAAC,WAAW,CAAC;IAIxE,wBAAwB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IAc3D,6BAA6B,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAK1E,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAiChC,IAAI,IAAI,IAAI;CASb"}
@@ -2,6 +2,7 @@ import { dirname, join } from 'node:path';
2
2
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
3
3
  import { logger } from '../utils/logger.js';
4
4
  import { summarizeError } from '../utils/error-display.js';
5
+ import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
5
6
  const OPENROUTER_MODELS_URL = 'https://openrouter.ai/api/v1/models';
6
7
  const FETCH_TIMEOUT_MS = 15_000;
7
8
  const CACHE_TTL_MS = 86_400_000;
@@ -49,7 +50,7 @@ async function fetchOpenRouterModels() {
49
50
  const controller = new AbortController();
50
51
  const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
51
52
  try {
52
- const response = await fetch(OPENROUTER_MODELS_URL, {
53
+ const response = await instrumentedFetch(OPENROUTER_MODELS_URL, {
53
54
  signal: controller.signal,
54
55
  headers: { Accept: 'application/json' },
55
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/ollama.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,WAAW,EAEX,wBAAwB,EACxB,uBAAuB,EAEvB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,KAAK,WAAW,GAAG,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../utils/retry.js';
2
+ import { instrumentedLlmCall } from '../runtime/llm-observability.js';
2
3
  import { ProviderError } from '../types/errors.js';
3
4
  import { OpenAICompatProvider } from './openai-compat.js';
4
5
  import { toOpenAITools } from './tool-formats.js';
5
6
  import { summarizeError, toProviderError } from '../utils/error-display.js';
6
7
  import { mapOllamaStopReason } from './stop-reason-maps.js';
8
+ import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
7
9
  export class OllamaProvider {
8
10
  name;
9
11
  models;
@@ -23,14 +25,14 @@ export class OllamaProvider {
23
25
  this.defaultModel = opts.defaultModel;
24
26
  this.nativeChatUrl = deriveOllamaChatUrl(opts.baseURL);
25
27
  this.nativeEmbedUrl = deriveOllamaEmbedUrl(opts.baseURL);
26
- this.nativeFetch = opts.nativeFetch ?? ((input, init) => fetch(input, init));
28
+ this.nativeFetch = opts.nativeFetch ?? instrumentedFetch;
27
29
  this.fallbackProvider = opts.fallbackProvider ?? new OpenAICompatProvider(opts);
28
30
  }
29
31
  isConfigured() {
30
32
  return this.fallbackProvider.isConfigured?.() ?? true;
31
33
  }
32
34
  async chat(params) {
33
- return withRetry(async () => {
35
+ return (await instrumentedLlmCall(() => withRetry(async () => {
34
36
  const model = params.model || this.defaultModel;
35
37
  if (canUseNativeOllamaChat(params.messages)) {
36
38
  try {
@@ -43,7 +45,7 @@ export class OllamaProvider {
43
45
  }
44
46
  }
45
47
  return this.fallbackProvider.chat(params);
46
- });
48
+ }), { provider: this.name, model: params.model || this.defaultModel })).result;
47
49
  }
48
50
  async embed(request) {
49
51
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"openai-codex.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/openai-codex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EAGX,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAA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2BAA2B,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAgC3F"}
@@ -3,7 +3,9 @@ import { withRetry } from '../utils/retry.js';
3
3
  import { resolveSubscriptionAccessToken } from '../config/subscription-auth.js';
4
4
  import { arch, platform, release } from 'node:os';
5
5
  import { toProviderError } from '../utils/error-display.js';
6
+ import { instrumentedLlmCall } from '../runtime/llm-observability.js';
6
7
  import { mapCodexStopReason } from './stop-reason-maps.js';
8
+ import { instrumentedFetch } from '../utils/fetch-with-timeout.js';
7
9
  const OPENAI_CODEX_BASE_URL = 'https://chatgpt.com/backend-api';
8
10
  const OPENAI_CODEX_PROVIDER_NAME = 'openai-subscriber';
9
11
  function getOpenAICodexUserAgent() {
@@ -148,7 +150,7 @@ export async function chatWithOpenAICodex(accessToken, params) {
148
150
  };
149
151
  let response;
150
152
  try {
151
- response = await fetch(`${OPENAI_CODEX_BASE_URL}/codex/responses`, {
153
+ response = await instrumentedFetch(`${OPENAI_CODEX_BASE_URL}/codex/responses`, {
152
154
  method: 'POST',
153
155
  headers: {
154
156
  authorization: `Bearer ${accessToken}`,
@@ -404,7 +406,7 @@ export class OpenAICodexProvider {
404
406
  phase: 'auth',
405
407
  });
406
408
  }
407
- return chatWithOpenAICodex(accessToken, params);
409
+ return (await instrumentedLlmCall(() => chatWithOpenAICodex(accessToken, params), { provider: this.name, model: params.model ?? '' })).result;
408
410
  }
409
411
  async describeRuntime(deps) {
410
412
  const { buildStandardProviderAuthRoutes } = await import('./runtime-metadata.js');
@@ -1 +1 @@
1
- {"version":3,"file":"openai-compat.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/openai-compat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,YAAY,EAEZ,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAY5D,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AuB,CAAC;IA8B1E,eAAe,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAiD3F"}
@@ -1,6 +1,7 @@
1
1
  import OpenAI from 'openai';
2
2
  import { ProviderError } from '../types/errors.js';
3
3
  import { withRetry } from '../utils/retry.js';
4
+ import { instrumentedLlmCall } from '../runtime/llm-observability.js';
4
5
  import { toOpenAITools, toOpenAIMessages, fromOpenAIToolCalls, extractTextToolCalls, } from './tool-formats.js';
5
6
  import { getCacheCapability } from './cache-capability.js';
6
7
  import { extractOpenAIStreamTextDelta } from './openai-stream-delta.js';
@@ -235,7 +236,7 @@ export class OpenAICompatProvider {
235
236
  }
236
237
  async chat(params) {
237
238
  const { messages, tools, model, maxTokens, signal, systemPrompt, reasoningEffort, reasoningSummary, onDelta, } = params;
238
- return withRetry(async () => {
239
+ return (await instrumentedLlmCall(() => withRetry(async () => {
239
240
  const allowReasoningStream = this.reasoningFormat !== 'none';
240
241
  let responseText = '';
241
242
  let inputTokens = 0;
@@ -419,7 +420,7 @@ export class OpenAICompatProvider {
419
420
  cacheReadTokens,
420
421
  });
421
422
  return response;
422
- });
423
+ }), { provider: this.name, model: model ?? this.defaultModel })).result;
423
424
  }
424
425
  async embed(request) {
425
426
  let response;
@@ -1,3 +1,4 @@
1
+ import { GoodVibesSdkError } from '../../errors/index.js';
1
2
  /**
2
3
  * Thrown by {@link ProviderRegistry.require} when no provider with the given ID
3
4
  * is registered.
@@ -6,7 +7,8 @@
6
7
  * so callers can quickly see what is available without having to inspect the
7
8
  * registry separately.
8
9
  */
9
- export declare class ProviderNotFoundError extends Error {
10
+ export declare class ProviderNotFoundError extends GoodVibesSdkError {
11
+ readonly code: 'PROVIDER_NOT_FOUND';
10
12
  /** The provider ID that was requested. */
11
13
  readonly providerId: string;
12
14
  /** Sorted list of currently-registered provider IDs at the time of the error. */
@@ -1 +1 @@
1
- {"version":3,"file":"provider-not-found-error.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/provider-not-found-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;gBAE7B,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE;CAY7D"}
1
+ {"version":3,"file":"provider-not-found-error.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/provider-not-found-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,iBAAiB;IAC1D,SAAiB,IAAI,EAAE,oBAAoB,CAAC;IAC5C,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;gBAE7B,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE;CAW7D"}
@@ -1,3 +1,4 @@
1
+ import { GoodVibesSdkError } from '../../errors/index.js';
1
2
  /**
2
3
  * Thrown by {@link ProviderRegistry.require} when no provider with the given ID
3
4
  * is registered.
@@ -6,7 +7,7 @@
6
7
  * so callers can quickly see what is available without having to inspect the
7
8
  * registry separately.
8
9
  */
9
- export class ProviderNotFoundError extends Error {
10
+ export class ProviderNotFoundError extends GoodVibesSdkError {
10
11
  /** The provider ID that was requested. */
11
12
  providerId;
12
13
  /** Sorted list of currently-registered provider IDs at the time of the error. */
@@ -14,11 +15,9 @@ export class ProviderNotFoundError extends Error {
14
15
  constructor(providerId, available) {
15
16
  const ids = available.length > 0 ? available.join(', ') : '(none)';
16
17
  super(`Provider '${providerId}' is not registered. ` +
17
- `Available providers: ${ids}`);
18
+ `Available providers: ${ids}`, { code: 'PROVIDER_NOT_FOUND', category: 'not_found', source: 'provider', recoverable: false });
18
19
  this.name = 'ProviderNotFoundError';
19
20
  this.providerId = providerId;
20
21
  this.availableIds = available;
21
- // Maintains proper prototype chain for instanceof checks
22
- Object.setPrototypeOf(this, new.target.prototype);
23
22
  }
24
23
  }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Well-known local LLM service endpoints and ports.
3
+ *
4
+ * These are **fallback defaults** used for zero-config local LLM discovery when
5
+ * no explicit base URL has been provided by the user. They represent the
6
+ * conventional ports that popular local inference servers listen on out of the box.
7
+ *
8
+ * Usage:
9
+ * - Import the base URL when building a default `baseURL` string literal.
10
+ * - Import the port when doing port-based fingerprinting in the scanner.
11
+ * - Never use these to override a user-supplied config value.
12
+ *
13
+ * @module well-known-endpoints
14
+ */
15
+ /**
16
+ * Frozen map of well-known local LLM service base URLs.
17
+ *
18
+ * Keys correspond to the canonical service identifier used across the codebase.
19
+ * Values are the bare origin (scheme + host + port, **no trailing slash**).
20
+ * Append a path suffix (e.g. `/v1`) at the call site where the full URL is built.
21
+ */
22
+ export declare const WELL_KNOWN_LOCAL_ENDPOINTS: Readonly<{
23
+ /** Ollama — default listen address (loopback) */
24
+ readonly ollama: "http://127.0.0.1:11434";
25
+ /** LM Studio — default OpenAI-compat server */
26
+ readonly lmStudio: "http://127.0.0.1:1234";
27
+ /** llama.cpp — default HTTP server */
28
+ readonly llamaCpp: "http://localhost:8080";
29
+ /** LiteLLM — default proxy gateway */
30
+ readonly liteLLM: "http://localhost:4000";
31
+ /** Copilot Proxy — operator-managed local gateway */
32
+ readonly copilotProxy: "http://localhost:3000";
33
+ }>;
34
+ /**
35
+ * Frozen map of well-known local LLM service port numbers.
36
+ *
37
+ * Used by the scanner when fingerprinting discovered servers by port. The full
38
+ * `KNOWN_PORTS` scan list is derived from this plus additional ports for less
39
+ * common services.
40
+ */
41
+ export declare const WELL_KNOWN_LOCAL_PORTS: Readonly<{
42
+ readonly ollama: 11434;
43
+ readonly lmStudio: 1234;
44
+ readonly llamaCpp: 8080;
45
+ readonly liteLLM: 4000;
46
+ readonly copilotProxy: 3000;
47
+ /** Oobabooga / Text Generation WebUI (common alt port) */
48
+ readonly jan: 1337;
49
+ readonly gpt4all: 4891;
50
+ readonly koboldCpp: 5001;
51
+ readonly aphrodite: 2242;
52
+ }>;
53
+ //# sourceMappingURL=well-known-endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"well-known-endpoints.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/providers/well-known-endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;IACrC,iDAAiD;;IAEjD,+CAA+C;;IAE/C,sCAAsC;;IAEtC,sCAAsC;;IAEtC,qDAAqD;;EAE5C,CAAC;AAEZ;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;IAMjC,0DAA0D;;;;;EAKjD,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Well-known local LLM service endpoints and ports.
3
+ *
4
+ * These are **fallback defaults** used for zero-config local LLM discovery when
5
+ * no explicit base URL has been provided by the user. They represent the
6
+ * conventional ports that popular local inference servers listen on out of the box.
7
+ *
8
+ * Usage:
9
+ * - Import the base URL when building a default `baseURL` string literal.
10
+ * - Import the port when doing port-based fingerprinting in the scanner.
11
+ * - Never use these to override a user-supplied config value.
12
+ *
13
+ * @module well-known-endpoints
14
+ */
15
+ /**
16
+ * Frozen map of well-known local LLM service base URLs.
17
+ *
18
+ * Keys correspond to the canonical service identifier used across the codebase.
19
+ * Values are the bare origin (scheme + host + port, **no trailing slash**).
20
+ * Append a path suffix (e.g. `/v1`) at the call site where the full URL is built.
21
+ */
22
+ export const WELL_KNOWN_LOCAL_ENDPOINTS = Object.freeze({
23
+ /** Ollama — default listen address (loopback) */
24
+ ollama: 'http://127.0.0.1:11434',
25
+ /** LM Studio — default OpenAI-compat server */
26
+ lmStudio: 'http://127.0.0.1:1234',
27
+ /** llama.cpp — default HTTP server */
28
+ llamaCpp: 'http://localhost:8080',
29
+ /** LiteLLM — default proxy gateway */
30
+ liteLLM: 'http://localhost:4000',
31
+ /** Copilot Proxy — operator-managed local gateway */
32
+ copilotProxy: 'http://localhost:3000',
33
+ });
34
+ /**
35
+ * Frozen map of well-known local LLM service port numbers.
36
+ *
37
+ * Used by the scanner when fingerprinting discovered servers by port. The full
38
+ * `KNOWN_PORTS` scan list is derived from this plus additional ports for less
39
+ * common services.
40
+ */
41
+ export const WELL_KNOWN_LOCAL_PORTS = Object.freeze({
42
+ ollama: 11434,
43
+ lmStudio: 1234,
44
+ llamaCpp: 8080,
45
+ liteLLM: 4000,
46
+ copilotProxy: 3000,
47
+ /** Oobabooga / Text Generation WebUI (common alt port) */
48
+ jan: 1337,
49
+ gpt4all: 4891,
50
+ koboldCpp: 5001,
51
+ aphrodite: 2242,
52
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"oauth-core.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/runtime/auth/oauth-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,wBAAgB,gBAAgB,CAAC,KAAK,SAAK,GAAG,MAAM,CAEnD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,SAAK,GAAG,MAAM,CAErD;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAI5E;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mB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C,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAI5E;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,KAAK,CAAC,EAAE;IACN,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,GACA,OAAO,CAAC,eAAe,CAAC,CA4B1B;AA4CD,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE;IACL,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAc5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAa9E"}
@@ -1,4 +1,5 @@
1
1
  import { createSha256Hash, randomBytesBase64url } from './crypto-adapter.js';
2
+ import { instrumentedFetch } from '../../utils/fetch-with-timeout.js';
2
3
  export function createOAuthState(bytes = 24) {
3
4
  return randomBytesBase64url(bytes);
4
5
  }
@@ -47,7 +48,7 @@ async function exchangeOAuthRequest(url, encoding, payload) {
47
48
  const body = encoding === 'json'
48
49
  ? JSON.stringify(payload)
49
50
  : new URLSearchParams(Object.entries(payload).map(([key, value]) => [key, String(value)])).toString();
50
- const response = await fetch(url, {
51
+ const response = await instrumentedFetch(url, {
51
52
  method: 'POST',
52
53
  headers: {
53
54
  'Content-Type': encoding === 'json' ? 'application/json' : 'application/x-www-form-urlencoded',
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/runtime/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAUjD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI;IACxC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,EAAE,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;CAC9C,CAsGA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/runtime/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAYjD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI;IACxC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,EAAE,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;CAC9C,CAsGA"}
@@ -20,11 +20,7 @@ export * from './version.js';
20
20
  export * from './validators/index.js';
21
21
  import { MigrationRegistry } from './migrations/index.js';
22
22
  import { SCHEMA_VERSIONS, MIN_SUPPORTED_VERSIONS } from './version.js';
23
- import { getRuntimeStateMigrationSteps } from './migrations/runtime-state.js';
24
- import { getEventEnvelopeMigrationSteps } from './migrations/event-envelope.js';
25
- import { getSessionMigrationSteps } from './migrations/session.js';
26
- import { getPluginManifestMigrationSteps } from './migrations/plugin-manifest.js';
27
- import { getTaskRecordMigrationSteps } from './migrations/task-record.js';
23
+ import { getRuntimeStateMigrationSteps, getEventEnvelopeMigrationSteps, getSessionMigrationSteps, getPluginManifestMigrationSteps, getTaskRecordMigrationSteps, } from './migrations/schemas.js';
28
24
  import { validateRuntimeState } from './validators/runtime-state.js';
29
25
  import { validateEventEnvelope } from './validators/event-envelope.js';
30
26
  import { validateSession } from './validators/session.js';
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Compatibility Contracts — Consolidated Migration Schemas
3
+ *
4
+ * All domain migration steps in one place. Each schema section:
5
+ * - Declares a private `_STEPS` array (MigrationStep[])
6
+ * - Exports a `_VERSION` constant (re-exported from SCHEMA_VERSIONS)
7
+ * - Exports a `get…MigrationSteps()` function for the contract registry
8
+ *
9
+ * Previously split across 5 stub files; consolidated here for DRY.
10
+ * Split back out if any individual contract accumulates > 10 migration steps.
11
+ *
12
+ * All migration functions must be pure — no mutations, no side effects.
13
+ *
14
+ * @module contracts/migrations/schemas
15
+ */
16
+ import type { MigrationStep } from '../types.js';
17
+ /** The current EventEnvelope schema version (re-exported for convenience). */
18
+ export declare const EVENT_ENVELOPE_VERSION: {
19
+ readonly major: 1;
20
+ readonly minor: 1;
21
+ readonly patch: 0;
22
+ };
23
+ /** Returns all EventEnvelope migration steps. Used by the contract registry. */
24
+ export declare function getEventEnvelopeMigrationSteps(): MigrationStep[];
25
+ /** The current PluginManifest schema version (re-exported for convenience). */
26
+ export declare const PLUGIN_MANIFEST_VERSION: {
27
+ readonly major: 1;
28
+ readonly minor: 0;
29
+ readonly patch: 0;
30
+ };
31
+ /** Returns all PluginManifest migration steps. Used by the contract registry. */
32
+ export declare function getPluginManifestMigrationSteps(): MigrationStep[];
33
+ /** The current RuntimeState schema version (re-exported for convenience). */
34
+ export declare const RUNTIME_STATE_VERSION: {
35
+ readonly major: 1;
36
+ readonly minor: 0;
37
+ readonly patch: 0;
38
+ };
39
+ /** Returns all RuntimeState migration steps. Used by the contract registry. */
40
+ export declare function getRuntimeStateMigrationSteps(): MigrationStep[];
41
+ /** The current Session schema version (re-exported for convenience). */
42
+ export declare const SESSION_VERSION: {
43
+ readonly major: 1;
44
+ readonly minor: 0;
45
+ readonly patch: 0;
46
+ };
47
+ /** Returns all Session migration steps. Used by the contract registry. */
48
+ export declare function getSessionMigrationSteps(): MigrationStep[];
49
+ /** The current TaskRecord schema version (re-exported for convenience). */
50
+ export declare const TASK_RECORD_VERSION: {
51
+ readonly major: 1;
52
+ readonly minor: 0;
53
+ readonly patch: 0;
54
+ };
55
+ /** Returns all TaskRecord migration steps. Used by the contract registry. */
56
+ export declare function getTaskRecordMigrationSteps(): MigrationStep[];
57
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/runtime/contracts/migrations/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA2BjD,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB;;;;CAAgC,CAAC;AAEpE,gFAAgF;AAChF,wBAAgB,8BAA8B,IAAI,aAAa,EAAE,CAEhE;AA0BD,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB;;;;CAAiC,CAAC;AAEtE,iFAAiF;AACjF,wBAAgB,+BAA+B,IAAI,aAAa,EAAE,CAEjE;AA0BD,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;CAA+B,CAAC;AAElE,+EAA+E;AAC/E,wBAAgB,6BAA6B,IAAI,aAAa,EAAE,CAE/D;AA2BD,wEAAwE;AACxE,eAAO,MAAM,eAAe;;;;CAA0B,CAAC;AAEvD,0EAA0E;AAC1E,wBAAgB,wBAAwB,IAAI,aAAa,EAAE,CAE1D;AA0BD,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB;;;;CAA6B,CAAC;AAE9D,6EAA6E;AAC7E,wBAAgB,2BAA2B,IAAI,aAAa,EAAE,CAE7D"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Compatibility Contracts — Consolidated Migration Schemas
3
+ *
4
+ * All domain migration steps in one place. Each schema section:
5
+ * - Declares a private `_STEPS` array (MigrationStep[])
6
+ * - Exports a `_VERSION` constant (re-exported from SCHEMA_VERSIONS)
7
+ * - Exports a `get…MigrationSteps()` function for the contract registry
8
+ *
9
+ * Previously split across 5 stub files; consolidated here for DRY.
10
+ * Split back out if any individual contract accumulates > 10 migration steps.
11
+ *
12
+ * All migration functions must be pure — no mutations, no side effects.
13
+ *
14
+ * @module contracts/migrations/schemas
15
+ */
16
+ import { SCHEMA_VERSIONS } from '../version.js';
17
+ // ─── EventEnvelope ────────────────────────────────────────────────────────────
18
+ /**
19
+ * All registered EventEnvelope migration steps.
20
+ *
21
+ * Currently empty — the schema is at its initial version (1.0.0).
22
+ * Future steps must be appended here and registered via the contract registry.
23
+ *
24
+ * Example: if `agentId` becomes required in v1.1.0, a migration step would
25
+ * backfill it with a sentinel value for older persisted envelopes.
26
+ */
27
+ const EVENT_ENVELOPE_STEPS = [
28
+ // Example structure for future use:
29
+ // {
30
+ // from: { major: 1, minor: 0, patch: 0 },
31
+ // to: { major: 1, minor: 1, patch: 0 },
32
+ // description: 'Backfill missing agentId with null sentinel',
33
+ // migrate: (data: unknown): unknown => {
34
+ // const d = data as Record<string, unknown>;
35
+ // return { ...d, agentId: d['agentId'] ?? null };
36
+ // },
37
+ // },
38
+ ];
39
+ /** The current EventEnvelope schema version (re-exported for convenience). */
40
+ export const EVENT_ENVELOPE_VERSION = SCHEMA_VERSIONS.eventEnvelope;
41
+ /** Returns all EventEnvelope migration steps. Used by the contract registry. */
42
+ export function getEventEnvelopeMigrationSteps() {
43
+ return EVENT_ENVELOPE_STEPS;
44
+ }
45
+ // ─── PluginManifest ───────────────────────────────────────────────────────────
46
+ /**
47
+ * All registered PluginManifest migration steps.
48
+ *
49
+ * Currently empty — the schema is at its initial version (1.0.0).
50
+ * Future steps must be appended here and registered via the contract registry.
51
+ *
52
+ * Example: if `capabilities` becomes an explicit array in v1.1.0, a migration
53
+ * step would synthesize it from `registerCommand`/`registerTool` declarations.
54
+ */
55
+ const PLUGIN_MANIFEST_STEPS = [
56
+ // Example structure for future use:
57
+ // {
58
+ // from: { major: 1, minor: 0, patch: 0 },
59
+ // to: { major: 1, minor: 1, patch: 0 },
60
+ // description: 'Add capabilities array to plugin manifest',
61
+ // migrate: (data: unknown): unknown => {
62
+ // const d = data as Record<string, unknown>;
63
+ // return { ...d, capabilities: d['capabilities'] ?? [] };
64
+ // },
65
+ // },
66
+ ];
67
+ /** The current PluginManifest schema version (re-exported for convenience). */
68
+ export const PLUGIN_MANIFEST_VERSION = SCHEMA_VERSIONS.pluginManifest;
69
+ /** Returns all PluginManifest migration steps. Used by the contract registry. */
70
+ export function getPluginManifestMigrationSteps() {
71
+ return PLUGIN_MANIFEST_STEPS;
72
+ }
73
+ // ─── RuntimeState ─────────────────────────────────────────────────────────────
74
+ /**
75
+ * All registered RuntimeState migration steps.
76
+ *
77
+ * Currently empty — the schema is at its initial version (1.0.0).
78
+ * Future steps must be appended here and registered via the contract registry.
79
+ *
80
+ * Example: if `uiSettings` is added in v1.1.0, a step would backfill it with
81
+ * default values for existing persisted snapshots.
82
+ */
83
+ const RUNTIME_STATE_STEPS = [
84
+ // Example structure for future use:
85
+ // {
86
+ // from: { major: 1, minor: 0, patch: 0 },
87
+ // to: { major: 1, minor: 1, patch: 0 },
88
+ // description: 'Add optional uiSettings field with defaults',
89
+ // migrate: (data: unknown): unknown => {
90
+ // const d = data as Record<string, unknown>;
91
+ // return { ...d, uiSettings: d['uiSettings'] ?? { theme: 'dark' } };
92
+ // },
93
+ // },
94
+ ];
95
+ /** The current RuntimeState schema version (re-exported for convenience). */
96
+ export const RUNTIME_STATE_VERSION = SCHEMA_VERSIONS.runtimeState;
97
+ /** Returns all RuntimeState migration steps. Used by the contract registry. */
98
+ export function getRuntimeStateMigrationSteps() {
99
+ return RUNTIME_STATE_STEPS;
100
+ }
101
+ // ─── Session ──────────────────────────────────────────────────────────────────
102
+ /**
103
+ * All registered Session migration steps.
104
+ *
105
+ * Currently empty — the schema is at its initial version (1.0.0).
106
+ * Future steps must be appended here and registered via the contract registry.
107
+ *
108
+ * Example: if session files gain a `tags` array in v1.1.0, a migration step
109
+ * would backfill it as an empty array for existing sessions.
110
+ */
111
+ const SESSION_STEPS = [
112
+ // Example structure for future use:
113
+ // {
114
+ // from: { major: 1, minor: 0, patch: 0 },
115
+ // to: { major: 1, minor: 1, patch: 0 },
116
+ // description: 'Add empty tags array to session meta',
117
+ // migrate: (data: unknown): unknown => {
118
+ // const d = data as Record<string, unknown>;
119
+ // const meta = d['meta'] as Record<string, unknown>;
120
+ // return { ...d, meta: { ...meta, tags: meta['tags'] ?? [] } };
121
+ // },
122
+ // },
123
+ ];
124
+ /** The current Session schema version (re-exported for convenience). */
125
+ export const SESSION_VERSION = SCHEMA_VERSIONS.session;
126
+ /** Returns all Session migration steps. Used by the contract registry. */
127
+ export function getSessionMigrationSteps() {
128
+ return SESSION_STEPS;
129
+ }
130
+ // ─── TaskRecord ───────────────────────────────────────────────────────────────
131
+ /**
132
+ * All registered TaskRecord migration steps.
133
+ *
134
+ * Currently empty — the schema is at its initial version (1.0.0).
135
+ * Future steps must be appended here and registered via the contract registry.
136
+ *
137
+ * Example: if `metadata` map is added to RuntimeTask in v1.1.0, a migration
138
+ * step would backfill it as an empty object for existing persisted records.
139
+ */
140
+ const TASK_RECORD_STEPS = [
141
+ // Example structure for future use:
142
+ // {
143
+ // from: { major: 1, minor: 0, patch: 0 },
144
+ // to: { major: 1, minor: 1, patch: 0 },
145
+ // description: 'Add metadata object to task records',
146
+ // migrate: (data: unknown): unknown => {
147
+ // const d = data as Record<string, unknown>;
148
+ // return { ...d, metadata: d['metadata'] ?? {} };
149
+ // },
150
+ // },
151
+ ];
152
+ /** The current TaskRecord schema version (re-exported for convenience). */
153
+ export const TASK_RECORD_VERSION = SCHEMA_VERSIONS.taskRecord;
154
+ /** Returns all TaskRecord migration steps. Used by the contract registry. */
155
+ export function getTaskRecordMigrationSteps() {
156
+ return TASK_RECORD_STEPS;
157
+ }