@opencraw/studio 0.0.31 → 0.0.33

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 (49) hide show
  1. package/dist/document-view/index.d.ts +1 -1
  2. package/dist/document-view/workbook-view.mapper.d.ts +17 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.esm.js +658 -49
  5. package/dist/page-snapshot/blocked-page.algorithm.d.ts +10 -0
  6. package/dist/page-snapshot/consent-banner.algorithm.d.ts +23 -0
  7. package/dist/page-snapshot/detect-url.use-case.d.ts +13 -0
  8. package/dist/page-snapshot/index.d.ts +4 -0
  9. package/dist/page-snapshot/inline-assets.mapper.d.ts +29 -0
  10. package/dist/page-snapshot/inline-local-images.use-case.d.ts +19 -0
  11. package/dist/page-snapshot/take-snapshot.use-case.d.ts +2 -0
  12. package/dist/recipe-workspace/import-document.use-case.d.ts +5 -3
  13. package/dist/selector-inference/selector-ranking.policy.d.ts +1 -1
  14. package/dist/src/document-view/index.d.ts +1 -1
  15. package/dist/src/document-view/workbook-view.mapper.d.ts +17 -1
  16. package/dist/src/index.d.ts +2 -2
  17. package/dist/src/page-snapshot/blocked-page.algorithm.d.ts +10 -0
  18. package/dist/src/page-snapshot/consent-banner.algorithm.d.ts +23 -0
  19. package/dist/src/page-snapshot/detect-url.use-case.d.ts +13 -0
  20. package/dist/src/page-snapshot/index.d.ts +4 -0
  21. package/dist/src/page-snapshot/inline-assets.mapper.d.ts +29 -0
  22. package/dist/src/page-snapshot/inline-local-images.use-case.d.ts +19 -0
  23. package/dist/src/page-snapshot/take-snapshot.use-case.d.ts +2 -0
  24. package/dist/src/recipe-workspace/import-document.use-case.d.ts +5 -3
  25. package/dist/src/selector-inference/selector-ranking.policy.d.ts +1 -1
  26. package/dist/src/studio-api/command.contract.d.ts +31 -0
  27. package/dist/src/studio-api/deck-view.contract.d.ts +2 -0
  28. package/dist/src/studio-api/detect-url-view.contract.d.ts +24 -0
  29. package/dist/src/studio-api/grid-view.contract.d.ts +15 -0
  30. package/dist/src/studio-api/index.d.ts +8 -6
  31. package/dist/src/studio-api/infer-selector-view.contract.d.ts +86 -0
  32. package/dist/src/studio-api/snapshot-view.contract.d.ts +1 -0
  33. package/dist/src/studio-server/detect-url.handler.d.ts +10 -0
  34. package/dist/src/studio-server/grid-view.handler.d.ts +12 -1
  35. package/dist/studio-api/command.contract.d.ts +31 -0
  36. package/dist/studio-api/deck-view.contract.d.ts +2 -0
  37. package/dist/studio-api/detect-url-view.contract.d.ts +24 -0
  38. package/dist/studio-api/grid-view.contract.d.ts +15 -0
  39. package/dist/studio-api/index.d.ts +8 -6
  40. package/dist/studio-api/infer-selector-view.contract.d.ts +86 -0
  41. package/dist/studio-api/snapshot-view.contract.d.ts +1 -0
  42. package/dist/studio-server/detect-url.handler.d.ts +10 -0
  43. package/dist/studio-server/grid-view.handler.d.ts +12 -1
  44. package/dist/ui/assets/index-Db6-8OgZ.js +42 -0
  45. package/dist/ui/assets/{pdf-CtmGNMM2.js → pdf-rdp2xUbL.js} +1 -1
  46. package/dist/ui/index.html +11 -2
  47. package/dist/ui/opencraw-logo.svg +28 -0
  48. package/package.json +3 -3
  49. package/dist/ui/assets/index-CMzc4-FL.js +0 -40
@@ -1,4 +1,16 @@
1
1
  import { z } from 'zod';
