@pellux/goodvibes-sdk 1.0.0 → 1.2.0

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 (241) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +2878 -264
  2. package/dist/events/communication.d.ts +1 -1
  3. package/dist/platform/agents/orchestrator-runner.d.ts +5 -5
  4. package/dist/platform/agents/orchestrator-runner.js +6 -6
  5. package/dist/platform/agents/orchestrator.d.ts +4 -4
  6. package/dist/platform/agents/orchestrator.js +2 -2
  7. package/dist/platform/agents/wrfc-controller.d.ts +1 -1
  8. package/dist/platform/agents/wrfc-controller.js +3 -3
  9. package/dist/platform/calendar/index.d.ts +2 -2
  10. package/dist/platform/calendar/index.js +3 -3
  11. package/dist/platform/calendar/oauth-providers.d.ts +1 -1
  12. package/dist/platform/calendar/oauth-providers.js +1 -1
  13. package/dist/platform/calendar/oauth-types.d.ts +1 -1
  14. package/dist/platform/calendar/oauth-types.js +1 -1
  15. package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
  16. package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
  17. package/dist/platform/companion/companion-chat-branching.js +142 -0
  18. package/dist/platform/companion/companion-chat-broker-bridge.d.ts +1 -1
  19. package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -1
  20. package/dist/platform/companion/companion-chat-broker-sync.d.ts +2 -2
  21. package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -1
  22. package/dist/platform/companion/companion-chat-broker-sync.js +1 -1
  23. package/dist/platform/companion/companion-chat-manager.d.ts +26 -5
  24. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  25. package/dist/platform/companion/companion-chat-manager.js +67 -81
  26. package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
  27. package/dist/platform/companion/companion-chat-routes.js +77 -1
  28. package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
  29. package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
  30. package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
  31. package/dist/platform/companion/companion-chat-types.d.ts +67 -0
  32. package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
  33. package/dist/platform/config/credential-status.d.ts +1 -1
  34. package/dist/platform/config/credential-status.js +1 -1
  35. package/dist/platform/config/index.d.ts +1 -1
  36. package/dist/platform/config/index.js +1 -1
  37. package/dist/platform/config/manager.d.ts +1 -1
  38. package/dist/platform/config/manager.js +1 -1
  39. package/dist/platform/config/migrations.d.ts +2 -2
  40. package/dist/platform/config/migrations.js +2 -2
  41. package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
  42. package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
  43. package/dist/platform/config/schema-domain-runtime.js +32 -0
  44. package/dist/platform/config/schema-types.d.ts +10 -2
  45. package/dist/platform/config/schema-types.d.ts.map +1 -1
  46. package/dist/platform/control-plane/gateway-scope-enforcement.js +2 -2
  47. package/dist/platform/control-plane/index.d.ts +2 -0
  48. package/dist/platform/control-plane/index.d.ts.map +1 -1
  49. package/dist/platform/control-plane/index.js +5 -1
  50. package/dist/platform/control-plane/invoke-input-validation.d.ts +1 -1
  51. package/dist/platform/control-plane/invoke-input-validation.js +1 -1
  52. package/dist/platform/control-plane/method-catalog-calendar.d.ts +2 -2
  53. package/dist/platform/control-plane/method-catalog-calendar.js +2 -2
  54. package/dist/platform/control-plane/method-catalog-channels.js +3 -3
  55. package/dist/platform/control-plane/method-catalog-control-automation.js +4 -4
  56. package/dist/platform/control-plane/method-catalog-control-companion.d.ts +1 -1
  57. package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -1
  58. package/dist/platform/control-plane/method-catalog-control-companion.js +43 -0
  59. package/dist/platform/control-plane/method-catalog-control-core.js +3 -3
  60. package/dist/platform/control-plane/method-catalog-email.d.ts +1 -1
  61. package/dist/platform/control-plane/method-catalog-email.js +1 -1
  62. package/dist/platform/control-plane/method-catalog-fleet.d.ts +1 -1
  63. package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
  64. package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
  65. package/dist/platform/control-plane/method-catalog-push.js +80 -0
  66. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +1 -1
  67. package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
  68. package/dist/platform/control-plane/method-catalog-runtime.js +177 -1
  69. package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
  70. package/dist/platform/control-plane/method-catalog.js +2 -0
  71. package/dist/platform/control-plane/operator-contract-schemas-fleet.js +1 -1
  72. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +15 -0
  73. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  74. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +81 -0
  75. package/dist/platform/control-plane/routes/checkpoints.d.ts +1 -1
  76. package/dist/platform/control-plane/routes/fleet.d.ts +2 -2
  77. package/dist/platform/control-plane/routes/fleet.js +1 -1
  78. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +1 -1
  79. package/dist/platform/control-plane/routes/gateway-verb-error.js +1 -1
  80. package/dist/platform/control-plane/routes/index.js +1 -1
  81. package/dist/platform/control-plane/routes/invocation-params.d.ts +1 -1
  82. package/dist/platform/control-plane/routes/push.d.ts +26 -0
  83. package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
  84. package/dist/platform/control-plane/routes/push.js +104 -0
  85. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
  86. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
  87. package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
  88. package/dist/platform/control-plane/routes/register-w3-s2.d.ts +2 -2
  89. package/dist/platform/control-plane/routes/session-search.d.ts +4 -4
  90. package/dist/platform/control-plane/session-broker.d.ts +1 -1
  91. package/dist/platform/control-plane/session-broker.js +1 -1
  92. package/dist/platform/control-plane/session-store-importer.d.ts +1 -1
  93. package/dist/platform/control-plane/session-store-importer.js +1 -1
  94. package/dist/platform/control-plane/session-types.d.ts +1 -1
  95. package/dist/platform/core/orchestrator-runtime.d.ts +4 -4
  96. package/dist/platform/core/orchestrator-tool-runtime.d.ts +1 -1
  97. package/dist/platform/core/orchestrator-turn-loop.d.ts +6 -6
  98. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  99. package/dist/platform/core/orchestrator-turn-loop.js +23 -22
  100. package/dist/platform/core/orchestrator.d.ts +10 -10
  101. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  102. package/dist/platform/core/orchestrator.js +8 -8
  103. package/dist/platform/daemon/boot.d.ts +6 -0
  104. package/dist/platform/daemon/boot.d.ts.map +1 -1
  105. package/dist/platform/daemon/boot.js +1 -0
  106. package/dist/platform/daemon/control-plane.js +2 -2
  107. package/dist/platform/daemon/facade.d.ts +4 -7
  108. package/dist/platform/daemon/facade.d.ts.map +1 -1
  109. package/dist/platform/daemon/facade.js +5 -7
  110. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +1 -1
  111. package/dist/platform/daemon/http/router.d.ts +1 -0
  112. package/dist/platform/daemon/http/router.d.ts.map +1 -1
  113. package/dist/platform/daemon/http/router.js +36 -19
  114. package/dist/platform/daemon/http/runtime-route-types.d.ts +1 -1
  115. package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  116. package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
  117. package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
  118. package/dist/platform/daemon/http/webui-serving.js +230 -0
  119. package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
  120. package/dist/platform/orchestration/budget.d.ts +2 -2
  121. package/dist/platform/orchestration/cancellation.d.ts +2 -2
  122. package/dist/platform/orchestration/controller-compat.d.ts +2 -3
  123. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
  124. package/dist/platform/orchestration/dirty-guard.js +1 -1
  125. package/dist/platform/orchestration/engine.d.ts.map +1 -1
  126. package/dist/platform/orchestration/engine.js +3 -4
  127. package/dist/platform/orchestration/persistence.js +2 -2
  128. package/dist/platform/orchestration/phase-runner.d.ts +4 -4
  129. package/dist/platform/orchestration/scheduler.d.ts +1 -1
  130. package/dist/platform/orchestration/types.d.ts +3 -3
  131. package/dist/platform/presentation/glyphs.d.ts +1 -1
  132. package/dist/platform/presentation/glyphs.js +1 -1
  133. package/dist/platform/presentation/index.d.ts +3 -3
  134. package/dist/platform/presentation/index.js +3 -3
  135. package/dist/platform/presentation/thinking-phrases.d.ts +1 -1
  136. package/dist/platform/presentation/thinking-phrases.js +1 -1
  137. package/dist/platform/presentation/waiting-wording.d.ts +1 -1
  138. package/dist/platform/presentation/waiting-wording.js +1 -1
  139. package/dist/platform/push/delivery.d.ts +48 -0
  140. package/dist/platform/push/delivery.d.ts.map +1 -0
  141. package/dist/platform/push/delivery.js +117 -0
  142. package/dist/platform/push/encryption.d.ts +41 -0
  143. package/dist/platform/push/encryption.d.ts.map +1 -0
  144. package/dist/platform/push/encryption.js +82 -0
  145. package/dist/platform/push/index.d.ts +17 -0
  146. package/dist/platform/push/index.d.ts.map +1 -0
  147. package/dist/platform/push/index.js +10 -0
  148. package/dist/platform/push/service.d.ts +75 -0
  149. package/dist/platform/push/service.d.ts.map +1 -0
  150. package/dist/platform/push/service.js +95 -0
  151. package/dist/platform/push/subscription-store.d.ts +50 -0
  152. package/dist/platform/push/subscription-store.d.ts.map +1 -0
  153. package/dist/platform/push/subscription-store.js +123 -0
  154. package/dist/platform/push/types.d.ts +68 -0
  155. package/dist/platform/push/types.d.ts.map +1 -0
  156. package/dist/platform/push/types.js +13 -0
  157. package/dist/platform/push/vapid.d.ts +54 -0
  158. package/dist/platform/push/vapid.d.ts.map +1 -0
  159. package/dist/platform/push/vapid.js +113 -0
  160. package/dist/platform/runtime/feature-flags/flags.js +3 -3
  161. package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
  162. package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
  163. package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
  164. package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
  165. package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
  166. package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
  167. package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
  168. package/dist/platform/runtime/fleet/adapters/orchestration.js +1 -1
  169. package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
  170. package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
  171. package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
  172. package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
  173. package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
  174. package/dist/platform/runtime/fleet/adapters/wrfc.js +1 -1
  175. package/dist/platform/runtime/fleet/registry.d.ts +7 -7
  176. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
  177. package/dist/platform/runtime/fleet/registry.js +3 -3
  178. package/dist/platform/runtime/fleet/types.d.ts +9 -9
  179. package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
  180. package/dist/platform/runtime/memory-spine/client.d.ts +240 -0
  181. package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
  182. package/dist/platform/runtime/memory-spine/client.js +221 -0
  183. package/dist/platform/runtime/memory-spine/index.d.ts +17 -0
  184. package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
  185. package/dist/platform/runtime/memory-spine/index.js +16 -0
  186. package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts +74 -0
  187. package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts.map +1 -0
  188. package/dist/platform/runtime/memory-spine/recall-snapshot.js +74 -0
  189. package/dist/platform/runtime/operator-client.d.ts +1 -1
  190. package/dist/platform/runtime/services.d.ts +6 -6
  191. package/dist/platform/runtime/services.d.ts.map +1 -1
  192. package/dist/platform/runtime/services.js +9 -9
  193. package/dist/platform/runtime/session-spine/union-cache.d.ts +1 -1
  194. package/dist/platform/runtime/session-spine/union-cache.js +1 -1
  195. package/dist/platform/state/canonical-memory.d.ts +7 -7
  196. package/dist/platform/state/canonical-memory.js +8 -8
  197. package/dist/platform/state/code-index-chunking.js +1 -1
  198. package/dist/platform/state/code-index-db.d.ts +1 -1
  199. package/dist/platform/state/code-index-store.js +1 -1
  200. package/dist/platform/state/index.d.ts +2 -2
  201. package/dist/platform/state/index.d.ts.map +1 -1
  202. package/dist/platform/state/index.js +1 -1
  203. package/dist/platform/state/memory-recall-contract.d.ts +59 -4
  204. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -1
  205. package/dist/platform/state/memory-recall-contract.js +79 -3
  206. package/dist/platform/state/memory-registry.d.ts +8 -0
  207. package/dist/platform/state/memory-registry.d.ts.map +1 -1
  208. package/dist/platform/state/memory-registry.js +10 -0
  209. package/dist/platform/state/memory-vector-store.js +1 -1
  210. package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
  211. package/dist/platform/state/sqlite-vec-loader.js +1 -1
  212. package/dist/platform/state/vibe-projection.d.ts +3 -3
  213. package/dist/platform/state/vibe-projection.js +3 -3
  214. package/dist/platform/tools/agent/manager.d.ts +10 -10
  215. package/dist/platform/tools/agent/manager.js +7 -7
  216. package/dist/platform/tools/exec/runtime.js +5 -5
  217. package/dist/platform/tools/exec/schema.d.ts +1 -1
  218. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  219. package/dist/platform/tools/fetch/runtime.d.ts +1 -1
  220. package/dist/platform/tools/registry.d.ts +1 -1
  221. package/dist/platform/tools/registry.js +1 -1
  222. package/dist/platform/types/tools.d.ts +1 -1
  223. package/dist/platform/utils/request-body.d.ts.map +1 -1
  224. package/dist/platform/utils/request-body.js +50 -5
  225. package/dist/platform/version.js +1 -1
  226. package/dist/platform/voice/index.d.ts +2 -0
  227. package/dist/platform/voice/index.d.ts.map +1 -1
  228. package/dist/platform/voice/index.js +3 -0
  229. package/dist/platform/voice/spoken-turn/audio-sink.d.ts +111 -0
  230. package/dist/platform/voice/spoken-turn/audio-sink.d.ts.map +1 -0
  231. package/dist/platform/voice/spoken-turn/audio-sink.js +1 -0
  232. package/dist/platform/voice/spoken-turn/controller.d.ts +117 -0
  233. package/dist/platform/voice/spoken-turn/controller.d.ts.map +1 -0
  234. package/dist/platform/voice/spoken-turn/controller.js +448 -0
  235. package/dist/platform/voice/spoken-turn/index.d.ts +16 -0
  236. package/dist/platform/voice/spoken-turn/index.d.ts.map +1 -0
  237. package/dist/platform/voice/spoken-turn/index.js +12 -0
  238. package/dist/platform/voice/spoken-turn/text-chunker.d.ts +33 -0
  239. package/dist/platform/voice/spoken-turn/text-chunker.d.ts.map +1 -0
  240. package/dist/platform/voice/spoken-turn/text-chunker.js +97 -0
  241. package/package.json +13 -9
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * gateway-verb-error.ts
3
3
  *
