@opencraw/studio 0.0.18 → 0.0.19

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 (115) hide show
  1. package/dist/browser-provisioning/ensure-browser-launch.use-case.d.ts +12 -0
  2. package/dist/browser-provisioning/index.d.ts +2 -0
  3. package/dist/browser-provisioning/install-chromium.use-case.d.ts +2 -0
  4. package/dist/browser-provisioning/missing-browser.policy.d.ts +3 -0
  5. package/dist/document-view/deck-view.mapper.d.ts +70 -0
  6. package/dist/document-view/index.d.ts +13 -0
  7. package/dist/document-view/pdf-view.mapper.d.ts +47 -0
  8. package/dist/document-view/region-preview.use-case.d.ts +30 -0
  9. package/dist/document-view/table-preview.use-case.d.ts +152 -0
  10. package/dist/document-view/tree-view.mapper.d.ts +47 -0
  11. package/dist/document-view/workbook-view.mapper.d.ts +51 -0
  12. package/dist/explain-why/index.d.ts +5 -0
  13. package/dist/explain-why/item-hint.algorithm.d.ts +13 -0
  14. package/dist/explain-why/why-sentence.mapper.d.ts +48 -0
  15. package/dist/explain-why/why.use-case.d.ts +26 -0
  16. package/dist/flow-recording/action-to-step.mapper.d.ts +16 -0
  17. package/dist/flow-recording/index.d.ts +13 -0
  18. package/dist/flow-recording/next-link.policy.d.ts +27 -0
  19. package/dist/flow-recording/recorded-action.contract.d.ts +114 -0
  20. package/dist/flow-recording/recorder-script.client.d.ts +48 -0
  21. package/dist/flow-recording/recorder-session.use-case.d.ts +67 -0
  22. package/dist/flow-recording/secret-field.policy.d.ts +33 -0
  23. package/dist/flow-recording/wait-insertion.policy.d.ts +26 -0
  24. package/dist/index.d.ts +14 -1
  25. package/dist/main.d.ts +18 -0
  26. package/dist/page-inspector/dom-tree.mapper.d.ts +32 -0
  27. package/dist/page-inspector/index.d.ts +7 -0
  28. package/dist/page-inspector/page-data.algorithm.d.ts +39 -0
  29. package/dist/page-inspector/responses-seen.use-case.d.ts +36 -0
  30. package/dist/page-snapshot/fetch-start-page.use-case.d.ts +20 -0
  31. package/dist/page-snapshot/hidden-marks.algorithm.d.ts +23 -0
  32. package/dist/page-snapshot/index.d.ts +13 -0
  33. package/dist/page-snapshot/invalidate-stale-snapshot.use-case.d.ts +12 -0
  34. package/dist/page-snapshot/pdf-bytes.use-case.d.ts +16 -0
  35. package/dist/page-snapshot/reread-csv.use-case.d.ts +22 -0
  36. package/dist/page-snapshot/rewrite-document.mapper.d.ts +27 -0
  37. package/dist/page-snapshot/snapshot.store.d.ts +14 -0
  38. package/dist/page-snapshot/start-point.policy.d.ts +12 -0
  39. package/dist/page-snapshot/take-snapshot.use-case.d.ts +60 -0
  40. package/dist/recipe-workspace/import-document.use-case.d.ts +22 -0
  41. package/dist/recipe-workspace/index.d.ts +5 -0
  42. package/dist/recipe-workspace/open-workspace.use-case.d.ts +15 -0
  43. package/dist/recipe-workspace/save-recipe.use-case.d.ts +21 -0
  44. package/dist/sample-run/index.d.ts +8 -0
  45. package/dist/sample-run/last-run.store.d.ts +17 -0
  46. package/dist/sample-run/load-recipe-pair.use-case.d.ts +18 -0
  47. package/dist/sample-run/run-sample.use-case.d.ts +40 -0
  48. package/dist/sample-run/sample-run-record.contract.d.ts +48 -0
  49. package/dist/scope-outline/card-sentence.mapper.d.ts +18 -0
  50. package/dist/scope-outline/index.d.ts +8 -0
  51. package/dist/scope-outline/outline-to-recipe.mapper.d.ts +17 -0
  52. package/dist/scope-outline/outline.model.d.ts +57 -0
  53. package/dist/scope-outline/recipe-to-outline.mapper.d.ts +14 -0
  54. package/dist/scope-outline/scope-at-path.algorithm.d.ts +19 -0
  55. package/dist/selector-inference/class-token.policy.d.ts +35 -0
  56. package/dist/selector-inference/dom-path.model.d.ts +73 -0
  57. package/dist/selector-inference/index.d.ts +12 -0
  58. package/dist/selector-inference/list-inference.algorithm.d.ts +43 -0
  59. package/dist/selector-inference/selector-candidates.algorithm.d.ts +22 -0
  60. package/dist/selector-inference/selector-ranking.policy.d.ts +27 -0
  61. package/dist/selector-inference/shadow-dom.error.d.ts +11 -0
  62. package/dist/selector-inference/take-kind.policy.d.ts +12 -0
  63. package/dist/studio-api/command.contract.d.ts +531 -0
  64. package/dist/studio-api/deck-preview-view.contract.d.ts +28 -0
  65. package/dist/studio-api/deck-view.contract.d.ts +127 -0
  66. package/dist/studio-api/document-tree-view.contract.d.ts +26 -0
  67. package/dist/studio-api/event.contract.d.ts +155 -0
  68. package/dist/studio-api/grid-preview-view.contract.d.ts +26 -0
  69. package/dist/studio-api/grid-view.contract.d.ts +75 -0
  70. package/dist/studio-api/import-document-view.contract.d.ts +8 -0
  71. package/dist/studio-api/index.d.ts +43 -0
  72. package/dist/studio-api/infer-selector-view.contract.d.ts +68 -0
  73. package/dist/studio-api/inspect-view.contract.d.ts +62 -0
  74. package/dist/studio-api/outline-view.contract.d.ts +37 -0
  75. package/dist/studio-api/pdf-view.contract.d.ts +66 -0
  76. package/dist/studio-api/region-preview-view.contract.d.ts +53 -0
  77. package/dist/studio-api/responses-seen-view.contract.d.ts +20 -0
  78. package/dist/studio-api/sample-run-view.contract.d.ts +28 -0
  79. package/dist/studio-api/snapshot-view.contract.d.ts +30 -0
  80. package/dist/studio-api/start-page-view.contract.d.ts +7 -0
  81. package/dist/studio-api/table-preview-view.contract.d.ts +65 -0
  82. package/dist/studio-api/verify-selector-view.contract.d.ts +18 -0
  83. package/dist/studio-api/why-view.contract.d.ts +16 -0
  84. package/dist/studio-api/workspace-view.contract.d.ts +67 -0
  85. package/dist/studio-server/access-token.policy.d.ts +26 -0
  86. package/dist/studio-server/deck-preview.handler.d.ts +17 -0
  87. package/dist/studio-server/deck-view.handler.d.ts +15 -0
  88. package/dist/studio-server/document-tree.handler.d.ts +14 -0
  89. package/dist/studio-server/explain-why.handler.d.ts +14 -0
  90. package/dist/studio-server/fetch-start-page.handler.d.ts +14 -0
  91. package/dist/studio-server/grid-preview.handler.d.ts +17 -0
  92. package/dist/studio-server/grid-view.handler.d.ts +20 -0
  93. package/dist/studio-server/import-document.handler.d.ts +14 -0
  94. package/dist/studio-server/index.d.ts +3 -0
  95. package/dist/studio-server/infer-selector.handler.d.ts +18 -0
  96. package/dist/studio-server/inspect-page.handler.d.ts +18 -0
  97. package/dist/studio-server/open-workspace.handler.d.ts +20 -0
  98. package/dist/studio-server/pdf-bytes.handler.d.ts +17 -0
  99. package/dist/studio-server/pdf-view.handler.d.ts +14 -0
  100. package/dist/studio-server/recording.handler.d.ts +36 -0
  101. package/dist/studio-server/region-preview.handler.d.ts +17 -0
  102. package/dist/studio-server/responses-seen.handler.d.ts +16 -0
  103. package/dist/studio-server/run-sample.handler.d.ts +28 -0
  104. package/dist/studio-server/save-outline.handler.d.ts +18 -0
  105. package/dist/studio-server/save-recipe.handler.d.ts +15 -0
  106. package/dist/studio-server/static-file.handler.d.ts +14 -0
  107. package/dist/studio-server/studio-http.use-case.d.ts +40 -0
  108. package/dist/studio-server/table-preview.handler.d.ts +16 -0
  109. package/dist/studio-server/take-snapshot.handler.d.ts +16 -0
  110. package/dist/studio-server/verify-selector.handler.d.ts +18 -0
  111. package/dist/studio-server/websocket.client.d.ts +22 -0
  112. package/dist/studio-server/workspace.store.d.ts +36 -0
  113. package/dist/trusted-plugins/index.d.ts +2 -0
  114. package/dist/trusted-plugins/trusted-plugins.contract.d.ts +14 -0
  115. package/package.json +3 -3
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ /** One text cell, in PDF points — mirrors `document-view/pdf-view.mapper.ts`'s `PdfCellView`, the wire shape for the UI (studio plan §3.4, issue #94's 5b). */
3
+ export declare const pdfCellViewSchema: z.ZodObject<{
4
+ x: z.ZodNumber;
5
+ y: z.ZodNumber;
6
+ width: z.ZodNumber;
7
+ height: z.ZodNumber;
8
+ text: z.ZodString;
9
+ }, z.core.$strip>;
10
+ export declare const pdfRowViewSchema: z.ZodObject<{
11
+ top: z.ZodNumber;
12
+ bottom: z.ZodNumber;
13
+ cells: z.ZodArray<z.ZodObject<{
14
+ x: z.ZodNumber;
15
+ y: z.ZodNumber;
16
+ width: z.ZodNumber;
17
+ height: z.ZodNumber;
18
+ text: z.ZodString;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>;
21
+ export declare const pdfPageViewSchema: z.ZodObject<{
22
+ number: z.ZodNumber;
23
+ width: z.ZodNumber;
24
+ height: z.ZodNumber;
25
+ rows: z.ZodArray<z.ZodObject<{
26
+ top: z.ZodNumber;
27
+ bottom: z.ZodNumber;
28
+ cells: z.ZodArray<z.ZodObject<{
29
+ x: z.ZodNumber;
30
+ y: z.ZodNumber;
31
+ width: z.ZodNumber;
32
+ height: z.ZodNumber;
33
+ text: z.ZodString;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>>;
36
+ rowCount: z.ZodNumber;
37
+ cellCount: z.ZodNumber;
38
+ hasTextLayer: z.ZodBoolean;
39
+ }, z.core.$strip>;
40
+ /** What `pdf-view` answers with (studio plan §3.4, issue #94's 5b): every page's cells and rows, for the PDF canvas to draw over its own `pdf.js` rendering. */
41
+ export declare const pdfDocumentViewSchema: z.ZodObject<{
42
+ pages: z.ZodArray<z.ZodObject<{
43
+ number: z.ZodNumber;
44
+ width: z.ZodNumber;
45
+ height: z.ZodNumber;
46
+ rows: z.ZodArray<z.ZodObject<{
47
+ top: z.ZodNumber;
48
+ bottom: z.ZodNumber;
49
+ cells: z.ZodArray<z.ZodObject<{
50
+ x: z.ZodNumber;
51
+ y: z.ZodNumber;
52
+ width: z.ZodNumber;
53
+ height: z.ZodNumber;
54
+ text: z.ZodString;
55
+ }, z.core.$strip>>;
56
+ }, z.core.$strip>>;
57
+ rowCount: z.ZodNumber;
58
+ cellCount: z.ZodNumber;
59
+ hasTextLayer: z.ZodBoolean;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>;
62
+ export type PdfCellView = z.infer<typeof pdfCellViewSchema>;
63
+ export type PdfRowView = z.infer<typeof pdfRowViewSchema>;
64
+ export type PdfPageView = z.infer<typeof pdfPageViewSchema>;
65
+ export type PdfDocumentView = z.infer<typeof pdfDocumentViewSchema>;
66
+ //# sourceMappingURL=pdf-view.contract.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ /** One page of a PDF, or one slide of a deck, a `region` extract's box reads text off — mirrors `document-view/region-preview.use-case.ts`'s `RegionPreviewMatch`: `cells` for a PDF, `shapes` for a deck, the other empty. */
3
+ export declare const regionPreviewMatchSchema: z.ZodObject<{
4
+ page: z.ZodNumber;
5
+ text: z.ZodString;
6
+ cells: z.ZodArray<z.ZodObject<{
7
+ x: z.ZodNumber;
8
+ y: z.ZodNumber;
9
+ width: z.ZodNumber;
10
+ height: z.ZodNumber;
11
+ text: z.ZodString;
12
+ }, z.core.$strip>>;
13
+ shapes: z.ZodArray<z.ZodObject<{
14
+ x: z.ZodNumber;
15
+ y: z.ZodNumber;
16
+ width: z.ZodNumber;
17
+ height: z.ZodNumber;
18
+ text: z.ZodString;
19
+ placeholder: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>>;
21
+ }, z.core.$strip>;
22
+ /**
23
+ * What `region-preview` answers with (issues #121 and #122: the PDF and
24
+ * deck canvases' click-to-snap selection): the engine's own matches for
25
+ * the selector — the text the step would bind, and the cells or text boxes
26
+ * to highlight — or `error` when the selector does not parse yet, or names
27
+ * the other document's keyword, reported rather than thrown.
28
+ */
29
+ export declare const regionPreviewViewSchema: z.ZodObject<{
30
+ matches: z.ZodArray<z.ZodObject<{
31
+ page: z.ZodNumber;
32
+ text: z.ZodString;
33
+ cells: z.ZodArray<z.ZodObject<{
34
+ x: z.ZodNumber;
35
+ y: z.ZodNumber;
36
+ width: z.ZodNumber;
37
+ height: z.ZodNumber;
38
+ text: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ shapes: z.ZodArray<z.ZodObject<{
41
+ x: z.ZodNumber;
42
+ y: z.ZodNumber;
43
+ width: z.ZodNumber;
44
+ height: z.ZodNumber;
45
+ text: z.ZodString;
46
+ placeholder: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ error: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>;
51
+ export type RegionPreviewMatchView = z.infer<typeof regionPreviewMatchSchema>;
52
+ export type RegionPreviewView = z.infer<typeof regionPreviewViewSchema>;
53
+ //# sourceMappingURL=region-preview-view.contract.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ /** One JSON response seen — mirrors `page-inspector/responses-seen.use-case.ts`'s `ObservedResponse`. */
3
+ export declare const observedResponseSchema: z.ZodObject<{
4
+ url: z.ZodString;
5
+ status: z.ZodNumber;
6
+ size: z.ZodNumber;
7
+ shape: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export type ObservedResponseView = z.infer<typeof observedResponseSchema>;
10
+ /** What `responses-seen` answers with (studio plan §3.3, issue #93): the JSON responses the page fetched while it rendered, for the panel's "responses seen" list. */
11
+ export declare const responsesSeenViewSchema: z.ZodObject<{
12
+ responses: z.ZodArray<z.ZodObject<{
13
+ url: z.ZodString;
14
+ status: z.ZodNumber;
15
+ size: z.ZodNumber;
16
+ shape: z.ZodString;
17
+ }, z.core.$strip>>;
18
+ }, z.core.$strip>;
19
+ export type ResponsesSeenView = z.infer<typeof responsesSeenViewSchema>;
20
+ //# sourceMappingURL=responses-seen-view.contract.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ /** One record of a sample run's result, kept for the Records tab. */
3
+ export declare const sampleRunRecordSchema: z.ZodObject<{
4
+ key: z.ZodNullable<z.ZodString>;
5
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6
+ }, z.core.$strip>;
7
+ /** The last sample run's result, for a client that opens the UI after it finished. */
8
+ export declare const sampleRunViewSchema: z.ZodObject<{
9
+ recipeId: z.ZodString;
10
+ emitted: z.ZodNumber;
11
+ rejected: z.ZodNumber;
12
+ duplicates: z.ZodNumber;
13
+ durationMs: z.ZodNumber;
14
+ error: z.ZodOptional<z.ZodString>;
15
+ stoppedBy: z.ZodOptional<z.ZodEnum<{
16
+ "sample-maxMs": "sample-maxMs";
17
+ "sample-maxPages": "sample-maxPages";
18
+ "sample-maxRecords": "sample-maxRecords";
19
+ }>>;
20
+ records: z.ZodArray<z.ZodObject<{
21
+ key: z.ZodNullable<z.ZodString>;
22
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
23
+ }, z.core.$strip>>;
24
+ trace: z.ZodArray<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type SampleRunRecord = z.infer<typeof sampleRunRecordSchema>;
27
+ export type SampleRunView = z.infer<typeof sampleRunViewSchema>;
28
+ //# sourceMappingURL=sample-run-view.contract.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What `take-snapshot` answers with: the rewritten document ready for the
4
+ * content pane's sandboxed iframe (studio plan §3.1, issue #91). `format`
5
+ * (api mode only; absent in web mode, whose document is always HTML) is
6
+ * what the content pane uses to choose a canvas — the snapshot iframe for
7
+ * `html` (and `docx`/`markdown`, already turned into HTML), else
8
+ * `document-view`'s tree/pdf/grid/deck canvas (studio plan §3.4, issue #94).
9
+ */
10
+ export declare const snapshotViewSchema: z.ZodObject<{
11
+ html: z.ZodString;
12
+ nodeCount: z.ZodNumber;
13
+ baseUrl: z.ZodString;
14
+ format: z.ZodOptional<z.ZodEnum<{
15
+ csv: "csv";
16
+ docx: "docx";
17
+ html: "html";
18
+ json: "json";
19
+ jsonl: "jsonl";
20
+ markdown: "markdown";
21
+ pdf: "pdf";
22
+ pptx: "pptx";
23
+ text: "text";
24
+ xlsx: "xlsx";
25
+ xml: "xml";
26
+ yaml: "yaml";
27
+ }>>;
28
+ }, z.core.$strip>;
29
+ export type SnapshotView = z.infer<typeof snapshotViewSchema>;
30
+ //# sourceMappingURL=snapshot-view.contract.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /** What `fetch-start-page` answers with. */
3
+ export declare const startPageViewSchema: z.ZodObject<{
4
+ html: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type StartPageView = z.infer<typeof startPageViewSchema>;
7
+ //# sourceMappingURL=start-page-view.contract.d.ts.map
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ /** One table matched by a `table` extract's options — mirrors `@opencraw/core`'s `PdfTable`. */
3
+ export declare const tablePreviewTableSchema: z.ZodObject<{
4
+ page: z.ZodNumber;
5
+ title: z.ZodString;
6
+ header: z.ZodArray<z.ZodString>;
7
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>;
8
+ }, z.core.$strip>;
9
+ /** One column band a matched table's body clustered into — mirrors `@opencraw/core`'s `TableBandDiagnostics`. */
10
+ export declare const tablePreviewBandSchema: z.ZodObject<{
11
+ start: z.ZodNumber;
12
+ end: z.ZodNumber;
13
+ column: z.ZodNumber;
14
+ name: z.ZodString;
15
+ }, z.core.$strip>;
16
+ /** One matched table, with the exact page rows to highlight — mirrors `document-view/table-preview.use-case.ts`'s `TablePreviewMatch`. */
17
+ export declare const tablePreviewMatchSchema: z.ZodObject<{
18
+ page: z.ZodNumber;
19
+ headerRowIndex: z.ZodNumber;
20
+ matchedRowIndices: z.ZodArray<z.ZodNumber>;
21
+ bands: z.ZodArray<z.ZodObject<{
22
+ start: z.ZodNumber;
23
+ end: z.ZodNumber;
24
+ column: z.ZodNumber;
25
+ name: z.ZodString;
26
+ }, z.core.$strip>>;
27
+ bandTolerance: z.ZodNumber;
28
+ table: z.ZodObject<{
29
+ page: z.ZodNumber;
30
+ title: z.ZodString;
31
+ header: z.ZodArray<z.ZodString>;
32
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>;
35
+ /**
36
+ * What `table-preview` answers with (studio plan §3.4, issue #94's 5b: the
37
+ * live preview): every match, or `error` when a pattern in the options does
38
+ * not compile — expected while the person is still typing it, not thrown.
39
+ */
40
+ export declare const tablePreviewViewSchema: z.ZodObject<{
41
+ matches: z.ZodArray<z.ZodObject<{
42
+ page: z.ZodNumber;
43
+ headerRowIndex: z.ZodNumber;
44
+ matchedRowIndices: z.ZodArray<z.ZodNumber>;
45
+ bands: z.ZodArray<z.ZodObject<{
46
+ start: z.ZodNumber;
47
+ end: z.ZodNumber;
48
+ column: z.ZodNumber;
49
+ name: z.ZodString;
50
+ }, z.core.$strip>>;
51
+ bandTolerance: z.ZodNumber;
52
+ table: z.ZodObject<{
53
+ page: z.ZodNumber;
54
+ title: z.ZodString;
55
+ header: z.ZodArray<z.ZodString>;
56
+ rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>;
57
+ }, z.core.$strip>;
58
+ }, z.core.$strip>>;
59
+ error: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>;
61
+ export type TablePreviewTableView = z.infer<typeof tablePreviewTableSchema>;
62
+ export type TablePreviewBandView = z.infer<typeof tablePreviewBandSchema>;
63
+ export type TablePreviewMatchView = z.infer<typeof tablePreviewMatchSchema>;
64
+ export type TablePreviewView = z.infer<typeof tablePreviewViewSchema>;
65
+ //# sourceMappingURL=table-preview-view.contract.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What `verify-selector` answers with: the match count against the snapshot
4
+ * and, when the live page could be reached, against it too (issue #91's
5
+ * "flag a selector that matches the snapshot but not the live page").
6
+ * `liveChecked` is `false` when the live page could not be fetched (offline,
7
+ * blocked by `allowedHosts`, a transient error) — the card shows the
8
+ * snapshot count alone rather than a misleading "0 on the live page".
9
+ */
10
+ export declare const verifySelectorViewSchema: z.ZodObject<{
11
+ selector: z.ZodString;
12
+ snapshotMatches: z.ZodNumber;
13
+ liveChecked: z.ZodBoolean;
14
+ liveMatches: z.ZodOptional<z.ZodNumber>;
15
+ liveError: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export type VerifySelectorView = z.infer<typeof verifySelectorViewSchema>;
18
+ //# sourceMappingURL=verify-selector-view.contract.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ /** What `explain-why` answers with: the sentence (`why-sentence.mapper.ts`'s `buildWhySentence`), plus the structured facts a click can act on — a link back to the step that bound the value, the policy that applied. */
3
+ export declare const whyViewSchema: z.ZodObject<{
4
+ sentence: z.ZodString;
5
+ field: z.ZodString;
6
+ recipeId: z.ZodString;
7
+ outcome: z.ZodEnum<{
8
+ missing: "missing";
9
+ rejected: "rejected";
10
+ }>;
11
+ stepPath: z.ZodOptional<z.ZodString>;
12
+ policy: z.ZodOptional<z.ZodString>;
13
+ reason: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ export type WhyView = z.infer<typeof whyViewSchema>;
16
+ //# sourceMappingURL=why-view.contract.d.ts.map
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ /** One problem found on a recipe file, with the JSON path it lives at. */
3
+ export declare const recipeIssueSchema: z.ZodObject<{
4
+ path: z.ZodString;
5
+ message: z.ZodString;
6
+ kind: z.ZodEnum<{
7
+ binding: "binding";
8
+ validation: "validation";
9
+ }>;
10
+ }, z.core.$strip>;
11
+ /** One recipe file in an opened workspace. */
12
+ export declare const recipeListingSchema: z.ZodObject<{
13
+ file: z.ZodString;
14
+ kind: z.ZodEnum<{
15
+ input: "input";
16
+ output: "output";
17
+ unknown: "unknown";
18
+ }>;
19
+ id: z.ZodOptional<z.ZodString>;
20
+ issues: z.ZodArray<z.ZodObject<{
21
+ path: z.ZodString;
22
+ message: z.ZodString;
23
+ kind: z.ZodEnum<{
24
+ binding: "binding";
25
+ validation: "validation";
26
+ }>;
27
+ }, z.core.$strip>>;
28
+ text: z.ZodString;
29
+ outline: z.ZodOptional<z.ZodType<import("./outline-view.contract").OutlineView, unknown, z.core.$ZodTypeInternals<import("./outline-view.contract").OutlineView, unknown>>>;
30
+ }, z.core.$strip>;
31
+ /** The hooks Studio was started with (`opencraw studio --hooks <file>`, issue #150): where they came from and what they are called, for the warning bar and the hook-name suggestions. */
32
+ export declare const loadedHooksSchema: z.ZodObject<{
33
+ source: z.ZodString;
34
+ names: z.ZodArray<z.ZodString>;
35
+ }, z.core.$strip>;
36
+ /** What `open-workspace` answers with: every recipe file directly inside the folder, and the hooks Studio runs them with, if any. */
37
+ export declare const workspaceViewSchema: z.ZodObject<{
38
+ folder: z.ZodString;
39
+ recipes: z.ZodArray<z.ZodObject<{
40
+ file: z.ZodString;
41
+ kind: z.ZodEnum<{
42
+ input: "input";
43
+ output: "output";
44
+ unknown: "unknown";
45
+ }>;
46
+ id: z.ZodOptional<z.ZodString>;
47
+ issues: z.ZodArray<z.ZodObject<{
48
+ path: z.ZodString;
49
+ message: z.ZodString;
50
+ kind: z.ZodEnum<{
51
+ binding: "binding";
52
+ validation: "validation";
53
+ }>;
54
+ }, z.core.$strip>>;
55
+ text: z.ZodString;
56
+ outline: z.ZodOptional<z.ZodType<import("./outline-view.contract").OutlineView, unknown, z.core.$ZodTypeInternals<import("./outline-view.contract").OutlineView, unknown>>>;
57
+ }, z.core.$strip>>;
58
+ hooks: z.ZodOptional<z.ZodObject<{
59
+ source: z.ZodString;
60
+ names: z.ZodArray<z.ZodString>;
61
+ }, z.core.$strip>>;
62
+ }, z.core.$strip>;
63
+ export type RecipeIssue = z.infer<typeof recipeIssueSchema>;
64
+ export type RecipeListing = z.infer<typeof recipeListingSchema>;
65
+ export type LoadedHooks = z.infer<typeof loadedHooksSchema>;
66
+ export type WorkspaceView = z.infer<typeof workspaceViewSchema>;
67
+ //# sourceMappingURL=workspace-view.contract.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { IncomingMessage } from 'node:http';
2
+ /** The cookie set on the page's own document response, so its own asset and API requests carry the token too. */
3
+ export declare const TOKEN_COOKIE = "opencraw_token";
4
+ /** A random token, generated once at server startup and required on every request. */
5
+ export declare function generateToken(): string;
6
+ /**
7
+ * The token a request carries, checked in this order: the `x-opencraw-token`
8
+ * header, the `token` query param, the studio's own cookie (set after the
9
+ * first authenticated document request, so a browser's own asset and API
10
+ * requests need not repeat the query param).
11
+ *
12
+ * @param request - The incoming request.
13
+ * @param query - Its URL's query string, parsed.
14
+ * @returns The token found, or `undefined`.
15
+ */
16
+ export declare function tokenOf(request: Pick<IncomingMessage, 'headers'>, query: URLSearchParams): string | undefined;
17
+ /**
18
+ * Whether a request proves it holds the server's token.
19
+ *
20
+ * @param expected - The server's token.
21
+ * @param request - The incoming request.
22
+ * @param query - Its URL's query string, parsed.
23
+ * @returns Whether the request is authorized.
24
+ */
25
+ export declare function isAuthorized(expected: string, request: Pick<IncomingMessage, 'headers'>, query: URLSearchParams): boolean;
26
+ //# sourceMappingURL=access-token.policy.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { DeckPreviewCommand, DeckTablePreviewView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `deck-preview`: the deck canvas's live preview of a `table`
5
+ * extract's options (`document-view`'s `table-preview.use-case.ts`'s
6
+ * `previewDeckTable`, studio plan §3.4, issue #94's 5d), off the same cached
7
+ * snapshot `take-snapshot`/`deck-view` already captured — a pure computation
8
+ * over it, so this answers instantly on every option change, no re-fetch or
9
+ * re-parse.
10
+ *
11
+ * @param state - The server state.
12
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
13
+ * @returns The matched tables, or `error` when an option's pattern does not compile.
14
+ * @throws Error when no workspace is open, or `command.path` has no cached snapshot yet.
15
+ */
16
+ export declare function handleDeckPreview(state: StudioState, command: DeckPreviewCommand): DeckTablePreviewView;
17
+ //# sourceMappingURL=deck-preview.handler.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { DeckDocumentView, DeckViewCommand } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `deck-view`: the deck canvas's slides, shapes, tables, charts and
5
+ * notes (`document-view`'s `deck-view.mapper.ts`, studio plan §3.4, issue
6
+ * #94's 5d), off the same cached snapshot `take-snapshot`/`document-tree`
7
+ * already use.
8
+ *
9
+ * @param state - The server state.
10
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
11
+ * @returns The document's view.
12
+ * @throws Error when no workspace is open, `command.path` has no cached snapshot yet, or the snapshot's document is not a read deck.
13
+ */
14
+ export declare function handleDeckView(state: StudioState, command: DeckViewCommand): DeckDocumentView;
15
+ //# sourceMappingURL=deck-view.handler.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { DocumentTreeCommand, DocumentTreeView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `document-tree`: the content pane's tree canvas for a JSON, YAML
5
+ * or XML document (`document-view`, studio plan §3.4, issue #94's 5a), off
6
+ * the same cached snapshot `take-snapshot`/`inspect-page` already use.
7
+ *
8
+ * @param state - The server state.
9
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
10
+ * @returns The tree.
11
+ * @throws Error when no workspace is open, `command.path` has no cached snapshot yet, or the snapshot's document is not JSON/YAML/XML (no parsed body at all in web mode; PDF/workbook/deck in api mode — see `documentTreeView`'s own doc comment).
12
+ */
13
+ export declare function handleDocumentTree(state: StudioState, command: DocumentTreeCommand): DocumentTreeView;
14
+ //# sourceMappingURL=document-tree.handler.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { ExplainWhyCommand, WhyView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `explain-why` (issue #92's Why? tab): builds the sentence for a
5
+ * missing or rejected value from the recipe's last sample run, kept in
6
+ * `state.lastRuns` by `handleRunSample`.
7
+ *
8
+ * @param state - The server state: `folder` must already be set (`open-workspace` first).
9
+ * @param command - The command.
10
+ * @returns The explanation.
11
+ * @throws Error when no workspace is open, no sample run has finished for the target's recipe, or the target does not name a real record/field.
12
+ */
13
+ export declare function handleExplainWhy(state: StudioState, command: ExplainWhyCommand): Promise<WhyView>;
14
+ //# sourceMappingURL=explain-why.handler.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { FetchStartPageCommand, StartPageView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `fetch-start-page`: loads the named input recipe from the current
5
+ * workspace and fetches its start point (see `page-snapshot`'s own caveats:
6
+ * no session bootstrap, a fresh browser or HTTP context per call).
7
+ *
8
+ * @param state - The server state: `folder` must already be set.
9
+ * @param command - The command.
10
+ * @returns The page's content as plain text.
11
+ * @throws Error when no workspace is open, or the recipe cannot be found or loaded.
12
+ */
13
+ export declare function handleFetchStartPage(state: StudioState, command: FetchStartPageCommand): Promise<StartPageView>;
14
+ //# sourceMappingURL=fetch-start-page.handler.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { GridPreviewCommand, GridTablePreviewView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `grid-preview`: the grid canvas's live preview of a `table`
5
+ * extract's options (`document-view`'s `table-preview.use-case.ts`'s
6
+ * `previewGridTable`, studio plan §3.4, issue #94's 5c), off the same
7
+ * cached snapshot `take-snapshot`/`grid-view` already captured — a pure
8
+ * computation over it, so this answers instantly on every option change, no
9
+ * re-fetch or re-parse.
10
+ *
11
+ * @param state - The server state.
12
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
13
+ * @returns The matched tables, or `error` when an option's pattern does not compile.
14
+ * @throws Error when no workspace is open, or `command.path` has no cached snapshot yet.
15
+ */
16
+ export declare function handleGridPreview(state: StudioState, command: GridPreviewCommand): GridTablePreviewView;
17
+ //# sourceMappingURL=grid-preview.handler.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { GridViewCommand, WorkbookDocumentView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `grid-view`: the grid canvas's sheets and cells (`document-view`'s
5
+ * `workbook-view.mapper.ts`, studio plan §3.4, issue #94's 5c), off the same
6
+ * cached snapshot `take-snapshot`/`document-tree`/`pdf-view` already use.
7
+ *
8
+ * `delimiter`/`encoding` re-read a CSV with the override applied
9
+ * (`page-snapshot`'s `rereadCsv`) and replace the cached snapshot's body with
10
+ * the fresh reading, so a following `grid-preview` (and another `grid-view`
11
+ * with no override) sees the same one — the override sticks until
12
+ * `take-snapshot` recaptures.
13
+ *
14
+ * @param state - The server state.
15
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
16
+ * @returns The document's view.
17
+ * @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
+ */
19
+ export declare function handleGridView(state: StudioState, command: GridViewCommand): Promise<WorkbookDocumentView>;
20
+ //# sourceMappingURL=grid-view.handler.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { ImportDocumentCommand, ImportDocumentView } from '../studio-api';
2
+ /**
3
+ * Handles `import-document` (issue #120): decodes the base64 bytes and copies
4
+ * the file into the folder (see `recipe-workspace/import-document.use-case.ts`
5
+ * for the folder creation and the no-overwrite numbering). Nothing is
6
+ * broadcast: the copy is not a recipe, the workspace listing does not change
7
+ * until the UI saves the recipe pair that points at it, which `save-recipe`
8
+ * announces as usual.
9
+ *
10
+ * @param command - The folder, the file's name and its base64 content.
11
+ * @returns Where the copy landed and its `file:` URL.
12
+ */
13
+ export declare function handleImportDocument(command: ImportDocumentCommand): Promise<ImportDocumentView>;
14
+ //# sourceMappingURL=import-document.handler.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { startStudioServer } from './studio-http.use-case';
2
+ export type { StudioServer, StudioServerOptions } from './studio-http.use-case';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { InferSelectorCommand, InferSelectorView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `infer-selector`: turns one or two picked nodes (their
5
+ * `data-oc-node` ids, off the cached snapshot) into a verified selector —
6
+ * one id for a `Read` card's field, two for the safe item+field list shape
7
+ * `selector-inference`'s `inferList` builds by construction (issue #91,
8
+ * studio plan §3.2). All the actual candidate/ranking/list-inference work
9
+ * is `selector-inference`'s (pure); this handler only locates the clicked
10
+ * nodes in the cached document and calls into it.
11
+ *
12
+ * @param state - The server state.
13
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
14
+ * @returns A field pick, a list pick, or `"unsupported"` with why.
15
+ * @throws Error when no workspace is open, or `command.path` has no cached snapshot yet.
16
+ */
17
+ export declare function handleInferSelector(state: StudioState, command: InferSelectorCommand): InferSelectorView;
18
+ //# sourceMappingURL=infer-selector.handler.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { InspectPageCommand, InspectView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `inspect-page`: the Inspect panel's DOM tree and data-in-the-page
5
+ * findings, off the same cached snapshot `take-snapshot`/`infer-selector`
6
+ * already use (`page-inspector`, issue #93). `domTree` reads the cached,
7
+ * rewritten snapshot (the same markup the content pane's iframe shows, so a
8
+ * tree row's `nodeId` lines up with it exactly); `pageData` reads the raw
9
+ * capture (`SnapshotResult.rawHtml`), since the display snapshot has had its
10
+ * `<script>` tags stripped for the sandboxed iframe.
11
+ *
12
+ * @param state - The server state.
13
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
14
+ * @returns The tree and the data-in-the-page findings.
15
+ * @throws Error when no workspace is open, or `command.path` has no cached snapshot yet.
16
+ */
17
+ export declare function handleInspectPage(state: StudioState, command: InspectPageCommand): InspectView;
18
+ //# sourceMappingURL=inspect-page.handler.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { OpenWorkspaceCommand, WorkspaceView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `open-workspace`: reads the folder, remembers it as the server's
5
+ * current workspace (every later command that names a recipe resolves it
6
+ * against this folder), and, when that is a different folder than before,
7
+ * tells every connected client the workspace changed.
8
+ *
9
+ * Only on an actual switch: the UI answers `workspace-changed` with another
10
+ * `open-workspace` of the same folder (its workspace query re-fetches), so a
11
+ * broadcast on every open would answer that re-fetch with another broadcast,
12
+ * for ever — and each round cancels the fetch in flight, so a recipe saved
13
+ * meanwhile never showed up in the listing (found by issue #120's drop flow).
14
+ *
15
+ * @param state - The server state to update.
16
+ * @param command - The command.
17
+ * @returns The workspace's recipes and their issues.
18
+ */
19
+ export declare function handleOpenWorkspace(state: StudioState, command: OpenWorkspaceCommand): Promise<WorkspaceView>;
20
+ //# sourceMappingURL=open-workspace.handler.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { StudioState } from './workspace.store';
2
+ /**
3
+ * Handles `GET /api/pdf-bytes`: the raw bytes of a cached PDF snapshot, for
4
+ * the PDF canvas's `pdf.js` to render in the browser (studio plan §3.4,
5
+ * issue #94's 5b). Not a `studio-api` command — the other commands all
6
+ * answer JSON, and pdf.js wants the file itself — so this is its own route,
7
+ * read directly by `studio-http.use-case.ts` (mirrors `static-file.handler.ts`'s
8
+ * own reach outside the command dispatch).
9
+ *
10
+ * @param state - The server state.
11
+ * @param recipeId - The recipe.
12
+ * @param path - The step path; must already have a cached PDF snapshot (call `take-snapshot` first).
13
+ * @returns The raw PDF bytes.
14
+ * @throws Error when `path` has no cached snapshot yet, or the snapshot's document is not a PDF.
15
+ */
16
+ export declare function handlePdfBytes(state: StudioState, recipeId: string, path: string): Promise<Uint8Array>;
17
+ //# sourceMappingURL=pdf-bytes.handler.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { PdfDocumentView, PdfViewCommand } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `pdf-view`: the PDF canvas's cells and rows (`document-view`'s
5
+ * `pdf-view.mapper.ts`, studio plan §3.4, issue #94's 5b), off the same
6
+ * cached snapshot `take-snapshot`/`document-tree` already use.
7
+ *
8
+ * @param state - The server state.
9
+ * @param command - The command; `command.path` must already have a cached snapshot (call `take-snapshot` first).
10
+ * @returns The document's view.
11
+ * @throws Error when no workspace is open, `command.path` has no cached snapshot yet, or the snapshot's document is not a read PDF.
12
+ */
13
+ export declare function handlePdfView(state: StudioState, command: PdfViewCommand): PdfDocumentView;
14
+ //# sourceMappingURL=pdf-view.handler.d.ts.map