2
+ /** Another selector that reaches the clicked node, verified against the snapshot, for the person to choose instead of the best one. */
3
+ export declare const selectorAlternativeSchema: z.ZodObject<{
4
+ selector: z.ZodString;
5
+ tier: z.ZodEnum<{
6
+ id: "id";
7
+ "data-attr": "data-attr";
8
+ class: "class";
9
+ structure: "structure";
10
+ position: "position";
11
+ }>;
12
+ matches: z.ZodNumber;
13
+ }, z.core.$strip>;
2
14
  /** One clicked node's field: the best selector found for it, verified against the snapshot. */
3
15
  export declare const fieldPickSchema: z.ZodObject<{
4
16
  selector: z.ZodString;
@@ -11,6 +23,18 @@ export declare const fieldPickSchema: z.ZodObject<{
11
23
  }>;
12
24
  take: z.ZodString;
13
25
  matches: z.ZodNumber;
26
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
+ selector: z.ZodString;
28
+ tier: z.ZodEnum<{
29
+ id: "id";
30
+ "data-attr": "data-attr";
31
+ class: "class";
32
+ structure: "structure";
33
+ position: "position";
34
+ }>;
35
+ matches: z.ZodNumber;
36
+ }, z.core.$strip>>>;
37
+ generatedId: z.ZodOptional<z.ZodString>;
14
38
  }, z.core.$strip>;
15
39
  /**
16
40
  * What `infer-selector` answers with (issue #91, studio plan §3.2):
@@ -33,6 +57,18 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
33
57
  }>;
34
58
  take: z.ZodString;
35
59
  matches: z.ZodNumber;
60
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ selector: z.ZodString;
62
+ tier: z.ZodEnum<{
63
+ id: "id";
64
+ "data-attr": "data-attr";
65
+ class: "class";
66
+ structure: "structure";
67
+ position: "position";
68
+ }>;
69
+ matches: z.ZodNumber;
70
+ }, z.core.$strip>>>;
71
+ generatedId: z.ZodOptional<z.ZodString>;
36
72
  }, z.core.$strip>;
37
73
  }, z.core.$strip>, z.ZodObject<{
38
74
  kind: z.ZodLiteral<"list">;
@@ -46,7 +82,44 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
46
82
  position: "position";
47
83
  }>;
48
84
  matches: z.ZodNumber;
85
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ selector: z.ZodString;
87
+ tier: z.ZodEnum<{
88
+ id: "id";
89
+ "data-attr": "data-attr";
90
+ class: "class";
91
+ structure: "structure";
92
+ position: "position";
93
+ }>;
94
+ matches: z.ZodNumber;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>;
97
+ field: z.ZodObject<{
98
+ selector: z.ZodString;
99
+ tier: z.ZodEnum<{
100
+ id: "id";
101
+ "data-attr": "data-attr";
102
+ class: "class";
103
+ structure: "structure";
104
+ position: "position";
105
+ }>;
106
+ take: z.ZodString;
107
+ matches: z.ZodNumber;
108
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ selector: z.ZodString;
110
+ tier: z.ZodEnum<{
111
+ id: "id";
112
+ "data-attr": "data-attr";
113
+ class: "class";
114
+ structure: "structure";
115
+ position: "position";
116
+ }>;
117
+ matches: z.ZodNumber;
118
+ }, z.core.$strip>>>;
119
+ generatedId: z.ZodOptional<z.ZodString>;
49
120
  }, z.core.$strip>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ kind: z.ZodLiteral<"item-field">;
50
123
  field: z.ZodObject<{
51
124
  selector: z.ZodString;
52
125
  tier: z.ZodEnum<{
@@ -58,11 +131,24 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
58
131
  }>;
59
132
  take: z.ZodString;
60
133
  matches: z.ZodNumber;
134
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ selector: z.ZodString;
136
+ tier: z.ZodEnum<{
137
+ id: "id";
138
+ "data-attr": "data-attr";
139
+ class: "class";
140
+ structure: "structure";
141
+ position: "position";
142
+ }>;
143
+ matches: z.ZodNumber;
144
+ }, z.core.$strip>>>;
145
+ generatedId: z.ZodOptional<z.ZodString>;
61
146
  }, z.core.$strip>;
62
147
  }, z.core.$strip>, z.ZodObject<{
63
148
  kind: z.ZodLiteral<"unsupported">;
64
149
  reason: z.ZodString;
65
150
  }, z.core.$strip>], "kind">;
151
+ export type SelectorAlternative = z.infer<typeof selectorAlternativeSchema>;
66
152
  export type FieldPick = z.infer<typeof fieldPickSchema>;
67
153
  export type InferSelectorView = z.infer<typeof inferSelectorViewSchema>;
68
154
  //# sourceMappingURL=infer-selector-view.contract.d.ts.map
@@ -25,6 +25,7 @@ export declare const snapshotViewSchema: z.ZodObject<{
25
25
  xml: "xml";
26
26
  docx: "docx";
27
27
  }>>;
28
+ notice: z.ZodOptional<z.ZodString>;
28
29
  }, z.core.$strip>;
29
30
  export type SnapshotView = z.infer<typeof snapshotViewSchema>;
30
31
  //# sourceMappingURL=snapshot-view.contract.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { DetectUrlCommand, DetectUrlView } from '../studio-api/index.js';
2
+ /**
3
+ * Handles `detect-url`: what the address returns, for "Load ▾ Web page" to start a recipe that reads a document (a JSON API, a PDF,
4
+ * a spreadsheet, Markdown...) instead of a browser recipe over a response that is not a page.
5
+ *
6
+ * @param command - The address.
7
+ * @returns What it returns.
8
+ */
9
+ export declare function handleDetectUrl(command: DetectUrlCommand): Promise<DetectUrlView>;
10
+ //# sourceMappingURL=detect-url.handler.d.ts.map
@@ -1,5 +1,7 @@
1
- import type { GridViewCommand, WorkbookDocumentView } from '../studio-api/index.js';
1
+ import type { GridRowsCommand, GridRowsView, GridViewCommand, WorkbookDocumentView } from '../studio-api/index.js';
2
2
  import type { StudioState } from './workspace.store.js';
