@opencraw/studio 0.0.27 → 0.0.29

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 (47) hide show
  1. package/dist/browser-provisioning/install-chromium.use-case.d.ts +13 -0
  2. package/dist/document-view/workbook-view.mapper.d.ts +8 -0
  3. package/dist/folder-dialog/choose-folder.client.d.ts +25 -0
  4. package/dist/folder-dialog/folder-dialog.algorithm.d.ts +25 -0
  5. package/dist/folder-dialog/index.d.ts +2 -0
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.esm.js +355 -8
  8. package/dist/main.d.ts +2 -0
  9. package/dist/recipe-workspace/index.d.ts +1 -0
  10. package/dist/recipe-workspace/open-path.use-case.d.ts +18 -0
  11. package/dist/src/browser-provisioning/install-chromium.use-case.d.ts +13 -0
  12. package/dist/src/document-view/workbook-view.mapper.d.ts +8 -0
  13. package/dist/src/folder-dialog/choose-folder.client.d.ts +25 -0
  14. package/dist/src/folder-dialog/folder-dialog.algorithm.d.ts +25 -0
  15. package/dist/src/folder-dialog/index.d.ts +2 -0
  16. package/dist/src/index.d.ts +2 -2
  17. package/dist/src/main.d.ts +2 -0
  18. package/dist/src/recipe-workspace/index.d.ts +1 -0
  19. package/dist/src/recipe-workspace/open-path.use-case.d.ts +18 -0
  20. package/dist/src/studio-api/choose-folder-view.contract.d.ts +7 -0
  21. package/dist/src/studio-api/command.contract.d.ts +18 -0
  22. package/dist/src/studio-api/deck-view.contract.d.ts +8 -0
  23. package/dist/src/studio-api/grid-view.contract.d.ts +8 -0
  24. package/dist/src/studio-api/index.d.ts +6 -2
  25. package/dist/src/studio-api/open-path-view.contract.d.ts +23 -0
  26. package/dist/src/studio-server/choose-folder.handler.d.ts +13 -0
  27. package/dist/src/studio-server/open-path.handler.d.ts +11 -0
  28. package/dist/src/studio-server/studio-http.use-case.d.ts +7 -0
  29. package/dist/src/studio-server/workspace.store.d.ts +4 -0
  30. package/dist/studio-api/choose-folder-view.contract.d.ts +7 -0
  31. package/dist/studio-api/command.contract.d.ts +18 -0
  32. package/dist/studio-api/deck-view.contract.d.ts +8 -0
  33. package/dist/studio-api/grid-view.contract.d.ts +8 -0
  34. package/dist/studio-api/index.d.ts +6 -2
  35. package/dist/studio-api/open-path-view.contract.d.ts +23 -0
  36. package/dist/studio-server/choose-folder.handler.d.ts +13 -0
  37. package/dist/studio-server/open-path.handler.d.ts +11 -0
  38. package/dist/studio-server/studio-http.use-case.d.ts +7 -0
  39. package/dist/studio-server/workspace.store.d.ts +4 -0
  40. package/dist/ui/apple-touch-icon.png +0 -0
  41. package/dist/ui/assets/index-Bzb5bAuR.js +38 -0
  42. package/dist/ui/assets/{pdf-clzdjy4q.js → pdf-BReC8938.js} +1 -1
  43. package/dist/ui/favicon.ico +0 -0
  44. package/dist/ui/favicon.svg +30 -0
  45. package/dist/ui/index.html +4 -2
  46. package/package.json +3 -3
  47. package/dist/ui/assets/index-D1vjq3SW.js +0 -38