4
- * W3-S2 (fleet.*, checkpoints.*, sessions.search): a structured error for
4
+ * (fleet.*, checkpoints.*, sessions.search — see CHANGELOG 1.0.0): a structured error for
5
5
  * gateway methods registered with a direct handler via
6
6
  * `GatewayMethodCatalog.register(descriptor, handler)`.
7
7
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * gateway-verb-error.ts
3
3
  *
4
- * W3-S2 (fleet.*, checkpoints.*, sessions.search): a structured error for
4
+ * (fleet.*, checkpoints.*, sessions.search — see CHANGELOG 1.0.0): a structured error for
5
5
  * gateway methods registered with a direct handler via
6
6
  * `GatewayMethodCatalog.register(descriptor, handler)`.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  // The live daemon route dispatch is daemon-sdk's; this barrel re-exports it.
2
2
  // The former sdk-local dispatcher copies (automation/tasks/operator/remote/
3
3
  // sessions + their context types) were a superseded, unreachable parallel —
4
- // deleted in the Wave-1 spine integration cleanup (0 callers, 0 api.md
4
+ // deleted in the session-spine integration cleanup (see CHANGELOG 1.0.0; 0 callers, 0 api.md
5
5
  // presence; every test imports the daemon-sdk originals). Pay-its-way rule.