3
+ /** How many rows of a sheet the first `grid-view` answer carries; a bigger sheet's other rows come from `grid-rows` as the grid is scrolled. */
4
+ export declare const GRID_WINDOW_ROWS = 200;
3
5
  /**
4
6
  * Handles `grid-view`: the grid canvas's sheets and cells (`document-view`'s
5
7
  * `workbook-view.mapper.ts`, studio plan §3.4, issue #94's 5c), off the same
@@ -17,4 +19,13 @@ import type { StudioState } from './workspace.store.js';
17
19
  * @throws Error when no workspace is open, `command.path` has no cached snapshot yet, an override is given for a snapshot that is not a CSV, or the snapshot's document is not a read workbook.
18
20
  */
19
21
  export declare function handleGridView(state: StudioState, command: GridViewCommand): Promise<WorkbookDocumentView>;
22
+ /**
23
+ * Handles `grid-rows`: a run of one sheet's rows from the cached snapshot, for the grid that holds only a few screens of a big file at a time.
24
+ *
25
+ * @param state - The server state.
26
+ * @param command - The command; `command.path` must already have a cached snapshot.
27
+ * @returns The rows (none past the end of the sheet).
28
+ * @throws Error when there is no cached snapshot or it is not a workbook.
29
+ */
30
+ export declare function handleGridRows(state: StudioState, command: GridRowsCommand): GridRowsView;
20
31
  //# sourceMappingURL=grid-view.handler.d.ts.map
@@ -10,6 +10,11 @@ export declare const openWorkspaceCommandSchema: z.ZodObject<{
10
10
  type: z.ZodLiteral<"open-workspace">;
11
11
  folder: z.ZodString;
12
12
  }, z.core.$strip>;
13
+ /** Says what a page address returns, so a recipe is started the right way: a JSON API is read with a request, a page with a browser. */
14
+ export declare const detectUrlCommandSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"detect-url">;
16
+ url: z.ZodString;
17
+ }, z.core.$strip>;
13
18
  /** Says what a path is (folder, recipe or document) and where to open it: how a link or an IDE entry opens a path (issue #235). `workspace` is the folder a document should belong to, when the caller has one. */
