agentfootprint 18.3.0 → 19.0.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 (97) hide show
  1. package/CAPABILITIES.md +2 -0
  2. package/dist/core/agent/runtime/configuration/configure.js +6 -0
  3. package/dist/core/agent/runtime/configuration/configure.js.map +1 -1
  4. package/dist/core/agent/runtime/configuration/values.js.map +1 -1
  5. package/dist/core/agent/runtime/native/initialize.js +1 -0
  6. package/dist/core/agent/runtime/native/initialize.js.map +1 -1
  7. package/dist/esm/core/agent/runtime/configuration/configure.js +6 -0
  8. package/dist/esm/core/agent/runtime/configuration/configure.js.map +1 -1
  9. package/dist/esm/core/agent/runtime/configuration/types.d.ts +5 -1
  10. package/dist/esm/core/agent/runtime/configuration/values.d.ts +1 -0
  11. package/dist/esm/core/agent/runtime/configuration/values.js.map +1 -1
  12. package/dist/esm/core/agent/runtime/native/initialize.js +1 -0
  13. package/dist/esm/core/agent/runtime/native/initialize.js.map +1 -1
  14. package/dist/esm/core/agent/types/observation.d.ts +34 -1
  15. package/dist/esm/hosting/durability.d.ts +10 -0
  16. package/dist/esm/hosting/durability.js +54 -30
  17. package/dist/esm/hosting/durability.js.map +1 -1
  18. package/dist/esm/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
  19. package/dist/esm/hosting/standingAgent/artifacts/accountParts.js +9 -4
  20. package/dist/esm/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
  21. package/dist/esm/index.d.ts +1 -0
  22. package/dist/esm/observe.d.ts +1 -1
  23. package/dist/esm/observe.js.map +1 -1
  24. package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +8 -120
  25. package/dist/esm/recorders/observability/FlowchartRecorder.js +16 -0
  26. package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
  27. package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
  28. package/dist/esm/recorders/observability/recordingParts/format.d.ts +87 -12
  29. package/dist/esm/recorders/observability/recordingParts/format.js +136 -17
  30. package/dist/esm/recorders/observability/recordingParts/format.js.map +1 -1
  31. package/dist/esm/recorders/observability/recordingParts/open.d.ts +41 -7
  32. package/dist/esm/recorders/observability/recordingParts/open.js +32 -6
  33. package/dist/esm/recorders/observability/recordingParts/open.js.map +1 -1
  34. package/dist/esm/recorders/observability/recordingParts/partReader.d.ts +25 -2
  35. package/dist/esm/recorders/observability/recordingParts/partReader.js +183 -15
  36. package/dist/esm/recorders/observability/recordingParts/partReader.js.map +1 -1
  37. package/dist/esm/recorders/observability/recordingParts/split.d.ts +13 -0
  38. package/dist/esm/recorders/observability/recordingParts/split.js +135 -26
  39. package/dist/esm/recorders/observability/recordingParts/split.js.map +1 -1
  40. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.d.ts +124 -0
  41. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js +389 -0
  42. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
  43. package/dist/esm/recorders/observability/stepGraphTypes.d.ts +139 -0
  44. package/dist/esm/recorders/observability/stepGraphTypes.js +10 -0
  45. package/dist/esm/recorders/observability/stepGraphTypes.js.map +1 -0
  46. package/dist/hosting/durability.js +54 -30
  47. package/dist/hosting/durability.js.map +1 -1
  48. package/dist/hosting/standingAgent/artifacts/accountParts.js +9 -4
  49. package/dist/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
  50. package/dist/observe.js.map +1 -1
  51. package/dist/recorders/observability/FlowchartRecorder.js +16 -0
  52. package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
  53. package/dist/recorders/observability/recordingParts/format.js +139 -18
  54. package/dist/recorders/observability/recordingParts/format.js.map +1 -1
  55. package/dist/recorders/observability/recordingParts/open.js +30 -4
  56. package/dist/recorders/observability/recordingParts/open.js.map +1 -1
  57. package/dist/recorders/observability/recordingParts/partReader.js +182 -14
  58. package/dist/recorders/observability/recordingParts/partReader.js.map +1 -1
  59. package/dist/recorders/observability/recordingParts/split.js +134 -25
  60. package/dist/recorders/observability/recordingParts/split.js.map +1 -1
  61. package/dist/recorders/observability/recordingParts/subflowPayloads.js +396 -0
  62. package/dist/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
  63. package/dist/recorders/observability/stepGraphTypes.js +11 -0
  64. package/dist/recorders/observability/stepGraphTypes.js.map +1 -0
  65. package/dist/types/core/agent/runtime/configuration/configure.d.ts.map +1 -1
  66. package/dist/types/core/agent/runtime/configuration/types.d.ts +5 -1
  67. package/dist/types/core/agent/runtime/configuration/types.d.ts.map +1 -1
  68. package/dist/types/core/agent/runtime/configuration/values.d.ts +1 -0
  69. package/dist/types/core/agent/runtime/configuration/values.d.ts.map +1 -1
  70. package/dist/types/core/agent/runtime/native/initialize.d.ts.map +1 -1
  71. package/dist/types/core/agent/types/observation.d.ts +34 -1
  72. package/dist/types/core/agent/types/observation.d.ts.map +1 -1
  73. package/dist/types/hosting/durability.d.ts +10 -0
  74. package/dist/types/hosting/durability.d.ts.map +1 -1
  75. package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
  76. package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts.map +1 -1
  77. package/dist/types/index.d.ts +1 -0
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/observe.d.ts +1 -1
  80. package/dist/types/observe.d.ts.map +1 -1
  81. package/dist/types/recorders/observability/FlowchartRecorder.d.ts +8 -120
  82. package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
  83. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
  84. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts.map +1 -1
  85. package/dist/types/recorders/observability/recordingParts/format.d.ts +87 -12
  86. package/dist/types/recorders/observability/recordingParts/format.d.ts.map +1 -1
  87. package/dist/types/recorders/observability/recordingParts/open.d.ts +41 -7
  88. package/dist/types/recorders/observability/recordingParts/open.d.ts.map +1 -1
  89. package/dist/types/recorders/observability/recordingParts/partReader.d.ts +25 -2
  90. package/dist/types/recorders/observability/recordingParts/partReader.d.ts.map +1 -1
  91. package/dist/types/recorders/observability/recordingParts/split.d.ts +13 -0
  92. package/dist/types/recorders/observability/recordingParts/split.d.ts.map +1 -1
  93. package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts +125 -0
  94. package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts.map +1 -0
  95. package/dist/types/recorders/observability/stepGraphTypes.d.ts +140 -0
  96. package/dist/types/recorders/observability/stepGraphTypes.d.ts.map +1 -0
  97. package/package.json +1 -1