6
6
  export { dispatchDaemonApiRoutes } from './api-router.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * routes/invocation-params.ts
3
3
  *
4
- * W3-S2 (post-S1 alignment) — one params view for the handler-registered
4
+ * (see CHANGELOG 1.0.0, post-S1 alignment) — one params view for the handler-registered
5
5
  * verbs (fleet.*, checkpoints.*, sessions.search).
6
6
  *
7
7
  * S1's invoke-layer input gate (invoke-input-validation.ts, wired in
@@ -0,0 +1,26 @@
1
+ /**
2
+ * routes/push.ts
3
+ *
4
+ * Attaches the `push.*` gateway-method handlers to the descriptors declared in
5
+ * ../method-catalog-push.ts. Same mechanism fleet.* uses:
6
+ * `catalog.register(descriptor, handler)`, reached over real HTTP through the
7
+ * generic `/api/control-plane/methods/{id}/invoke` endpoint — no new REST route
8
+ * in the external daemon-sdk package, no router change.
9
+ *
10
+ * Every write is scoped to the authenticated principal (the operator identity
11
+ * the invoke layer resolved), so one operator can neither read, delete, nor
12
+ * test another operator's registered devices.
13
+ */
14
+ import type { GatewayMethodCatalog } from '../method-catalog.js';
15
+ import type { PushService } from '../../push/index.js';
16
+ /** The narrow slice of PushService these verbs need. */
17
+ export type PushGatewayService = Pick<PushService, 'getPublicKey' | 'subscribe' | 'listSubscriptions' | 'unsubscribe' | 'verify'>;
18
+ /**
19
+ * Attach the `push.*` handlers to their already-cataloged descriptors. Call
20
+ * once, at RuntimeServices construction time, after the PushService exists. A
21
+ * missing descriptor (contract/registration drift) is a silent no-op rather
22
+ * than a throw — construction must never fail because one wire verb failed to
23
+ * register; the operator-contract gates catch a real drift.
24
+ */
25
+ export declare function registerPushGatewayMethods(catalog: GatewayMethodCatalog, service: PushGatewayService): void;
26
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../../src/platform/control-plane/routes/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,wDAAwD;AACxD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,WAAW,EACX,cAAc,GAAG,WAAW,GAAG,mBAAmB,GAAG,aAAa,GAAG,QAAQ,CAC9E,CAAC;AAkGF;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAO3G"}
@@ -0,0 +1,104 @@
1
+ import { GatewayVerbError } from './gateway-verb-error.js';
2
+ import { readInvocationParams } from './invocation-params.js';
3
+ function requirePrincipal(invocation) {
4
+ const principalId = invocation.context.principalId;
5
+ if (!principalId) {
6
+ throw new GatewayVerbError('Push verbs require an authenticated principal', 'UNAUTHENTICATED', 401);
7
+ }
8
+ return principalId;
9
+ }
10
+ function requireString(value, field) {
11
+ if (typeof value !== 'string' || value.trim().length === 0) {
12
+ throw new GatewayVerbError(`Missing or invalid ${field}`, 'INVALID_ARGUMENT', 400);
13
+ }
14
+ return value;
15
+ }
16
+ function requireHttpsEndpoint(value) {
17
+ const endpoint = requireString(value, 'endpoint');
18
+ let parsed;
19
+ try {
20
+ parsed = new URL(endpoint);
21
+ }
22
+ catch {
23
+ throw new GatewayVerbError('endpoint is not a valid URL', 'INVALID_ARGUMENT', 400);
24
+ }
25
+ if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
26
+ throw new GatewayVerbError('endpoint must be an http(s) URL', 'INVALID_ARGUMENT', 400);
27
+ }
28
+ return endpoint;
29
+ }
30
+ function requireKeys(value) {
31
+ if (value === null || typeof value !== 'object') {
32
+ throw new GatewayVerbError('Missing subscription keys', 'INVALID_ARGUMENT', 400);
33
+ }
34
+ const keys = value;
35
+ return {
36
+ p256dh: requireString(keys.p256dh, 'keys.p256dh'),
37
+ auth: requireString(keys.auth, 'keys.auth'),
38
+ };
39
+ }
40
+ function createVapidGetHandler(service) {
41
+ return async () => ({ publicKey: await service.getPublicKey() });
42
+ }
43
+ function createSubscribeHandler(service) {
44
+ return async (invocation) => {
45
+ const principalId = requirePrincipal(invocation);
46
+ const params = readInvocationParams(invocation);
47
+ const endpoint = requireHttpsEndpoint(params.endpoint);
48
+ const keys = requireKeys(params.keys);
49
+ const subscription = await service.subscribe({ principalId, endpoint, keys });
50
+ return { subscription };
51
+ };
52
+ }
53
+ function createListHandler(service) {
54
+ return async (invocation) => {
55
+ const principalId = requirePrincipal(invocation);
56
+ return { subscriptions: await service.listSubscriptions(principalId) };
57
+ };
58
+ }
59
+ function createDeleteHandler(service) {
60
+ return async (invocation) => {
61
+ const principalId = requirePrincipal(invocation);
62
+ const params = readInvocationParams(invocation);
63
+ const subscriptionId = requireString(params.subscriptionId, 'subscriptionId');
64
+ const deleted = await service.unsubscribe(subscriptionId, principalId);
65
+ if (!deleted) {
66
+ throw new GatewayVerbError('Unknown push subscription', 'SUBSCRIPTION_NOT_FOUND', 404);
67
+ }
68
+ return { subscriptionId, deleted: true };
69
+ };
70
+ }
71
+ function createVerifyHandler(service) {
72
+ return async (invocation) => {
73
+ const principalId = requirePrincipal(invocation);
74
+ const params = readInvocationParams(invocation);
75
+ const subscriptionId = requireString(params.subscriptionId, 'subscriptionId');
76
+ const receipt = await service.verify(subscriptionId, principalId);
77
+ if (!receipt) {
78
+ throw new GatewayVerbError('Unknown push subscription', 'SUBSCRIPTION_NOT_FOUND', 404);
79
+ }
80
+ return { receipt };
81
+ };
82
+ }
83
+ const PUSH_HANDLER_FACTORIES = {
84
+ 'push.vapid.get': createVapidGetHandler,
85
+ 'push.subscriptions.create': createSubscribeHandler,
86
+ 'push.subscriptions.list': createListHandler,
87
+ 'push.subscriptions.delete': createDeleteHandler,
88
+ 'push.subscriptions.verify': createVerifyHandler,
89
+ };
90
+ /**
91
+ * Attach the `push.*` handlers to their already-cataloged descriptors. Call
92
+ * once, at RuntimeServices construction time, after the PushService exists. A
93
+ * missing descriptor (contract/registration drift) is a silent no-op rather
94
+ * than a throw — construction must never fail because one wire verb failed to
95
+ * register; the operator-contract gates catch a real drift.
96
+ */
97
+ export function registerPushGatewayMethods(catalog, service) {
98
+ for (const [methodId, factory] of Object.entries(PUSH_HANDLER_FACTORIES)) {
99
+ const descriptor = catalog.get(methodId);
100
+ if (descriptor) {
101
+ catalog.register(descriptor, factory(service), { replace: true });
102
+ }
103
+ }
104
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * routes/register-gateway-verb-groups.ts
3
+ *
4
+ * One entry point the runtime-services composition root calls to attach every
5
+ * handler-registered gateway verb group, so services.ts needs a single import
6
+ * and a single call regardless of how many groups exist.
7
+ *
8
+ * It folds in the pre-existing fleet / checkpoints / sessions.search group
9
+ * (registerW3S2GatewayMethods, unchanged) and constructs + wires the browser-
10
+ * push group: a PushService over the subscription store and VAPID key custody,
11
+ * its verb handlers, and — the real event source — a subscription to the
12
+ * approval broker so an approval that needs a decision fans out as a push to the
13
+ * operator's registered devices.
14
+ */
15
+ import type { GatewayMethodCatalog } from '../method-catalog.js';
16
+ import { type W3S2GatewayDeps } from './register-w3-s2.js';
17
+ import { type ApprovalSource, type VapidSecretStore } from '../../push/index.js';
18
+ export interface GatewayVerbGroupDeps extends W3S2GatewayDeps {
19
+ /** SecretsManager (get/set) — VAPID keypair custody lives here, never in config. */
20
+ readonly secretsManager: VapidSecretStore;
21
+ /** The approval broker — the real event source push fans out from. */
22
+ readonly approvalBroker: ApprovalSource;
23
+ /** Home-scoped path service; the subscription store file resolves under it. */
24
+ readonly shellPaths: {
25
+ resolveUserPath(...segments: string[]): string;
26
+ };
27
+ /** Optional VAPID JWT `sub` contact. */
28
+ readonly vapidSubject?: string | undefined;
29
+ }
30
+ export declare function registerGatewayVerbGroups(catalog: GatewayMethodCatalog, deps: GatewayVerbGroupDeps): void;
31
+ //# sourceMappingURL=register-gateway-verb-groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-gateway-verb-groups.d.ts","sourceRoot":"","sources":["../../../../src/platform/control-plane/routes/register-gateway-verb-groups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,oFAAoF;IACpF,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAC1C,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE;QAAE,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;KAAE,CAAC;IACxE,wCAAwC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAezG"}
@@ -0,0 +1,16 @@
1
+ import { registerW3S2GatewayMethods } from './register-w3-s2.js';
2
+ import { registerPushGatewayMethods } from './push.js';
3
+ import { PushService, PushSubscriptionStore, VapidManager, } from '../../push/index.js';
4
+ export function registerGatewayVerbGroups(catalog, deps) {
5
+ registerW3S2GatewayMethods(catalog, deps);
6
+ const pushService = new PushService({
7
+ vapid: new VapidManager(deps.secretsManager, { subject: deps.vapidSubject }),
8
+ store: new PushSubscriptionStore(deps.shellPaths.resolveUserPath('control-plane', 'push-subscriptions.json')),
9
+ });
10
+ registerPushGatewayMethods(catalog, pushService);
11
+ // Real event source: approvals-needed -> push to every registered device.
12
+ // The unsubscribe handle is intentionally not retained — the subscription
13
+ // lives for the daemon's lifetime, exactly like the fleet/checkpoint verb
14
+ // registrations above (there is no RuntimeServices-wide shutdown seam yet).
15
+ pushService.attachApprovalSource(deps.approvalBroker);
16
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * routes/register-w3-s2.ts
3
3
  *
4
- * Single composite entry point for W3-S2's three verb-registration calls
5
- * (fleet.*, checkpoints.*, sessions.search), so ../../runtime/services.ts —
4
+ * Single composite entry point for the fleet.*, checkpoints.*, sessions.search
5
+ * verb-registration calls (see CHANGELOG 1.0.0), so ../../runtime/services.ts —
6
6
  * already at its line-cap ceiling — only needs one import and one call
7
7
  * instead of three of each. See routes/fleet.ts, routes/checkpoints.ts, and
8
8
  * routes/session-search.ts for what each registration actually does and why
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * routes/session-search.ts
3
3
  *
4
- * W3-S2 — `sessions.search`: a paginated/filtered query over the
4
+ * `sessions.search` (see CHANGELOG 1.0.0): a paginated/filtered query over the
5
5
  * ALREADY-daemon-resident `SharedSessionBroker`'s home-scoped store,
6
- * extending the Wave-1 list-filter shape (`ListSharedSessionsOptions`:
6
+ * extending the session-spine list-filter shape (`ListSharedSessionsOptions`:
7
7
  * project/kind/includeClosed) with a free-text `query`, `surfaceKind`,
8
8
  * `status`, and opaque cursor pagination (mirrors the
9
9
  * daemon-sdk `paginateItems` convention already used by
@@ -16,9 +16,9 @@
16
16
  * is built from the broker's existing public `listSessions()` — no new
17
17
  * broker state, no new broker method.
18
18
  *
19
- * Bounded in-memory filter+sort (risk #3, W3-S2 brief): the store is
19
+ * Bounded in-memory filter+sort: the store is
20
20
  * single-user scale, so a full unbounded scan per call is intentional (no
21
- * index) — see the brief's decision record for the documented ceiling.
21
+ * index) — this ceiling is a deliberate, documented decision.
22
22
  */
23
23
  import type { GatewayMethodCatalog } from '../method-catalog.js';
24
24
  import type { GatewayMethodHandler } from '../method-catalog-shared.js';
@@ -77,7 +77,7 @@ export declare class SharedSessionBroker {
77
77
  reopenSession(sessionId: string): Promise<SharedSessionRecord | null>;
78
78
  /**
79
79
  * Permanently remove a shared session record and its queued messages/inputs
80
- * from the home-scoped store (W5-S1: a real hard-delete verb, distinct from
80
+ * from the home-scoped store (see CHANGELOG 1.0.0: a real hard-delete verb, distinct from
81
81
  * `closeSession` — closed sessions are HISTORY and are never touched by this
82
82
  * path unless explicitly asked). Requires the session to already be closed:
83
83
  * deleting a still-active session returns `'active'` so the caller can
@@ -260,7 +260,7 @@ export class SharedSessionBroker {
260
260
  }
261
261
  /**
262
262
  * Permanently remove a shared session record and its queued messages/inputs
263
- * from the home-scoped store (W5-S1: a real hard-delete verb, distinct from
263
+ * from the home-scoped store (see CHANGELOG 1.0.0: a real hard-delete verb, distinct from
264
264
  * `closeSession` — closed sessions are HISTORY and are never touched by this
265
265
  * path unless explicitly asked). Requires the session to already be closed:
266
266
  * deleting a still-active session returns `'active'` so the caller can
@@ -5,7 +5,7 @@
5
5
  * home-scoped durable broker store. Idempotent and safe to run repeatedly — the
6
6
  * merge is keyed on session id, so a re-run over the same sources is a no-op.
7
7
  *
8
- * Sources folded in (One-Platform Wave 1, S1 spine):
8
+ * Sources folded in (the one-broker session-spine effort, see CHANGELOG 1.0.0, S1 spine):
9
9
  * 1. Companion chat files — ~/.goodvibes/companion-chat/sessions/*.json
10
10
  * (home-scoped, projectless → project 'unknown'); INCLUDING closed sessions.
11
11
  * 2. Per-project broker snapshots — <root>/.goodvibes/<surface>/control-plane/
@@ -5,7 +5,7 @@
5
5
  * home-scoped durable broker store. Idempotent and safe to run repeatedly — the
6
6
  * merge is keyed on session id, so a re-run over the same sources is a no-op.
7
7
  *
8
- * Sources folded in (One-Platform Wave 1, S1 spine):
8
+ * Sources folded in (the one-broker session-spine effort, see CHANGELOG 1.0.0, S1 spine):
9
9
  * 1. Companion chat files — ~/.goodvibes/companion-chat/sessions/*.json
10
10
  * (home-scoped, projectless → project 'unknown'); INCLUDING closed sessions.
11
11
  * 2. Per-project broker snapshots — <root>/.goodvibes/<surface>/control-plane/
@@ -55,7 +55,7 @@ export type SharedSessionKind = 'tui' | 'agent' | 'webui' | 'companion-task' | '
55
55
  * session the SYSTEM closed underneath it is not a conflict).
56
56
  * - 'user' / 'surface': a deliberate close. It does NOT auto-reopen — register
57
57
  * records the heartbeat and returns the still-closed record with a conflict
58
- * marker unless `reopen: true` is passed (the Wave-1 honest-register semantics).
58
+ * marker unless `reopen: true` is passed (the session-spine honest-register semantics, see CHANGELOG 1.0.0).
59
59
  *
60
60
  * Carried on the record under `metadata[SESSION_CLOSE_REASON_METADATA_KEY]` so it
61
61
  * rides the wire without a schema change and old readers ignore it (metadata is
@@ -21,17 +21,17 @@ export type OrchestratorCoreServices = {
21
21
  sessionMemoryStore?: Pick<SessionMemoryStore, 'list'> | undefined;
22
22
  favoritesStore?: Pick<FavoritesStore, 'recordUsage'> | undefined;
23
23
  /**
24
- * Wave-5 (wo805) narrow injection seam for the MAIN interactive session's per-turn
24
+ * Narrow injection seam for the MAIN interactive session's per-turn
25
25
  * passive knowledge injection (see core/orchestrator-turn-loop.ts). Optional/undefined
26
26
  * is a hard no-op — the feature never runs and the base system prompt is
27
- * byte-identical, matching the agent path's (wo801) `memoryRegistry` semantics. Wired
27
+ * byte-identical, matching the agent path's `memoryRegistry` semantics. Wired
28
28
  * in post-construction via `Orchestrator.setCoreServices({ memoryRegistry })` since,
29
29
  * like `sessionMemoryStore`/`planManager` above, it is not required at construction
30
30
  * time.
31
31
  */
32
32
  memoryRegistry?: TurnKnowledgeRegistrySource | undefined;
33
33
  /**
34
- * Wave-5 Stage B code-index injection seam for the MAIN interactive session. Optional/
34
+ * Stage B code-index injection seam for the MAIN interactive session. Optional/
35
35
  * undefined is a hard no-op (memory-only injection, base prompt byte-identical). Whether code
36
36
  * hits are actually injected is additionally gated by the `agent-passive-code-injection`
37
37
  * feature flag (DEFAULT OFF) and `isCodeInjectionSettingEnabled` below — both must hold.
@@ -44,7 +44,7 @@ export type OrchestratorCoreServices = {
44
44
  */
45
45
  isCodeInjectionSettingEnabled?: (() => boolean) | undefined;
46
46
  /**
47
- * Wave-5 Stage B tool-site reindex scheduler. Optional/undefined is a hard no-op. When wired,
47
+ * Stage B tool-site reindex scheduler. Optional/undefined is a hard no-op. When wired,
48
48
  * a successful write/edit tool call schedules a debounced incremental reindex of the touched
49
49
  * path(s) (never blocking the tool result).
50
50
  */
@@ -20,7 +20,7 @@ export type ToolExecutionDeps = {
20
20
  sessionId: string;
21
21
  emitterContext: EmitterContextFactory;
22
22
  /**
23
- * Wave-5 Stage B: called once per executed tool with (toolName, resolved args, success) so a
23
+ * Stage B: called once per executed tool with (toolName, resolved args, success) so a
24
24
  * code-index reindex scheduler can debounce an incremental reindex of touched files. Invoked
25
25
  * for BOTH success and failure (the scheduler no-ops on failure); never awaited — it must not
26
26
  * block the tool-result path.
@@ -60,10 +60,10 @@ export interface OrchestratorTurnLoopContext {
60
60
  cacheWrite: number;
61
61
  };
62
62
  /**
63
- * Wave-5 (wo805) per-turn passive-injection wiring for the MAIN interactive session —
64
- * the sibling of wo801's agents/orchestrator-runner.ts runAgentTask wiring, gated on the
65
- * SAME `agent-passive-knowledge-injection` feature flag (its description already
66
- * promised "the EVOLVING main-session conversation" coverage; see
63
+ * Per-turn passive-injection wiring for the MAIN interactive session —
64
+ * the sibling of the agent-runner's runAgentTask wiring in agents/orchestrator-runner.ts,
65
+ * gated on the SAME `agent-passive-knowledge-injection` feature flag (its description
66
+ * already promised "the EVOLVING main-session conversation" coverage; see
67
67
  * runtime/feature-flags/flags.ts). `memoryRegistry` undefined is a hard no-op, matching
68
68
  * the agent path. Budget/floor default to the same derived defaults
69
69
  * (defaultTurnKnowledgeBudgetTokens / DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR) when
@@ -74,7 +74,7 @@ export interface OrchestratorTurnLoopContext {
74
74
  readonly passiveKnowledgeInjectionBudgetTokens?: number | undefined;
75
75
  readonly passiveKnowledgeInjectionRelevanceFloor?: number | undefined;
76
76
  /**
77
- * Wave-5 Stage B — repo code index for the main session's per-turn injection. Undefined is a
77
+ * Stage B — repo code index for the main session's per-turn injection. Undefined is a
78
78
  * hard no-op. `isPassiveCodeInjectionEnabled` resolves the combined gate (flag AND setting);
79
79
  * both it and the source must be present for code hits to be considered this turn.
80
80
  */
@@ -83,7 +83,7 @@ export interface OrchestratorTurnLoopContext {
83
83
  /**
84
84
  * The main session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this
85
85
  * starts empty and grows monotonically for the life of the Orchestrator — no record is
86
- * ever surfaced twice across the whole interactive session (mirrors wo801's
86
+ * ever surfaced twice across the whole interactive session (mirrors the agent-runner's
87
87
  * knowledgeIdsAlreadySurfaced, but session-lifetime instead of one-agent-run-lifetime).
88
88
  */
89
89
  readonly getAlreadyInjectedKnowledgeIds: () => readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-turn-loop.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-turn-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAe,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAc/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;A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AM,OAAO,CAAC;IAC3D,QAAQ,CAAC,qCAAqC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpE,QAAQ,CAAC,uCAAuC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtE;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,6BAA6B,EAAE,MAAM,OAAO,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,8BAA8B,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IACjE,QAAQ,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IACnE,uFAAuF;IACvF,QAAQ,CAAC,4BAA4B,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC7E,wFAAwF;IACxF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,MAAM,CAAC;CAClD;AAED,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAserG"}
@@ -11,13 +11,13 @@ import { buildWrfcWorkflowRoutingPrompt } from './wrfc-routing.js';
11
11
  import { buildPerTurnKnowledgeInjection, defaultTurnKnowledgeBudgetTokens, DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR, } from '../agents/turn-knowledge-injection.js';
12
12
  const AUTO_SPAWN_FALLBACK_DELAY_MS = 5_000;
13
13
  /**
14
- * Wave-5 (wo805) per-turn passive-injection headroom clamp for the MAIN interactive
14
+ * Per-turn passive-injection headroom clamp for the MAIN interactive
15
15
  * session. Mirrors agents/orchestrator-runner.ts's CONTEXT_COMPACT_THRESHOLD (0.85) —
16
16
  * deliberately NOT derived from this loop's own configurable `behavior.autoCompactThreshold`
17
17
  * (default 80, see config/schema-domain-core.ts), which governs CONVERSATION compaction and
18
18
  * can be user-tuned or disabled (0) independently of this feature. Keeping this fixed keeps
19
- * the injection block's safety margin identical to wo801's regardless of what the operator
20
- * has configured for compaction.
19
+ * the injection block's safety margin identical to the agent-runner's regardless of what the
20
+ * operator has configured for compaction.
21
21
  */
22
22
  const PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD = 0.85;
23
23
  export async function executeOrchestratorTurnLoop(context) {
@@ -28,13 +28,13 @@ export async function executeOrchestratorTurnLoop(context) {
28
28
  const streamEnabled = context.configManager.get('display.stream');
29
29
  let continueLoop = true;
30
30
  const circuitBreaker = new ConsecutiveErrorBreaker();
31
- // Wave-5 (wo805): true only for the FIRST LLM call this executeOrchestratorTurnLoop()
31
+ // True only for the FIRST LLM call this executeOrchestratorTurnLoop()
32
32
  // invocation makes (see the per-iteration gate below for why this is the main loop's
33
- // analog of wo801's "new user input this turn").
33
+ // analog of the agent-runner's "new user input this turn").
34
34
  let isFirstIterationOfThisCall = true;
35
- // Wave-5 (wo805): the last successfully-built per-turn knowledge block, reused verbatim
35
+ // The last successfully-built per-turn knowledge block, reused verbatim
36
36
  // on tool-continuation iterations of THIS call where nothing new arrived (mirrors
37
- // wo801's priorTurnKnowledgeBlock) — declared OUTSIDE the while loop so a block built on
37
+ // the agent-runner's priorTurnKnowledgeBlock) — declared OUTSIDE the while loop so a block built on
38
38
  // iteration 1 (the human message that started this runTurn()) stays available to every
39
39
  // later tool round of the SAME call, not just the first LLM call. It is composed onto
40
40
  // the CURRENT `composedBaseSystemPrompt` fresh every iteration (see
@@ -124,17 +124,18 @@ export async function executeOrchestratorTurnLoop(context) {
124
124
  break;
125
125
  }
126
126
  }
127
- // Wave-5 (wo805): per-turn passive knowledge injection for the MAIN interactive
128
- // session — the missing counterpart to wo801's agents/orchestrator-runner.ts wiring.
129
- // `newUserInputThisTurn` mirrors wo801's turn-1/steer-drain gate: it is true exactly
130
- // on the FIRST LLM call this executeOrchestratorTurnLoop() invocation makes (the fresh
131
- // human message this runTurn() call was invoked with) and false on every subsequent
132
- // tool-continuation iteration of the SAME call, since the main session never drains
133
- // new human input mid-call (handleUserInput queues a second message until the current
134
- // runTurn() completes see orchestrator.ts). Retrieval reruns only when
135
- // newUserInputThisTurn is true; tool-continuation iterations reuse `turnKnowledgeBlock`
136
- // as-is (declared before the while loop) exactly wo801's reuse behavior for
137
- // no-new-input turns, just with a different trigger for what counts as "new".
127
+ // Per-turn passive knowledge injection for the MAIN interactive
128
+ // session — the missing counterpart to the agent-runner's wiring in
129
+ // agents/orchestrator-runner.ts. `newUserInputThisTurn` mirrors the agent-runner's
130
+ // turn-1/steer-drain gate: it is true exactly on the FIRST LLM call this
131
+ // executeOrchestratorTurnLoop() invocation makes (the fresh human message this
132
+ // runTurn() call was invoked with) and false on every subsequent tool-continuation
133
+ // iteration of the SAME call, since the main session never drains new human input
134
+ // mid-call (handleUserInput queues a second message until the current runTurn()
135
+ // completes see orchestrator.ts). Retrieval reruns only when newUserInputThisTurn
136
+ // is true; tool-continuation iterations reuse `turnKnowledgeBlock` as-is (declared
137
+ // before the while loop) exactly the agent-runner's reuse behavior for no-new-input
138
+ // turns, just with a different trigger for what counts as "new".
138
139
  const newUserInputThisTurn = isFirstIterationOfThisCall;
139
140
  isFirstIterationOfThisCall = false;
140
141
  const passiveKnowledgeInjectionEnabled = context.isPassiveKnowledgeInjectionEnabled();
@@ -176,7 +177,7 @@ export async function executeOrchestratorTurnLoop(context) {
176
177
  // is also the latest user-role message already appended to the conversation
177
178
  // before the loop started (see prepareConversationForTurn), so
178
179
  // deriveTurnKnowledgeQuery collapses to it with no duplication — the same
179
- // turn-1 behavior wo801 documents for the agent path.
180
+ // turn-1 behavior documented for the agent path.
180
181
  task: context.text,
181
182
  conversationTail: context.conversation.getMessagesForLLM(),
182
183
  budgetTokens: turnBudgetTokens,
@@ -196,14 +197,14 @@ export async function executeOrchestratorTurnLoop(context) {
196
197
  // Hard no-op: no budget headroom this call. Never call into retrieval for a
197
198
  // budget already known to be zero, and never keep claiming a stale block from an
198
199
  // earlier iteration that no longer fits — clear it so composeTurnSystemPrompt
199
- // falls back to the base prompt exactly (mirrors wo801's identical branch).
200
+ // falls back to the base prompt exactly (mirrors the agent-runner's identical branch).
200
201
  turnKnowledgeBlock = null;
201
202
  }
202
203
  }
203
204
  // Composed fresh at the call site (never a hoisted `const` reused across calls) so the
204
205
  // block is re-validated against LIVE tokens at the instant it is actually sent — the
205
- // same "never mutate the cached base, recompute at the call site" discipline wo801's
206
- // composeTurnSystemPrompt established, even though this loop has no in-call
206
+ // same "never mutate the cached base, recompute at the call site" discipline the
207
+ // agent-runner's composeTurnSystemPrompt established, even though this loop has no in-call
207
208
  // context-exceeded retry path to go stale across (compaction here is the PROACTIVE
208
209
  // checkContextWindowPreflight above, not a reactive mid-call retry-and-shrink).
209
210
  const composeTurnSystemPrompt = (base) => {
@@ -68,14 +68,14 @@ export interface OrchestratorOptions {
68
68
  */
69
69
  sessionId?: string | undefined;
70
70
  /**
71
- * Wave-5 (wo805) per-turn passive-injection budget override for the main session,
71
+ * Per-turn passive-injection budget override for the main session,
72
72
  * mirroring agents/orchestrator-runner.ts's `passiveKnowledgeInjectionBudgetTokens`.
73
73
  * Omitted uses the derived default (defaultTurnKnowledgeBudgetTokens). `0` is a hard
74
74
  * no-op, independent of the feature flag's own state.
75
75
  */
76
76
  passiveKnowledgeInjectionBudgetTokens?: number | undefined;
77
77
  /**
78
- * Wave-5 (wo805) per-turn passive-injection relevance-floor override for the main
78
+ * Per-turn passive-injection relevance-floor override for the main
79
79
  * session, mirroring agents/orchestrator-runner.ts's
80
80
  * `passiveKnowledgeInjectionRelevanceFloor`. Omitted uses DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR.
81
81
  */
@@ -184,7 +184,7 @@ export declare class Orchestrator {
184
184
  private getSystemPrompt;
185
185
  private hookDispatcher;
186
186
  /**
187
- * Wave-5 (wo805) per-turn passive-injection state for the MAIN interactive session —
187
+ * Per-turn passive-injection state for the MAIN interactive session —
188
188
  * see core/orchestrator-turn-loop.ts for the retrieval/budget wiring that reads and
189
189
  * mutates these. `turnKnowledgeIdsAlreadySurfaced` has no spawn-time baseline (unlike
190
190
  * an AgentRecord's `knowledgeInjections`) so it starts empty and grows monotonically
@@ -225,9 +225,9 @@ export declare class Orchestrator {
225
225
  registerDelegateTool(manager: AcpManager): void;
226
226
  getSpinner(): string;
227
227
  /**
228
- * Wave-5 (wo805): bounded ring of per-turn passive-injection honesty records for the
228
+ * Bounded ring of per-turn passive-injection honesty records for the
229
229
  * MAIN interactive session — the main-session counterpart to `AgentRecord.turnInjections`
230
- * (wo801). There is no AgentRecord for the primary conversation, so this is the exact
230
+ * on the agent path. There is no AgentRecord for the primary conversation, so this is the exact
231
231
  * accessor a `/recall`-style renderer should read as the main-session default when no
232
232
  * agent id is given. See agents/turn-knowledge-injection.ts for the record shape and
233
233
  * recordTurnInjection for the ring-eviction policy (same bounded size as the agent path).
@@ -304,7 +304,7 @@ export declare class Orchestrator {
304
304
  */
305
305
  private isReconciliationEnabled;
306
306
  /**
307
- * Returns `true` when Wave-5 (wo801/wo805) per-turn passive knowledge injection is
307
+ * Returns `true` when per-turn passive knowledge injection is
308
308
  * active for this session. Shares the SAME `agent-passive-knowledge-injection` flag as
309
309
  * the agent path (agents/orchestrator-runner.ts) rather than a sibling main-session
310
310
  * flag — the flag's own description already promises "the EVOLVING main-session
@@ -323,16 +323,16 @@ export declare class Orchestrator {
323
323
  */
324
324
  private isPassiveCodeInjectionEnabled;
325
325
  /**
326
- * Wave-5 (wo805): ids never to re-surface in a later per-turn knowledge block. The main
326
+ * Ids never to re-surface in a later per-turn knowledge block. The main
327
327
  * session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this starts
328
328
  * empty and grows monotonically for the life of the Orchestrator.
329
329
  */
330
330
  private getAlreadyInjectedKnowledgeIds;
331
- /** Wave-5 (wo805): mark ids as surfaced so they are never listed twice this session. */
331
+ /** Mark ids as surfaced so they are never listed twice this session. */
332
332
  private addInjectedKnowledgeIds;
333
- /** Wave-5 (wo805): append one honesty record to the bounded ring behind {@link getTurnInjections}. */
333
+ /** Append one honesty record to the bounded ring behind {@link getTurnInjections}. */
334
334
  private recordTurnKnowledgeInjection;
335
- /** Wave-5 (wo805): monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
335
+ /** Monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
336
336
  private nextTurnKnowledgeSequence;
337
337
  /**
338
338
  * Reconcile unresolved tool calls at turn end.
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EACL,KAAK,wBAAwB,EAC9B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAmBnF,OAAO,EASL,KAAK,wBAAwB,EAC9B,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;AAE/C,sFAAsF;AACtF,UAAU,kBAAkB;IAC1B,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,U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