14
19
  export declare const openPathCommandSchema: z.ZodObject<{
15
20
  type: z.ZodLiteral<"open-path">;
@@ -87,6 +92,7 @@ export declare const inferSelectorCommandSchema: z.ZodObject<{
87
92
  recipeId: z.ZodString;
88
93
  path: z.ZodString;
89
94
  nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
95
+ within: z.ZodOptional<z.ZodString>;
90
96
  }, z.core.$strip>;
91
97
  /**
92
98
  * The Inspect panel's DOM tree and data-in-the-page findings, off the same
@@ -201,6 +207,18 @@ export declare const gridViewCommandSchema: z.ZodObject<{
201
207
  delimiter: z.ZodOptional<z.ZodString>;
202
208
  encoding: z.ZodOptional<z.ZodString>;
203
209
  }, z.core.$strip>;
210
+ /**
211
+ * `grid-rows`: a run of one sheet's rows of a big CSV/spreadsheet, for the grid canvas that holds only the screens around where it is
212
+ * scrolled to. The first window comes with `grid-view`; the rest are asked for as the person scrolls.
213
+ */
214
+ export declare const gridRowsCommandSchema: z.ZodObject<{
215
+ type: z.ZodLiteral<"grid-rows">;
216
+ recipeId: z.ZodString;
217
+ path: z.ZodString;
218
+ sheet: z.ZodInt;
219
+ from: z.ZodInt;
220
+ count: z.ZodInt;
221
+ }, z.core.$strip>;
204
222
  /** 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`. */
205
223
  export declare const gridPreviewOptionsSchema: z.ZodObject<{
206
224
  sheet: z.ZodOptional<z.ZodString>;
@@ -399,6 +417,9 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
399
417
  }, z.core.$strip>, z.ZodObject<{
400
418
  type: z.ZodLiteral<"fetch-start-page">;
401
419
  recipeId: z.ZodString;
420
+ }, z.core.$strip>, z.ZodObject<{
421
+ type: z.ZodLiteral<"detect-url">;
422
+ url: z.ZodString;
402
423
  }, z.core.$strip>, z.ZodObject<{
403
424
  type: z.ZodLiteral<"save-outline">;
404
425
  path: z.ZodString;
@@ -417,6 +438,7 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
417
438
  recipeId: z.ZodString;
418
439
  path: z.ZodString;
419
440
  nodeIds: z.ZodUnion<readonly [z.ZodTuple<[z.ZodString], null>, z.ZodTuple<[z.ZodString, z.ZodString], null>]>;
441
+ within: z.ZodOptional<z.ZodString>;
420
442
  }, z.core.$strip>, z.ZodObject<{
421
443
  type: z.ZodLiteral<"explain-why">;
422
444
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -471,6 +493,13 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
471
493
  path: z.ZodString;
472
494
  delimiter: z.ZodOptional<z.ZodString>;
473
495
  encoding: z.ZodOptional<z.ZodString>;
496
+ }, z.core.$strip>, z.ZodObject<{
497
+ type: z.ZodLiteral<"grid-rows">;
498
+ recipeId: z.ZodString;
499
+ path: z.ZodString;
500
+ sheet: z.ZodInt;
501
+ from: z.ZodInt;
502
+ count: z.ZodInt;
474
503
  }, z.core.$strip>, z.ZodObject<{
475
504
  type: z.ZodLiteral<"grid-preview">;
476
505
  recipeId: z.ZodString;
@@ -523,6 +552,7 @@ export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
523
552
  export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
524
553
  export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
525
554
  export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
555
+ export type DetectUrlCommand = z.infer<typeof detectUrlCommandSchema>;
526
556
  export type SaveOutlineCommand = z.infer<typeof saveOutlineCommandSchema>;
527
557
  export type TakeSnapshotCommand = z.infer<typeof takeSnapshotCommandSchema>;
528
558
  export type VerifySelectorCommand = z.infer<typeof verifySelectorCommandSchema>;
@@ -535,6 +565,7 @@ export type TablePreviewOptions = z.infer<typeof tablePreviewOptionsSchema>;
535
565
  export type TablePreviewCommand = z.infer<typeof tablePreviewCommandSchema>;
536
566
  export type RegionPreviewCommand = z.infer<typeof regionPreviewCommandSchema>;
537
567
  export type GridViewCommand = z.infer<typeof gridViewCommandSchema>;
568
+ export type GridRowsCommand = z.infer<typeof gridRowsCommandSchema>;
538
569
  export type GridPreviewOptions = z.infer<typeof gridPreviewOptionsSchema>;
539
570
  export type GridPreviewCommand = z.infer<typeof gridPreviewCommandSchema>;
540
571
  export type DeckViewCommand = z.infer<typeof deckViewCommandSchema>;
@@ -49,6 +49,7 @@ export declare const deckSlideViewSchema: z.ZodObject<{
49
49
  string: "string";
50
50
  }>;
51
51
  }, z.core.$strip>>>;
52
+ rowCount: z.ZodOptional<z.ZodNumber>;
52
53
  merges: z.ZodArray<z.ZodObject<{
53
54
  ref: z.ZodString;
54
55
  top: z.ZodNumber;
@@ -103,6 +104,7 @@ export declare const deckDocumentViewSchema: z.ZodObject<{
103
104
  string: "string";
104
105
  }>;
105
106
  }, z.core.$strip>>>;
107
+ rowCount: z.ZodOptional<z.ZodNumber>;
106
108
  merges: z.ZodArray<z.ZodObject<{
107
109
  ref: z.ZodString;
108
110
  top: z.ZodNumber;
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `detect-url`'s answer: what the address returns, so "Load ▾ Web page" starts the right recipe: `html` is a page (opened in a
4
+ * browser); `json`, `pdf`, `csv`, `xlsx`, `markdown`, `xml`... are documents (read with a request); `unknown` when it could not be fetched.
5
+ */
6
+ export declare const detectUrlViewSchema: z.ZodObject<{
7
+ kind: z.ZodEnum<{
8
+ csv: "csv";
9
+ docx: "docx";
10
+ html: "html";
11
+ json: "json";
12
+ jsonl: "jsonl";
13
+ markdown: "markdown";
14
+ pdf: "pdf";
15
+ pptx: "pptx";
16
+ text: "text";
17
+ unknown: "unknown";
18
+ xlsx: "xlsx";
19
+ xml: "xml";
20
+ yaml: "yaml";
21
+ }>;
22
+ }, z.core.$strip>;
23
+ export type DetectUrlView = z.infer<typeof detectUrlViewSchema>;
24
+ //# sourceMappingURL=detect-url-view.contract.d.ts.map
@@ -31,6 +31,7 @@ export declare const gridSheetViewSchema: z.ZodObject<{
31
31
  string: "string";
32
32
  }>;
33
33
  }, z.core.$strip>>>;
