@nodetool-ai/execution 0.8.1

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 (231) hide show
  1. package/README.md +129 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/app-debug/app-spec.d.ts +94 -0
  4. package/dist/app-debug/app-spec.d.ts.map +1 -0
  5. package/dist/app-debug/app-spec.js +710 -0
  6. package/dist/app-debug/app-spec.js.map +1 -0
  7. package/dist/app-debug/application-target.d.ts +53 -0
  8. package/dist/app-debug/application-target.d.ts.map +1 -0
  9. package/dist/app-debug/application-target.js +126 -0
  10. package/dist/app-debug/application-target.js.map +1 -0
  11. package/dist/app-debug/bundle-target.d.ts +21 -0
  12. package/dist/app-debug/bundle-target.d.ts.map +1 -0
  13. package/dist/app-debug/bundle-target.js +51 -0
  14. package/dist/app-debug/bundle-target.js.map +1 -0
  15. package/dist/app-debug/graph-shape.d.ts +14 -0
  16. package/dist/app-debug/graph-shape.d.ts.map +1 -0
  17. package/dist/app-debug/graph-shape.js +23 -0
  18. package/dist/app-debug/graph-shape.js.map +1 -0
  19. package/dist/app-debug/index.d.ts +26 -0
  20. package/dist/app-debug/index.d.ts.map +1 -0
  21. package/dist/app-debug/index.js +19 -0
  22. package/dist/app-debug/index.js.map +1 -0
  23. package/dist/app-debug/markdown.d.ts +6 -0
  24. package/dist/app-debug/markdown.d.ts.map +1 -0
  25. package/dist/app-debug/markdown.js +133 -0
  26. package/dist/app-debug/markdown.js.map +1 -0
  27. package/dist/app-debug/runtime.d.ts +267 -0
  28. package/dist/app-debug/runtime.d.ts.map +1 -0
  29. package/dist/app-debug/runtime.js +633 -0
  30. package/dist/app-debug/runtime.js.map +1 -0
  31. package/dist/app-debug/script-operation.d.ts +58 -0
  32. package/dist/app-debug/script-operation.d.ts.map +1 -0
  33. package/dist/app-debug/script-operation.js +44 -0
  34. package/dist/app-debug/script-operation.js.map +1 -0
  35. package/dist/app-debug/simulate.d.ts +85 -0
  36. package/dist/app-debug/simulate.d.ts.map +1 -0
  37. package/dist/app-debug/simulate.js +991 -0
  38. package/dist/app-debug/simulate.js.map +1 -0
  39. package/dist/app-debug/summarize.d.ts +64 -0
  40. package/dist/app-debug/summarize.d.ts.map +1 -0
  41. package/dist/app-debug/summarize.js +65 -0
  42. package/dist/app-debug/summarize.js.map +1 -0
  43. package/dist/app-debug/types.d.ts +343 -0
  44. package/dist/app-debug/types.d.ts.map +1 -0
  45. package/dist/app-debug/types.js +2 -0
  46. package/dist/app-debug/types.js.map +1 -0
  47. package/dist/cost-ledger.d.ts +147 -0
  48. package/dist/cost-ledger.d.ts.map +1 -0
  49. package/dist/cost-ledger.js +288 -0
  50. package/dist/cost-ledger.js.map +1 -0
  51. package/dist/debug/collector.d.ts +28 -0
  52. package/dist/debug/collector.d.ts.map +1 -0
  53. package/dist/debug/collector.js +284 -0
  54. package/dist/debug/collector.js.map +1 -0
  55. package/dist/debug/index.d.ts +15 -0
  56. package/dist/debug/index.d.ts.map +1 -0
  57. package/dist/debug/index.js +16 -0
  58. package/dist/debug/index.js.map +1 -0
  59. package/dist/debug/types.d.ts +179 -0
  60. package/dist/debug/types.d.ts.map +1 -0
  61. package/dist/debug/types.js +11 -0
  62. package/dist/debug/types.js.map +1 -0
  63. package/dist/debug/verdict.d.ts +27 -0
  64. package/dist/debug/verdict.d.ts.map +1 -0
  65. package/dist/debug/verdict.js +51 -0
  66. package/dist/debug/verdict.js.map +1 -0
  67. package/dist/executor-resolver.d.ts +13 -0
  68. package/dist/executor-resolver.d.ts.map +1 -0
  69. package/dist/executor-resolver.js +13 -0
  70. package/dist/executor-resolver.js.map +1 -0
  71. package/dist/fal-output-decoder.d.ts +36 -0
  72. package/dist/fal-output-decoder.d.ts.map +1 -0
  73. package/dist/fal-output-decoder.js +129 -0
  74. package/dist/fal-output-decoder.js.map +1 -0
  75. package/dist/generation-lifecycle.d.ts +54 -0
  76. package/dist/generation-lifecycle.d.ts.map +1 -0
  77. package/dist/generation-lifecycle.js +431 -0
  78. package/dist/generation-lifecycle.js.map +1 -0
  79. package/dist/generation-recovery-worker.d.ts +100 -0
  80. package/dist/generation-recovery-worker.d.ts.map +1 -0
  81. package/dist/generation-recovery-worker.js +995 -0
  82. package/dist/generation-recovery-worker.js.map +1 -0
  83. package/dist/generation-tracker.d.ts +83 -0
  84. package/dist/generation-tracker.d.ts.map +1 -0
  85. package/dist/generation-tracker.js +436 -0
  86. package/dist/generation-tracker.js.map +1 -0
  87. package/dist/index.d.ts +28 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +21 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/js-script-debug/index.d.ts +13 -0
  92. package/dist/js-script-debug/index.d.ts.map +1 -0
  93. package/dist/js-script-debug/index.js +12 -0
  94. package/dist/js-script-debug/index.js.map +1 -0
  95. package/dist/js-script-debug/markdown.d.ts +6 -0
  96. package/dist/js-script-debug/markdown.d.ts.map +1 -0
  97. package/dist/js-script-debug/markdown.js +62 -0
  98. package/dist/js-script-debug/markdown.js.map +1 -0
  99. package/dist/js-script-debug/outputs.d.ts +20 -0
  100. package/dist/js-script-debug/outputs.d.ts.map +1 -0
  101. package/dist/js-script-debug/outputs.js +30 -0
  102. package/dist/js-script-debug/outputs.js.map +1 -0
  103. package/dist/js-script-debug/report.d.ts +15 -0
  104. package/dist/js-script-debug/report.d.ts.map +1 -0
  105. package/dist/js-script-debug/report.js +90 -0
  106. package/dist/js-script-debug/report.js.map +1 -0
  107. package/dist/js-script-debug/types.d.ts +63 -0
  108. package/dist/js-script-debug/types.d.ts.map +1 -0
  109. package/dist/js-script-debug/types.js +10 -0
  110. package/dist/js-script-debug/types.js.map +1 -0
  111. package/dist/js-script-debug/validate.d.ts +38 -0
  112. package/dist/js-script-debug/validate.d.ts.map +1 -0
  113. package/dist/js-script-debug/validate.js +137 -0
  114. package/dist/js-script-debug/validate.js.map +1 -0
  115. package/dist/message-stream.d.ts +33 -0
  116. package/dist/message-stream.d.ts.map +1 -0
  117. package/dist/message-stream.js +58 -0
  118. package/dist/message-stream.js.map +1 -0
  119. package/dist/normalize-graph.d.ts +13 -0
  120. package/dist/normalize-graph.d.ts.map +1 -0
  121. package/dist/normalize-graph.js +63 -0
  122. package/dist/normalize-graph.js.map +1 -0
  123. package/dist/output-names.d.ts +13 -0
  124. package/dist/output-names.d.ts.map +1 -0
  125. package/dist/output-names.js +13 -0
  126. package/dist/output-names.js.map +1 -0
  127. package/dist/predicates.d.ts +6 -0
  128. package/dist/predicates.d.ts.map +1 -0
  129. package/dist/predicates.js +6 -0
  130. package/dist/predicates.js.map +1 -0
  131. package/dist/preflight.d.ts +87 -0
  132. package/dist/preflight.d.ts.map +1 -0
  133. package/dist/preflight.js +139 -0
  134. package/dist/preflight.js.map +1 -0
  135. package/dist/provider-secret-key.d.ts +3 -0
  136. package/dist/provider-secret-key.d.ts.map +1 -0
  137. package/dist/provider-secret-key.js +7 -0
  138. package/dist/provider-secret-key.js.map +1 -0
  139. package/dist/service/app-debug-service.d.ts +78 -0
  140. package/dist/service/app-debug-service.d.ts.map +1 -0
  141. package/dist/service/app-debug-service.js +201 -0
  142. package/dist/service/app-debug-service.js.map +1 -0
  143. package/dist/service/app-run-server.d.ts +28 -0
  144. package/dist/service/app-run-server.d.ts.map +1 -0
  145. package/dist/service/app-run-server.js +104 -0
  146. package/dist/service/app-run-server.js.map +1 -0
  147. package/dist/service/debug-sessions.d.ts +158 -0
  148. package/dist/service/debug-sessions.d.ts.map +1 -0
  149. package/dist/service/debug-sessions.js +358 -0
  150. package/dist/service/debug-sessions.js.map +1 -0
  151. package/dist/service/index.d.ts +22 -0
  152. package/dist/service/index.d.ts.map +1 -0
  153. package/dist/service/index.js +17 -0
  154. package/dist/service/index.js.map +1 -0
  155. package/dist/service/job-progress.d.ts +40 -0
  156. package/dist/service/job-progress.d.ts.map +1 -0
  157. package/dist/service/job-progress.js +53 -0
  158. package/dist/service/job-progress.js.map +1 -0
  159. package/dist/service/workflow-run.d.ts +279 -0
  160. package/dist/service/workflow-run.d.ts.map +1 -0
  161. package/dist/service/workflow-run.js +598 -0
  162. package/dist/service/workflow-run.js.map +1 -0
  163. package/dist/service/workflow-workspace.d.ts +89 -0
  164. package/dist/service/workflow-workspace.d.ts.map +1 -0
  165. package/dist/service/workflow-workspace.js +160 -0
  166. package/dist/service/workflow-workspace.js.map +1 -0
  167. package/dist/session.d.ts +62 -0
  168. package/dist/session.d.ts.map +1 -0
  169. package/dist/session.js +353 -0
  170. package/dist/session.js.map +1 -0
  171. package/dist/sketch-debug/index.d.ts +11 -0
  172. package/dist/sketch-debug/index.d.ts.map +1 -0
  173. package/dist/sketch-debug/index.js +10 -0
  174. package/dist/sketch-debug/index.js.map +1 -0
  175. package/dist/sketch-debug/markdown.d.ts +6 -0
  176. package/dist/sketch-debug/markdown.d.ts.map +1 -0
  177. package/dist/sketch-debug/markdown.js +93 -0
  178. package/dist/sketch-debug/markdown.js.map +1 -0
  179. package/dist/sketch-debug/report.d.ts +15 -0
  180. package/dist/sketch-debug/report.d.ts.map +1 -0
  181. package/dist/sketch-debug/report.js +98 -0
  182. package/dist/sketch-debug/report.js.map +1 -0
  183. package/dist/sketch-debug/types.d.ts +62 -0
  184. package/dist/sketch-debug/types.d.ts.map +1 -0
  185. package/dist/sketch-debug/types.js +10 -0
  186. package/dist/sketch-debug/types.js.map +1 -0
  187. package/dist/sketch-debug/validate.d.ts +14 -0
  188. package/dist/sketch-debug/validate.d.ts.map +1 -0
  189. package/dist/sketch-debug/validate.js +478 -0
  190. package/dist/sketch-debug/validate.js.map +1 -0
  191. package/dist/supervisor.d.ts +45 -0
  192. package/dist/supervisor.d.ts.map +1 -0
  193. package/dist/supervisor.js +97 -0
  194. package/dist/supervisor.js.map +1 -0
  195. package/dist/timeline-debug/index.d.ts +11 -0
  196. package/dist/timeline-debug/index.d.ts.map +1 -0
  197. package/dist/timeline-debug/index.js +10 -0
  198. package/dist/timeline-debug/index.js.map +1 -0
  199. package/dist/timeline-debug/legibility.d.ts +23 -0
  200. package/dist/timeline-debug/legibility.d.ts.map +1 -0
  201. package/dist/timeline-debug/legibility.js +240 -0
  202. package/dist/timeline-debug/legibility.js.map +1 -0
  203. package/dist/timeline-debug/markdown.d.ts +6 -0
  204. package/dist/timeline-debug/markdown.d.ts.map +1 -0
  205. package/dist/timeline-debug/markdown.js +103 -0
  206. package/dist/timeline-debug/markdown.js.map +1 -0
  207. package/dist/timeline-debug/motion.d.ts +20 -0
  208. package/dist/timeline-debug/motion.d.ts.map +1 -0
  209. package/dist/timeline-debug/motion.js +362 -0
  210. package/dist/timeline-debug/motion.js.map +1 -0
  211. package/dist/timeline-debug/report.d.ts +16 -0
  212. package/dist/timeline-debug/report.d.ts.map +1 -0
  213. package/dist/timeline-debug/report.js +100 -0
  214. package/dist/timeline-debug/report.js.map +1 -0
  215. package/dist/timeline-debug/showcase.d.ts +7 -0
  216. package/dist/timeline-debug/showcase.d.ts.map +1 -0
  217. package/dist/timeline-debug/showcase.js +347 -0
  218. package/dist/timeline-debug/showcase.js.map +1 -0
  219. package/dist/timeline-debug/types.d.ts +64 -0
  220. package/dist/timeline-debug/types.d.ts.map +1 -0
  221. package/dist/timeline-debug/types.js +10 -0
  222. package/dist/timeline-debug/types.js.map +1 -0
  223. package/dist/timeline-debug/validate.d.ts +24 -0
  224. package/dist/timeline-debug/validate.d.ts.map +1 -0
  225. package/dist/timeline-debug/validate.js +1432 -0
  226. package/dist/timeline-debug/validate.js.map +1 -0
  227. package/dist/types.d.ts +211 -0
  228. package/dist/types.d.ts.map +1 -0
  229. package/dist/types.js +2 -0
  230. package/dist/types.js.map +1 -0
  231. package/package.json +103 -0