@@ -38,6 +38,12 @@
38
38
  * loop.iteration → loop-iteration StepEdge
39
39
  * context.injected → attached to NEXT user→llm / tool→llm StepNode
40
40
  *
41
+ * A sub-flow event's `payload` becomes `entryPayload` / `exitPayload` (on the
42
+ * subflow node, or the slot boundary of the next model call). An event read
43
+ * from a recording saved in parts may carry `payloadWith: 'invocation'`
44
+ * instead (the payload lives with that invocation): it becomes
45
+ * `entryPayloadWith` / `exitPayloadWith: 'invocation'`, never an empty value.
46
+ *
41
47
  * Result: a one-to-one correspondence between visible scrubbable steps
42
48
  * and DomainEvents. Adding a new event type adds one mapping line here
43
49
  * (or in the pure projection); no state machine, no merging.
@@ -45,126 +51,8 @@
45
51
  import type { CombinedRecorder } from 'footprintjs';
46
52
  import type { EventDispatcher } from '../../events/dispatcher.js';
47
53
  import { BoundaryRecorder, type DomainEvent } from './BoundaryRecorder.js';
48
- /**
49
- * One node in the step-level flowchart. Node kind drives rendering
50
- * (actor icon, color). ReAct steps carry token + tool details; topology
51
- * nodes (subflow / fork-branch / decision-branch) mirror the footprintjs
52
- * composition events and exist so composition structure (Loop, Parallel,
53
- * Conditional, Swarm) stays visible in the graph.
54
- */
55
- export interface StepNode {
56
- readonly id: string;
57
- readonly kind: 'user->llm' | 'llm->tool' | 'tool->llm' | 'llm->user' | 'subflow' | 'fork-branch' | 'decision-branch';
58
- readonly label: string;
59
- readonly startOffsetMs: number;
60
- readonly endOffsetMs?: number;
61
- /** LLM step: token usage of the call that bounded this step. */
62
- readonly tokens?: {
63
- readonly in: number;
64
- readonly out: number;
65
- };
66
- /** llm->tool / tool->llm: the tool name. */
67
- readonly toolName?: string;
68
- /** user->llm / tool->llm: the model that was invoked. */
69
- readonly llmModel?: string;
70
- /** Decomposition of the underlying subflowId (rooted under '__root__'). */
71
- readonly subflowPath: readonly string[];
72
- /** Context injections attributed to this step (LLM steps only). */
73
- readonly injections?: readonly ContextInjection[];
74
- /** 1-based ReAct iteration this step belongs to. Undefined for
75
- * topology / composition nodes. */
76
- readonly iterationIndex?: number;
77
- /** Which slot the step's input updated. ReAct steps only. */
78
- readonly slotUpdated?: 'system-prompt' | 'messages' | 'tools';
79
- /** True ONLY for `subflow` StepNodes whose primitiveKind is `'Agent'`.
80
- * Narrow flag for callers that distinguish ReAct agents from other
81
- * composition primitives (cost / iteration / token attribution). */
82
- readonly isAgentBoundary?: boolean;
83
- /** Primitive kind from the subflow root description prefix
84
- * (`'Agent'` / `'LLMCall'` / `'Sequence'` / etc.). */
85
- readonly primitiveKind?: string;
86
- /** True for `subflow` StepNodes representing any KNOWN primitive
87
- * (Agent / LLMCall / Sequence / Parallel / Conditional / Loop) —
88
- * drives Lens's drill-in container treatment. */
89
- readonly isPrimitiveBoundary?: boolean;
90
- /** `inputMapper` payload at the subflow's entry. Subflow nodes only. */
91
- readonly entryPayload?: unknown;
92
- /** Subflow shared state at exit. Subflow nodes only.
93
- * Undefined for in-progress / paused subflows. */
94
- readonly exitPayload?: unknown;
95
- /** LLM's text content. Set on `llm->tool` (the reasoning emitted with the
96
- * tool_use blocks) and on `llm->user` (the terminal answer). */
97
- readonly assistantText?: string;
98
- /** Tool input arguments the LLM produced. Set on `llm->tool` from the
99
- * matching `tool.start` event payload. */
100
- readonly toolArgs?: unknown;
101
- /** Tool result returned to the LLM. Set on `tool->llm` from the
102
- * preceding `tool.end` event payload. */
103
- readonly toolResult?: unknown;
104
- /** Stable per-execution key — same `runtimeStageId` Trace view uses. */
105
- readonly runtimeStageId?: string;
106
- /**
107
- * Slot boundary payloads composed for THIS LLM step.
108
- *
109
- * Set ONLY for `kind === 'user->llm'` and `kind === 'tool->llm'`
110
- * StepNodes — the moments where context flows INTO the LLM. Each
111
- * entry carries the slot subflow's `inputMapper` result (entryPayload)
112
- * and rendered slot output (exitPayload).
113
- *
114
- * Attribution: any slot subflow that fired BETWEEN the previous LLM
115
- * end (or run start) and THIS LLM start is attributed to this call.
116
- * Done at projection time over `boundary.getEvents()`; no consumer-
117
- * side correlation required.
118
- *
119
- * Lens uses this to make the 3 slot rows inside the LLM card
120
- * clickable — clicking a slot reveals its entry/exit payloads in
121
- * the right-pane detail panel without needing direct BoundaryRecorder
122
- * access.
123
- */
124
- readonly slotBoundaries?: {
125
- readonly systemPrompt?: SlotBoundary;
126
- readonly messages?: SlotBoundary;
127
- readonly tools?: SlotBoundary;
128
- };
129
- }
130
- /** One slot's boundary pair attributed to a specific LLM step. */
131
- export interface SlotBoundary {
132
- /** runtimeStageId of the slot subflow execution. */
133
- readonly runtimeStageId: string;
134
- /** `inputMapper` payload — the data the slot was COMPOSED FROM
135
- * (RAG hits, skill content, user message, tool result, etc). */
136
- readonly entryPayload?: unknown;
137
- /** Subflow shared state at exit — the rendered slot content
138
- * (system prompt string, messages array, tools array). */
139
- readonly exitPayload?: unknown;
140
- }
141
- /** Consumer-facing context injection (5 axes of context engineering). */
142
- export interface ContextInjection {
143
- readonly slot: 'system-prompt' | 'messages' | 'tools';
144
- readonly asRole?: 'system' | 'user' | 'assistant' | 'tool';
145
- readonly source: string;
146
- readonly sourceId?: string;
147
- readonly contentSummary?: string;
148
- readonly reason?: string;
149
- readonly sectionTag?: string;
150
- readonly upstreamRef?: string;
151
- readonly retrievalScore?: number;
152
- readonly rankPosition?: number;
153
- readonly budgetTokens?: number;
154
- readonly budgetFraction?: number;
155
- }
156
- export interface StepEdge {
157
- readonly id: string;
158
- readonly from: string;
159
- readonly to: string;
160
- readonly kind: 'next' | 'loop-iteration' | 'fork-branch' | 'decision-branch';
161
- readonly iteration?: number;
162
- }
163
- export interface StepGraph {
164
- readonly nodes: readonly StepNode[];
165
- readonly edges: readonly StepEdge[];
166
- readonly activeNodeId?: string;
167
- }
54
+ import type { StepGraph } from './stepGraphTypes.js';
55
+ export type { ContextInjection, SlotBoundary, StepEdge, StepGraph, StepNode, } from './stepGraphTypes.js';
168
56
  export interface FlowchartOptions {
169
57
  /** Called each time the graph changes; fires synchronously on the
170
58
  * driving event so the UI updates the moment the structure changes. */
@@ -38,6 +38,12 @@
38
38
  * loop.iteration → loop-iteration StepEdge
39
39
  * context.injected → attached to NEXT user→llm / tool→llm StepNode
40
40
  *
41
+ * A sub-flow event's `payload` becomes `entryPayload` / `exitPayload` (on the
42
+ * subflow node, or the slot boundary of the next model call). An event read
43
+ * from a recording saved in parts may carry `payloadWith: 'invocation'`
44
+ * instead (the payload lives with that invocation): it becomes
45
+ * `entryPayloadWith` / `exitPayloadWith: 'invocation'`, never an empty value.
46
+ *
41
47
  * Result: a one-to-one correspondence between visible scrubbable steps