34
+ rowCount: z.ZodOptional<z.ZodNumber>;
34
35
  merges: z.ZodArray<z.ZodObject<{
35
36
  ref: z.ZodString;
36
37
  top: z.ZodNumber;
@@ -43,6 +44,18 @@ export declare const gridSheetViewSchema: z.ZodObject<{
43
44
  defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
44
45
  defaultRowHeight: z.ZodOptional<z.ZodNumber>;
45
46
  }, z.core.$strip>;
47
+ /** What `grid-rows` answers with: a run of one sheet's rows. */
48
+ export declare const gridRowsViewSchema: z.ZodObject<{
49
+ rows: z.ZodArray<z.ZodArray<z.ZodObject<{
50
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
51
+ type: z.ZodEnum<{
52
+ boolean: "boolean";
53
+ date: "date";
54
+ number: "number";
55
+ string: "string";
56
+ }>;
57
+ }, z.core.$strip>>>;
58
+ }, z.core.$strip>;
46
59
  /** What `grid-view` answers with (studio plan §3.4, issue #94's 5c): every sheet's cells, typed, with hidden sheets/rows marked and merged ranges resolved, for the grid canvas to draw. */
47
60
  export declare const workbookDocumentViewSchema: z.ZodObject<{
48
61
  sheets: z.ZodArray<z.ZodObject<{
@@ -59,6 +72,7 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
59
72
  string: "string";
60
73
  }>;
61
74
  }, z.core.$strip>>>;
75
+ rowCount: z.ZodOptional<z.ZodNumber>;
62
76
  merges: z.ZodArray<z.ZodObject<{
63
77
  ref: z.ZodString;
64
78
  top: z.ZodNumber;
@@ -76,6 +90,7 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
76
90
  delimiter: z.ZodString;
77
91
  }, z.core.$strip>>;
78
92
  }, z.core.$strip>;
