@opencraw/studio 0.0.18 → 0.0.20

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 (116) hide show
  1. package/README.md +3 -3
  2. package/dist/browser-provisioning/ensure-browser-launch.use-case.d.ts +12 -0
  3. package/dist/browser-provisioning/index.d.ts +2 -0
  4. package/dist/browser-provisioning/install-chromium.use-case.d.ts +2 -0
  5. package/dist/browser-provisioning/missing-browser.policy.d.ts +3 -0
  6. package/dist/document-view/deck-view.mapper.d.ts +70 -0
  7. package/dist/document-view/index.d.ts +13 -0
  8. package/dist/document-view/pdf-view.mapper.d.ts +47 -0
  9. package/dist/document-view/region-preview.use-case.d.ts +30 -0
  10. package/dist/document-view/table-preview.use-case.d.ts +152 -0
  11. package/dist/document-view/tree-view.mapper.d.ts +47 -0
  12. package/dist/document-view/workbook-view.mapper.d.ts +51 -0
  13. package/dist/explain-why/index.d.ts +5 -0
  14. package/dist/explain-why/item-hint.algorithm.d.ts +13 -0
  15. package/dist/explain-why/why-sentence.mapper.d.ts +48 -0
  16. package/dist/explain-why/why.use-case.d.ts +26 -0
  17. package/dist/flow-recording/action-to-step.mapper.d.ts +16 -0
  18. package/dist/flow-recording/index.d.ts +13 -0
  19. package/dist/flow-recording/next-link.policy.d.ts +27 -0
  20. package/dist/flow-recording/recorded-action.contract.d.ts +114 -0
  21. package/dist/flow-recording/recorder-script.client.d.ts +48 -0
  22. package/dist/flow-recording/recorder-session.use-case.d.ts +67 -0
  23. package/dist/flow-recording/secret-field.policy.d.ts +33 -0
  24. package/dist/flow-recording/wait-insertion.policy.d.ts +26 -0
  25. package/dist/index.d.ts +14 -1
  26. package/dist/main.d.ts +18 -0
  27. package/dist/page-inspector/dom-tree.mapper.d.ts +32 -0
  28. package/dist/page-inspector/index.d.ts +7 -0
  29. package/dist/page-inspector/page-data.algorithm.d.ts +39 -0
  30. package/dist/page-inspector/responses-seen.use-case.d.ts +36 -0
  31. package/dist/page-snapshot/fetch-start-page.use-case.d.ts +20 -0
  32. package/dist/page-snapshot/hidden-marks.algorithm.d.ts +23 -0
  33. package/dist/page-snapshot/index.d.ts +13 -0
  34. package/dist/page-snapshot/invalidate-stale-snapshot.use-case.d.ts +12 -0
  35. package/dist/page-snapshot/pdf-bytes.use-case.d.ts +16 -0
  36. package/dist/page-snapshot/reread-csv.use-case.d.ts +22 -0
  37. package/dist/page-snapshot/rewrite-document.mapper.d.ts +27 -0
  38. package/dist/page-snapshot/snapshot.store.d.ts +14 -0
  39. package/dist/page-snapshot/start-point.policy.d.ts +12 -0
  40. package/dist/page-snapshot/take-snapshot.use-case.d.ts +60 -0
  41. package/dist/recipe-workspace/import-document.use-case.d.ts +22 -0
  42. package/dist/recipe-workspace/index.d.ts +5 -0
  43. package/dist/recipe-workspace/open-workspace.use-case.d.ts +15 -0
  44. package/dist/recipe-workspace/save-recipe.use-case.d.ts +21 -0
  45. package/dist/sample-run/index.d.ts +8 -0
  46. package/dist/sample-run/last-run.store.d.ts +17 -0
  47. package/dist/sample-run/load-recipe-pair.use-case.d.ts +18 -0
  48. package/dist/sample-run/run-sample.use-case.d.ts +40 -0
  49. package/dist/sample-run/sample-run-record.contract.d.ts +48 -0
  50. package/dist/scope-outline/card-sentence.mapper.d.ts +18 -0
  51. package/dist/scope-outline/index.d.ts +8 -0
  52. package/dist/scope-outline/outline-to-recipe.mapper.d.ts +17 -0
  53. package/dist/scope-outline/outline.model.d.ts +57 -0
  54. package/dist/scope-outline/recipe-to-outline.mapper.d.ts +14 -0
  55. package/dist/scope-outline/scope-at-path.algorithm.d.ts +19 -0
  56. package/dist/selector-inference/class-token.policy.d.ts +35 -0
  57. package/dist/selector-inference/dom-path.model.d.ts +73 -0
  58. package/dist/selector-inference/index.d.ts +12 -0
  59. package/dist/selector-inference/list-inference.algorithm.d.ts +43 -0
  60. package/dist/selector-inference/selector-candidates.algorithm.d.ts +22 -0
  61. package/dist/selector-inference/selector-ranking.policy.d.ts +27 -0
  62. package/dist/selector-inference/shadow-dom.error.d.ts +11 -0
  63. package/dist/selector-inference/take-kind.policy.d.ts +12 -0
  64. package/dist/studio-api/command.contract.d.ts +531 -0
  65. package/dist/studio-api/deck-preview-view.contract.d.ts +28 -0
  66. package/dist/studio-api/deck-view.contract.d.ts +127 -0
  67. package/dist/studio-api/document-tree-view.contract.d.ts +26 -0
  68. package/dist/studio-api/event.contract.d.ts +155 -0
  69. package/dist/studio-api/grid-preview-view.contract.d.ts +26 -0
  70. package/dist/studio-api/grid-view.contract.d.ts +75 -0
  71. package/dist/studio-api/import-document-view.contract.d.ts +8 -0
  72. package/dist/studio-api/index.d.ts +43 -0
  73. package/dist/studio-api/infer-selector-view.contract.d.ts +68 -0
  74. package/dist/studio-api/inspect-view.contract.d.ts +62 -0
  75. package/dist/studio-api/outline-view.contract.d.ts +37 -0
  76. package/dist/studio-api/pdf-view.contract.d.ts +66 -0
  77. package/dist/studio-api/region-preview-view.contract.d.ts +53 -0
  78. package/dist/studio-api/responses-seen-view.contract.d.ts +20 -0
  79. package/dist/studio-api/sample-run-view.contract.d.ts +28 -0
  80. package/dist/studio-api/snapshot-view.contract.d.ts +30 -0
  81. package/dist/studio-api/start-page-view.contract.d.ts +7 -0
  82. package/dist/studio-api/table-preview-view.contract.d.ts +65 -0
  83. package/dist/studio-api/verify-selector-view.contract.d.ts +18 -0
  84. package/dist/studio-api/why-view.contract.d.ts +16 -0
  85. package/dist/studio-api/workspace-view.contract.d.ts +67 -0
  86. package/dist/studio-server/access-token.policy.d.ts +26 -0
  87. package/dist/studio-server/deck-preview.handler.d.ts +17 -0
  88. package/dist/studio-server/deck-view.handler.d.ts +15 -0
  89. package/dist/studio-server/document-tree.handler.d.ts +14 -0
  90. package/dist/studio-server/explain-why.handler.d.ts +14 -0
  91. package/dist/studio-server/fetch-start-page.handler.d.ts +14 -0
  92. package/dist/studio-server/grid-preview.handler.d.ts +17 -0
  93. package/dist/studio-server/grid-view.handler.d.ts +20 -0
  94. package/dist/studio-server/import-document.handler.d.ts +14 -0
  95. package/dist/studio-server/index.d.ts +3 -0
  96. package/dist/studio-server/infer-selector.handler.d.ts +18 -0
  97. package/dist/studio-server/inspect-page.handler.d.ts +18 -0
  98. package/dist/studio-server/open-workspace.handler.d.ts +20 -0
  99. package/dist/studio-server/pdf-bytes.handler.d.ts +17 -0
  100. package/dist/studio-server/pdf-view.handler.d.ts +14 -0
  101. package/dist/studio-server/recording.handler.d.ts +36 -0
  102. package/dist/studio-server/region-preview.handler.d.ts +17 -0
  103. package/dist/studio-server/responses-seen.handler.d.ts +16 -0
  104. package/dist/studio-server/run-sample.handler.d.ts +28 -0
  105. package/dist/studio-server/save-outline.handler.d.ts +18 -0
  106. package/dist/studio-server/save-recipe.handler.d.ts +15 -0
  107. package/dist/studio-server/static-file.handler.d.ts +14 -0
  108. package/dist/studio-server/studio-http.use-case.d.ts +40 -0
  109. package/dist/studio-server/table-preview.handler.d.ts +16 -0
  110. package/dist/studio-server/take-snapshot.handler.d.ts +16 -0
  111. package/dist/studio-server/verify-selector.handler.d.ts +18 -0
  112. package/dist/studio-server/websocket.client.d.ts +22 -0
  113. package/dist/studio-server/workspace.store.d.ts +36 -0
  114. package/dist/trusted-plugins/index.d.ts +2 -0
  115. package/dist/trusted-plugins/trusted-plugins.contract.d.ts +14 -0
  116. package/package.json +4 -4
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Thrown when a pick or a list-inference walk crosses a declarative shadow
3
+ * root (`<template shadowrootmode>`). v1 does not pierce shadow DOM: rather
4
+ * than infer a selector that silently matches the wrong thing (or nothing,
5
+ * once the page hydrates), the studio surfaces this and stops.
6
+ */
7
+ export declare class ShadowDomUnsupportedError extends Error {
8
+ readonly path: string;
9
+ constructor(path: string);
10
+ }
11
+ //# sourceMappingURL=shadow-dom.error.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { DomPathLevel } from './dom-path.model';
2
+ /**
3
+ * What a `Read` card's `take` should be for the element a pick landed on
4
+ * (issue #91, studio plan §3.2): `attr:href` for an `<a>`, `attr:src` for an
5
+ * `<img>`, `attr:<name>` for the first `data-*` attribute otherwise, `json`
6
+ * for a `<script type="application/json">`, else the default, `text`.
7
+ *
8
+ * @param level - The clicked element's own level (the last entry of its `DomPath`).
9
+ * @returns The `take` value to put on the `extract` step.
10
+ */
11
+ export declare function takeKindFor(level: DomPathLevel): string;
12
+ //# sourceMappingURL=take-kind.policy.d.ts.map
@@ -0,0 +1,531 @@
1
+ import { z } from 'zod';
2
+ /** A budget for a sample run; never authored into a recipe, only asked for by the caller. */
3
+ export declare const sampleBudgetSchema: z.ZodObject<{
4
+ maxRecords: z.ZodOptional<z.ZodNumber>;
5
+ maxPages: z.ZodOptional<z.ZodNumber>;
6
+ maxMs: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strip>;
8
+ /** Opens a recipe folder: the server reads it and answers with a `WorkspaceView`. */
9
+ export declare const openWorkspaceCommandSchema: z.ZodObject<{
10
+ type: z.ZodLiteral<"open-workspace">;
11
+ folder: z.ZodString;
12
+ }, z.core.$strip>;
13
+ /** Runs one input recipe under a budget, streaming `trace-line` and `record` events, ending in `run-finished`. */
14
+ export declare const runSampleCommandSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"run-sample">;
16
+ recipeId: z.ZodString;
17
+ budget: z.ZodOptional<z.ZodObject<{
18
+ maxRecords: z.ZodOptional<z.ZodNumber>;
19
+ maxPages: z.ZodOptional<z.ZodNumber>;
20
+ maxMs: z.ZodOptional<z.ZodNumber>;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ /** Closes the crawler of the run in progress, if any; a no-op otherwise. */
24
+ export declare const stopRunCommandSchema: z.ZodObject<{
25
+ type: z.ZodLiteral<"stop-run">;
26
+ }, z.core.$strip>;
27
+ /** Writes a recipe file: the whole object, pretty-printed by the server (see `recipe-workspace`). */
28
+ export declare const saveRecipeCommandSchema: z.ZodObject<{
29
+ type: z.ZodLiteral<"save-recipe">;
30
+ path: z.ZodString;
31
+ recipe: z.ZodRecord<z.ZodString, z.ZodUnknown>;
32
+ }, z.core.$strip>;
33
+ /** Fetches the HTML of an input recipe's start page, as the engine would see it. */
34
+ export declare const fetchStartPageCommandSchema: z.ZodObject<{
35
+ type: z.ZodLiteral<"fetch-start-page">;
36
+ recipeId: z.ZodString;
37
+ }, z.core.$strip>;
38
+ /**
39
+ * Writes a recipe file from an edited outline: the server converts it back
40
+ * to the recipe's JSON (`scope-outline`'s `outlineToRecipe`) and saves it
41
+ * exactly as `save-recipe` would. Kept as its own command, rather than
42
+ * asking the Steps tab to run the outline↔recipe mappers itself, so that
43
+ * conversion stays server-side code (it already is: `@opencraw/studio`'s
44
+ * root export also carries Node-only slices, so the UI never imports
45
+ * runtime code from it, only types — see `apps/studio-ui`'s `steps-outline`
46
+ * for where this is called from).
47
+ */
48
+ export declare const saveOutlineCommandSchema: z.ZodObject<{
49
+ type: z.ZodLiteral<"save-outline">;
50
+ path: z.ZodString;
51
+ outline: z.ZodType<import("./outline-view.contract").OutlineView, unknown, z.core.$ZodTypeInternals<import("./outline-view.contract").OutlineView, unknown>>;
52
+ }, z.core.$strip>;
53
+ /**
54
+ * Captures the snapshot the content pane shows for a step (`page-snapshot`'s
55
+ * `take-snapshot.use-case.ts`), caching it by recipe and step path so
56
+ * switching the selected step does not always re-run the recipe.
57
+ */
58
+ export declare const takeSnapshotCommandSchema: z.ZodObject<{
59
+ type: z.ZodLiteral<"take-snapshot">;
60
+ recipeId: z.ZodString;
61
+ path: z.ZodString;
62
+ }, z.core.$strip>;
63
+ /**
64
+ * Verifies a candidate selector against the cached snapshot and, when
65
+ * reachable, the live page — the studio's own selection (`@opencraw/core`'s
66
+ * `countMatches`), never the browser's or a guess (issue #91).
67
+ */
68
+ export declare const verifySelectorCommandSchema: z.ZodObject<{
69
+ type: z.ZodLiteral<"verify-selector">;
70
+ recipeId: z.ZodString;
71
+ path: z.ZodString;
72
+ selector: z.ZodString;
73
+ }, z.core.$strip>;
74
+ export declare const inferSelectorCommandSchema: z.ZodObject<{
75
+ type: z.ZodLiteral<"infer-selector">;
76
+ recipeId: z.ZodString;
77
+ path: z.ZodString;
78
+ nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
79
+ }, z.core.$strip>;
80
+ /**
81
+ * The Inspect panel's DOM tree and data-in-the-page findings, off the same
82
+ * cached snapshot `take-snapshot`/`infer-selector` already use (`page-inspector`,
83
+ * issue #93). Call `take-snapshot` first, same as `infer-selector`.
84
+ */
85
+ export declare const inspectPageCommandSchema: z.ZodObject<{
86
+ type: z.ZodLiteral<"inspect-page">;
87
+ recipeId: z.ZodString;
88
+ path: z.ZodString;
89
+ }, z.core.$strip>;
90
+ /**
91
+ * The JSON responses seen while a recipe's start page rendered
92
+ * (`page-inspector`'s `responses-seen.use-case.ts`, issue #93), for the
93
+ * Inspect panel's "responses seen" list. Opens its own browser session
94
+ * (see that use-case's doc comment for why); slower than `inspect-page`.
95
+ */
96
+ export declare const responsesSeenCommandSchema: z.ZodObject<{
97
+ type: z.ZodLiteral<"responses-seen">;
98
+ recipeId: z.ZodString;
99
+ path: z.ZodString;
100
+ }, z.core.$strip>;
101
+ /**
102
+ * The document tree for the content pane's tree canvas (`document-view`'s
103
+ * `tree-view.mapper.ts`, studio plan §3.4, issue #94's 5a), off the same
104
+ * cached snapshot `take-snapshot`/`inspect-page` already use — call
105
+ * `take-snapshot` first, same as `inspect-page`. Only a JSON/YAML/XML
106
+ * snapshot has one; PDF, workbook and deck documents get their own canvases
107
+ * (5b/5c/5d).
108
+ */
109
+ export declare const documentTreeCommandSchema: z.ZodObject<{
110
+ type: z.ZodLiteral<"document-tree">;
111
+ recipeId: z.ZodString;
112
+ path: z.ZodString;
113
+ }, z.core.$strip>;
114
+ /**
115
+ * The PDF canvas's cells and rows (`document-view`'s `pdf-view.mapper.ts`,
116
+ * studio plan §3.4, issue #94's 5b), off the same cached snapshot
117
+ * `take-snapshot`/`document-tree` already use — call `take-snapshot` first.
118
+ * Only a PDF snapshot has one; JSON/YAML/XML get the tree canvas (5a), the
119
+ * workbook and deck their own canvases (5c/5d).
120
+ */
121
+ export declare const pdfViewCommandSchema: z.ZodObject<{
122
+ type: z.ZodLiteral<"pdf-view">;
123
+ recipeId: z.ZodString;
124
+ path: z.ZodString;
125
+ }, z.core.$strip>;
126
+ /** A `table` extract's options, as the studio's PDF canvas picks build them — mirrors `document-view/table-preview.use-case.ts`'s `TablePreviewOptions`. */
127
+ export declare const tablePreviewOptionsSchema: z.ZodObject<{
128
+ header: z.ZodString;
129
+ until: z.ZodOptional<z.ZodString>;
130
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
131
+ align: z.ZodOptional<z.ZodEnum<{
132
+ auto: "auto";
133
+ bottom: "bottom";
134
+ center: "center";
135
+ top: "top";
136
+ }>>;
137
+ }, z.core.$strip>;
138
+ /**
139
+ * The live preview of a `table` extract's options against a cached PDF
140
+ * snapshot (`document-view`'s `table-preview.use-case.ts`, studio plan §3.4,
141
+ * issue #94's 5b): the matched rows to highlight on the page, recomputed as
142
+ * the person edits the options — call `take-snapshot` first.
143
+ */
144
+ export declare const tablePreviewCommandSchema: z.ZodObject<{
145
+ type: z.ZodLiteral<"table-preview">;
146
+ recipeId: z.ZodString;
147
+ path: z.ZodString;
148
+ options: z.ZodObject<{
149
+ header: z.ZodString;
150
+ until: z.ZodOptional<z.ZodString>;
151
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
152
+ align: z.ZodOptional<z.ZodEnum<{
153
+ auto: "auto";
154
+ bottom: "bottom";
155
+ center: "center";
156
+ top: "top";
157
+ }>>;
158
+ }, z.core.$strip>;
159
+ }, z.core.$strip>;
160
+ /**
161
+ * The live preview of a `region` extract's selector against a cached PDF
162
+ * snapshot (`document-view`'s `region-preview.use-case.ts`, issue #121: the
163
+ * PDF canvas's click-to-snap selection): the text the step would bind and
164
+ * the cells to highlight, recomputed as the box changes — call
165
+ * `take-snapshot` first.
166
+ */
167
+ export declare const regionPreviewCommandSchema: z.ZodObject<{
168
+ type: z.ZodLiteral<"region-preview">;
169
+ recipeId: z.ZodString;
170
+ path: z.ZodString;
171
+ selector: z.ZodString;
172
+ }, z.core.$strip>;
173
+ /**
174
+ * The grid canvas's sheets and cells (`document-view`'s `workbook-view.mapper.ts`,
175
+ * studio plan §3.4, issue #94's 5c), off the same cached snapshot
176
+ * `take-snapshot`/`document-tree` already use — call `take-snapshot` first.
177
+ * Only a CSV/spreadsheet snapshot has one; JSON/YAML/XML get the tree canvas
178
+ * (5a), PDF the PDF canvas (5b), the deck its own canvas (5d).
179
+ *
180
+ * `delimiter`/`encoding` override a CSV's auto-detected format (issue #94's
181
+ * 5c: "the detected delimiter and encoding shown and overridable"); the
182
+ * server re-reads the file with the override applied and keeps it cached, so
183
+ * a later `grid-preview` sees the same reading. Both are rejected on a
184
+ * spreadsheet snapshot (there is nothing to detect).
185
+ */
186
+ export declare const gridViewCommandSchema: z.ZodObject<{
187
+ type: z.ZodLiteral<"grid-view">;
188
+ recipeId: z.ZodString;
189
+ path: z.ZodString;
190
+ delimiter: z.ZodOptional<z.ZodString>;
191
+ encoding: z.ZodOptional<z.ZodString>;
192
+ }, z.core.$strip>;
193
+ /** A `table` extract's options for a workbook, as the studio's grid canvas picks build them — mirrors `document-view/table-preview.use-case.ts`'s `GridTablePreviewOptions`. */
194
+ export declare const gridPreviewOptionsSchema: z.ZodObject<{
195
+ sheet: z.ZodOptional<z.ZodString>;
196
+ header: z.ZodString;
197
+ until: z.ZodOptional<z.ZodString>;
198
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
199
+ headerRows: z.ZodOptional<z.ZodInt>;
200
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
201
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
202
+ }, z.core.$strip>;
203
+ /**
204
+ * The live preview of a `table` extract's options against a cached CSV/
205
+ * spreadsheet snapshot (`document-view`'s `table-preview.use-case.ts`'s
206
+ * `previewGridTable`, studio plan §3.4, issue #94's 5c): the matched
207
+ * table(s), recomputed as the person edits the options — call `take-snapshot`
208
+ * and `grid-view` first.
209
+ */
210
+ export declare const gridPreviewCommandSchema: z.ZodObject<{
211
+ type: z.ZodLiteral<"grid-preview">;
212
+ recipeId: z.ZodString;
213
+ path: z.ZodString;
214
+ options: z.ZodObject<{
215
+ sheet: z.ZodOptional<z.ZodString>;
216
+ header: z.ZodString;
217
+ until: z.ZodOptional<z.ZodString>;
218
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
219
+ headerRows: z.ZodOptional<z.ZodInt>;
220
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
221
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
222
+ }, z.core.$strip>;
223
+ }, z.core.$strip>;
224
+ /**
225
+ * The deck canvas's slides, shapes, tables, charts and notes for a deck
226
+ * (PowerPoint) snapshot (`document-view`'s `deck-view.mapper.ts`, studio plan
227
+ * §3.4, issue #94's 5d), off the same cached snapshot
228
+ * `take-snapshot`/`document-tree` already use — call `take-snapshot` first.
229
+ * Only a `.pptx` snapshot has one; JSON/YAML/XML get the tree canvas (5a),
230
+ * PDF the PDF canvas (5b), the workbook the grid canvas (5c).
231
+ */
232
+ export declare const deckViewCommandSchema: z.ZodObject<{
233
+ type: z.ZodLiteral<"deck-view">;
234
+ recipeId: z.ZodString;
235
+ path: z.ZodString;
236
+ }, z.core.$strip>;
237
+ /** A `table` extract's options for a deck, as the studio's deck canvas picks build them — mirrors `document-view/table-preview.use-case.ts`'s `DeckTablePreviewOptions`. */
238
+ export declare const deckPreviewOptionsSchema: z.ZodObject<{
239
+ slide: z.ZodOptional<z.ZodString>;
240
+ shapes: z.ZodOptional<z.ZodBoolean>;
241
+ align: z.ZodOptional<z.ZodEnum<{
242
+ auto: "auto";
243
+ bottom: "bottom";
244
+ center: "center";
245
+ top: "top";
246
+ }>>;
247
+ header: z.ZodString;
248
+ until: z.ZodOptional<z.ZodString>;
249
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
250
+ headerRows: z.ZodOptional<z.ZodInt>;
251
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
252
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
253
+ }, z.core.$strip>;
254
+ /**
255
+ * The live preview of a `table` extract's options against a cached deck
256
+ * snapshot (`document-view`'s `table-preview.use-case.ts`'s `previewDeckTable`,
257
+ * studio plan §3.4, issue #94's 5d): the matched table(s), recomputed as the
258
+ * person edits the options — call `take-snapshot` and `deck-view` first.
259
+ */
260
+ export declare const deckPreviewCommandSchema: z.ZodObject<{
261
+ type: z.ZodLiteral<"deck-preview">;
262
+ recipeId: z.ZodString;
263
+ path: z.ZodString;
264
+ options: z.ZodObject<{
265
+ slide: z.ZodOptional<z.ZodString>;
266
+ shapes: z.ZodOptional<z.ZodBoolean>;
267
+ align: z.ZodOptional<z.ZodEnum<{
268
+ auto: "auto";
269
+ bottom: "bottom";
270
+ center: "center";
271
+ top: "top";
272
+ }>>;
273
+ header: z.ZodString;
274
+ until: z.ZodOptional<z.ZodString>;
275
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
276
+ headerRows: z.ZodOptional<z.ZodInt>;
277
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
278
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
279
+ }, z.core.$strip>;
280
+ }, z.core.$strip>;
281
+ /** A missing value in an emitted record, by its position in the last sample run's records (the order they streamed in, matching the UI's own `records` list). */
282
+ export declare const missingWhyTargetSchema: z.ZodObject<{
283
+ kind: z.ZodLiteral<"missing">;
284
+ recipeId: z.ZodString;
285
+ recordIndex: z.ZodInt;
286
+ field: z.ZodString;
287
+ }, z.core.$strip>;
288
+ /** A rejected record, by its position in the last sample run's `rejectedRecords`. */
289
+ export declare const rejectedWhyTargetSchema: z.ZodObject<{
290
+ kind: z.ZodLiteral<"rejected">;
291
+ recipeId: z.ZodString;
292
+ rejectedIndex: z.ZodInt;
293
+ }, z.core.$strip>;
294
+ export declare const whyTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
295
+ kind: z.ZodLiteral<"missing">;
296
+ recipeId: z.ZodString;
297
+ recordIndex: z.ZodInt;
298
+ field: z.ZodString;
299
+ }, z.core.$strip>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"rejected">;
301
+ recipeId: z.ZodString;
302
+ rejectedIndex: z.ZodInt;
303
+ }, z.core.$strip>], "kind">;
304
+ /**
305
+ * Explains one missing or rejected value from the recipe's last sample run
306
+ * (`explain-why.use-case.ts`, issue #92's Why? tab): the mapping trace and
307
+ * scope snapshot `run-sample` already kept, the step that bound the value's
308
+ * source id and whether it ran, was skipped or found nothing, and the
309
+ * missing-value policy that applied.
310
+ */
311
+ export declare const explainWhyCommandSchema: z.ZodObject<{
312
+ type: z.ZodLiteral<"explain-why">;
313
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
314
+ kind: z.ZodLiteral<"missing">;
315
+ recipeId: z.ZodString;
316
+ recordIndex: z.ZodInt;
317
+ field: z.ZodString;
318
+ }, z.core.$strip>, z.ZodObject<{
319
+ kind: z.ZodLiteral<"rejected">;
320
+ recipeId: z.ZodString;
321
+ rejectedIndex: z.ZodInt;
322
+ }, z.core.$strip>], "kind">;
323
+ }, z.core.$strip>;
324
+ /**
325
+ * Opens the studio's own headed browser window and starts recording user
326
+ * actions on it (issue #95, phase 6): clicks, fills, selects, key presses
327
+ * and scrolls stream back as `recording-card` events, each already a
328
+ * verified step. `recipeId`'s start point is where the window opens.
329
+ */
330
+ export declare const startRecordingCommandSchema: z.ZodObject<{
331
+ type: z.ZodLiteral<"start-recording">;
332
+ recipeId: z.ZodString;
333
+ }, z.core.$strip>;
334
+ /**
335
+ * Closes the recording window, if one is open; a no-op otherwise. Answers
336
+ * with every step recorded, in order, so the caller can offer "make this
337
+ * the login" (writes them under `session.bootstrap`) or "keep as steps"
338
+ * (appends them to the recipe's own `steps`) without a second round trip.
339
+ */
340
+ export declare const stopRecordingCommandSchema: z.ZodObject<{
341
+ type: z.ZodLiteral<"stop-recording">;
342
+ }, z.core.$strip>;
343
+ /**
344
+ * Copies a document the person dropped on (or opened in) the studio into a
345
+ * workspace folder, so a recipe can point at it with a `file:` URL (issue
346
+ * #120). The bytes travel base64-encoded inside the JSON command envelope
347
+ * every other command uses: a local tool's own files are a few megabytes at
348
+ * most, not worth a second, multipart endpoint. `folder` is created when it
349
+ * does not exist yet, so a dropped file can also start a workspace; `name`
350
+ * is a plain file name (no directories), kept as the copy's name unless one
351
+ * is already there, in which case a numbered one is used.
352
+ */
353
+ export declare const importDocumentCommandSchema: z.ZodObject<{
354
+ type: z.ZodLiteral<"import-document">;
355
+ folder: z.ZodString;
356
+ name: z.ZodString;
357
+ bytes: z.ZodString;
358
+ }, z.core.$strip>;
359
+ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
360
+ type: z.ZodLiteral<"open-workspace">;
361
+ folder: z.ZodString;
362
+ }, z.core.$strip>, z.ZodObject<{
363
+ type: z.ZodLiteral<"import-document">;
364
+ folder: z.ZodString;
365
+ name: z.ZodString;
366
+ bytes: z.ZodString;
367
+ }, z.core.$strip>, z.ZodObject<{
368
+ type: z.ZodLiteral<"run-sample">;
369
+ recipeId: z.ZodString;
370
+ budget: z.ZodOptional<z.ZodObject<{
371
+ maxRecords: z.ZodOptional<z.ZodNumber>;
372
+ maxPages: z.ZodOptional<z.ZodNumber>;
373
+ maxMs: z.ZodOptional<z.ZodNumber>;
374
+ }, z.core.$strip>>;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ type: z.ZodLiteral<"stop-run">;
377
+ }, z.core.$strip>, z.ZodObject<{
378
+ type: z.ZodLiteral<"save-recipe">;
379
+ path: z.ZodString;
380
+ recipe: z.ZodRecord<z.ZodString, z.ZodUnknown>;
381
+ }, z.core.$strip>, z.ZodObject<{
382
+ type: z.ZodLiteral<"fetch-start-page">;
383
+ recipeId: z.ZodString;
384
+ }, z.core.$strip>, z.ZodObject<{
385
+ type: z.ZodLiteral<"save-outline">;
386
+ path: z.ZodString;
387
+ outline: z.ZodType<import("./outline-view.contract").OutlineView, unknown, z.core.$ZodTypeInternals<import("./outline-view.contract").OutlineView, unknown>>;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ type: z.ZodLiteral<"take-snapshot">;
390
+ recipeId: z.ZodString;
391
+ path: z.ZodString;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ type: z.ZodLiteral<"verify-selector">;
394
+ recipeId: z.ZodString;
395
+ path: z.ZodString;
396
+ selector: z.ZodString;
397
+ }, z.core.$strip>, z.ZodObject<{
398
+ type: z.ZodLiteral<"infer-selector">;
399
+ recipeId: z.ZodString;
400
+ path: z.ZodString;
401
+ nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
402
+ }, z.core.$strip>, z.ZodObject<{
403
+ type: z.ZodLiteral<"explain-why">;
404
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
405
+ kind: z.ZodLiteral<"missing">;
406
+ recipeId: z.ZodString;
407
+ recordIndex: z.ZodInt;
408
+ field: z.ZodString;
409
+ }, z.core.$strip>, z.ZodObject<{
410
+ kind: z.ZodLiteral<"rejected">;
411
+ recipeId: z.ZodString;
412
+ rejectedIndex: z.ZodInt;
413
+ }, z.core.$strip>], "kind">;
414
+ }, z.core.$strip>, z.ZodObject<{
415
+ type: z.ZodLiteral<"inspect-page">;
416
+ recipeId: z.ZodString;
417
+ path: z.ZodString;
418
+ }, z.core.$strip>, z.ZodObject<{
419
+ type: z.ZodLiteral<"responses-seen">;
420
+ recipeId: z.ZodString;
421
+ path: z.ZodString;
422
+ }, z.core.$strip>, z.ZodObject<{
423
+ type: z.ZodLiteral<"document-tree">;
424
+ recipeId: z.ZodString;
425
+ path: z.ZodString;
426
+ }, z.core.$strip>, z.ZodObject<{
427
+ type: z.ZodLiteral<"pdf-view">;
428
+ recipeId: z.ZodString;
429
+ path: z.ZodString;
430
+ }, z.core.$strip>, z.ZodObject<{
431
+ type: z.ZodLiteral<"table-preview">;
432
+ recipeId: z.ZodString;
433
+ path: z.ZodString;
434
+ options: z.ZodObject<{
435
+ header: z.ZodString;
436
+ until: z.ZodOptional<z.ZodString>;
437
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
438
+ align: z.ZodOptional<z.ZodEnum<{
439
+ auto: "auto";
440
+ bottom: "bottom";
441
+ center: "center";
442
+ top: "top";
443
+ }>>;
444
+ }, z.core.$strip>;
445
+ }, z.core.$strip>, z.ZodObject<{
446
+ type: z.ZodLiteral<"region-preview">;
447
+ recipeId: z.ZodString;
448
+ path: z.ZodString;
449
+ selector: z.ZodString;
450
+ }, z.core.$strip>, z.ZodObject<{
451
+ type: z.ZodLiteral<"grid-view">;
452
+ recipeId: z.ZodString;
453
+ path: z.ZodString;
454
+ delimiter: z.ZodOptional<z.ZodString>;
455
+ encoding: z.ZodOptional<z.ZodString>;
456
+ }, z.core.$strip>, z.ZodObject<{
457
+ type: z.ZodLiteral<"grid-preview">;
458
+ recipeId: z.ZodString;
459
+ path: z.ZodString;
460
+ options: z.ZodObject<{
461
+ sheet: z.ZodOptional<z.ZodString>;
462
+ header: z.ZodString;
463
+ until: z.ZodOptional<z.ZodString>;
464
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
465
+ headerRows: z.ZodOptional<z.ZodInt>;
466
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
467
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
468
+ }, z.core.$strip>;
469
+ }, z.core.$strip>, z.ZodObject<{
470
+ type: z.ZodLiteral<"deck-view">;
471
+ recipeId: z.ZodString;
472
+ path: z.ZodString;
473
+ }, z.core.$strip>, z.ZodObject<{
474
+ type: z.ZodLiteral<"deck-preview">;
475
+ recipeId: z.ZodString;
476
+ path: z.ZodString;
477
+ options: z.ZodObject<{
478
+ slide: z.ZodOptional<z.ZodString>;
479
+ shapes: z.ZodOptional<z.ZodBoolean>;
480
+ align: z.ZodOptional<z.ZodEnum<{
481
+ auto: "auto";
482
+ bottom: "bottom";
483
+ center: "center";
484
+ top: "top";
485
+ }>>;
486
+ header: z.ZodString;
487
+ until: z.ZodOptional<z.ZodString>;
488
+ columns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
489
+ headerRows: z.ZodOptional<z.ZodInt>;
490
+ fillDown: z.ZodOptional<z.ZodArray<z.ZodString>>;
491
+ includeHidden: z.ZodOptional<z.ZodBoolean>;
492
+ }, z.core.$strip>;
493
+ }, z.core.$strip>, z.ZodObject<{
494
+ type: z.ZodLiteral<"start-recording">;
495
+ recipeId: z.ZodString;
496
+ }, z.core.$strip>, z.ZodObject<{
497
+ type: z.ZodLiteral<"stop-recording">;
498
+ }, z.core.$strip>], "type">;
499
+ export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
500
+ export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
501
+ export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
502
+ export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
503
+ export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
504
+ export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
505
+ export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
506
+ export type SaveOutlineCommand = z.infer<typeof saveOutlineCommandSchema>;
507
+ export type TakeSnapshotCommand = z.infer<typeof takeSnapshotCommandSchema>;
508
+ export type VerifySelectorCommand = z.infer<typeof verifySelectorCommandSchema>;
509
+ export type InferSelectorCommand = z.infer<typeof inferSelectorCommandSchema>;
510
+ export type InspectPageCommand = z.infer<typeof inspectPageCommandSchema>;
511
+ export type ResponsesSeenCommand = z.infer<typeof responsesSeenCommandSchema>;
512
+ export type DocumentTreeCommand = z.infer<typeof documentTreeCommandSchema>;
513
+ export type PdfViewCommand = z.infer<typeof pdfViewCommandSchema>;
514
+ export type TablePreviewOptions = z.infer<typeof tablePreviewOptionsSchema>;
515
+ export type TablePreviewCommand = z.infer<typeof tablePreviewCommandSchema>;
516
+ export type RegionPreviewCommand = z.infer<typeof regionPreviewCommandSchema>;
517
+ export type GridViewCommand = z.infer<typeof gridViewCommandSchema>;
518
+ export type GridPreviewOptions = z.infer<typeof gridPreviewOptionsSchema>;
519
+ export type GridPreviewCommand = z.infer<typeof gridPreviewCommandSchema>;
520
+ export type DeckViewCommand = z.infer<typeof deckViewCommandSchema>;
521
+ export type DeckPreviewOptions = z.infer<typeof deckPreviewOptionsSchema>;
522
+ export type DeckPreviewCommand = z.infer<typeof deckPreviewCommandSchema>;
523
+ export type MissingWhyTarget = z.infer<typeof missingWhyTargetSchema>;
524
+ export type RejectedWhyTarget = z.infer<typeof rejectedWhyTargetSchema>;
525
+ export type WhyTarget = z.infer<typeof whyTargetSchema>;
526
+ export type ExplainWhyCommand = z.infer<typeof explainWhyCommandSchema>;
527
+ export type StartRecordingCommand = z.infer<typeof startRecordingCommandSchema>;
528
+ export type StopRecordingCommand = z.infer<typeof stopRecordingCommandSchema>;
529
+ /** Every command the UI can send the server, over HTTP POST. */
530
+ export type StudioCommand = z.infer<typeof studioCommandSchema>;
531
+ //# sourceMappingURL=command.contract.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ /** One table matched by a `table` extract's options against a deck — mirrors `@opencraw/core`'s `DeckTable`. */
3
+ export declare const deckTablePreviewMatchSchema: z.ZodObject<{
4
+ slide: z.ZodNumber;
5
+ slideTitle: z.ZodString;
6
+ title: z.ZodString;
7
+ header: z.ZodArray<z.ZodString>;
8
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
9
+ }, z.core.$strip>;
10
+ /**
11
+ * What `deck-preview` answers with (studio plan §3.4, issue #94's 5d: the
12
+ * live preview): every matched table, or `error` when a pattern in the
13
+ * options does not compile — expected while the person is still typing it,
14
+ * not thrown.
15
+ */
16
+ export declare const deckTablePreviewViewSchema: z.ZodObject<{
17
+ matches: z.ZodArray<z.ZodObject<{
18
+ slide: z.ZodNumber;
19
+ slideTitle: z.ZodString;
20
+ title: z.ZodString;
21
+ header: z.ZodArray<z.ZodString>;
22
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
23
+ }, z.core.$strip>>;
24
+ error: z.ZodOptional<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type DeckTablePreviewMatchView = z.infer<typeof deckTablePreviewMatchSchema>;
27
+ export type DeckTablePreviewView = z.infer<typeof deckTablePreviewViewSchema>;
28
+ //# sourceMappingURL=deck-preview-view.contract.d.ts.map