@north-light/crouter 0.3.205 → 0.3.206

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.
@@ -1,4 +1,14 @@
1
1
  import type { InboxTierDTO, IsoTime, NodeIdDTO } from './common.js';
2
+ /** One runtime card supplied by a caller: the runtime renders and escapes it
3
+ * exactly once, so a caller cannot emit a malformed card or smuggle markup
4
+ * into one. `kind` must be namespaced (contain `:`) — bare kinds are
5
+ * crouter's own closed vocabulary. */
6
+ export interface RuntimeCardRequest {
7
+ kind: string;
8
+ facts?: Record<string, string | number>;
9
+ /** Data, not markup. */
10
+ body?: string;
11
+ }
2
12
  /** `POST /v1/nodes/{id}/messages` body. */
3
13
  export interface SendMessageRequest {
4
14
  body: string;
@@ -16,6 +26,14 @@ export interface SendMessageRequest {
16
26
  * a `<situational-context>` block, never visible chat (`--situational-context`).
17
27
  * Immediate only; valid alone (no body). */
18
28
  situational_context?: string;
29
+ /** A runtime card that REPLACES the target's situational sidecar, delivered
30
+ * ahead of the body in the same turn and re-stated by the session-start
31
+ * bearings after a context refresh. Mutually exclusive with
32
+ * `situational_context`; valid alone (no body) on the durable path. */
33
+ situational_card?: RuntimeCardRequest;
34
+ /** One-shot runtime cards for this turn only — never persisted. Delivered in
35
+ * array order, after `situational_card` and ahead of the body. */
36
+ context_cards?: RuntimeCardRequest[];
19
37
  /** Raw JSON-schema string granting a one-off `submit` tool before delivery
20
38
  * (`--output-schema`). Immediate only. */
21
39
  output_schema?: string;
@@ -24,7 +42,10 @@ export interface SendMessageRequest {
24
42
  * instead of the durable inbox; a dormant or mid-revive target falls back to
25
43
  * the durable inbox + revive (watcher delivers post-boot). Plain immediate
26
44
  * body only — rejected with fresh/reopen/situational_context/
27
- * output_schema or tier 'deferred'. Absent → durable inbox (unchanged). */
45
+ * output_schema or tier 'deferred'. Runtime cards ARE accepted: a
46
+ * card-bearing send is an ordinary human send that happens to carry context,
47
+ * and the live deliver frame places the cards ahead of the body in one turn.
48
+ * Absent → durable inbox (unchanged). */
28
49
  delivery?: 'interactive';
29
50
  }
30
51
  /** Result of an immediate message send. */