93
+ export type GridRowsView = z.infer<typeof gridRowsViewSchema>;
79
94
  export type GridCellView = z.infer<typeof gridCellViewSchema>;
80
95
  export type GridMergeView = z.infer<typeof gridMergeViewSchema>;
81
96
  export type GridSheetView = z.infer<typeof gridSheetViewSchema>;
@@ -1,11 +1,11 @@
1
- export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, gridViewCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, startRecordingCommandSchema, stopRecordingCommandSchema, studioCommandSchema } from './command.contract';
2
- export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StartRecordingCommand, StopRecordingCommand, StudioCommand } from './command.contract';
1
+ export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, detectUrlCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, gridViewCommandSchema, gridRowsCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, startRecordingCommandSchema, stopRecordingCommandSchema, studioCommandSchema } from './command.contract';
2
+ export type { SampleBudget, OpenWorkspaceCommand, ChooseFolderCommand, OpenPathCommand, ImportDocumentCommand, RunSampleCommand, StopRunCommand, SaveRecipeCommand, FetchStartPageCommand, DetectUrlCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridRowsCommand, GridPreviewOptions, GridPreviewCommand, DeckViewCommand, DeckPreviewOptions, DeckPreviewCommand, StartRecordingCommand, StopRecordingCommand, StudioCommand } from './command.contract';
3
3
  export { snapshotViewSchema } from './snapshot-view.contract';
4
4
  export type { SnapshotView } from './snapshot-view.contract';
5
5
  export { verifySelectorViewSchema } from './verify-selector-view.contract';
6
6
  export type { VerifySelectorView } from './verify-selector-view.contract';
7
- export { fieldPickSchema, inferSelectorViewSchema } from './infer-selector-view.contract';
8
- export type { FieldPick, InferSelectorView } from './infer-selector-view.contract';
7
+ export { fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema } from './infer-selector-view.contract';
8
+ export type { FieldPick, InferSelectorView, SelectorAlternative } from './infer-selector-view.contract';
9
9
  export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, studioEventSchema } from './event.contract';
10
10
  export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, StudioEvent } from './event.contract';
11
11
  export { loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema } from './workspace-view.contract';
@@ -18,6 +18,8 @@ export { importDocumentViewSchema } from './import-document-view.contract';
18
18
  export type { ImportDocumentView } from './import-document-view.contract';
19
19
  export { sampleRunRecordSchema, sampleRunViewSchema } from './sample-run-view.contract';
20
20
  export type { SampleRunRecord, SampleRunView } from './sample-run-view.contract';
21
+ export { detectUrlViewSchema } from './detect-url-view.contract';
22
+ export type { DetectUrlView } from './detect-url-view.contract';
21
23
  export { startPageViewSchema } from './start-page-view.contract';
22
24
  export type { StartPageView } from './start-page-view.contract';
23
25
  export { sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema } from './outline-view.contract';