@@ -0,0 +1,25 @@
1
+ import type { DialogCommand } from './folder-dialog.algorithm.js';
2
+ /** What a dialog program did: its output, or how it ended. `missing` means the program is not installed. */
3
+ export type DialogRun = {
4
+ output: string;
5
+ } | {
6
+ cancelled: true;
7
+ } | {
8
+ missing: true;
9
+ };
10
+ /** Runs one dialog program and waits for the person to answer; real by default, replaced in tests. */
11
+ export type RunDialog = (command: DialogCommand) => Promise<DialogRun>;
12
+ /** Runs the program with Node's own `execFile`: no shell, so a path or title is never parsed as a command. */
13
+ export declare const runDialogProgram: RunDialog;
14
+ /**
15
+ * Opens the operating system's own folder dialog on the machine the server
16
+ * runs on, which is where the recipe folder is: a browser tab cannot do it,
17
+ * the server can. Waits until the person picks a folder or closes the dialog.
18
+ *
19
+ * @param platform - `process.platform`; passed in so a test names the platform it means.
20
+ * @param run - How a dialog program is run.
21
+ * @returns The folder picked, or `undefined` when the dialog was closed without a choice.
22
+ * @throws Error when the platform has no dialog program installed (a server with no display, a container).
23
+ */
24
+ export declare function chooseFolderWithDialog(platform?: NodeJS.Platform, run?: RunDialog): Promise<string | undefined>;
25
+ //# sourceMappingURL=choose-folder.client.d.ts.map
@@ -0,0 +1,25 @@
1
+ /** One way to open a folder dialog: a program and its arguments. */
2
+ export interface DialogCommand {
3
+ file: string;
4
+ args: string[];
5
+ }
6
+ /**
7
+ * The programs that can open a folder dialog on a platform, in the order to
8
+ * try them: the first one installed is used. Windows and macOS have one each
9
+ * in every install; Linux has whichever of `zenity` (GNOME and most others)
10
+ * and `kdialog` (KDE) the desktop ships.
11
+ *
12
+ * @param platform - `process.platform`.
13
+ * @returns The candidates; empty for a platform with no known dialog.
14
+ */
15
+ export declare function folderDialogCommands(platform: NodeJS.Platform): DialogCommand[];
16
+ /**
17
+ * The folder a dialog printed: its output without the line break and the
18
+ * trailing separator (`osascript` ends a folder with `/`), a root kept as it
19
+ * is. Nothing printed means the person cancelled.
20
+ *
21
+ * @param output - What the dialog program wrote to its standard output.
22
+ * @returns The folder path, or `undefined` for a cancelled dialog.
23
+ */
24
+ export declare function folderFromDialogOutput(output: string): string | undefined;
25
+ //# sourceMappingURL=folder-dialog.algorithm.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { chooseFolderWithDialog } from './choose-folder.client.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -9,6 +9,6 @@ export { runSample, loadRecipePair } from './sample-run/index.js';
9
9
  export type { RecipePair, SampleRunCallbacks, SampleRunHandle, SampleRunRecord, SampleRunRejected, SampleRunResult, SampleStepSummary, SampleStoppedBy } from './sample-run/index.js';
10
10
  export { fetchStartPage } from './page-snapshot/index.js';
11
11
  export type { WhyFacts, WhyStepFact } from './explain-why/index.js';
