@north-light/crouter 0.3.269 → 0.3.270

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 (72) hide show
  1. package/dist/api/dto/broker.d.ts +11 -2
  2. package/dist/api/dto/broker.js +2 -2
  3. package/dist/api/dto/nodes.d.ts +4 -0
  4. package/dist/clients/attach/viewer.js +406 -406
  5. package/dist/commands/pkg/plugin-inspect.js +2 -2
  6. package/dist/commands/pkg/plugin-manage.js +3 -3
  7. package/dist/commands/sys/doctor.js +4 -3
  8. package/dist/core/__tests__/human-deliver.test.js +1 -1
  9. package/dist/core/__tests__/integration/lifecycle-hooks.test.d.ts +1 -0
  10. package/dist/core/__tests__/integration/lifecycle-hooks.test.js +182 -0
  11. package/dist/core/__tests__/integration/revive.test.js +15 -15
  12. package/dist/core/__tests__/push-final-guard.test.js +1 -1
  13. package/dist/core/__tests__/revive-capacity.test.js +20 -20
  14. package/dist/core/__tests__/revive-parked-fresh.test.js +14 -14
  15. package/dist/core/__tests__/seam/broker-cap-freeze.test.js +2 -2
  16. package/dist/core/__tests__/seam/dormancy-release.test.js +7 -7
  17. package/dist/core/__tests__/seam/held-deferred-human-prompt.test.js +1 -1
  18. package/dist/core/__tests__/seam/yield-refresh-transaction.test.js +2 -2
  19. package/dist/core/command-hooks/discovery.d.ts +27 -1
  20. package/dist/core/command-hooks/discovery.js +52 -0
  21. package/dist/core/command-hooks/index.d.ts +4 -3
  22. package/dist/core/command-hooks/index.js +2 -1
  23. package/dist/core/command-hooks/lifecycle-catalog.d.ts +3 -0
  24. package/dist/core/command-hooks/lifecycle-catalog.js +4 -0
  25. package/dist/core/command-hooks/report.d.ts +11 -2
  26. package/dist/core/command-hooks/report.js +10 -1
  27. package/dist/core/command-hooks/schema.d.ts +16 -1
  28. package/dist/core/command-hooks/schema.js +128 -40
  29. package/dist/core/command-hooks/transport/exec-lifecycle.d.ts +12 -0
  30. package/dist/core/command-hooks/transport/exec-lifecycle.js +152 -0
  31. package/dist/core/human/feedback-companion.js +1 -1
  32. package/dist/core/review/realize.js +1 -1
  33. package/dist/core/runtime/broker/engine-drive.d.ts +14 -3
  34. package/dist/core/runtime/broker/engine-drive.js +29 -1
  35. package/dist/core/runtime/broker/frame-client.js +3 -4
  36. package/dist/core/runtime/broker/rebind.js +7 -0
  37. package/dist/core/runtime/broker-protocol.d.ts +11 -2
  38. package/dist/core/runtime/broker.d.ts +1 -1
  39. package/dist/core/runtime/broker.js +13 -3
  40. package/dist/core/runtime/node-read.d.ts +2 -0
  41. package/dist/core/runtime/node-read.js +18 -9
  42. package/dist/core/runtime/revive-all.d.ts +1 -1
  43. package/dist/core/runtime/revive-all.js +2 -2
  44. package/dist/core/runtime/revive.d.ts +2 -2
  45. package/dist/core/runtime/revive.js +49 -13
  46. package/dist/core/runtime/session-visibility.d.ts +10 -14
  47. package/dist/core/runtime/session-visibility.js +43 -30
  48. package/dist/core/runtime/stamp/channel.d.ts +10 -6
  49. package/dist/core/runtime/stamp/channel.js +16 -7
  50. package/dist/core/runtime/stamp/protocol.d.ts +4 -0
  51. package/dist/core/runtime/turn-visibility.d.ts +10 -0
  52. package/dist/core/runtime/turn-visibility.js +31 -0
  53. package/dist/daemon/api/__tests__/profile-launch-gates.test.js +2 -2
  54. package/dist/daemon/api/bridge.js +1 -1
  55. package/dist/daemon/api/handlers/attach.js +4 -4
  56. package/dist/daemon/api/handlers/bash-jobs.js +1 -1
  57. package/dist/daemon/api/handlers/messages.js +2 -2
  58. package/dist/daemon/api/handlers/nodes.js +7 -4
  59. package/dist/daemon/cron/sinks.js +3 -3
  60. package/dist/daemon/fleet.js +1 -1
  61. package/dist/daemon/messaging/node-message.js +1 -1
  62. package/dist/daemon/profile-delete.js +1 -1
  63. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +6 -6
  64. package/dist/hook-authoring.d.ts +31 -1
  65. package/dist/hook-authoring.js +42 -5
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.js +3 -0
  68. package/dist/pi-extensions/canvas-stamp.js +3 -3
  69. package/dist/shared/generated-context.d.ts +1 -2
  70. package/dist/shared/generated-context.js +3 -4
  71. package/package.json +1 -1
  72. package/runtime.lock.json +2 -2