@@ -36,8 +38,8 @@ export { tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchem
36
38
  export type { TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView } from './table-preview-view.contract';
37
39
  export { regionPreviewMatchSchema, regionPreviewViewSchema } from './region-preview-view.contract';
38
40
  export type { RegionPreviewMatchView, RegionPreviewView } from './region-preview-view.contract';
39
- export { gridCellViewSchema, gridMergeViewSchema, gridSheetViewSchema, workbookDocumentViewSchema } from './grid-view.contract';
40
- export type { GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView } from './grid-view.contract';
41
+ export { gridCellViewSchema, gridMergeViewSchema, gridRowsViewSchema, gridSheetViewSchema, workbookDocumentViewSchema } from './grid-view.contract';
42
+ export type { GridCellView, GridMergeView, GridRowsView, GridSheetView, WorkbookDocumentView } from './grid-view.contract';
41
43
  export { gridTablePreviewMatchSchema, gridTablePreviewViewSchema } from './grid-preview-view.contract';
42
44
  export type { GridTablePreviewMatchView, GridTablePreviewView } from './grid-preview-view.contract';
43
45
  export { deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema } from './deck-view.contract';
@@ -1,4 +1,16 @@
1
1
  import { z } from 'zod';
2
+ /** Another selector that reaches the clicked node, verified against the snapshot, for the person to choose instead of the best one. */
3
+ export declare const selectorAlternativeSchema: z.ZodObject<{
4
+ selector: z.ZodString;
5
+ tier: z.ZodEnum<{
6
+ class: "class";
7
+ "data-attr": "data-attr";
8
+ id: "id";
9
+ position: "position";
10
+ structure: "structure";
11
+ }>;
12
+ matches: z.ZodNumber;
13
+ }, z.core.$strip>;
2
14
  /** One clicked node's field: the best selector found for it, verified against the snapshot. */
3
15
  export declare const fieldPickSchema: z.ZodObject<{
4
16
  selector: z.ZodString;
@@ -11,6 +23,18 @@ export declare const fieldPickSchema: z.ZodObject<{
11
23
  }>;
12
24
  take: z.ZodString;
13
25
  matches: z.ZodNumber;
26
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
+ selector: z.ZodString;
28
+ tier: z.ZodEnum<{
29
+ class: "class";
30
+ "data-attr": "data-attr";
31
+ id: "id";
32
+ position: "position";
33
+ structure: "structure";
34
+ }>;
35
+ matches: z.ZodNumber;
36
+ }, z.core.$strip>>>;
37
+ generatedId: z.ZodOptional<z.ZodString>;
14
38
  }, z.core.$strip>;