12
- export { sampleBudgetSchema, openWorkspaceCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, studioCommandSchema, importDocumentViewSchema, stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, studioEventSchema, loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema, sampleRunRecordSchema, sampleRunViewSchema, startPageViewSchema, snapshotViewSchema, verifySelectorViewSchema, fieldPickSchema, inferSelectorViewSchema, sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema, whyViewSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, regionPreviewMatchSchema, regionPreviewViewSchema, gridViewCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, domTreeNodeViewSchema, pageDataFindingSchema, inspectViewSchema, observedResponseSchema, responsesSeenViewSchema, documentTreeNodeViewSchema, documentTreeViewSchema, pdfCellViewSchema, pdfRowViewSchema, pdfPageViewSchema, pdfDocumentViewSchema, tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchema, tablePreviewViewSchema, gridCellViewSchema, gridMergeViewSchema, gridSheetViewSchema, workbookDocumentViewSchema, gridTablePreviewMatchSchema, gridTablePreviewViewSchema, deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema, deckTablePreviewMatchSchema, deckTablePreviewViewSchema, startRecordingCommandSchema, stopRecordingCommandSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, } from './studio-api/index.js';
13
- export type { SampleBudget, OpenWorkspaceCommand, 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, StudioCommand, ImportDocumentView, RegionPreviewMatchView, RegionPreviewView, StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, StudioEvent, LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView, SampleRunView, StartPageView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
12
+ export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, saveOutlineCommandSchema, takeSnapshotCommandSchema, verifySelectorCommandSchema, inferSelectorCommandSchema, missingWhyTargetSchema, rejectedWhyTargetSchema, whyTargetSchema, explainWhyCommandSchema, studioCommandSchema, chooseFolderViewSchema, openPathViewSchema, importDocumentViewSchema, stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, studioEventSchema, loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema, sampleRunRecordSchema, sampleRunViewSchema, startPageViewSchema, snapshotViewSchema, verifySelectorViewSchema, fieldPickSchema, inferSelectorViewSchema, sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema, whyViewSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, regionPreviewMatchSchema, regionPreviewViewSchema, gridViewCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, domTreeNodeViewSchema, pageDataFindingSchema, inspectViewSchema, observedResponseSchema, responsesSeenViewSchema, documentTreeNodeViewSchema, documentTreeViewSchema, pdfCellViewSchema, pdfRowViewSchema, pdfPageViewSchema, pdfDocumentViewSchema, tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchema, tablePreviewViewSchema, gridCellViewSchema, gridMergeViewSchema, gridSheetViewSchema, workbookDocumentViewSchema, gridTablePreviewMatchSchema, gridTablePreviewViewSchema, deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, deckSlideViewSchema, deckDocumentViewSchema, deckTablePreviewMatchSchema, deckTablePreviewViewSchema, startRecordingCommandSchema, stopRecordingCommandSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, } from './studio-api/index.js';
13
+ 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, StudioCommand, ChooseFolderView, OpenPathView, ImportDocumentView, RegionPreviewMatchView, RegionPreviewView, StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, StudioEvent, LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView, SampleRunView, StartPageView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -3,6 +3,8 @@ import type { TrustedPlugins } from './trusted-plugins/index.js';
3
3
  export interface StudioMainOptions {
4
4
  /** Hooks and plugins loaded from a file the person named at launch (`opencraw studio --hooks <file>`, issue #150). `main` never loads code itself. */
5
5
  plugins?: TrustedPlugins;
6
+ /** A folder, recipe file or document the printed link opens straight away (`opencraw studio --open <path>`, issue #235); resolved against the current directory. */
7
+ open?: string;
6
8
  }