@@ -26,6 +26,10 @@ export interface BrokerWelcomeSnapshot<M = unknown> {
26
26
  messages: M[];
27
27
  /** Stable session-entry ids aligned 1:1 with `messages`. */
28
28
  messageIds?: string[];
29
+ /** Presentation visibility aligned 1:1 with `messages`. */
30
+ messageVisibility: Array<'visible' | 'internal'>;
31
+ /** Presentation visibility of the run currently owned by the engine. */
32
+ turnVisibility: 'visible' | 'internal';
29
33
  state?: {
30
34
  isStreaming?: boolean;
31
35
  };
@@ -42,6 +46,11 @@ export interface BrokerWelcomeFrame<M = unknown> {
42
46
  type: 'welcome';
43
47
  snapshot?: BrokerWelcomeSnapshot<M>;
44
48
  }
49
+ /** The presentation classification of the run whose native events follow. */
50
+ export interface BrokerTurnVisibilityFrame {
51
+ type: 'turn_visibility';
52
+ visibility: 'visible' | 'internal';
53
+ }
45
54
  /**
46
55
  * The crtrd broker `node_named` control frame — the node's generated name at the
47
56
  * instant crtrd committed it.
@@ -68,11 +77,11 @@ export interface BrokerNodeNamedFrame {
68
77
  }
69
78
  /**
70
79
  * The broker-control frames a relay consumer reads: `welcome` (catch-up snapshot),
71
- * `error`, and `node_named`. The broker interleaves others (display_*, ack, …)
80
+ * `turn_visibility`, `error`, and `node_named`. The broker interleaves others (display_*, ack, …)
72
81
  * under non-colliding `type` discriminants; a relay mapper drops those through its
73
82
  * `default` arm untyped, so they are not enumerated here.
74
83
  */
75
- export type BrokerControlFrame<M = unknown> = BrokerWelcomeFrame<M> | BrokerErrorFrame | BrokerNodeNamedFrame;
84
+ export type BrokerControlFrame<M = unknown> = BrokerWelcomeFrame<M> | BrokerTurnVisibilityFrame | BrokerErrorFrame | BrokerNodeNamedFrame;
76
85
  /**
77
86
  * What the crtrd broker attach delivers to a relay consumer: the live engine
78
87
  * event stream (`E` — pi's `AgentSessionEvent`, relayed verbatim) unioned with the
@@ -1,8 +1,8 @@
1
1
  // Broker attach-protocol envelope DTOs — the crtrd-specific control frames the
2
2
  // broker interleaves around pi's native agent-session event stream over a node's
3
3
  // `view.sock` (and its WS bridge, spec §5). This module owns ONLY that envelope
4
- // vocabulary: the two broker-control frames a relay consumer reads (`welcome` +
5
- // `error`), the welcome snapshot they carry, and the relay union that folds them
4
+ // vocabulary: the broker-control frames a relay consumer reads, the welcome
5
+ // snapshot they carry, and the relay union that folds them
6
6
  // together with the live engine event stream.
7
7
  //
8
8
  // PURITY (spec §3.1): like every file under `src/api/`, this imports NOTHING —
@@ -244,6 +244,8 @@ export interface NodeSnapshotDTO {
244
244
  snapshot: {
245
245
  messages: unknown[];
246
246
  messageIds?: string[];
247
+ messageVisibility: Array<'visible' | 'internal'>;
248
+ turnVisibility: 'visible' | 'internal';
247
249
  stats: unknown;
248
250
  state: Record<string, unknown>;
249
251
  display: {
@@ -282,6 +284,8 @@ export interface NodeMessagesPageDTO {
282
284
  messages: unknown[];
283
285
  /** Stable session-entry ids aligned 1:1 with `messages`. */
284
286
  message_ids?: string[];
287
+ /** Presentation visibility aligned 1:1 with `messages`. */
288
+ message_visibility: Array<'visible' | 'internal'>;
285
289
  /** Opaque cursor toward older messages; null at the start of the session. */
286
290
  next_cursor: Cursor | null;
287
291
  captured_at: IsoTime;