15
39
  /**
16
40
  * What `infer-selector` answers with (issue #91, studio plan §3.2):
@@ -33,6 +57,18 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
33
57
  }>;
34
58
  take: z.ZodString;
35
59
  matches: z.ZodNumber;
60
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ selector: z.ZodString;
62
+ tier: z.ZodEnum<{
63
+ class: "class";
64
+ "data-attr": "data-attr";
65
+ id: "id";
66
+ position: "position";
67
+ structure: "structure";
68
+ }>;
69
+ matches: z.ZodNumber;
70
+ }, z.core.$strip>>>;
71
+ generatedId: z.ZodOptional<z.ZodString>;
36
72
  }, z.core.$strip>;
37
73
  }, z.core.$strip>, z.ZodObject<{
38
74
  kind: z.ZodLiteral<"list">;
@@ -46,7 +82,44 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
46
82
  structure: "structure";
47
83
  }>;
48
84
  matches: z.ZodNumber;
85
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ selector: z.ZodString;
87
+ tier: z.ZodEnum<{
88
+ class: "class";
89
+ "data-attr": "data-attr";
90
+ id: "id";
91
+ position: "position";
92
+ structure: "structure";
93
+ }>;
94
+ matches: z.ZodNumber;
95
+ }, z.core.$strip>>>;
96
+ }, z.core.$strip>;
97
+ field: z.ZodObject<{
98
+ selector: z.ZodString;
99
+ tier: z.ZodEnum<{
100
+ class: "class";
101
+ "data-attr": "data-attr";
102
+ id: "id";
103
+ position: "position";
104
+ structure: "structure";
105
+ }>;
106
+ take: z.ZodString;
107
+ matches: z.ZodNumber;
108
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
+ selector: z.ZodString;
110
+ tier: z.ZodEnum<{
111
+ class: "class";
112
+ "data-attr": "data-attr";
113
+ id: "id";
114
+ position: "position";
115
+ structure: "structure";
116
+ }>;
117
+ matches: z.ZodNumber;
118
+ }, z.core.$strip>>>;
119
+ generatedId: z.ZodOptional<z.ZodString>;
49
120
  }, z.core.$strip>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ kind: z.ZodLiteral<"item-field">;
50
123
  field: z.ZodObject<{
51
124
  selector: z.ZodString;
52
125
  tier: z.ZodEnum<{
@@ -58,11 +131,24 @@ export declare const inferSelectorViewSchema: z.ZodDiscriminatedUnion<[z.ZodObje
58
131
  }>;
59
132
  take: z.ZodString;
60
133
  matches: z.ZodNumber;
134
+ alternatives: z.ZodOptional<z.ZodArray<z.ZodObject<{
135
+ selector: z.ZodString;
136
+ tier: z.ZodEnum<{
137
+ class: "class";
138
+ "data-attr": "data-attr";
139
+ id: "id";
140
+ position: "position";
141
+ structure: "structure";
142
+ }>;
143
+ matches: z.ZodNumber;
144
+ }, z.core.$strip>>>;
145
+ generatedId: z.ZodOptional<z.ZodString>;
61
146
  }, z.core.$strip>;
62
147
  }, z.core.$strip>, z.ZodObject<{
63
148
  kind: z.ZodLiteral<"unsupported">;
64
149
  reason: z.ZodString;
65
150
  }, z.core.$strip>], "kind">;
151
+ export type SelectorAlternative = z.infer<typeof selectorAlternativeSchema>;
66
152
  export type FieldPick = z.infer<typeof fieldPickSchema>;
67
153
  export type InferSelectorView = z.infer<typeof inferSelectorViewSchema>;
68
154
  //# sourceMappingURL=infer-selector-view.contract.d.ts.map
@@ -25,6 +25,7 @@ export declare const snapshotViewSchema: z.ZodObject<{
25
25
  xml: "xml";
26
26
  yaml: "yaml";
27
27
  }>>;
28
+ notice: z.ZodOptional<z.ZodString>;
28
29
  }, z.core.$strip>;
29
30
  export type SnapshotView = z.infer<typeof snapshotViewSchema>;
30
31
  //# sourceMappingURL=snapshot-view.contract.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { DetectUrlCommand, DetectUrlView } from '../studio-api';
2
+ /**
3
+ * Handles `detect-url`: what the address returns, for "Load ▾ Web page" to start a recipe that reads a document (a JSON API, a PDF,
4
+ * a spreadsheet, Markdown...) instead of a browser recipe over a response that is not a page.
5
+ *
6
+ * @param command - The address.
7
+ * @returns What it returns.
8
+ */
9
+ export declare function handleDetectUrl(command: DetectUrlCommand): Promise<DetectUrlView>;
10
+ //# sourceMappingURL=detect-url.handler.d.ts.map
@@ -1,5 +1,7 @@
1
- import type { GridViewCommand, WorkbookDocumentView } from '../studio-api';
1
+ import type { GridRowsCommand, GridRowsView, GridViewCommand, WorkbookDocumentView } from '../studio-api';
2
2
  import type { StudioState } from './workspace.store';
3
+ /** How many rows of a sheet the first `grid-view` answer carries; a bigger sheet's other rows come from `grid-rows` as the grid is scrolled. */
4
+ export declare const GRID_WINDOW_ROWS = 200;
3
5
  /**
4
6
  * Handles `grid-view`: the grid canvas's sheets and cells (`document-view`'s
5
7
  * `workbook-view.mapper.ts`, studio plan §3.4, issue #94's 5c), off the same
@@ -17,4 +19,13 @@ import type { StudioState } from './workspace.store';
17
19
  * @throws Error when no workspace is open, `command.path` has no cached snapshot yet, an override is given for a snapshot that is not a CSV, or the snapshot's document is not a read workbook.
18
20
  */
19
21
  export declare function handleGridView(state: StudioState, command: GridViewCommand): Promise<WorkbookDocumentView>;
22
+ /**
23
+ * Handles `grid-rows`: a run of one sheet's rows from the cached snapshot, for the grid that holds only a few screens of a big file at a time.
24
+ *
25
+ * @param state - The server state.
26
+ * @param command - The command; `command.path` must already have a cached snapshot.
27
+ * @returns The rows (none past the end of the sheet).
28
+ * @throws Error when there is no cached snapshot or it is not a workbook.
29
+ */
30
+ export declare function handleGridRows(state: StudioState, command: GridRowsCommand): GridRowsView;
20
31
  //# sourceMappingURL=grid-view.handler.d.ts.map