7
9
  /**
8
10
  * Runs `opencraw-studio`: starts the server, opens `folder` (if given) as
@@ -1,5 +1,6 @@
1
1
  export { openWorkspace } from './open-workspace.use-case.js';
2
2
  export { saveRecipe } from './save-recipe.use-case.js';
3
+ export { openPath } from './open-path.use-case.js';
3
4
  export { importDocument } from './import-document.use-case.js';
4
5
  export type { ImportedDocument } from './import-document.use-case.js';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { OpenPathView } from '../studio-api/index.js';
2
+ /**
3
+ * Says what a path is, for a link or an IDE menu entry that only knows a
4
+ * path: a folder opens as the workspace; a `.json` file whose `kind` is
5
+ * `input` or `output` is a recipe, opened through its own folder; any other
6
+ * file is a document to start a recipe from.
7
+ *
8
+ * A document is read in place when it is already inside the workspace folder
9
+ * (`workspace`, else the file's own folder), and copied into the folder
10
+ * otherwise, with the same no-overwrite numbering `import-document` uses.
11
+ *
12
+ * @param path - An absolute path to a folder or a file.
13
+ * @param workspace - The folder a document should belong to, when the caller has one (an IDE's workspace folder).
14
+ * @returns What it is and where to open it.
15
+ * @throws Error when the path is relative or does not exist.
16
+ */
17
+ export declare function openPath(path: string, workspace?: string): Promise<OpenPathView>;
18
+ //# sourceMappingURL=open-path.use-case.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /** `choose-folder`'s answer: the folder the person picked in the operating system's dialog; absent when the dialog was closed without a choice. */
3
+ export declare const chooseFolderViewSchema: z.ZodObject<{
4
+ folder: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type ChooseFolderView = z.infer<typeof chooseFolderViewSchema>;
7
+ //# sourceMappingURL=choose-folder-view.contract.d.ts.map
@@ -10,6 +10,16 @@ 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 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
+ export declare const openPathCommandSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"open-path">;
16
+ path: z.ZodString;
17
+ workspace: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ /** Opens the operating system's folder dialog on the server's machine: the answer is the folder picked, if any. */
20
+ export declare const chooseFolderCommandSchema: z.ZodObject<{
21
+ type: z.ZodLiteral<"choose-folder">;
22
+ }, z.core.$strip>;
13
23
  /** Runs one input recipe under a budget, streaming `trace-line` and `record` events, ending in `run-finished`. */
14
24
  export declare const runSampleCommandSchema: z.ZodObject<{
15
25
  type: z.ZodLiteral<"run-sample">;
@@ -360,6 +370,12 @@ export declare const importDocumentCommandSchema: z.ZodObject<{
360
370
  export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
361
371
  type: z.ZodLiteral<"open-workspace">;
362
372
  folder: z.ZodString;
373
+ }, z.core.$strip>, z.ZodObject<{
374
+ type: z.ZodLiteral<"choose-folder">;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ type: z.ZodLiteral<"open-path">;
377
+ path: z.ZodString;
378
+ workspace: z.ZodOptional<z.ZodString>;
363
379
  }, z.core.$strip>, z.ZodObject<{
364
380
  type: z.ZodLiteral<"import-document">;
365
381
  folder: z.ZodString;
@@ -500,6 +516,8 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
500
516
  }, z.core.$strip>], "type">;
501
517
  export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
502
518
  export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
519
+ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
520
+ export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
503
521
  export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
504
522
  export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
505
523
  export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
@@ -56,6 +56,10 @@ export declare const deckSlideViewSchema: z.ZodObject<{
56
56
  bottom: z.ZodNumber;
57
57
  right: z.ZodNumber;
58
58
  }, z.core.$strip>>;
59
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
60
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
61
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
62
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
59
63
  }, z.core.$strip>>;
60
64
  charts: z.ZodArray<z.ZodObject<{
61
65
  type: z.ZodString;
@@ -106,6 +110,10 @@ export declare const deckDocumentViewSchema: z.ZodObject<{
106
110
  bottom: z.ZodNumber;
107
111
  right: z.ZodNumber;
108
112
  }, z.core.$strip>>;
113
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
114
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
115
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
116
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
109
117
  }, z.core.$strip>>;
110
118
  charts: z.ZodArray<z.ZodObject<{
111
119
  type: z.ZodString;
@@ -38,6 +38,10 @@ export declare const gridSheetViewSchema: z.ZodObject<{
38
38
  bottom: z.ZodNumber;
39
39
  right: z.ZodNumber;
40
40
  }, z.core.$strip>>;
41
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
42
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
43
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
44
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
41
45
  }, z.core.$strip>;
42
46
  /** 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. */
43
47
  export declare const workbookDocumentViewSchema: z.ZodObject<{
@@ -62,6 +66,10 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
62
66
  bottom: z.ZodNumber;
63
67
  right: z.ZodNumber;
64
68
  }, z.core.$strip>>;
