@farmslot/recipe-runner 0.23.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 (212) hide show
  1. package/CHANGELOG.md +255 -0
  2. package/LICENSE +21 -0
  3. package/README.md +274 -0
  4. package/bin/farmslot-visual-review.mjs +152 -0
  5. package/dist/adapters/app-lifecycle.d.ts +41 -0
  6. package/dist/adapters/app-lifecycle.d.ts.map +1 -0
  7. package/dist/adapters/app-lifecycle.js +224 -0
  8. package/dist/adapters/app-lifecycle.js.map +1 -0
  9. package/dist/adapters/core.d.ts +5 -0
  10. package/dist/adapters/core.d.ts.map +1 -0
  11. package/dist/adapters/core.js +433 -0
  12. package/dist/adapters/core.js.map +1 -0
  13. package/dist/adapters/gesture.d.ts +12 -0
  14. package/dist/adapters/gesture.d.ts.map +1 -0
  15. package/dist/adapters/gesture.js +76 -0
  16. package/dist/adapters/gesture.js.map +1 -0
  17. package/dist/adapters/ui.d.ts +33 -0
  18. package/dist/adapters/ui.d.ts.map +1 -0
  19. package/dist/adapters/ui.js +130 -0
  20. package/dist/adapters/ui.js.map +1 -0
  21. package/dist/cli/error-output.d.ts +6 -0
  22. package/dist/cli/error-output.d.ts.map +1 -0
  23. package/dist/cli/error-output.js +19 -0
  24. package/dist/cli/error-output.js.map +1 -0
  25. package/dist/cli/index.d.ts +12 -0
  26. package/dist/cli/index.d.ts.map +1 -0
  27. package/dist/cli/index.js +29 -0
  28. package/dist/cli/index.js.map +1 -0
  29. package/dist/cli/run-command.d.ts +8 -0
  30. package/dist/cli/run-command.d.ts.map +1 -0
  31. package/dist/cli/run-command.js +253 -0
  32. package/dist/cli/run-command.js.map +1 -0
  33. package/dist/cli/support.d.ts +31 -0
  34. package/dist/cli/support.d.ts.map +1 -0
  35. package/dist/cli/support.js +297 -0
  36. package/dist/cli/support.js.map +1 -0
  37. package/dist/cli/validate-command.d.ts +4 -0
  38. package/dist/cli/validate-command.d.ts.map +1 -0
  39. package/dist/cli/validate-command.js +52 -0
  40. package/dist/cli/validate-command.js.map +1 -0
  41. package/dist/core/compose.d.ts +23 -0
  42. package/dist/core/compose.d.ts.map +1 -0
  43. package/dist/core/compose.js +104 -0
  44. package/dist/core/compose.js.map +1 -0
  45. package/dist/core/execution.d.ts +44 -0
  46. package/dist/core/execution.d.ts.map +1 -0
  47. package/dist/core/execution.js +304 -0
  48. package/dist/core/execution.js.map +1 -0
  49. package/dist/core/failure.d.ts +23 -0
  50. package/dist/core/failure.d.ts.map +1 -0
  51. package/dist/core/failure.js +43 -0
  52. package/dist/core/failure.js.map +1 -0
  53. package/dist/core/graph.d.ts +12 -0
  54. package/dist/core/graph.d.ts.map +1 -0
  55. package/dist/core/graph.js +65 -0
  56. package/dist/core/graph.js.map +1 -0
  57. package/dist/core/hud.d.ts +11 -0
  58. package/dist/core/hud.d.ts.map +1 -0
  59. package/dist/core/hud.js +120 -0
  60. package/dist/core/hud.js.map +1 -0
  61. package/dist/core/invocation.d.ts +13 -0
  62. package/dist/core/invocation.d.ts.map +1 -0
  63. package/dist/core/invocation.js +68 -0
  64. package/dist/core/invocation.js.map +1 -0
  65. package/dist/core/json.d.ts +9 -0
  66. package/dist/core/json.d.ts.map +1 -0
  67. package/dist/core/json.js +74 -0
  68. package/dist/core/json.js.map +1 -0
  69. package/dist/core/library-manifest.d.ts +53 -0
  70. package/dist/core/library-manifest.d.ts.map +1 -0
  71. package/dist/core/library-manifest.js +263 -0
  72. package/dist/core/library-manifest.js.map +1 -0
  73. package/dist/core/library.d.ts +80 -0
  74. package/dist/core/library.d.ts.map +1 -0
  75. package/dist/core/library.js +321 -0
  76. package/dist/core/library.js.map +1 -0
  77. package/dist/core/parameters.d.ts +5 -0
  78. package/dist/core/parameters.d.ts.map +1 -0
  79. package/dist/core/parameters.js +57 -0
  80. package/dist/core/parameters.js.map +1 -0
  81. package/dist/core/passive-observations.d.ts +25 -0
  82. package/dist/core/passive-observations.d.ts.map +1 -0
  83. package/dist/core/passive-observations.js +62 -0
  84. package/dist/core/passive-observations.js.map +1 -0
  85. package/dist/core/path.d.ts +7 -0
  86. package/dist/core/path.d.ts.map +1 -0
  87. package/dist/core/path.js +147 -0
  88. package/dist/core/path.js.map +1 -0
  89. package/dist/core/recording-cleanup.d.ts +10 -0
  90. package/dist/core/recording-cleanup.d.ts.map +1 -0
  91. package/dist/core/recording-cleanup.js +32 -0
  92. package/dist/core/recording-cleanup.js.map +1 -0
  93. package/dist/core/resolution-error.d.ts +7 -0
  94. package/dist/core/resolution-error.d.ts.map +1 -0
  95. package/dist/core/resolution-error.js +9 -0
  96. package/dist/core/resolution-error.js.map +1 -0
  97. package/dist/core/runner.d.ts +4 -0
  98. package/dist/core/runner.d.ts.map +1 -0
  99. package/dist/core/runner.js +738 -0
  100. package/dist/core/runner.js.map +1 -0
  101. package/dist/core/scroll-to.d.ts +111 -0
  102. package/dist/core/scroll-to.d.ts.map +1 -0
  103. package/dist/core/scroll-to.js +353 -0
  104. package/dist/core/scroll-to.js.map +1 -0
  105. package/dist/core/suite.d.ts +25 -0
  106. package/dist/core/suite.d.ts.map +1 -0
  107. package/dist/core/suite.js +76 -0
  108. package/dist/core/suite.js.map +1 -0
  109. package/dist/core/trace.d.ts +5 -0
  110. package/dist/core/trace.d.ts.map +1 -0
  111. package/dist/core/trace.js +25 -0
  112. package/dist/core/trace.js.map +1 -0
  113. package/dist/core/trust-error.d.ts +9 -0
  114. package/dist/core/trust-error.d.ts.map +1 -0
  115. package/dist/core/trust-error.js +18 -0
  116. package/dist/core/trust-error.js.map +1 -0
  117. package/dist/core/trust-input.d.ts +20 -0
  118. package/dist/core/trust-input.d.ts.map +1 -0
  119. package/dist/core/trust-input.js +68 -0
  120. package/dist/core/trust-input.js.map +1 -0
  121. package/dist/core/trust.d.ts +28 -0
  122. package/dist/core/trust.d.ts.map +1 -0
  123. package/dist/core/trust.js +284 -0
  124. package/dist/core/trust.js.map +1 -0
  125. package/dist/core/types.d.ts +319 -0
  126. package/dist/core/types.d.ts.map +1 -0
  127. package/dist/core/types.js +2 -0
  128. package/dist/core/types.js.map +1 -0
  129. package/dist/core/validation.d.ts +4 -0
  130. package/dist/core/validation.d.ts.map +1 -0
  131. package/dist/core/validation.js +18 -0
  132. package/dist/core/validation.js.map +1 -0
  133. package/dist/index.d.ts +32 -0
  134. package/dist/index.d.ts.map +1 -0
  135. package/dist/index.js +25 -0
  136. package/dist/index.js.map +1 -0
  137. package/dist/node/writers.d.ts +27 -0
  138. package/dist/node/writers.d.ts.map +1 -0
  139. package/dist/node/writers.js +99 -0
  140. package/dist/node/writers.js.map +1 -0
  141. package/dist/recording/android-mirror.d.ts +10 -0
  142. package/dist/recording/android-mirror.d.ts.map +1 -0
  143. package/dist/recording/android-mirror.js +180 -0
  144. package/dist/recording/android-mirror.js.map +1 -0
  145. package/dist/recording/capture-helper-timing.d.ts +4 -0
  146. package/dist/recording/capture-helper-timing.d.ts.map +1 -0
  147. package/dist/recording/capture-helper-timing.js +47 -0
  148. package/dist/recording/capture-helper-timing.js.map +1 -0
  149. package/dist/recording/capture-helper.d.ts +10 -0
  150. package/dist/recording/capture-helper.d.ts.map +1 -0
  151. package/dist/recording/capture-helper.js +335 -0
  152. package/dist/recording/capture-helper.js.map +1 -0
  153. package/dist/recording/cdp-video-recorder.d.ts +9 -0
  154. package/dist/recording/cdp-video-recorder.d.ts.map +1 -0
  155. package/dist/recording/cdp-video-recorder.js +319 -0
  156. package/dist/recording/cdp-video-recorder.js.map +1 -0
  157. package/dist/recording/frame-sampler.d.ts +19 -0
  158. package/dist/recording/frame-sampler.d.ts.map +1 -0
  159. package/dist/recording/frame-sampler.js +29 -0
  160. package/dist/recording/frame-sampler.js.map +1 -0
  161. package/dist/recording/timeline.d.ts +15 -0
  162. package/dist/recording/timeline.d.ts.map +1 -0
  163. package/dist/recording/timeline.js +88 -0
  164. package/dist/recording/timeline.js.map +1 -0
  165. package/dist/runtime/browser-extension.d.ts +17 -0
  166. package/dist/runtime/browser-extension.d.ts.map +1 -0
  167. package/dist/runtime/browser-extension.js +42 -0
  168. package/dist/runtime/browser-extension.js.map +1 -0
  169. package/dist/runtime/cdp.d.ts +138 -0
  170. package/dist/runtime/cdp.d.ts.map +1 -0
  171. package/dist/runtime/cdp.js +1429 -0
  172. package/dist/runtime/cdp.js.map +1 -0
  173. package/dist/runtime/decision-types.d.ts +23 -0
  174. package/dist/runtime/decision-types.d.ts.map +1 -0
  175. package/dist/runtime/decision-types.js +2 -0
  176. package/dist/runtime/decision-types.js.map +1 -0
  177. package/dist/runtime/deps-readiness.d.ts +21 -0
  178. package/dist/runtime/deps-readiness.d.ts.map +1 -0
  179. package/dist/runtime/deps-readiness.js +141 -0
  180. package/dist/runtime/deps-readiness.js.map +1 -0
  181. package/dist/runtime/log-analysis.d.ts +48 -0
  182. package/dist/runtime/log-analysis.d.ts.map +1 -0
  183. package/dist/runtime/log-analysis.js +128 -0
  184. package/dist/runtime/log-analysis.js.map +1 -0
  185. package/dist/runtime/metro-probe.d.ts +5 -0
  186. package/dist/runtime/metro-probe.d.ts.map +1 -0
  187. package/dist/runtime/metro-probe.js +24 -0
  188. package/dist/runtime/metro-probe.js.map +1 -0
  189. package/dist/runtime/operation.d.ts +32 -0
  190. package/dist/runtime/operation.d.ts.map +1 -0
  191. package/dist/runtime/operation.js +184 -0
  192. package/dist/runtime/operation.js.map +1 -0
  193. package/dist/runtime/orchestrate-up.d.ts +22 -0
  194. package/dist/runtime/orchestrate-up.d.ts.map +1 -0
  195. package/dist/runtime/orchestrate-up.js +35 -0
  196. package/dist/runtime/orchestrate-up.js.map +1 -0
  197. package/dist/runtime/react-native-bridge.d.ts +17 -0
  198. package/dist/runtime/react-native-bridge.d.ts.map +1 -0
  199. package/dist/runtime/react-native-bridge.js +57 -0
  200. package/dist/runtime/react-native-bridge.js.map +1 -0
  201. package/dist/version.d.ts +2 -0
  202. package/dist/version.d.ts.map +1 -0
  203. package/dist/version.js +8 -0
  204. package/dist/version.js.map +1 -0
  205. package/package.json +163 -0
  206. package/test/fixtures/scroll-to-visible/README.md +39 -0
  207. package/visual-review/feedback-draft.mjs +82 -0
  208. package/visual-review/index.d.mts +41 -0
  209. package/visual-review/index.mjs +4 -0
  210. package/visual-review/recipe-board.mjs +142 -0
  211. package/visual-review/review-board.mjs +981 -0
  212. package/visual-review/server.mjs +69 -0