42
48
  * and DomainEvents. Adding a new event type adds one mapping line here
43
49
  * (or in the pure projection); no state machine, no merging.
@@ -267,6 +273,7 @@ export function buildStepGraphFromEvents(events) {
267
273
  pendingSlotBoundaries[slotPropName(e.slotKind)] = {
268
274
  runtimeStageId: e.runtimeStageId,
269
275
  ...(e.payload !== undefined ? { entryPayload: e.payload } : {}),
276
+ ...(movedPayload(e) ? { entryPayloadWith: 'invocation' } : {}),
270
277
  };
271
278
  break;
272
279
  }
@@ -290,6 +297,7 @@ export function buildStepGraphFromEvents(events) {
290
297
  pendingSlotBoundaries[key] = {
291
298
  ...existing,
292
299
  ...(e.payload !== undefined ? { exitPayload: e.payload } : {}),
300
+ ...(movedPayload(e) ? { exitPayloadWith: 'invocation' } : {}),
293
301
  };
294
302
  }
295
303
  break;
@@ -302,6 +310,9 @@ export function buildStepGraphFromEvents(events) {
302
310
  if (e.payload !== undefined) {
303
311
  open.exitPayload = e.payload;
304
312
  }
313
+ if (movedPayload(e)) {
314
+ open.exitPayloadWith = 'invocation';
315
+ }
305
316
  openSubflowsByRuntimeId.delete(e.runtimeStageId);
306
317
  }