69
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
70
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
71
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
72
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
65
73
  }, z.core.$strip>>;
66
74
  csv: z.ZodOptional<z.ZodObject<{
67
75
  encoding: z.ZodString;
@@ -1,5 +1,5 @@
1
- export { sampleBudgetSchema, openWorkspaceCommandSchema, 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.js';
2
- export type { SampleBudget, OpenWorkspaceCommand, 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.js';
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.js';
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.js';
3
3
  export { snapshotViewSchema } from './snapshot-view.contract.js';
4
4
  export type { SnapshotView } from './snapshot-view.contract.js';
5
5
  export { verifySelectorViewSchema } from './verify-selector-view.contract.js';
@@ -10,6 +10,10 @@ export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSch
10
10
  export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, StudioEvent } from './event.contract.js';
11
11
  export { loadedHooksSchema, recipeIssueSchema, recipeListingSchema, workspaceViewSchema } from './workspace-view.contract.js';
12
12
  export type { LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView } from './workspace-view.contract.js';
13
+ export { chooseFolderViewSchema } from './choose-folder-view.contract.js';
14
+ export type { ChooseFolderView } from './choose-folder-view.contract.js';
15
+ export { openPathViewSchema } from './open-path-view.contract.js';
16
+ export type { OpenPathView } from './open-path-view.contract.js';
13
17
  export { importDocumentViewSchema } from './import-document-view.contract.js';
14
18
  export type { ImportDocumentView } from './import-document-view.contract.js';
15
19
  export { sampleRunRecordSchema, sampleRunViewSchema } from './sample-run-view.contract.js';
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `open-path`'s answer: what the path turned out to be, and the folder to
4
+ * open as the workspace for it. A `recipe` names the input recipe to select
5
+ * when there is one; a `document` is where the file is read from (in place
6
+ * when it is already inside the folder, else the copy made there) and its
7
+ * `file:` URL, ready for a recipe's `start.url`.
8
+ */
9
+ export declare const openPathViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ kind: z.ZodLiteral<"folder">;
11
+ folder: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ kind: z.ZodLiteral<"recipe">;
14
+ folder: z.ZodString;
15
+ recipeId: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ kind: z.ZodLiteral<"document">;
18
+ folder: z.ZodString;
19
+ path: z.ZodString;
20
+ url: z.ZodString;
21
+ }, z.core.$strip>], "kind">;
22
+ export type OpenPathView = z.infer<typeof openPathViewSchema>;
23
+ //# sourceMappingURL=open-path-view.contract.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { ChooseFolderView } from '../studio-api/index.js';
2
+ import type { StudioState } from './workspace.store.js';
3
+ /**
4
+ * Handles `choose-folder`: opens the folder dialog of the machine the server
5
+ * runs on and answers the folder picked. Only answers: the UI follows with
6
+ * `open-workspace`, the same as when the folder is typed. A dialog still
7
+ * open is not opened a second time; the second request waits for the first.
8
+ *
9
+ * @param state - The server state holding the dialog to use.
10
+ * @returns The folder, or none when the dialog was closed.
11
+ */
12
+ export declare function handleChooseFolder(state: StudioState): Promise<ChooseFolderView>;
13
+ //# sourceMappingURL=choose-folder.handler.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { OpenPathCommand, OpenPathView } from '../studio-api/index.js';
2
+ /**
3
+ * Handles `open-path`: says what the path is (folder, recipe or document) and
4
+ * where to open it. Opens nothing itself: the UI follows with `open-workspace`
5
+ * on the answer's folder, the same as when the folder is typed.
6
+ *
7
+ * @param command - The path, and the workspace it should belong to if the caller has one.
8
+ * @returns What the path is.
9
+ */
10
+ export declare function handleOpenPath(command: OpenPathCommand): Promise<OpenPathView>;
11
+ //# sourceMappingURL=open-path.handler.d.ts.map
@@ -17,6 +17,8 @@ export interface StudioServerOptions {
17
17
  browser?: BrowserSessionConfig;
18
18
  /** Hooks, access plugins and captcha solvers to run recipes with, loaded by the caller from a file the person named at launch (`opencraw studio --hooks`, issue #150). The server never loads code itself and no request can set this. Default: none. */
19
19
  plugins?: TrustedPlugins;
20
+ /** How `choose-folder` asks the person for a folder; default: the operating system's own folder dialog (`folder-dialog`), opened on the machine the server runs on. A host that has a dialog of its own passes it here. */
21
+ chooseFolder?: () => Promise<string | undefined>;
20
22
  /** Where the studio's own recorder profile lives (issue #95); default: a fixed directory under the OS temp folder, never a crawl's own profile directory, never the person's default browser. */
21
23
  recorderProfileDir?: string;
22
24
  }