@@ -0,0 +1,267 @@
1
+ /**
2
+ * Headless driver for the shared app runtime core.
3
+ *
4
+ * The fold rules, the state namespaces, the run policy, and the action
5
+ * vocabulary all live in `@nodetool-ai/app-runtime` — the same code the web and
6
+ * mobile runtimes run. This file only supplies what a headless run needs: a
7
+ * workflow executor per operation and the bookkeeping that turns an awaited run
8
+ * into an invocation, plus the in-memory resource collections a run gets in
9
+ * place of the server-backed ones the web runtime reads.
10
+ *
11
+ * The web engine's reactive subgraph runs collapse to full workflow runs here
12
+ * (the headless kernel has no browser worker), which the report notes rather
13
+ * than simulates.
14
+ */
15
+ import { type AppAction, type AppInstanceState, type BindingRef, type BindingScope, type ConditionProps, type OperationBinding, type ResourceBinding, type ResourceKind, type ResourceOperation, type ResourceRef, type RunDecision, type VariableDeclaration } from "@nodetool-ai/app-runtime";
16
+ import type { ResourceDetail } from "@nodetool-ai/protocol/api-schemas/resources.js";
17
+ /** What one run returned: its messages plus where its report landed. */
18
+ export interface HeadlessRunResult {
19
+ messages: ReadonlyArray<Record<string, unknown>>;
20
+ /** Index into the harness's `runs` array. */
21
+ runIndex: number;
22
+ }
23
+ export interface HeadlessOperationInit {
24
+ binding: OperationBinding;
25
+ /** Output node id → the state key its value lands in. */
26
+ outputKeyByNodeId: ReadonlyMap<string, string>;
27
+ /** Input node ids, in graph order. */
28
+ inputNodeIds: ReadonlyArray<string>;
29
+ /** Input node id → the param name the run protocol expects. */
30
+ inputNameByNodeId: ReadonlyMap<string, string>;
31
+ /** Input node id → node type, for shared admission checks. */
32
+ inputNodeTypeByNodeId?: ReadonlyMap<string, string>;
33
+ /** Input defaults, keyed by input state key. */
34
+ defaults: Record<string, unknown>;
35
+ /**
36
+ * Execute the operation's workflow. Absent when the workflow could not be
37
+ * loaded — dispatching a run then records why instead of throwing.
38
+ */
39
+ runWorkflow?: (params: Record<string, unknown>) => Promise<HeadlessRunResult>;
40
+ }
41
+ /** A widget's declarative logic props, as the document stores them. */
42
+ interface HeadlessWidgetInit {
43
+ id: string;
44
+ visibleWhen?: ConditionProps;
45
+ disabledWhen?: ConditionProps;
46
+ /** `{binding|filter}` template rendered in place of the raw value. */
47
+ format?: string;
48
+ }
49
+ /** Whether a widget is on screen and usable, as of the last fold. */
50
+ interface HeadlessWidgetState {
51
+ visible: boolean;
52
+ disabled: boolean;
53
+ /** True once the widget was both visible and enabled at any point. */
54
+ everReachable: boolean;
55
+ /** The `visibleWhen` condition in prose, or null when it has none. */
56
+ visibleWhen: string | null;
57
+ /** The `disabledWhen` condition in prose, or null when it has none. */
58
+ disabledWhen: string | null;
59
+ }
60
+ interface HeadlessRuntimeInit {
61
+ operations: ReadonlyArray<HeadlessOperationInit>;
62
+ /** The operation a bare `run`/`cancel` targets. */
63
+ defaultOperationId: string;
64
+ /** Declared variables, for `seedVariables`. */
65
+ variables?: ReadonlyArray<VariableDeclaration>;
66
+ /** Declared resource bindings — what `seedResource` can attach a collection to. */
67
+ resources?: ReadonlyArray<ResourceBinding>;
68
+ /** Ceiling on every run, on top of each operation's own `timeoutMs`. */
69
+ timeoutMs?: number;
70
+ /** Placed widgets, for condition and `format` evaluation. */
71
+ widgets?: ReadonlyArray<HeadlessWidgetInit>;
72
+ /** The scope widget conditions and `format` tokens resolve against. */
73
+ scope?: BindingScope;
74
+ }
75
+ /**
76
+ * A condition as a failure message names it: `draft notEmpty`, `count gt 3`.
77
+ * The stored props are what an author sees in the builder, so the message
78
+ * points at something they can find.
79
+ */
80
+ export declare const describeCondition: (props: ConditionProps | null | undefined) => string | null;
81
+ /**
82
+ * Why a ref cannot be written, or null when it can.
83
+ *
84
+ * Only a run fills an output slot or an operation's execution state, so a
85
+ * script that writes one has named the wrong thing — the value would land in
86
+ * the inputs namespace, where nothing reads it.
87
+ */
88
+ export declare const writeRefusal: (ref: BindingRef) => string | null;
89
+ /**
90
+ * One member of a collection, in the envelope the resources router speaks
91
+ * (`ResourceDetail`): a `ResourceRef`, the fields a picker lists, and the
92
+ * provider's payload.
93
+ */
94
+ export type ResourceItem = ResourceDetail;
95
+ /** A collection member as a seed step or a `resource:` param writes it. */
96
+ export interface SeedResourceItem {
97
+ id: string;
98
+ name?: string;
99
+ /** The provider's payload: a document body, or an asset's metadata. */
100
+ document?: unknown;
101
+ contentType?: string | null;
102
+ projectId?: string | null;
103
+ revision?: number;
104
+ updatedAt?: string;
105
+ }
106
+ /** What a `resourceCommand` asks a provider to do. */
107
+ export interface HeadlessResourceCommand {
108
+ command: ResourceOperation | "upload";
109
+ /** The item the widget points at. Ignored by `create` and `upload`. */
110
+ ref?: ResourceRef | null;
111
+ args?: Record<string, unknown>;
112
+ }
113
+ /** How to seed a collection, named in every message about an unseeded one. */
114
+ export declare const seedResourceHint: (resourceBindingId: string) => string;
115
+ /**
116
+ * The collection behind one resource binding, held in memory for the length of
117
+ * one debug run.
118
+ *
119
+ * The web runtime reads collections over tRPC and hands widgets a `ResourceRef`
120
+ * to act on; a headless run has no server and no user, so it gets the same
121
+ * envelope from a seeded provider instead. Nothing here touches the database —
122
+ * a run only ever sees what the interaction script or `--params` put in.
123
+ *
124
+ * Selection follows `useBoundResource`: a pinned `fixedId` wins, else the item
125
+ * the last command or `select` chose, else the first member — so a picker that
126
+ * nobody touched still has something to send.
127
+ */
128
+ export declare class InMemoryResourceProvider {
129
+ readonly kind: ResourceKind;
130
+ private readonly items;
131
+ private readonly pinnedId;
132
+ private chosenId;
133
+ private seq;
134
+ constructor(init: {
135
+ kind: ResourceKind;
136
+ items?: ReadonlyArray<SeedResourceItem>;
137
+ /** A binding scoped to one document pins its id. */
138
+ pinnedId?: string;
139
+ });
140
+ /**
141
+ * Timestamps come from a counter, not the clock, so two runs of the same
142
+ * script produce identical reports.
143
+ */
144
+ private toItem;
145
+ list(): ResourceItem[];
146
+ get(id: string): ResourceItem | null;
147
+ /** The item a `from: "resource"` param sends and a command acts on. */
148
+ selected(): ResourceRef | null;
149
+ select(ref: ResourceRef | null): void;
150
+ apply(op: HeadlessResourceCommand): ResourceItem | null;
151
+ /** An id no member holds, so `create` twice makes two resources. */
152
+ private nextId;
153
+ }
154
+ /** One simulated invocation, as the report shows it. */
155
+ interface HeadlessInvocationRecord {
156
+ id: string;
157
+ operationId: string;
158
+ decision: RunDecision["kind"];
159
+ decisionTargets: string[];
160
+ runIndex: number | null;
161
+ timedOutMs: number | null;
162
+ activity: string[];
163
+ }
164
+ /**
165
+ * The timeout a run actually gets: the operation's own `timeoutMs` capped by
166
+ * the harness-wide ceiling, so `--timeout` always shortens and never extends.
167
+ */
168
+ export declare const effectiveTimeoutMs: (operationTimeoutMs: number | null | undefined, ceilingMs: number | null | undefined) => number | null;
169
+ export declare class HeadlessAppRuntime {
170
+ private _state;
171
+ runCount: number;
172
+ /**
173
+ * Every state write goes through here, so a widget's conditions are re-read
174
+ * after each fold — exactly where the web runtime re-renders.
175
+ */
176
+ get state(): AppInstanceState;
177
+ set state(next: AppInstanceState);
178
+ /** Every invocation started, in order. */
179
+ readonly invocations: HeadlessInvocationRecord[];
180
+ /** Every activity label reported, in order. */
181
+ readonly activity: Array<{
182
+ invocationId: string;
183
+ operationId: string;
184
+ label: string;
185
+ }>;
186
+ private readonly init;
187
+ private readonly byId;
188
+ /** Runs the harness stopped waiting for, still settling in the background. */
189
+ private readonly inFlight;
190
+ private invocationSeq;
191
+ /** Widget conditions, parsed once, plus the state each evaluation writes. */
192
+ private readonly compiled;
193
+ private readonly widgetStates;
194
+ /** Declared resource bindings, keyed by id. */
195
+ private readonly resourceBindings;
196
+ /** Seeded collections, keyed by resource binding id. */
197
+ private readonly providers;
198
+ /** Every resource command dispatched, in order. */
199
+ readonly resourceCommands: Array<{
200
+ resourceBindingId: string;
201
+ command: string;
202
+ }>;
203
+ constructor(init: HeadlessRuntimeInit);
204
+ /**
205
+ * Re-evaluate every widget's `visibleWhen`/`disabledWhen` against the current
206
+ * state. An unset or unresolvable condition leaves the widget visible and
207
+ * enabled, the same fallback the web runtime uses.
208
+ */
209
+ private refreshWidgets;
210
+ /** A widget's current visibility, or null when the runtime has no such widget. */
211
+ widgetState(widgetId: string): HeadlessWidgetState | null;
212
+ /**
213
+ * What a widget displays: its `format` template rendered against the current
214
+ * state, or null when it has none and shows its bound value raw.
215
+ */
216
+ display(widgetId: string): string | null;
217
+ /**
218
+ * Attach a collection to a declared resource binding, replacing whatever was
219
+ * seeded before. Seeding is the only way a headless run gets resources.
220
+ */
221
+ seedResource(resourceBindingId: string, items: ReadonlyArray<SeedResourceItem>): InMemoryResourceProvider;
222
+ /** The collection behind a resource binding, or null when nothing seeded it. */
223
+ resourceProvider(resourceBindingId: string): InMemoryResourceProvider | null;
224
+ /** Resource bindings the document declares, in document order. */
225
+ get resourceBindingList(): ResourceBinding[];
226
+ /** Last error reported against an operation's active invocation. */
227
+ errorFor(operationId: string): string | null;
228
+ get error(): string | null;
229
+ /**
230
+ * Write a value through its resolved binding.
231
+ *
232
+ * A ref {@link writeRefusal} rejects throws instead of landing in the inputs
233
+ * namespace: an output slot only a run fills, written as an input, is a value
234
+ * no reader ever sees, and the step that wrote it must not report success.
235
+ */
236
+ write(ref: BindingRef, value: unknown): void;
237
+ /**
238
+ * HOLDOUT (anti-slop/no-unknown-returns): a slot holds a workflow value —
239
+ * the open domain `AppInstanceState` stores as `unknown`.
240
+ */
241
+ read(ref: BindingRef | null): unknown;
242
+ /**
243
+ * Params for one operation's run: every input resolved through its mapping
244
+ * (widget value, variable, constant, or resource), keyed by node name.
245
+ */
246
+ collectParams(operationId: string): Record<string, unknown>;
247
+ /**
248
+ * Refuse to run an operation whose inputs read a collection nothing seeded.
249
+ * Sending no param for it would look like a passing run against an app that
250
+ * cannot work, which is the failure this harness exists to catch.
251
+ */
252
+ private assertResourcesSeeded;
253
+ private assertRequiredInputs;
254
+ /** Dispatch one action; a `run` executes the workflow and folds its stream. */
255
+ dispatch(action: AppAction): Promise<void>;
256
+ /** Cancel an operation's live invocations (or one named invocation). */
257
+ cancel(operationId: string, invocationId?: string): string[];
258
+ private timeoutFor;
259
+ /**
260
+ * Start one run, after `decideRun` says what the operation's policy makes of
261
+ * whatever is already in flight.
262
+ */
263
+ private run;
264
+ private recordActivity;
265
+ }
266
+ export {};
267
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/app-debug/runtime.ts"],"names":[],"mappings":"AA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