307
318
  break;
@@ -526,9 +537,14 @@ function subflowToStepNode(e, t) {
526
537
  isPrimitiveBoundary,
527
538
  ...(e.primitiveKind ? { primitiveKind: e.primitiveKind } : {}),
528
539
  ...(e.payload !== undefined ? { entryPayload: e.payload } : {}),
540
+ ...(movedPayload(e) ? { entryPayloadWith: 'invocation' } : {}),
529
541
  runtimeStageId: e.runtimeStageId,
530
542
  };
531
543
  }
544
+ /** Whether a sub-flow event's payload lives with its invocation (a format-2 base part's mark). */
545
+ function movedPayload(e) {
546
+ return e.payloadWith === 'invocation' && e.payload === undefined;
547
+ }
532
548
  /** Append a `next` edge between the previous and current node IF both
533
549
  * are ReAct steps (we don't auto-wire subflow-to-subflow edges; those
534
550
  * come from explicit fork/decision events). */
@@ -1 +1 @@
1
- {"version":3,"file":"FlowchartRecorder.js","sourceRoot":"","sources":["../../../../src/recorders/observability/FlowchartRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH,OAAO,EAEL,gBAAgB,GAGjB,MAAM,uBAAuB,CAAC;AAuJ/B,wEAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,eAAe,CAC7B,YAAwD,EACxD,UAA2B,EAC3B,UAA4B,EAAE,EAC9B,cAA6B;IAE7B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC5E,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAElC,sEAAsE;IACtE,uEAAuE;IACvE,mDAAmD;IACnD,MAAM,OAAO,GAAqB,QAAQ;QACxC,CAAC,CAAC,YAAY,CAAC,QAAQ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6 +53,15 @@ export interface DomainSubflowEvent extends DomainEventBase {
53
53
  readonly isAgentInternal: boolean;
54
54
  /** `inputMapper` result on entry; subflow shared state on exit. */
55
55
  readonly payload?: unknown;
56
+ /**
57
+ * Set ONLY on an event read from a recording saved in parts (index format
58
+ * 2), in place of `payload`: the payload lives with the invocation this
59
+ * event's `runtimeStageId` names, read with
60
+ * `openSavedRecording(…).readInvocation(runtimeStageId)` (its `payloads`).
61
+ * The row's `meta.subflowPayloads` is `'with-invocation'` then. No mark and
62
+ * no `payload` means none was recorded. The live stream never carries it.
63
+ */
64
+ readonly payloadWith?: 'invocation';
56
65
  }
57
66
  export interface DomainForkBranchEvent extends DomainEventBase {
58
67
  readonly type: 'fork.branch';
@@ -13,10 +13,29 @@
13
13
  * decides before reading bytes is decided from it, so everything in it is
14
14
  * checked here before anything else trusts it.
15
15
  */
16
- /** The format marker of an index. */
17
- export declare const RECORDING_INDEX_FORMAT = "agentfootprint.recording.index.v1";
18
- /** The format marker of a part (the base part and every invocation part). */
19
- export declare const RECORDING_PART_FORMAT = "agentfootprint.recording.part.v1";
16
+ /**
17
+ * The format marker of an index the writer writes: format 2, where an
18
+ * invocation's sub-flow entry and exit payloads live with the invocation
19
+ * (`recordingParts/subflowPayloads.ts`). A v2 index names v2 parts.
20
+ */
21
+ export declare const RECORDING_INDEX_FORMAT = "agentfootprint.recording.index.v2";
22
+ /** Format 1, still read: every payload in the base row. A v1 index names v1 parts; no mix. */
23
+ export declare const RECORDING_INDEX_FORMAT_V1 = "agentfootprint.recording.index.v1";
24
+ /** The format marker of a part (the base part and every invocation part) a v2 index names. */
25
+ export declare const RECORDING_PART_FORMAT = "agentfootprint.recording.part.v2";
26
+ /** The part format a v1 index names. */
27
+ export declare const RECORDING_PART_FORMAT_V1 = "agentfootprint.recording.part.v1";
28
+ /** Either index format this reader admits. */
29
+ export type RecordingIndexFormat = typeof RECORDING_INDEX_FORMAT | typeof RECORDING_INDEX_FORMAT_V1;
30
+ /** The part format an index of `format` names. */
31
+ export declare function partFormatOf(format: RecordingIndexFormat): string;
32
+ /**
33
+ * Whether `value` is an index of a format this reader does not know: a plain
34
+ * object whose `format` is spelled `agentfootprint.recording.index.v<N>` for
35
+ * another N. A reader answers it `unsupported-format`, so the next bump is
36
+ * honest; anything else it cannot admit stays `invalid-index`.
37
+ */
38
+ export declare function isUnsupportedIndexFormat(value: unknown): boolean;
20
39
  /**
21
40
  * The size a part is filled to: 1 MiB of JSON text. A part holds whole
22
41
  * results only, so one result bigger than this is a part of its own.
@@ -48,6 +67,22 @@ export interface StoredPartEntry {
48
67
  /** One invocation part: the stored artifact and how many results it holds. */
49
68
  export interface IndexPartEntry extends StoredPartEntry {
50
69
  readonly results: number;
70
+ /** Format 2 only (required there): how many `'stored'` payloads the part holds. */
71
+ readonly payloads?: number;
72
+ }
73
+ /**
74
+ * How one sub-flow boundary payload left the base row (format 2):
75
+ * - `'same'` proven at the cut by equal JSON text to the result's own value
76
+ * (entry: `treeContext.history[0].overwrite`, exit:
77
+ * `treeContext.globalContext`); nothing is stored for it.
78
+ * - `'stored'` the texts differ; the payload is stored in the invocation's
79
+ * part, beside its result (never inside it).
80
+ */
81
+ export type IndexPayloadPlace = 'same' | 'stored';
82
+ /** Where one invocation's moved payloads are (format 2). At least one of the two is present. */
83
+ export interface IndexInvocationPayloads {
84
+ readonly entry?: IndexPayloadPlace;
85
+ readonly exit?: IndexPayloadPlace;
51
86
  }
52
87
  /** One recorded invocation. `part` is `null` when the tree mounts it but no result was recorded. */
53
88
  export interface IndexInvocation {
@@ -59,6 +94,40 @@ export interface IndexInvocation {
59
94
  readonly part: number | null;
60
95
  /** Compact JSON bytes of this one result; present exactly when `part` is a number. */
61
96
  readonly bytes?: number;
97
+ /** Format 2: present exactly when one of its payloads moved (never when `part` is `null`). */
98
+ readonly payloads?: IndexInvocationPayloads;
99
+ /** Format 2: present exactly when a payload is `'same'`; the plain JSON bytes a whole read restores from the result. */
100
+ readonly restoredBytes?: number;
101
+ }
102
+ /**
103
+ * Format 2: the sub-flow payload counts. `same`, `stored` and `restoredBytes`
104
+ * equal the sums over the invocations, and `stored` the sum over the parts:
105
+ * `readRecordingIndex` admits nothing else.
106
+ */
107
+ export interface IndexSubflowPayloads {
108
+ readonly same: number;
109
+ readonly stored: number;
110
+ readonly restoredBytes: number;
111
+ /**
112
+ * Positions in `snapshot.recorders` of the rows the cut marked, ascending:
113
+ * the only rows a reader restores. Empty exactly when nothing moved. A row
114
+ * that arrived carrying the row fact or the mark key is never listed: it
115
+ * is kept whole, as the recording's own data.
116
+ */
117
+ readonly rows: readonly number[];
118
+ /** Sub-flow payloads left whole in the base row, by why. */
119
+ readonly kept: {
120
+ /** The rows do not hold exactly one entry and at most one exit with that id and its `subflowId`. */
121
+ readonly ambiguous: number;
122
+ /**
123
+ * `payload` is not the event's last key, or its row cannot carry a mark
124
+ * (not a BoundaryEvents row in full mode, or one of its events already
125
+ * holds the mark's key).
126
+ */
127
+ readonly notLast: number;
128
+ /** No indexed invocation with a part has that id (a paused mount, or not an index key). */
129
+ readonly noPart: number;
130
+ };
62
131
  }
63
132
  /** A path alias of `subflowResults`: proven equal to an execution key's result, or stored itself. */
64
133
  export type IndexAlias = {
@@ -75,7 +144,7 @@ export interface IndexUnmounted {
75
144
  }
76
145
  /** An admitted index. */
77
146
  export interface RecordingIndex {
78
- readonly format: typeof RECORDING_INDEX_FORMAT;
147
+ readonly format: RecordingIndexFormat;
79
148
  /** The run the recording was filed for (`origin.runId`). */
80
149
  readonly runId?: string;
81
150
  /** `snapshot.runId`, the engine's executor id. */
@@ -90,9 +159,11 @@ export interface RecordingIndex {
90
159
  readonly invocations: readonly IndexInvocation[];
91
160
  readonly aliases: readonly IndexAlias[];
92
161
  readonly unmounted: readonly IndexUnmounted[];
162
+ /** Present exactly when `format` is format 2. */
163
+ readonly subflowPayloads?: IndexSubflowPayloads;
93
164
  }
94
165
  /** Everything in an index except the refs the store mints. */
95
- export type IndexDraft = Omit<RecordingIndex, 'format' | 'base' | 'parts'> & {
166
+ export type IndexDraft = Omit<RecordingIndex, 'base' | 'parts'> & {
96
167
  readonly base: Omit<StoredPartEntry, 'ref'>;
97
168
  readonly parts: readonly Omit<IndexPartEntry, 'ref'>[];
98
169
  };
@@ -114,11 +185,15 @@ export declare function pathKey(path: readonly string[]): string;
114
185
  /**
115
186
  * Admit an index read back from a store, or refuse it whole (`undefined`).
116
187
  *
117
- * Checked: the exact field set at every level, plain data only; refs in the
118
- * artifact grammar; digests in `sha-256:<hex>`; byte counts; part ordinals in
119
- * range; unique, canonical execution keys; bounded paths that end at their key
120
- * and whose every prefix is itself an invocation; aliases that name a stored
121
- * key or a part; per-part result counts that match the invocations and
122
- * unmounted results that name the part; `complete` that admits what is listed.
188
+ * Checked: the exact field set at every level for its format, plain data only;
189
+ * refs in the artifact grammar; digests in `sha-256:<hex>`; byte counts; part
190
+ * ordinals in range; unique, canonical execution keys; bounded paths that end
191
+ * at their key and whose every prefix is itself an invocation; aliases that
192
+ * name a stored key or a part; per-part result counts that match the
193
+ * invocations and unmounted results that name the part; `complete` that
194
+ * admits what is listed. Format 2 also: every invocation's payload places,
195
+ * only on an invocation with a part, its `restoredBytes` exactly when one is
196
+ * `'same'`, and the counts equal to the sums over the invocations and the parts.
197
+ * An unknown format is refused here too; `isUnsupportedIndexFormat` names it.
123
198
  */
124
199
  export declare function readRecordingIndex(value: unknown): RecordingIndex | undefined;
@@ -15,10 +15,39 @@
15
15
  */
16
16
  import { buildRuntimeStageId, isExecutionKey, parseRuntimeStageId } from 'foottrace';
17
17
  import { isArtifactRef } from '../../../artifacts/naming.js';
18
- /** The format marker of an index. */
19
- export const RECORDING_INDEX_FORMAT = 'agentfootprint.recording.index.v1';
20
- /** The format marker of a part (the base part and every invocation part). */
21
- export const RECORDING_PART_FORMAT = 'agentfootprint.recording.part.v1';
18
+ /**
19
+ * The format marker of an index the writer writes: format 2, where an
20
+ * invocation's sub-flow entry and exit payloads live with the invocation
21
+ * (`recordingParts/subflowPayloads.ts`). A v2 index names v2 parts.
22
+ */
23
+ export const RECORDING_INDEX_FORMAT = 'agentfootprint.recording.index.v2';
24
+ /** Format 1, still read: every payload in the base row. A v1 index names v1 parts; no mix. */
25
+ export const RECORDING_INDEX_FORMAT_V1 = 'agentfootprint.recording.index.v1';
26
+ /** The format marker of a part (the base part and every invocation part) a v2 index names. */
27
+ export const RECORDING_PART_FORMAT = 'agentfootprint.recording.part.v2';
28
+ /** The part format a v1 index names. */
29
+ export const RECORDING_PART_FORMAT_V1 = 'agentfootprint.recording.part.v1';
30
+ /** The part format an index of `format` names. */
31
+ export function partFormatOf(format) {
32
+ return format === RECORDING_INDEX_FORMAT ? RECORDING_PART_FORMAT : RECORDING_PART_FORMAT_V1;
33
+ }
34
+ /** Any index format number, spelled the one way this family spells it. */
35
+ const INDEX_FORMAT_FAMILY = /^agentfootprint\.recording\.index\.v[1-9][0-9]{0,8}$/;
36
+ /**
37
+ * Whether `value` is an index of a format this reader does not know: a plain
38
+ * object whose `format` is spelled `agentfootprint.recording.index.v<N>` for
39
+ * another N. A reader answers it `unsupported-format`, so the next bump is
40
+ * honest; anything else it cannot admit stays `invalid-index`.
41
+ */
42
+ export function isUnsupportedIndexFormat(value) {
43
+ if (!isPlainObject(value))
44
+ return false;
45
+ const format = ownValue(value, 'format');
46
+ return (typeof format === 'string' &&
47
+ INDEX_FORMAT_FAMILY.test(format) &&
48
+ format !== RECORDING_INDEX_FORMAT &&
49
+ format !== RECORDING_INDEX_FORMAT_V1);
50
+ }
22
51
  /**
23
52
  * The size a part is filled to: 1 MiB of JSON text. A part holds whole
24
53
  * results only, so one result bigger than this is a part of its own.
@@ -153,12 +182,16 @@ function optionalName(row, key) {
153
182
  /**
154
183
  * Admit an index read back from a store, or refuse it whole (`undefined`).
155
184
  *
156
- * Checked: the exact field set at every level, plain data only; refs in the
157
- * artifact grammar; digests in `sha-256:<hex>`; byte counts; part ordinals in
158
- * range; unique, canonical execution keys; bounded paths that end at their key
159
- * and whose every prefix is itself an invocation; aliases that name a stored
160
- * key or a part; per-part result counts that match the invocations and
161
- * unmounted results that name the part; `complete` that admits what is listed.
185
+ * Checked: the exact field set at every level for its format, plain data only;
186
+ * refs in the artifact grammar; digests in `sha-256:<hex>`; byte counts; part
187
+ * ordinals in range; unique, canonical execution keys; bounded paths that end
188
+ * at their key and whose every prefix is itself an invocation; aliases that
189
+ * name a stored key or a part; per-part result counts that match the
190
+ * invocations and unmounted results that name the part; `complete` that
191
+ * admits what is listed. Format 2 also: every invocation's payload places,
192
+ * only on an invocation with a part, its `restoredBytes` exactly when one is
193
+ * `'same'`, and the counts equal to the sums over the invocations and the parts.
194
+ * An unknown format is refused here too; `isUnsupportedIndexFormat` names it.
162
195
  */
163
196
  export function readRecordingIndex(value) {
164
197
  try {
@@ -170,8 +203,57 @@ export function readRecordingIndex(value) {
170
203
  throw err;
171
204
  }
172
205
  }
206
+ function place(value) {
207
+ if (value !== 'same' && value !== 'stored')
208
+ refuse();
209
+ return value;
210
+ }
211
+ function payloadPlaces(value) {
212
+ const row = fields(value, [], ['entry', 'exit']);
213
+ const entry = ownValue(row, 'entry');
214
+ const exit = ownValue(row, 'exit');
215
+ if (entry === undefined && exit === undefined)
216
+ refuse();
217
+ return {
218
+ ...(entry !== undefined && { entry: place(entry) }),
219
+ ...(exit !== undefined && { exit: place(exit) }),
220
+ };
221
+ }
222
+ function sum(a, b) {
223
+ const total = a + b;
224
+ if (!Number.isSafeInteger(total))
225
+ refuse();
226
+ return total;
227
+ }
228
+ function subflowPayloadCounts(value) {
229
+ const row = fields(value, ['same', 'stored', 'restoredBytes', 'rows', 'kept']);
230
+ const kept = fields(row.kept, ['ambiguous', 'notLast', 'noPart']);
231
+ const rows = list(row.rows, RECORDING_PARTS_LIMITS.parts).map(count);
232
+ // Strictly ascending positions: no row twice, one order.
233
+ rows.forEach((at, i) => {
234
+ if (i > 0 && at <= rows[i - 1])
235
+ refuse();
236
+ });
237
+ return {
238
+ same: count(row.same),
239
+ stored: count(row.stored),
240
+ restoredBytes: count(row.restoredBytes),
241
+ rows,
242
+ kept: {
243
+ ambiguous: count(kept.ambiguous),
244
+ notLast: count(kept.notLast),
245
+ noPart: count(kept.noPart),
246
+ },
247
+ };
248
+ }
173
249
  function admit(value) {
174
250
  const limits = RECORDING_PARTS_LIMITS;
251
+ if (!isPlainObject(value))
252
+ refuse();
253
+ const format = ownValue(value, 'format');
254
+ if (format !== RECORDING_INDEX_FORMAT && format !== RECORDING_INDEX_FORMAT_V1)
255
+ refuse();
256
+ const v2 = format === RECORDING_INDEX_FORMAT;
175
257
  const root = fields(value, [
176
258
  'format',
177
259
  'packed',
@@ -182,9 +264,8 @@ function admit(value) {
182
264
  'invocations',
183
265
  'aliases',
184
266
  'unmounted',
267
+ ...(v2 ? ['subflowPayloads'] : []),
185
268
  ], ['runId', 'snapshotRunId']);
186
- if (root.format !== RECORDING_INDEX_FORMAT)
187
- refuse();
188
269
  const runId = optionalName(root, 'runId');
189
270
  const snapshotRunId = optionalName(root, 'snapshotRunId');
190
271
  const { packed, complete, hasSubflowResults } = root;
@@ -195,17 +276,22 @@ function admit(value) {
195
276
  }
196
277
  const base = stored(root.base);
197
278
  const parts = list(root.parts, limits.parts).map((row) => {
198
- const entry = stored(row, ['results']);
199
- return { ...entry, results: count(row.results) };
279
+ const entry = stored(row, v2 ? ['results', 'payloads'] : ['results']);
280
+ const results = count(row.results);
281
+ if (!v2)
282
+ return { ...entry, results };
283
+ return { ...entry, results, payloads: count(row.payloads) };
200
284
  });
201
285
  const refs = new Set([base.ref, ...parts.map((part) => part.ref)]);
202
286
  if (refs.size !== parts.length + 1)
203
287
  refuse();
204
288
  const perPart = new Array(parts.length).fill(0);
289
+ const storedPerPart = new Array(parts.length).fill(0);
290
+ const totals = { same: 0, stored: 0, restoredBytes: 0 };
205
291
  const keys = new Set();
206
292
  const paths = new Set();
207
293
  const invocations = list(root.invocations, limits.invocations).map((item) => {
208
- const row = fields(item, ['key', 'path', 'subflowId', 'part'], ['bytes']);
294
+ const row = fields(item, ['key', 'path', 'subflowId', 'part'], v2 ? ['bytes', 'payloads', 'restoredBytes'] : ['bytes']);
209
295
  if (!isCanonicalExecutionKey(row.key) || keys.has(row.key) || !isName(row.subflowId))
210
296
  refuse();
211
297
  const path = list(row.path, limits.pathSegments);
@@ -221,18 +307,37 @@ function admit(value) {
221
307
  keys.add(row.key);
222
308
  paths.add(pathKey(path));
223
309
  if (row.part === null) {
224
- if (ownValue(row, 'bytes') !== undefined)
310
+ if (ownValue(row, 'bytes') !== undefined ||
311
+ ownValue(row, 'payloads') !== undefined ||
312
+ ownValue(row, 'restoredBytes') !== undefined) {
225
313
  refuse();
314
+ }
226
315
  return { key: row.key, path: path, subflowId: row.subflowId, part: null };
227
316
  }
228
317
  const part = ordinal(row.part, parts.length);
229
318
  perPart[part] = (perPart[part] ?? 0) + 1;
319
+ const rawPlaces = ownValue(row, 'payloads');
320
+ const payloads = rawPlaces === undefined ? undefined : payloadPlaces(rawPlaces);
321
+ const places = payloads === undefined ? [] : [payloads.entry, payloads.exit];
322
+ const same = places.filter((at) => at === 'same').length;
323
+ const storedHere = places.filter((at) => at === 'stored').length;
324
+ const rawRestored = ownValue(row, 'restoredBytes');
325
+ // Present exactly when a payload is restored from the result.
326
+ if ((rawRestored !== undefined) !== same > 0)
327
+ refuse();
328
+ const restoredBytes = rawRestored === undefined ? undefined : count(rawRestored);
329
+ totals.same = sum(totals.same, same);
330
+ totals.stored = sum(totals.stored, storedHere);
331
+ totals.restoredBytes = sum(totals.restoredBytes, restoredBytes ?? 0);
332
+ storedPerPart[part] = (storedPerPart[part] ?? 0) + storedHere;
230
333
  return {
231
334
  key: row.key,
232
335
  path: path,
233
336
  subflowId: row.subflowId,
234
337
  part,
235
338
  bytes: count(row.bytes),
339
+ ...(payloads !== undefined && { payloads }),
340
+ ...(restoredBytes !== undefined && { restoredBytes }),
236
341
  };
237
342
  });
238
343
  for (const invocation of invocations) {
@@ -272,13 +377,26 @@ function admit(value) {
272
377
  parts.forEach((part, at) => {
273
378
  if (part.results !== perPart[at])
274
379
  refuse();
380
+ if (v2 && part.payloads !== storedPerPart[at])
381
+ refuse();
275
382
  });
276
383
  if (complete && (unmounted.length > 0 || invocations.some((i) => i.part === null)))
277
384
  refuse();
278
385
  if (!hasSubflowResults && (parts.length > 0 || aliases.length > 0))
279
386
  refuse();
387
+ let subflowPayloads;
388
+ if (v2) {
389
+ subflowPayloads = subflowPayloadCounts(root.subflowPayloads);
390
+ if (subflowPayloads.same !== totals.same ||
391
+ subflowPayloads.stored !== totals.stored ||
392
+ subflowPayloads.restoredBytes !== totals.restoredBytes ||
393
+ // A row is listed exactly when something moved.
394
+ subflowPayloads.rows.length > 0 !== totals.same + totals.stored > 0) {
395
+ refuse();
396
+ }
397
+ }
280
398
  return {
281
- format: RECORDING_INDEX_FORMAT,
399
+ format,
282
400
  ...(runId !== undefined && { runId }),
283
401
  ...(snapshotRunId !== undefined && { snapshotRunId }),
284
402
  packed,
@@ -289,6 +407,7 @@ function admit(value) {
289
407
  invocations,
290
408
  aliases,
291
409
  unmounted,
410
+ ...(subflowPayloads !== undefined && { subflowPayloads }),
292
411
  };
293
412
  }
294
413
  //# sourceMappingURL=format.js.map