@@ -24,6 +26,11 @@ export interface StudioServerOptions {
24
26
  export interface StudioServer {
25
27
  url: string;
26
28
  token: string;
29
+ /** A link that opens Studio on `open` (a folder, a recipe or a document; see `open-path`), with `workspace` as the folder a document belongs to. Without a target it is `url`. */
30
+ link: (target?: {
31
+ open?: string;
32
+ workspace?: string;
33
+ }) => string;
27
34
  close: () => Promise<void>;
28
35
  }
29
36
  /**
@@ -19,6 +19,10 @@ export interface StudioState {
19
19
  browser?: BrowserSessionConfig;
20
20
  /** Set once at server start (`StudioServerOptions.plugins`): the hooks and plugins the person started Studio with (issue #150). Never set by a request. */
21
21
  plugins?: TrustedPlugins;
22
+ /** Set once at server start (`StudioServerOptions.chooseFolder`): how `choose-folder` asks the person for a folder. */
23
+ chooseFolder?: () => Promise<string | undefined>;
24
+ /** The dialog currently open, so a second `choose-folder` waits for it instead of opening another. */
25
+ openDialog?: Promise<string | undefined>;
22
26
  /** Set once at server start (`StudioServerOptions.recorderProfileDir`), else `defaultRecorderProfileDir()`. */
23
27
  recorderProfileDir: string;
24
28
  }
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /** `choose-folder`'s answer: the folder the person picked in the operating system's dialog; absent when the dialog was closed without a choice. */
3
+ export declare const chooseFolderViewSchema: z.ZodObject<{
4
+ folder: z.ZodOptional<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type ChooseFolderView = z.infer<typeof chooseFolderViewSchema>;
7
+ //# sourceMappingURL=choose-folder-view.contract.d.ts.map
@@ -10,6 +10,16 @@ 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 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
+ export declare const openPathCommandSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"open-path">;
16
+ path: z.ZodString;
17
+ workspace: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ /** Opens the operating system's folder dialog on the server's machine: the answer is the folder picked, if any. */
20
+ export declare const chooseFolderCommandSchema: z.ZodObject<{
21
+ type: z.ZodLiteral<"choose-folder">;
22
+ }, z.core.$strip>;
13
23
  /** Runs one input recipe under a budget, streaming `trace-line` and `record` events, ending in `run-finished`. */
14
24
  export declare const runSampleCommandSchema: z.ZodObject<{
15
25
  type: z.ZodLiteral<"run-sample">;
@@ -360,6 +370,12 @@ export declare const importDocumentCommandSchema: z.ZodObject<{
360
370
  export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
361
371
  type: z.ZodLiteral<"open-workspace">;
362
372
  folder: z.ZodString;
373
+ }, z.core.$strip>, z.ZodObject<{
374
+ type: z.ZodLiteral<"choose-folder">;
375
+ }, z.core.$strip>, z.ZodObject<{
376
+ type: z.ZodLiteral<"open-path">;
377
+ path: z.ZodString;
378
+ workspace: z.ZodOptional<z.ZodString>;
363
379
  }, z.core.$strip>, z.ZodObject<{
364
380
  type: z.ZodLiteral<"import-document">;
365
381
  folder: z.ZodString;
@@ -500,6 +516,8 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
500
516
  }, z.core.$strip>], "type">;
501
517
  export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
502
518
  export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
519
+ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
520
+ export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
503
521
  export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
504
522
  export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
505
523
  export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
@@ -56,6 +56,10 @@ export declare const deckSlideViewSchema: z.ZodObject<{
56
56
  bottom: z.ZodNumber;
57
57
  right: z.ZodNumber;
58
58
  }, z.core.$strip>>;
59
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
60
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
61
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
62
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
59
63
  }, z.core.$strip>>;