@@ -0,0 +1,319 @@
1
+ import type { RecipeActionManifestDocument, RecipeArtifactManifestEntry, RecipeExecutionApproval, RecipeExecutionCapability, RecipeExecutionPlan, RecipeFailureCause, RecipeResolutionDocument, RecipeSourceProvenance, UiObserverRef } from '@farmslot/protocol';
2
+ export type RecipeRunStatus = 'pass' | 'fail' | 'unknown';
3
+ export type RecipeVideoRecordingMode = 'off' | 'full-run';
4
+ export interface RecipeRunRequest {
5
+ recipePath?: string;
6
+ recipeDocument?: unknown;
7
+ artifactsDir: string;
8
+ projectRoot?: string;
9
+ env?: Record<string, string | undefined>;
10
+ /** Disable ambient process inheritance when the caller supplies the complete execution environment. */
11
+ inheritProcessEnv?: boolean;
12
+ recordVideo?: boolean | RecipeVideoRecordingMode | RecipeVideoRecordingOptions;
13
+ /** Provenance assigned by the caller; omitted sources receive unknown trust. */
14
+ source?: RecipeSourceProvenance;
15
+ /** Out-of-band approval bound to the fully resolved execution-plan digest. */
16
+ approval?: RecipeExecutionApproval;
17
+ /** Root recipe parameters. Defaults from paramsSchema are applied first. */
18
+ params?: Record<string, unknown>;
19
+ /** Active adapter used for recipe selection and manifest capability validation. */
20
+ adapter?: string;
21
+ /** Ordered recipe library sources; the first source declaring a recipe ref wins. */
22
+ librarySources?: RecipeLibrarySource[];
23
+ /** Package versions the host provides for checking each library's `requires`. */
24
+ packageVersions?: Readonly<Record<string, string>>;
25
+ /** How the caller chose a library recipe by name; recorded in the summary. */
26
+ selection?: RecipeSelection;
27
+ /**
28
+ * Partial execution: stop the root graph after this node succeeds, then run the recipe's
29
+ * declared teardown. The node must be reachable from workflow.entry.
30
+ */
31
+ stopAfterNode?: string;
32
+ }
33
+ export interface RecipeLibrarySource {
34
+ /** Source name used in resolution output. Defaults to the directory basename. */
35
+ name?: string;
36
+ /** Library root directory containing recipes/ and optionally runner-owned manifests/actions. */
37
+ root: string;
38
+ /** Trust comes from caller configuration, never from library contents. */
39
+ provenance?: RecipeSourceProvenance;
40
+ /** Where the entry was configured: --library flag, RECIPE_LIBRARY_PATH, the personal default, or task-local. */
41
+ origin?: RecipeLibraryOrigin;
42
+ /** Root of the RECIPE_LIBRARY_PATH entry with the same name that a --library flag replaced. */
43
+ overrides?: string;
44
+ }
45
+ export type RecipeLibraryOrigin = 'flag' | 'env' | 'default' | 'task';
46
+ /** A library recipe chosen by name: ref, qualified platform alias, or `<library>.<ref>` id. */
47
+ export interface RecipeSelection {
48
+ /** The name as given. */
49
+ name: string;
50
+ resolvedBy: 'ref' | 'alias' | 'id';
51
+ /** Library that provided the recipe. */
52
+ source: string;
53
+ /** Recipe file relative to that library root. */
54
+ file: string;
55
+ path: string;
56
+ }
57
+ export interface LoadedRecipeLibrarySource {
58
+ name: string;
59
+ root: string;
60
+ recipeCount: number;
61
+ provenance: RecipeSourceProvenance;
62
+ }
63
+ export interface RecipeShadowEntry {
64
+ ref: string;
65
+ /** Winning source. */
66
+ source: string;
67
+ /** Catalog file path relative to the winning source's root. */
68
+ file: string;
69
+ /** Source names shadowed at lower precedence. */
70
+ shadows: string[];
71
+ }
72
+ export interface RecipeLibrarySummary {
73
+ sources: LoadedRecipeLibrarySource[];
74
+ /** Every cross-source shadowing in the resolution, used or not. */
75
+ shadowed: RecipeShadowEntry[];
76
+ }
77
+ export interface RecipeRunResult {
78
+ status: RecipeRunStatus;
79
+ summaryPath: string;
80
+ tracePath: string;
81
+ artifactManifestPath: string;
82
+ recipePath: string;
83
+ }
84
+ export interface RecipeRunner {
85
+ /** Resolve and authorize the exact execution plan without running actions or writing artifacts. */
86
+ preflight(request: RecipeRunRequest): Promise<RecipeExecutionPlan>;
87
+ run(request: RecipeRunRequest): Promise<RecipeRunResult>;
88
+ }
89
+ export interface RecipeLogger {
90
+ info(message: string): void;
91
+ warn(message: string): void;
92
+ error(message: string): void;
93
+ }
94
+ export interface RecipeRunnerProvenance {
95
+ source: string;
96
+ git_ref: string;
97
+ name?: string;
98
+ version?: string;
99
+ }
100
+ export interface CreateRecipeRunnerOptions {
101
+ actionManifest: RecipeActionManifestDocument;
102
+ adapters: ActionAdapter[];
103
+ /** Caller-owned default provenance. Omit to fail closed with unknown trust. */
104
+ defaultSource?: RecipeSourceProvenance;
105
+ logger?: RecipeLogger;
106
+ hud?: RecipeHudOptions | false;
107
+ runner?: RecipeRunnerProvenance;
108
+ recording?: RecipeRecordingOptions;
109
+ /** Capabilities denied when recipe or implementation provenance is not trusted. */
110
+ blockedCapabilities?: RecipeExecutionCapability[];
111
+ }
112
+ export interface RecipeVideoRecordingOptions {
113
+ mode?: RecipeVideoRecordingMode;
114
+ maxFps?: number;
115
+ maxSize?: number;
116
+ target?: RecordingTarget;
117
+ }
118
+ export interface RecipeRecordingOptions {
119
+ targetProvider?: RecordingTargetProvider;
120
+ videoRecorder?: VideoRecorder;
121
+ }
122
+ export interface RecordingTargetProvider {
123
+ resolveRecordingTarget(context: RecordingTargetContext): Promise<RecordingTarget>;
124
+ }
125
+ export interface RecordingTargetContext {
126
+ nodeId: string;
127
+ node: Record<string, unknown>;
128
+ recipe: unknown;
129
+ projectRoot: string;
130
+ artifactsDir: string;
131
+ env: Record<string, string | undefined>;
132
+ scope?: 'run' | 'node';
133
+ }
134
+ export type RecordingTarget = {
135
+ kind: 'android-device';
136
+ serial: string;
137
+ } | {
138
+ kind: 'window-id';
139
+ windowId: string;
140
+ } | {
141
+ kind: 'pid';
142
+ pid: number;
143
+ } | {
144
+ kind: 'app-window';
145
+ appName: string;
146
+ windowName: string;
147
+ } | {
148
+ kind: 'simulator';
149
+ device: string;
150
+ };
151
+ export interface VideoRecorderStartRequest {
152
+ outputPath: string;
153
+ target: RecordingTarget;
154
+ maxFps?: number;
155
+ maxSize?: number;
156
+ nodeId: string;
157
+ record: 'full_run';
158
+ }
159
+ export interface ActiveVideoRecording {
160
+ stop(): Promise<VideoRecordingResult>;
161
+ /** Capture a PNG from this recording's stream, if the provider supports it. */
162
+ snapshot?(outputPath: string): Promise<Record<string, unknown>>;
163
+ }
164
+ export interface VideoRecordingResult {
165
+ recorder?: RecipeArtifactManifestEntry['recorder'];
166
+ timing?: import('@farmslot/protocol').RecipeVideoTiming;
167
+ timingUnavailableReason?: string;
168
+ /** Raw provider timing evidence, relative to the private video staging directory. */
169
+ timingEvidencePath?: string;
170
+ }
171
+ export interface VideoRecorder {
172
+ name: string;
173
+ version?: string;
174
+ platform?: string;
175
+ doctor?(): Promise<VideoRecorderDoctorResult>;
176
+ start(request: VideoRecorderStartRequest): Promise<ActiveVideoRecording>;
177
+ }
178
+ export interface VideoRecorderDoctorResult {
179
+ ok: boolean;
180
+ code: string;
181
+ message: string;
182
+ suggestedFix?: string;
183
+ }
184
+ export interface RecipeHudOptions {
185
+ enabled?: boolean;
186
+ title?: string;
187
+ display?: RecipeHudDisplayOptions;
188
+ }
189
+ export interface RecipeHudDisplayOptions {
190
+ layout?: 'bottom-bar' | 'docked-bottom' | 'card';
191
+ position?: 'bottom' | 'top' | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
192
+ showTitle?: boolean;
193
+ /** Show node/action/proof metadata. Hidden by default because HUD copy is for humans, not trace/debug labels. */
194
+ showDebug?: boolean;
195
+ /** Show authored detail as a second HUD line. Hidden by default because detail is trace/review metadata, not the current intent. */
196
+ showDetail?: boolean;
197
+ maxDetailLines?: number;
198
+ width?: string;
199
+ }
200
+ export interface ActionResult {
201
+ case?: string;
202
+ output?: unknown;
203
+ artifacts?: RecipeArtifactManifestEntry[];
204
+ phases?: RecipeActionPhase[];
205
+ observations?: RecipeObservations;
206
+ observationWarnings?: RecipeObservationWarning[];
207
+ }
208
+ export interface RecipeActionPhase {
209
+ phase: 'start' | 'move' | 'end';
210
+ x: number;
211
+ y: number;
212
+ elapsedMs: number;
213
+ }
214
+ export interface ActionExecutionContext {
215
+ nodeId: string;
216
+ recipe: unknown;
217
+ projectRoot: string;
218
+ artifactsDir: string;
219
+ env: Record<string, string | undefined>;
220
+ outputs: ReadonlyMap<string, unknown>;
221
+ getOutput(nodeId: string): unknown;
222
+ resolveProjectPath(relativePath: string): string;
223
+ resolveArtifactPath(relativePath: string): string;
224
+ getRunFileOffset(relativePath: string): number | undefined;
225
+ registerArtifact(entry: RecipeArtifactManifestEntry): void;
226
+ captureRecordingSnapshot?(relativePath: string): Promise<Record<string, unknown>>;
227
+ logger: RecipeLogger;
228
+ }
229
+ export interface ActionAdapter {
230
+ action: string;
231
+ testOnly?: boolean;
232
+ capabilities?: RecipeExecutionCapability[];
233
+ source?: RecipeSourceProvenance;
234
+ resolveSourceDigest?: () => Promise<string>;
235
+ execute(node: Record<string, unknown>, context: ActionExecutionContext): Promise<ActionResult>;
236
+ observe?(refs: readonly UiObserverRef[], node: Record<string, unknown>, context: ActionExecutionContext): Promise<RecipeObservationResult>;
237
+ }
238
+ export type RecipeObservations = Partial<Record<UiObserverRef, unknown>>;
239
+ export interface RecipeObservationWarning {
240
+ ref: UiObserverRef;
241
+ message: string;
242
+ }
243
+ export interface RecipeObservationResult {
244
+ observations?: RecipeObservations;
245
+ warnings?: RecipeObservationWarning[];
246
+ }
247
+ export interface RecipeCallTrace {
248
+ ref: string;
249
+ digest: string;
250
+ source: string;
251
+ file: string;
252
+ adapter?: string;
253
+ }
254
+ export interface ArtifactWriter {
255
+ copyRecipe(recipe: unknown): Promise<string>;
256
+ copyResolvedRecipe(digest: string, recipe: unknown): Promise<string>;
257
+ writeRecipeResolution(resolution: RecipeResolutionDocument): Promise<string>;
258
+ register(entry: RecipeArtifactManifestEntry): void;
259
+ list(): RecipeArtifactManifestEntry[];
260
+ write(status: RecipeRunStatus, runner?: RecipeRunnerProvenance): Promise<string>;
261
+ }
262
+ export interface TraceEntry {
263
+ nodeId: string;
264
+ action: string;
265
+ recipe?: RecipeCallTrace;
266
+ intent?: string;
267
+ proves?: string[];
268
+ startedAt: string;
269
+ endedAt: string;
270
+ durationMs: number;
271
+ ok: boolean;
272
+ cause_class?: RecipeFailureCause;
273
+ next?: string;
274
+ status?: RecipeRunStatus;
275
+ case?: string;
276
+ output?: unknown;
277
+ phases?: RecipeActionPhase[];
278
+ observations?: RecipeObservations;
279
+ observationWarnings?: RecipeObservationWarning[];
280
+ artifacts?: RecipeArtifactManifestEntry[];
281
+ error?: string;
282
+ /** Stable failure code, for example SCROLL_TARGET_NOT_VISIBLE. */
283
+ error_code?: string;
284
+ /** Observation preserved from the failed node, such as ui.scroll_to geometry. */
285
+ error_details?: unknown;
286
+ }
287
+ export interface TraceWriter {
288
+ record(entry: TraceEntry): void;
289
+ list(): TraceEntry[];
290
+ write(): Promise<string>;
291
+ }
292
+ export interface SummaryDocument {
293
+ /** Digest of the retained, redacted execution inputs when recorded. */
294
+ invocationDigest?: string;
295
+ status: RecipeRunStatus;
296
+ total: number;
297
+ passed: number;
298
+ failed: number;
299
+ cause_counts: Record<RecipeFailureCause, number>;
300
+ startedAt: string;
301
+ endedAt: string;
302
+ durationMs: number;
303
+ harness: {
304
+ name: '@farmslot/recipe-runner';
305
+ version: string;
306
+ action_manifest_schema: string;
307
+ };
308
+ runner?: RecipeRunnerProvenance;
309
+ /** Present when recipe library sources were configured for the run. */
310
+ recipeLibraries?: RecipeLibrarySummary;
311
+ /** Present when the caller selected a library recipe by name. */
312
+ recipeSelection?: RecipeSelection;
313
+ /** Present when the run was partial; the root graph stopped after this node. */
314
+ stopAfterNode?: string;
315
+ }
316
+ export interface SummaryWriter {
317
+ write(summary: SummaryDocument): Promise<string>;
318
+ }
319
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACv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,MAAM,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,IAAI,EAAE,yBAAyB,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,sBAAsB,EAAE,MAAM,CAAC;KAChC,CAAC;IACF,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,uEAAuE;IACvE,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,iEAAiE;IACjE,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { type RecipeActionManifestDocument, type RecipeDocumentValidationOptions } from '@farmslot/protocol';
2
+ export declare function assertManifestIsValid(manifest: unknown): asserts manifest is RecipeActionManifestDocument;
3
+ export declare function assertRecipeMatchesManifest(recipe: unknown, manifest: RecipeActionManifestDocument, options?: RecipeDocumentValidationOptions): void;
4
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,+BAA+B,EAGrC,MAAM,oBAAoB,CAAC;AAE5B,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,4BAA4B,CASlD;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,4BAA4B,EACtC,OAAO,CAAC,EAAE,+BAA+B,GACxC,IAAI,CASN"}
@@ -0,0 +1,18 @@
1
+ import { validateRecipeActionManifestDocument, validateRecipeWithManifest, } from '@farmslot/protocol';
2
+ export function assertManifestIsValid(manifest) {
3
+ const result = validateRecipeActionManifestDocument(manifest);
4
+ if (result.status === 'invalid') {
5
+ throw new Error(`Recipe action manifest is invalid: ${result.findings
6
+ .map((finding) => `${finding.code} ${finding.path}: ${finding.message}`)
7
+ .join('; ')}`);
8
+ }
9
+ }
10
+ export function assertRecipeMatchesManifest(recipe, manifest, options) {
11
+ const result = validateRecipeWithManifest(recipe, manifest, options);
12
+ if (result.status === 'invalid') {
13
+ throw new Error(`Recipe is invalid for the action manifest: ${result.findings
14
+ .map((finding) => `${finding.code} ${finding.path}: ${finding.message}`)
15
+ .join('; ')}`);
16
+ }
17
+ }
18
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oCAAoC,EACpC,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,UAAU,qBAAqB,CACnC,QAAiB;IAEjB,MAAM,MAAM,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,sCAAsC,MAAM,CAAC,QAAQ;aAClD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;aACvE,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,MAAe,EACf,QAAsC,EACtC,OAAyC;IAEzC,MAAM,MAAM,GAAG,0BAA0B,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,8CAA8C,MAAM,CAAC,QAAQ;aAC1D,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC;aACvE,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ export type { AppLifecycleCommand, AppLifecycleCommandRunner, AppLifecyclePlatform, AppLifecycleTarget, AppLifecycleTargetProvider, CreateAppLifecycleAdapterOptions, } from './adapters/app-lifecycle.js';
2
+ export { createAppLifecycleAdapter, createAppLifecycleAdapters } from './adapters/app-lifecycle.js';
3
+ export { createStandardCoreAdapters } from './adapters/core.js';
4
+ export { type GestureAction, gestureDurationMs, gesturePhase, gesturePoints, gestureSegmentDuration, gestureTarget, type UiPoint, } from './adapters/gesture.js';
5
+ export type { StandardUiAction, UiActionTransport, UiTransportControl, UiTransportResult, } from './adapters/ui.js';
6
+ export { createStandardUiAdapters, normalizeUiTransportResult, STANDARD_UI_ACTIONS, } from './adapters/ui.js';
7
+ export { type ResolvedRecipeDependencies, resolveRecipeDependencies, rootResolutionRef, validateRecipeDependencyParams, } from './core/compose.js';
8
+ export { RecipeExecutionError } from './core/failure.js';
9
+ export { extractWorkflowGraph, type WorkflowGraph } from './core/graph.js';
10
+ export { redactRecipeParams } from './core/invocation.js';
11
+ export type { LibraryRecipeMatch, RecipeLibraryEnv, RecipeLibraryLoadOptions, RecipeLibraryResolution, ResolvedLibraryRecipe, } from './core/library.js';
12
+ export { applyTaskLocalInvocationTrust, BUILT_IN_RECIPE_PLATFORMS, defaultRecipeLibrarySources, findLibraryRecipe, listRecipeFiles, listRecipeLibraryPlatforms, loadRecipeLibraries, logRecipeLibraryResolution, logRecipeLibraryShadows, logRecipeLibrarySources, parseRecipeLibraryPath, personalRecipeLibraryRoot, resolveRecipeLibrarySources, } from './core/library.js';
13
+ export { checkRecipeLibraryRequirements, digestRecipeLibrary, listLibraryFiles, readRecipeLibraryManifest, RECIPE_LIBRARY_DIRECTORIES, RECIPE_LIBRARY_MANIFEST_FILE, type RecipeLibraryAdapterDeclaration, type RecipeLibraryManifest, type RecipeLibraryRequirement, type RecipePackageVersions, SHARED_RECIPE_SCOPE, } from './core/library-manifest.js';
14
+ export { resolveRecipeParams, resolveRecipeValue } from './core/parameters.js';
15
+ export { RecipeResolutionError } from './core/resolution-error.js';
16
+ export { createRecipeRunner, defineActionAdapter } from './core/runner.js';
17
+ export { isVisibleWithin, parseUiScrollToRequest, runUiScrollTo, safeViewportFor, UI_SCROLL_TO_ERROR_CODES, type UiRect, type UiScrollGeometry, type UiScrollOffset, type UiScrollSession, type UiScrollSettlement, type UiScrollSnapshot, UiScrollToError, type UiScrollToErrorCode, type UiScrollToObservation, type UiScrollToRequest, } from './core/scroll-to.js';
18
+ export { finalizeRecipeSuite, type FinalizeRecipeSuiteRequest, freezeRecipeSuiteScope, type RecipeSuiteFinalizeResult, type RecipeSuiteResolutionInput, type RecipeSuiteScopeSnapshot, type RecipeSuiteVerdictInput, } from './core/suite.js';
19
+ export { buildRecipeExecutionPlan, enforceRecipeExecutionPlan, recipeSourceForRequest, } from './core/trust.js';
20
+ export { RecipeTrustError } from './core/trust-error.js';
21
+ export { RECIPE_TRUST_ENV, resolveRecipeTrustInput } from './core/trust-input.js';
22
+ export type * from './core/types.js';
23
+ export { createAndroidMirrorVideoRecorder } from './recording/android-mirror.js';
24
+ export type { CaptureHelperVideoRecorderOptions } from './recording/capture-helper.js';
25
+ export { createCaptureHelperVideoRecorder, errorMessage, manifestTarget, } from './recording/capture-helper.js';
26
+ export { readCaptureHelperTiming } from './recording/capture-helper-timing.js';
27
+ export type { CdpVideoRecorderOptions } from './recording/cdp-video-recorder.js';
28
+ export { createCdpVideoRecorder } from './recording/cdp-video-recorder.js';
29
+ export { createRecordingTimeline, optionalVideoTiming, probeVideoTiming, writeRecordingTimeline, } from './recording/timeline.js';
30
+ export { RECIPE_RUNNER_VERSION } from './version.js';
31
+ export type { RecipeResolutionDependency, RecipeResolutionDocument, RecipeResolutionEdge, } from '@farmslot/protocol';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EACL,KAAK,aAAa,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,KAAK,OAAO,GACb,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MA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B,EAC/B,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAClF,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EACL,gCAAgC,EAChC,YAAY,EACZ,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ export { createAppLifecycleAdapter, createAppLifecycleAdapters } from './adapters/app-lifecycle.js';
2
+ export { createStandardCoreAdapters } from './adapters/core.js';
3
+ export { gestureDurationMs, gesturePhase, gesturePoints, gestureSegmentDuration, gestureTarget, } from './adapters/gesture.js';
4
+ export { createStandardUiAdapters, normalizeUiTransportResult, STANDARD_UI_ACTIONS, } from './adapters/ui.js';
5
+ export { resolveRecipeDependencies, rootResolutionRef, validateRecipeDependencyParams, } from './core/compose.js';
6
+ export { RecipeExecutionError } from './core/failure.js';
7
+ export { extractWorkflowGraph } from './core/graph.js';
8
+ export { redactRecipeParams } from './core/invocation.js';
9
+ export { applyTaskLocalInvocationTrust, BUILT_IN_RECIPE_PLATFORMS, defaultRecipeLibrarySources, findLibraryRecipe, listRecipeFiles, listRecipeLibraryPlatforms, loadRecipeLibraries, logRecipeLibraryResolution, logRecipeLibraryShadows, logRecipeLibrarySources, parseRecipeLibraryPath, personalRecipeLibraryRoot, resolveRecipeLibrarySources, } from './core/library.js';
10
+ export { checkRecipeLibraryRequirements, digestRecipeLibrary, listLibraryFiles, readRecipeLibraryManifest, RECIPE_LIBRARY_DIRECTORIES, RECIPE_LIBRARY_MANIFEST_FILE, SHARED_RECIPE_SCOPE, } from './core/library-manifest.js';
11
+ export { resolveRecipeParams, resolveRecipeValue } from './core/parameters.js';
12
+ export { RecipeResolutionError } from './core/resolution-error.js';
13
+ export { createRecipeRunner, defineActionAdapter } from './core/runner.js';
14
+ export { isVisibleWithin, parseUiScrollToRequest, runUiScrollTo, safeViewportFor, UI_SCROLL_TO_ERROR_CODES, UiScrollToError, } from './core/scroll-to.js';
15
+ export { finalizeRecipeSuite, freezeRecipeSuiteScope, } from './core/suite.js';
16
+ export { buildRecipeExecutionPlan, enforceRecipeExecutionPlan, recipeSourceForRequest, } from './core/trust.js';
17
+ export { RecipeTrustError } from './core/trust-error.js';
18
+ export { RECIPE_TRUST_ENV, resolveRecipeTrustInput } from './core/trust-input.js';
19
+ export { createAndroidMirrorVideoRecorder } from './recording/android-mirror.js';
20
+ export { createCaptureHelperVideoRecorder, errorMessage, manifestTarget, } from './recording/capture-helper.js';
21
+ export { readCaptureHelperTiming } from './recording/capture-helper-timing.js';
22
+ export { createCdpVideoRecorder } from './recording/cdp-video-recorder.js';
23
+ export { createRecordingTimeline, optionalVideoTiming, probeVideoTiming, writeRecordingTimeline, } from './recording/timeline.js';
24
+ export { RECIPE_RUNNER_VERSION } from './version.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,aAAa,GAEd,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,yBAAyB,EACzB,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAsB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAQ1D,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAK5B,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,wBAAwB,EAOxB,eAAe,GAIhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,mBAAmB,EAEnB,sBAAsB,GAKvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAEjF,OAAO,EACL,gCAAgC,EAChC,YAAY,EACZ,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type RecipeArtifactManifestEntry, type RecipeResolutionDocument } from '@farmslot/protocol';
2
+ import type { RecipeInvocationDocument } from '../core/invocation.js';
3
+ import type { ArtifactWriter, RecipeRunnerProvenance, RecipeRunStatus, SummaryDocument, SummaryWriter, TraceEntry, TraceWriter } from '../core/types.js';
4
+ export declare class JsonArtifactWriter implements ArtifactWriter {
5
+ #private;
6
+ constructor(artifactsDir: string);
7
+ copyRecipe(recipe: unknown): Promise<string>;
8
+ copyResolvedRecipe(digest: string, recipe: unknown): Promise<string>;
9
+ writeRecipeResolution(resolution: RecipeResolutionDocument): Promise<string>;
10
+ writeInvocation(invocation: RecipeInvocationDocument): Promise<void>;
11
+ register(entry: RecipeArtifactManifestEntry): void;
12
+ list(): RecipeArtifactManifestEntry[];
13
+ write(status: RecipeRunStatus, runner?: RecipeRunnerProvenance): Promise<string>;
14
+ }
15
+ export declare class JsonTraceWriter implements TraceWriter {
16
+ #private;
17
+ constructor(artifactsDir: string, runner?: RecipeRunnerProvenance);
18
+ record(entry: TraceEntry): void;
19
+ list(): TraceEntry[];
20
+ write(): Promise<string>;
21
+ }
22
+ export declare class JsonSummaryWriter implements SummaryWriter {
23
+ #private;
24
+ constructor(artifactsDir: string);
25
+ write(summary: SummaryDocument): Promise<string>;
26
+ }
27
+ //# sourceMappingURL=writers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writers.d.ts","sourceRoot":"","sources":["../../src/node/writers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAE9B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAE1B,qBAAa,kBAAmB,YAAW,cAAc;;gBAI3C,YAAY,EAAE,MAAM;IAI1B,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAW5C,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAapE,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAY5E,eAAe,CAAC,UAAU,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAU1E,QAAQ,CAAC,KAAK,EAAE,2BAA2B,GAAG,IAAI;IAMlD,IAAI,IAAI,2BAA2B,EAAE;IAI/B,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;CAQvF;AAED,qBAAa,eAAgB,YAAW,WAAW;;gBAKrC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB;IAKjE,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAI/B,IAAI,IAAI,UAAU,EAAE;IAId,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAO/B;AAED,qBAAa,iBAAkB,YAAW,aAAa;;gBAGzC,YAAY,EAAE,MAAM;IAI1B,KAAK,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAGvD"}
@@ -0,0 +1,99 @@
1
+ import { resolvedRecipeArtifactPath, } from '@farmslot/protocol';
2
+ import { writeFileWithinRoot } from '../core/path.js';
3
+ export class JsonArtifactWriter {
4
+ #artifactsDir;
5
+ #entries = [];
6
+ constructor(artifactsDir) {
7
+ this.#artifactsDir = artifactsDir;
8
+ }
9
+ async copyRecipe(recipe) {
10
+ const recipePath = await writeJsonWithinRoot(this.#artifactsDir, 'recipe.json', recipe);
11
+ this.register({
12
+ path: 'recipe.json',
13
+ type: 'recipe',
14
+ label: 'Executed recipe',
15
+ category: 'system',
16
+ });
17
+ return recipePath;
18
+ }
19
+ async copyResolvedRecipe(digest, recipe) {
20
+ const relativePath = resolvedRecipeArtifactPath(digest);
21
+ if (!relativePath)
22
+ throw new Error(`Invalid resolved recipe digest ${digest}.`);
23
+ const resolvedPath = await writeJsonWithinRoot(this.#artifactsDir, relativePath, recipe);
24
+ this.register({
25
+ path: relativePath,
26
+ type: 'recipe',
27
+ label: 'Resolved recipe dependency',
28
+ category: 'system',
29
+ });
30
+ return resolvedPath;
31
+ }
32
+ async writeRecipeResolution(resolution) {
33
+ const relativePath = 'recipe-resolution.json';
34
+ const resolutionPath = await writeJsonWithinRoot(this.#artifactsDir, relativePath, resolution);
35
+ this.register({
36
+ path: relativePath,
37
+ type: 'json',
38
+ label: 'Resolved recipe dependency graph',
39
+ category: 'system',
40
+ });
41
+ return resolutionPath;
42
+ }
43
+ async writeInvocation(invocation) {
44
+ await writeJsonWithinRoot(this.#artifactsDir, 'recipe-invocation.json', invocation);
45
+ this.register({
46
+ path: 'recipe-invocation.json',
47
+ type: 'json',
48
+ label: 'Executed recipe parameters',
49
+ category: 'system',
50
+ });
51
+ }
52
+ register(entry) {
53
+ if (!this.#entries.some((existing) => existing.path === entry.path)) {
54
+ this.#entries.push(entry);
55
+ }
56
+ }
57
+ list() {
58
+ return [...this.#entries];
59
+ }
60
+ async write(status, runner) {
61
+ return writeJsonWithinRoot(this.#artifactsDir, 'artifact-manifest.json', {
62
+ version: 1,
63
+ runStatus: status,
64
+ ...(runner ? { provenance: { runner } } : {}),
65
+ artifacts: this.list(),
66
+ });
67
+ }
68
+ }
69
+ export class JsonTraceWriter {
70
+ #artifactsDir;
71
+ #entries = [];
72
+ #runner;
73
+ constructor(artifactsDir, runner) {
74
+ this.#artifactsDir = artifactsDir;
75
+ this.#runner = runner;
76
+ }
77
+ record(entry) {
78
+ this.#entries.push(entry);
79
+ }
80
+ list() {
81
+ return [...this.#entries];
82
+ }
83
+ async write() {
84
+ return writeJsonWithinRoot(this.#artifactsDir, 'trace.json', this.#runner ? { metadata: { runner: this.#runner }, entries: this.list() } : this.list());
85
+ }
86
+ }
87
+ export class JsonSummaryWriter {
88
+ #artifactsDir;
89
+ constructor(artifactsDir) {
90
+ this.#artifactsDir = artifactsDir;
91
+ }
92
+ async write(summary) {
93
+ return writeJsonWithinRoot(this.#artifactsDir, 'summary.json', summary);
94
+ }
95
+ }
96
+ function writeJsonWithinRoot(root, relativePath, value) {
97
+ return writeFileWithinRoot(root, relativePath, `${JSON.stringify(value, null, 2)}\n`);
98
+ }
99
+ //# sourceMappingURL=writers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writers.js","sourceRoot":"","sources":["../../src/node/writers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL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O,CAAqC;IAErD,YAAY,YAAoB,EAAE,MAA+B;QAC/D,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,KAAiB;QACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,mBAAmB,CACxB,IAAI,CAAC,aAAa,EAClB,YAAY,EACZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAC1F,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,iBAAiB;IACnB,aAAa,CAAS;IAE/B,YAAY,YAAoB;QAC9B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAwB;QAClC,OAAO,mBAAmB,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,SAAS,mBAAmB,CAAC,IAAY,EAAE,YAAoB,EAAE,KAAc;IAC7E,OAAO,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { VideoRecorder } from '../core/types.js';
2
+ /** The caller must hold the device lease. This recorder owns only its scrcpy
3
+ * process and exact window; it never installs, unlocks, or controls the device. */
4
+ export declare function createAndroidMirrorVideoRecorder(options: {
5
+ serial: string;
6
+ fallback: VideoRecorder;
7
+ scrcpyPath?: string;
8
+ captureHelperPath?: string;
9
+ }): VideoRecorder;
10
+ //# sourceMappingURL=android-mirror.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android-mirror.d.ts","sourceRoot":"","sources":["../../src/recording/android-mirror.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,aAAa,EAGd,MAAM,kBAAkB,CAAC;AAM1B;mFACmF;AACnF,wBAAgB,gCAAgC,CAAC,OAAO,EAAE;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,aAAa,CA0KhB"}