60
64
  charts: z.ZodArray<z.ZodObject<{
61
65
  type: z.ZodString;
@@ -106,6 +110,10 @@ export declare const deckDocumentViewSchema: z.ZodObject<{
106
110
  bottom: z.ZodNumber;
107
111
  right: z.ZodNumber;
108
112
  }, z.core.$strip>>;
113
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
114
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
115
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
116
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
109
117
  }, z.core.$strip>>;
110
118
  charts: z.ZodArray<z.ZodObject<{
111
119
  type: z.ZodString;
@@ -38,6 +38,10 @@ export declare const gridSheetViewSchema: z.ZodObject<{
38
38
  bottom: z.ZodNumber;
39
39
  right: z.ZodNumber;
40
40
  }, z.core.$strip>>;
41
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
42
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
43
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
44
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
41
45
  }, z.core.$strip>;
42
46
  /** 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. */
43
47
  export declare const workbookDocumentViewSchema: z.ZodObject<{
@@ -62,6 +66,10 @@ export declare const workbookDocumentViewSchema: z.ZodObject<{
62
66
  bottom: z.ZodNumber;
63
67
  right: z.ZodNumber;
64
68
  }, z.core.$strip>>;
69
+ columnWidths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
70
+ rowHeights: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
71
+ defaultColumnWidth: z.ZodOptional<z.ZodNumber>;
72
+ defaultRowHeight: z.ZodOptional<z.ZodNumber>;
65
73
  }, z.core.$strip>>;
66
74
  csv: z.ZodOptional<z.ZodObject<{
67
75
  encoding: z.ZodString;
@@ -1,5 +1,5 @@
1
- export { sampleBudgetSchema, openWorkspaceCommandSchema, 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, 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, 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';
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';
@@ -10,6 +10,10 @@ export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSch
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';
12
12
  export type { LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView } from './workspace-view.contract';
13
+ export { chooseFolderViewSchema } from './choose-folder-view.contract';
14
+ export type { ChooseFolderView } from './choose-folder-view.contract';
15
+ export { openPathViewSchema } from './open-path-view.contract';
16
+ export type { OpenPathView } from './open-path-view.contract';
13
17
  export { importDocumentViewSchema } from './import-document-view.contract';
14
18
  export type { ImportDocumentView } from './import-document-view.contract';
15
19
  export { sampleRunRecordSchema, sampleRunViewSchema } from './sample-run-view.contract';
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `open-path`'s answer: what the path turned out to be, and the folder to
4
+ * open as the workspace for it. A `recipe` names the input recipe to select
5
+ * when there is one; a `document` is where the file is read from (in place
6
+ * when it is already inside the folder, else the copy made there) and its
7
+ * `file:` URL, ready for a recipe's `start.url`.
8
+ */
9
+ export declare const openPathViewSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ kind: z.ZodLiteral<"folder">;
11
+ folder: z.ZodString;
12
+ }, z.core.$strip>, z.ZodObject<{
13
+ kind: z.ZodLiteral<"recipe">;
14
+ folder: z.ZodString;
15
+ recipeId: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ kind: z.ZodLiteral<"document">;
18
+ folder: z.ZodString;
19
+ path: z.ZodString;
20
+ url: z.ZodString;
21
+ }, z.core.$strip>], "kind">;
22
+ export type OpenPathView = z.infer<typeof openPathViewSchema>;
23
+ //# sourceMappingURL=open-path-view.contract.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { ChooseFolderView } from '../studio-api';
2
+ import type { StudioState } from './workspace.store';
3
+ /**
4
+ * Handles `choose-folder`: opens the folder dialog of the machine the server
5
+ * runs on and answers the folder picked. Only answers: the UI follows with
6
+ * `open-workspace`, the same as when the folder is typed. A dialog still
7
+ * open is not opened a second time; the second request waits for the first.
8
+ *
9
+ * @param state - The server state holding the dialog to use.
10
+ * @returns The folder, or none when the dialog was closed.
11
+ */
12
+ export declare function handleChooseFolder(state: StudioState): Promise<ChooseFolderView>;
13
+ //# sourceMappingURL=choose-folder.handler.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { OpenPathCommand, OpenPathView } from '../studio-api';
2
+ /**
3
+ * Handles `open-path`: says what the path is (folder, recipe or document) and
4
+ * where to open it. Opens nothing itself: the UI follows with `open-workspace`
5
+ * on the answer's folder, the same as when the folder is typed.
6
+ *
7
+ * @param command - The path, and the workspace it should belong to if the caller has one.
8
+ * @returns What the path is.
9
+ */
10
+ export declare function handleOpenPath(command: OpenPathCommand): Promise<OpenPathView>;
11
+ //# sourceMappingURL=open-path.handler.d.ts.map
@@ -17,6 +17,8 @@ export interface StudioServerOptions {
17
17
  browser?: BrowserSessionConfig;
18
18
  /** Hooks, access plugins and captcha solvers to run recipes with, loaded by the caller from a file the person named at launch (`opencraw studio --hooks`, issue #150). The server never loads code itself and no request can set this. Default: none. */
19
19
  plugins?: TrustedPlugins;
20
+ /** How `choose-folder` asks the person for a folder; default: the operating system's own folder dialog (`folder-dialog`), opened on the machine the server runs on. A host that has a dialog of its own passes it here. */
21
+ chooseFolder?: () => Promise<string | undefined>;
20
22
  /** Where the studio's own recorder profile lives (issue #95); default: a fixed directory under the OS temp folder, never a crawl's own profile directory, never the person's default browser. */
21
23
  recorderProfileDir?: string;
22
24
  }
@@ -24,6 +26,11 @@ export interface StudioServerOptions {
24
26
  export interface StudioServer {
25
27
  url: string;
26
28
  token: string;
29
+ /** A link that opens Studio on `open` (a folder, a recipe or a document; see `open-path`), with `workspace` as the folder a document belongs to. Without a target it is `url`. */
30
+ link: (target?: {
31
+ open?: string;
32
+ workspace?: string;
33
+ }) => string;
27
34
  close: () => Promise<void>;
28
35
  }
29
36
  /**
@@ -19,6 +19,10 @@ export interface StudioState {
19
19
  browser?: BrowserSessionConfig;
20
20
  /** Set once at server start (`StudioServerOptions.plugins`): the hooks and plugins the person started Studio with (issue #150). Never set by a request. */
21
21
  plugins?: TrustedPlugins;
22
+ /** Set once at server start (`StudioServerOptions.chooseFolder`): how `choose-folder` asks the person for a folder. */
23
+ chooseFolder?: () => Promise<string | undefined>;
24
+ /** The dialog currently open, so a second `choose-folder` waits for it instead of opening another. */
25
+ openDialog?: Promise<string | undefined>;
22
26
  /** Set once at server start (`StudioServerOptions.recorderProfileDir`), else `defaultRecorderProfileDir()`. */
23
27
  recorderProfileDir: string;
24
28
  }
Binary file