@opencraw/studio 0.0.34 → 0.0.37
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.
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +937 -653
- package/dist/src/index.d.ts +3 -1
- package/dist/src/studio-api/command.contract.d.ts +69 -0
- package/dist/src/studio-api/event.contract.d.ts +31 -0
- package/dist/src/studio-api/index.d.ts +8 -4
- package/dist/src/studio-api/studio-control-view.contract.d.ts +53 -0
- package/dist/src/studio-api/ui-request.contract.d.ts +15 -0
- package/dist/src/studio-instance/index.d.ts +3 -0
- package/dist/src/studio-instance/instance-file.repository.d.ts +14 -0
- package/dist/src/studio-instance/studio-instance.contract.d.ts +15 -0
- package/dist/src/studio-server/ask-ui.handler.d.ts +32 -0
- package/dist/src/studio-server/run-status.handler.d.ts +12 -0
- package/dist/src/studio-server/studio-http.use-case.d.ts +2 -0
- package/dist/src/studio-server/studio-status.handler.d.ts +10 -0
- package/dist/src/studio-server/workspace.store.d.ts +5 -1
- package/dist/studio-api/command.contract.d.ts +69 -0
- package/dist/studio-api/event.contract.d.ts +31 -0
- package/dist/studio-api/index.d.ts +8 -4
- package/dist/studio-api/studio-control-view.contract.d.ts +53 -0
- package/dist/studio-api/ui-request.contract.d.ts +15 -0
- package/dist/studio-instance/index.d.ts +3 -0
- package/dist/studio-instance/instance-file.repository.d.ts +14 -0
- package/dist/studio-instance/studio-instance.contract.d.ts +15 -0
- package/dist/studio-server/ask-ui.handler.d.ts +32 -0
- package/dist/studio-server/run-status.handler.d.ts +12 -0
- package/dist/studio-server/studio-http.use-case.d.ts +2 -0
- package/dist/studio-server/studio-status.handler.d.ts +10 -0
- package/dist/studio-server/workspace.store.d.ts +5 -1
- package/dist/ui/assets/{index-Db6-8OgZ.js → index-B40d4kiB.js} +26 -26
- package/dist/ui/assets/{pdf-rdp2xUbL.js → pdf-DS2CRtYv.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/package.json +3 -3
package/dist/src/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { main } from './main.js';
|
|
|
2
2
|
export type { StudioMainOptions } from './main.js';
|
|
3
3
|
export type { TrustedPlugins } from './trusted-plugins/index.js';
|
|
4
4
|
export { startStudioServer } from './studio-server/index.js';
|
|
5
|
+
export { defaultInstancesDirectory } from './studio-instance/index.js';
|
|
6
|
+
export type { StudioInstance } from './studio-instance/index.js';
|
|
5
7
|
export type { StudioServer, StudioServerOptions } from './studio-server/index.js';
|
|
6
8
|
export { openWorkspace, saveRecipe, importDocument } from './recipe-workspace/index.js';
|
|
7
9
|
export type { ImportedDocument } from './recipe-workspace/index.js';
|
|
@@ -10,5 +12,5 @@ export type { RecipePair, SampleRunCallbacks, SampleRunHandle, SampleRunRecord,
|
|
|
10
12
|
export { fetchStartPage } from './page-snapshot/index.js';
|
|
11
13
|
export type { WhyFacts, WhyStepFact } from './explain-why/index.js';
|
|
12
14
|
export { sampleBudgetSchema, openWorkspaceCommandSchema, chooseFolderCommandSchema, openPathCommandSchema, importDocumentCommandSchema, runSampleCommandSchema, stopRunCommandSchema, saveRecipeCommandSchema, fetchStartPageCommandSchema, detectUrlCommandSchema, 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, detectUrlViewSchema, snapshotViewSchema, verifySelectorViewSchema, fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema, sentencePartSchema, outlineCardSchema, outlineBracketSchema, outlineNodeSchema, outlineViewSchema, whyViewSchema, inspectPageCommandSchema, responsesSeenCommandSchema, documentTreeCommandSchema, pdfViewCommandSchema, tablePreviewOptionsSchema, tablePreviewCommandSchema, regionPreviewCommandSchema, regionPreviewMatchSchema, regionPreviewViewSchema, gridViewCommandSchema, gridRowsCommandSchema, gridPreviewOptionsSchema, gridPreviewCommandSchema, deckViewCommandSchema, deckPreviewOptionsSchema, deckPreviewCommandSchema, domTreeNodeViewSchema, pageDataFindingSchema, inspectViewSchema, observedResponseSchema, responsesSeenViewSchema, documentTreeNodeViewSchema, documentTreeViewSchema, pdfCellViewSchema, pdfRowViewSchema, pdfPageViewSchema, pdfDocumentViewSchema, tablePreviewTableSchema, tablePreviewBandSchema, tablePreviewMatchSchema, tablePreviewViewSchema, gridCellViewSchema, gridMergeViewSchema, gridRowsViewSchema, 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, DetectUrlCommand, SaveOutlineCommand, TakeSnapshotCommand, VerifySelectorCommand, InferSelectorCommand, MissingWhyTarget, RejectedWhyTarget, WhyTarget, ExplainWhyCommand, InspectPageCommand, ResponsesSeenCommand, DocumentTreeCommand, PdfViewCommand, TablePreviewOptions, TablePreviewCommand, RegionPreviewCommand, GridViewCommand, GridRowsCommand, 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, DetectUrlView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SelectorAlternative, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridRowsView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
|
|
15
|
+
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, StudioCommand, ChooseFolderView, OpenPathView, ImportDocumentView, RegionPreviewMatchView, RegionPreviewView, StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, StudioEvent, LoadedHooks, RecipeIssue, RecipeListing, WorkspaceView, SampleRunView, StartPageView, DetectUrlView, SnapshotView, VerifySelectorView, FieldPick, InferSelectorView, SelectorAlternative, SentencePart, OutlineCard, OutlineBracket, OutlineNode, OutlineView, WhyView, DomTreeNodeView, PageDataKind, PageDataFindingView, InspectView, ObservedResponseView, ResponsesSeenView, DocumentTreeNodeView, DocumentTreeView, PdfCellView, PdfRowView, PdfPageView, PdfDocumentView, TablePreviewTableView, TablePreviewBandView, TablePreviewMatchView, TablePreviewView, GridCellView, GridMergeView, GridRowsView, GridSheetView, WorkbookDocumentView, GridTablePreviewMatchView, GridTablePreviewView, DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView, DeckTablePreviewMatchView, DeckTablePreviewView, StartRecordingCommand, StopRecordingCommand, UiReportCommand, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, } from './studio-api/index.js';
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -385,6 +385,43 @@ export declare const importDocumentCommandSchema: z.ZodObject<{
|
|
|
385
385
|
name: z.ZodString;
|
|
386
386
|
bytes: z.ZodString;
|
|
387
387
|
}, z.core.$strip>;
|
|
388
|
+
/** Asks every open Studio page to do something (`ui-request`); the answer says how many pages were listening. How an agent opens a recipe for the person who is watching. */
|
|
389
|
+
export declare const askUiCommandSchema: z.ZodObject<{
|
|
390
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
391
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
392
|
+
kind: z.ZodLiteral<"open">;
|
|
393
|
+
path: z.ZodString;
|
|
394
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
kind: z.ZodLiteral<"pick">;
|
|
397
|
+
recipeId: z.ZodString;
|
|
398
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
399
|
+
text: z.ZodOptional<z.ZodString>;
|
|
400
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
401
|
+
}, z.core.$strip>], "kind">;
|
|
402
|
+
}, z.core.$strip>;
|
|
403
|
+
/** The page tells the server how a controller's request went, so the controller can find out (`ui-outcome`). */
|
|
404
|
+
export declare const uiReportCommandSchema: z.ZodObject<{
|
|
405
|
+
type: z.ZodLiteral<"ui-report">;
|
|
406
|
+
requestId: z.ZodString;
|
|
407
|
+
ok: z.ZodBoolean;
|
|
408
|
+
message: z.ZodString;
|
|
409
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
410
|
+
}, z.core.$strip>;
|
|
411
|
+
/** Asks how a controller's request went: still waiting for the page, or done. */
|
|
412
|
+
export declare const uiOutcomeCommandSchema: z.ZodObject<{
|
|
413
|
+
type: z.ZodLiteral<"ui-outcome">;
|
|
414
|
+
requestId: z.ZodString;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
/** Asks what Studio is doing: its workspace, how many pages are open and the run in progress. */
|
|
417
|
+
export declare const studioStatusCommandSchema: z.ZodObject<{
|
|
418
|
+
type: z.ZodLiteral<"studio-status">;
|
|
419
|
+
}, z.core.$strip>;
|
|
420
|
+
/** Asks how a recipe's sample run is going: still running, finished (with its first records) or never run. */
|
|
421
|
+
export declare const runStatusCommandSchema: z.ZodObject<{
|
|
422
|
+
type: z.ZodLiteral<"run-status">;
|
|
423
|
+
recipeId: z.ZodString;
|
|
424
|
+
}, z.core.$strip>;
|
|
388
425
|
export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
389
426
|
type: z.ZodLiteral<"open-workspace">;
|
|
390
427
|
folder: z.ZodString;
|
|
@@ -542,6 +579,33 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
542
579
|
recipeId: z.ZodString;
|
|
543
580
|
}, z.core.$strip>, z.ZodObject<{
|
|
544
581
|
type: z.ZodLiteral<"stop-recording">;
|
|
582
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
583
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
584
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
585
|
+
kind: z.ZodLiteral<"open">;
|
|
586
|
+
path: z.ZodString;
|
|
587
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
588
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
589
|
+
kind: z.ZodLiteral<"pick">;
|
|
590
|
+
recipeId: z.ZodString;
|
|
591
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
592
|
+
text: z.ZodOptional<z.ZodString>;
|
|
593
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
594
|
+
}, z.core.$strip>], "kind">;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
type: z.ZodLiteral<"ui-report">;
|
|
597
|
+
requestId: z.ZodString;
|
|
598
|
+
ok: z.ZodBoolean;
|
|
599
|
+
message: z.ZodString;
|
|
600
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
601
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
602
|
+
type: z.ZodLiteral<"ui-outcome">;
|
|
603
|
+
requestId: z.ZodString;
|
|
604
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
605
|
+
type: z.ZodLiteral<"studio-status">;
|
|
606
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
607
|
+
type: z.ZodLiteral<"run-status">;
|
|
608
|
+
recipeId: z.ZodString;
|
|
545
609
|
}, z.core.$strip>], "type">;
|
|
546
610
|
export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
|
|
547
611
|
export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
|
|
@@ -549,6 +613,11 @@ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
|
|
|
549
613
|
export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
|
|
550
614
|
export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
|
|
551
615
|
export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
|
|
616
|
+
export type UiReportCommand = z.infer<typeof uiReportCommandSchema>;
|
|
617
|
+
export type UiOutcomeCommand = z.infer<typeof uiOutcomeCommandSchema>;
|
|
618
|
+
export type AskUiCommand = z.infer<typeof askUiCommandSchema>;
|
|
619
|
+
export type StudioStatusCommand = z.infer<typeof studioStatusCommandSchema>;
|
|
620
|
+
export type RunStatusCommand = z.infer<typeof runStatusCommandSchema>;
|
|
552
621
|
export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
|
|
553
622
|
export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
|
|
554
623
|
export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
|
|
@@ -87,6 +87,22 @@ export declare const recordingStoppedEventSchema: z.ZodObject<{
|
|
|
87
87
|
type: z.ZodLiteral<"recording-stopped">;
|
|
88
88
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
89
89
|
}, z.core.$strip>;
|
|
90
|
+
/** A controller (an agent, through the MCP server) asked the open page to do something; every page does it. */
|
|
91
|
+
export declare const uiRequestEventSchema: z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"ui-request">;
|
|
93
|
+
requestId: z.ZodString;
|
|
94
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
95
|
+
kind: z.ZodLiteral<"open">;
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
kind: z.ZodLiteral<"pick">;
|
|
100
|
+
recipeId: z.ZodString;
|
|
101
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
102
|
+
text: z.ZodOptional<z.ZodString>;
|
|
103
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>], "kind">;
|
|
105
|
+
}, z.core.$strip>;
|
|
90
106
|
export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
107
|
type: z.ZodLiteral<"trace-line">;
|
|
92
108
|
line: z.ZodString;
|
|
@@ -139,7 +155,22 @@ export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
155
|
}, z.core.$strip>, z.ZodObject<{
|
|
140
156
|
type: z.ZodLiteral<"recording-stopped">;
|
|
141
157
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"ui-request">;
|
|
160
|
+
requestId: z.ZodString;
|
|
161
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
162
|
+
kind: z.ZodLiteral<"open">;
|
|
163
|
+
path: z.ZodString;
|
|
164
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
166
|
+
kind: z.ZodLiteral<"pick">;
|
|
167
|
+
recipeId: z.ZodString;
|
|
168
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
169
|
+
text: z.ZodOptional<z.ZodString>;
|
|
170
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strip>], "kind">;
|
|
142
172
|
}, z.core.$strip>], "type">;
|
|
173
|
+
export type UiRequestEvent = z.infer<typeof uiRequestEventSchema>;
|
|
143
174
|
export type StoppedBy = z.infer<typeof stoppedBySchema>;
|
|
144
175
|
export type TraceLineEvent = z.infer<typeof traceLineEventSchema>;
|
|
145
176
|
export type FieldTraceView = z.infer<typeof fieldTraceSchema>;
|
|
@@ -1,13 +1,13 @@
|
|
|
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.js';
|
|
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.js';
|
|
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, askUiCommandSchema, uiReportCommandSchema, uiOutcomeCommandSchema, studioStatusCommandSchema, runStatusCommandSchema, studioCommandSchema } from './command.contract.js';
|
|
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, AskUiCommand, UiReportCommand, UiOutcomeCommand, StudioStatusCommand, RunStatusCommand, 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';
|
|
6
6
|
export type { VerifySelectorView } from './verify-selector-view.contract.js';
|
|
7
7
|
export { fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema } from './infer-selector-view.contract.js';
|
|
8
8
|
export type { FieldPick, InferSelectorView, SelectorAlternative } from './infer-selector-view.contract.js';
|
|
9
|
-
export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, studioEventSchema } from './event.contract.js';
|
|
10
|
-
export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, StudioEvent } from './event.contract.js';
|
|
9
|
+
export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, uiRequestEventSchema, studioEventSchema } from './event.contract.js';
|
|
10
|
+
export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, UiRequestEvent, 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
13
|
export { chooseFolderViewSchema } from './choose-folder-view.contract.js';
|
|
@@ -46,4 +46,8 @@ export { deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, de
|
|
|
46
46
|
export type { DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView } from './deck-view.contract.js';
|
|
47
47
|
export { deckTablePreviewMatchSchema, deckTablePreviewViewSchema } from './deck-preview-view.contract.js';
|
|
48
48
|
export type { DeckTablePreviewMatchView, DeckTablePreviewView } from './deck-preview-view.contract.js';
|
|
49
|
+
export { uiRequestSchema } from './ui-request.contract.js';
|
|
50
|
+
export type { UiRequest } from './ui-request.contract.js';
|
|
51
|
+
export { askUiViewSchema, uiOutcomeViewSchema, studioStatusViewSchema, runStatusViewSchema } from './studio-control-view.contract.js';
|
|
52
|
+
export type { AskUiView, UiOutcomeView, StudioStatusView, RunStatusView } from './studio-control-view.contract.js';
|
|
49
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** How many pages were listening when a controller asked them to do something: none means nobody has Studio open. */
|
|
3
|
+
export declare const askUiViewSchema: z.ZodObject<{
|
|
4
|
+
pages: z.ZodNumber;
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
/** How a controller's request went: `pending` until a page reported, then what it said. */
|
|
8
|
+
export declare const uiOutcomeViewSchema: z.ZodObject<{
|
|
9
|
+
state: z.ZodEnum<{
|
|
10
|
+
pending: "pending";
|
|
11
|
+
done: "done";
|
|
12
|
+
}>;
|
|
13
|
+
ok: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
message: z.ZodOptional<z.ZodString>;
|
|
15
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
/** What Studio is doing: its workspace, how many pages are open, and the recipe whose sample run is in progress. */
|
|
18
|
+
export declare const studioStatusViewSchema: z.ZodObject<{
|
|
19
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
20
|
+
pages: z.ZodNumber;
|
|
21
|
+
running: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/** How a recipe's sample run is going; `result` only once it finished: the counts, the first records and the first rejections (the rest are in Studio). */
|
|
24
|
+
export declare const runStatusViewSchema: z.ZodObject<{
|
|
25
|
+
recipeId: z.ZodString;
|
|
26
|
+
state: z.ZodEnum<{
|
|
27
|
+
running: "running";
|
|
28
|
+
finished: "finished";
|
|
29
|
+
"never-run": "never-run";
|
|
30
|
+
}>;
|
|
31
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
emitted: z.ZodNumber;
|
|
33
|
+
rejected: z.ZodNumber;
|
|
34
|
+
duplicates: z.ZodNumber;
|
|
35
|
+
durationMs: z.ZodNumber;
|
|
36
|
+
error: z.ZodOptional<z.ZodString>;
|
|
37
|
+
stoppedBy: z.ZodOptional<z.ZodString>;
|
|
38
|
+
records: z.ZodArray<z.ZodObject<{
|
|
39
|
+
key: z.ZodNullable<z.ZodString>;
|
|
40
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
rejections: z.ZodArray<z.ZodObject<{
|
|
43
|
+
field: z.ZodString;
|
|
44
|
+
reason: z.ZodString;
|
|
45
|
+
url: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type UiOutcomeView = z.infer<typeof uiOutcomeViewSchema>;
|
|
50
|
+
export type AskUiView = z.infer<typeof askUiViewSchema>;
|
|
51
|
+
export type StudioStatusView = z.infer<typeof studioStatusViewSchema>;
|
|
52
|
+
export type RunStatusView = z.infer<typeof runStatusViewSchema>;
|
|
53
|
+
//# sourceMappingURL=studio-control-view.contract.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** What an outside controller (an agent, through the MCP server) can ask the open Studio page to do. Grows one `kind` at a time. */
|
|
3
|
+
export declare const uiRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<"open">;
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"pick">;
|
|
9
|
+
recipeId: z.ZodString;
|
|
10
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
11
|
+
text: z.ZodOptional<z.ZodString>;
|
|
12
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strip>], "kind">;
|
|
14
|
+
export type UiRequest = z.infer<typeof uiRequestSchema>;
|
|
15
|
+
//# sourceMappingURL=ui-request.contract.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StudioInstance } from './studio-instance.contract.js';
|
|
2
|
+
/** Where running Studios announce themselves, unless the caller says otherwise. */
|
|
3
|
+
export declare function defaultInstancesDirectory(): string;
|
|
4
|
+
/**
|
|
5
|
+
* Writes the file that tells controllers this Studio is running. Failing to write it never stops Studio: it only means no agent can find it.
|
|
6
|
+
*
|
|
7
|
+
* @param instance - What to announce.
|
|
8
|
+
* @param directory - Where announcements live.
|
|
9
|
+
* @returns Whether the file was written.
|
|
10
|
+
*/
|
|
11
|
+
export declare function announceInstance(instance: StudioInstance, directory: string): Promise<boolean>;
|
|
12
|
+
/** Removes the announcement, when Studio stops. */
|
|
13
|
+
export declare function withdrawInstance(instance: Pick<StudioInstance, 'pid' | 'url'>, directory: string): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=instance-file.repository.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a running Studio tells the machine about itself, one file per process, so a controller that did not start it (the MCP server an
|
|
3
|
+
* agent talks to) can find it: `~/.opencraw/studio/<pid>.json`. The token is in it, so the file is readable by its owner only.
|
|
4
|
+
* `@opencraw/mcp` reads the same shape (`studio-control`); change both together.
|
|
5
|
+
*/
|
|
6
|
+
export interface StudioInstance {
|
|
7
|
+
pid: number;
|
|
8
|
+
/** The server's address, without the token: `http://127.0.0.1:<port>`. */
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
/** The folder Studio was started with, if any; the live one is asked with `studio-status`. */
|
|
12
|
+
folder?: string;
|
|
13
|
+
startedAt: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=studio-instance.contract.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AskUiCommand, AskUiView, UiOutcomeCommand, UiOutcomeView, UiReportCommand } from '../studio-api/index.js';
|
|
2
|
+
import type { StudioState } from './workspace.store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handles `ask-ui`: tells every open page what a controller (an agent, through the MCP server) asked for, so
|
|
5
|
+
* the person watching sees it happen. Nothing is done server-side: the page does it the way a click would, and
|
|
6
|
+
* says how it went (`ui-report`).
|
|
7
|
+
*
|
|
8
|
+
* @param state - The server state holding the connected pages.
|
|
9
|
+
* @param command - What to ask the pages.
|
|
10
|
+
* @returns How many pages were listening (0 means nobody has Studio open) and the id to ask the outcome with.
|
|
11
|
+
*/
|
|
12
|
+
export declare function handleAskUi(state: StudioState, command: AskUiCommand): AskUiView;
|
|
13
|
+
/**
|
|
14
|
+
* Handles `ui-report`: a page says how a controller's request went. The first answer stays: every open page gets the
|
|
15
|
+
* request, and a page that has nothing to do with it (another recipe open) does not report.
|
|
16
|
+
*
|
|
17
|
+
* @param state - The server state.
|
|
18
|
+
* @param command - The request's id and the outcome.
|
|
19
|
+
* @returns Whether the report was kept.
|
|
20
|
+
*/
|
|
21
|
+
export declare function handleUiReport(state: StudioState, command: UiReportCommand): {
|
|
22
|
+
kept: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Handles `ui-outcome`: how a controller's request went.
|
|
26
|
+
*
|
|
27
|
+
* @param state - The server state.
|
|
28
|
+
* @param command - The request's id.
|
|
29
|
+
* @returns `pending` until a page reported, then what it said.
|
|
30
|
+
*/
|
|
31
|
+
export declare function handleUiOutcome(state: StudioState, command: UiOutcomeCommand): UiOutcomeView;
|
|
32
|
+
//# sourceMappingURL=ask-ui.handler.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RunStatusCommand, RunStatusView } from '../studio-api/index.js';
|
|
2
|
+
import type { StudioState } from './workspace.store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handles `run-status`: how a recipe's sample run is going, for a controller that started it and cannot watch
|
|
5
|
+
* the event stream. A run in progress is `running`; one that finished carries its counts and first records.
|
|
6
|
+
*
|
|
7
|
+
* @param state - The server state holding the run in progress and the last runs.
|
|
8
|
+
* @param command - The recipe asked about.
|
|
9
|
+
* @returns The state of the recipe's sample run.
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleRunStatus(state: StudioState, command: RunStatusCommand): RunStatusView;
|
|
12
|
+
//# sourceMappingURL=run-status.handler.d.ts.map
|
|
@@ -21,6 +21,8 @@ export interface StudioServerOptions {
|
|
|
21
21
|
chooseFolder?: () => Promise<string | undefined>;
|
|
22
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. */
|
|
23
23
|
recorderProfileDir?: string;
|
|
24
|
+
/** Where this Studio announces itself so an agent's MCP server can find it (`studio-instance`); default: `~/.opencraw/studio`. */
|
|
25
|
+
instancesDir?: string;
|
|
24
26
|
}
|
|
25
27
|
/** The running server: its URL (token included, ready to open), the token alone, and how to stop it. */
|
|
26
28
|
export interface StudioServer {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StudioStatusView } from '../studio-api/index.js';
|
|
2
|
+
import type { StudioState } from './workspace.store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Handles `studio-status`: what Studio is doing right now.
|
|
5
|
+
*
|
|
6
|
+
* @param state - The server state.
|
|
7
|
+
* @returns The open workspace, how many pages are open and the recipe being sampled.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleStudioStatus(state: StudioState): StudioStatusView;
|
|
10
|
+
//# sourceMappingURL=studio-status.handler.d.ts.map
|
|
@@ -2,17 +2,21 @@ import type { BrowserSessionConfig } from '@opencraw/core';
|
|
|
2
2
|
import type { RecorderSessionHandle } from '../flow-recording/index.js';
|
|
3
3
|
import type { SnapshotCache } from '../page-snapshot/index.js';
|
|
4
4
|
import type { LastRunCache, SampleRunHandle } from '../sample-run/index.js';
|
|
5
|
-
import type { StudioEvent } from '../studio-api/index.js';
|
|
5
|
+
import type { StudioEvent, UiOutcomeView } from '../studio-api/index.js';
|
|
6
6
|
import type { TrustedPlugins } from '../trusted-plugins/index.js';
|
|
7
7
|
import type { WsConnection } from './websocket.client.js';
|
|
8
8
|
/** The server's mutable state: the opened folder, the run in progress (if any), the recording in progress (if any, issue #95), the connected event sockets, the per-recipe snapshot cache `take-snapshot`/`verify-selector`/`infer-selector` share, each recipe's last finished sample run (`explain-why`, issue #92), the browser launch settings every web-mode command (`take-snapshot`, `verify-selector`, `run-sample`, `start-recording`) shares, and where the studio's own recorder profile lives. */
|
|
9
9
|
export interface StudioState {
|
|
10
10
|
folder?: string;
|
|
11
11
|
activeRun?: SampleRunHandle;
|
|
12
|
+
/** The recipe `activeRun` is sampling. */
|
|
13
|
+
activeRunId?: string;
|
|
12
14
|
activeRecording?: RecorderSessionHandle;
|
|
13
15
|
/** A `start-recording` still opening its window: `stop-recording` and the server's own close wait for it, so a window is never left open behind them (issue #174). */
|
|
14
16
|
openingRecording?: Promise<unknown>;
|
|
15
17
|
sockets: Set<WsConnection>;
|
|
18
|
+
/** How the pages said a controller's requests went (`ui-report`), by request id; the oldest are dropped past a few dozen. */
|
|
19
|
+
uiOutcomes: Map<string, UiOutcomeView>;
|
|
16
20
|
snapshots: SnapshotCache;
|
|
17
21
|
lastRuns: LastRunCache;
|
|
18
22
|
/** Set once at server start (`StudioServerOptions.browser`); every web-mode command reads it from here rather than each accepting its own. */
|
|
@@ -385,6 +385,43 @@ export declare const importDocumentCommandSchema: z.ZodObject<{
|
|
|
385
385
|
name: z.ZodString;
|
|
386
386
|
bytes: z.ZodString;
|
|
387
387
|
}, z.core.$strip>;
|
|
388
|
+
/** Asks every open Studio page to do something (`ui-request`); the answer says how many pages were listening. How an agent opens a recipe for the person who is watching. */
|
|
389
|
+
export declare const askUiCommandSchema: z.ZodObject<{
|
|
390
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
391
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
392
|
+
kind: z.ZodLiteral<"open">;
|
|
393
|
+
path: z.ZodString;
|
|
394
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
kind: z.ZodLiteral<"pick">;
|
|
397
|
+
recipeId: z.ZodString;
|
|
398
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
399
|
+
text: z.ZodOptional<z.ZodString>;
|
|
400
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
401
|
+
}, z.core.$strip>], "kind">;
|
|
402
|
+
}, z.core.$strip>;
|
|
403
|
+
/** The page tells the server how a controller's request went, so the controller can find out (`ui-outcome`). */
|
|
404
|
+
export declare const uiReportCommandSchema: z.ZodObject<{
|
|
405
|
+
type: z.ZodLiteral<"ui-report">;
|
|
406
|
+
requestId: z.ZodString;
|
|
407
|
+
ok: z.ZodBoolean;
|
|
408
|
+
message: z.ZodString;
|
|
409
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
410
|
+
}, z.core.$strip>;
|
|
411
|
+
/** Asks how a controller's request went: still waiting for the page, or done. */
|
|
412
|
+
export declare const uiOutcomeCommandSchema: z.ZodObject<{
|
|
413
|
+
type: z.ZodLiteral<"ui-outcome">;
|
|
414
|
+
requestId: z.ZodString;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
/** Asks what Studio is doing: its workspace, how many pages are open and the run in progress. */
|
|
417
|
+
export declare const studioStatusCommandSchema: z.ZodObject<{
|
|
418
|
+
type: z.ZodLiteral<"studio-status">;
|
|
419
|
+
}, z.core.$strip>;
|
|
420
|
+
/** Asks how a recipe's sample run is going: still running, finished (with its first records) or never run. */
|
|
421
|
+
export declare const runStatusCommandSchema: z.ZodObject<{
|
|
422
|
+
type: z.ZodLiteral<"run-status">;
|
|
423
|
+
recipeId: z.ZodString;
|
|
424
|
+
}, z.core.$strip>;
|
|
388
425
|
export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
389
426
|
type: z.ZodLiteral<"open-workspace">;
|
|
390
427
|
folder: z.ZodString;
|
|
@@ -542,6 +579,33 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
542
579
|
recipeId: z.ZodString;
|
|
543
580
|
}, z.core.$strip>, z.ZodObject<{
|
|
544
581
|
type: z.ZodLiteral<"stop-recording">;
|
|
582
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
583
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
584
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
585
|
+
kind: z.ZodLiteral<"open">;
|
|
586
|
+
path: z.ZodString;
|
|
587
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
588
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
589
|
+
kind: z.ZodLiteral<"pick">;
|
|
590
|
+
recipeId: z.ZodString;
|
|
591
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
592
|
+
text: z.ZodOptional<z.ZodString>;
|
|
593
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
594
|
+
}, z.core.$strip>], "kind">;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
type: z.ZodLiteral<"ui-report">;
|
|
597
|
+
requestId: z.ZodString;
|
|
598
|
+
ok: z.ZodBoolean;
|
|
599
|
+
message: z.ZodString;
|
|
600
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
601
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
602
|
+
type: z.ZodLiteral<"ui-outcome">;
|
|
603
|
+
requestId: z.ZodString;
|
|
604
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
605
|
+
type: z.ZodLiteral<"studio-status">;
|
|
606
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
607
|
+
type: z.ZodLiteral<"run-status">;
|
|
608
|
+
recipeId: z.ZodString;
|
|
545
609
|
}, z.core.$strip>], "type">;
|
|
546
610
|
export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
|
|
547
611
|
export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
|
|
@@ -549,6 +613,11 @@ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
|
|
|
549
613
|
export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
|
|
550
614
|
export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
|
|
551
615
|
export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
|
|
616
|
+
export type UiReportCommand = z.infer<typeof uiReportCommandSchema>;
|
|
617
|
+
export type UiOutcomeCommand = z.infer<typeof uiOutcomeCommandSchema>;
|
|
618
|
+
export type AskUiCommand = z.infer<typeof askUiCommandSchema>;
|
|
619
|
+
export type StudioStatusCommand = z.infer<typeof studioStatusCommandSchema>;
|
|
620
|
+
export type RunStatusCommand = z.infer<typeof runStatusCommandSchema>;
|
|
552
621
|
export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
|
|
553
622
|
export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
|
|
554
623
|
export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
|
|
@@ -87,6 +87,22 @@ export declare const recordingStoppedEventSchema: z.ZodObject<{
|
|
|
87
87
|
type: z.ZodLiteral<"recording-stopped">;
|
|
88
88
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
89
89
|
}, z.core.$strip>;
|
|
90
|
+
/** A controller (an agent, through the MCP server) asked the open page to do something; every page does it. */
|
|
91
|
+
export declare const uiRequestEventSchema: z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"ui-request">;
|
|
93
|
+
requestId: z.ZodString;
|
|
94
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
95
|
+
kind: z.ZodLiteral<"open">;
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
kind: z.ZodLiteral<"pick">;
|
|
100
|
+
recipeId: z.ZodString;
|
|
101
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
102
|
+
text: z.ZodOptional<z.ZodString>;
|
|
103
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>], "kind">;
|
|
105
|
+
}, z.core.$strip>;
|
|
90
106
|
export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
107
|
type: z.ZodLiteral<"trace-line">;
|
|
92
108
|
line: z.ZodString;
|
|
@@ -139,7 +155,22 @@ export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
155
|
}, z.core.$strip>, z.ZodObject<{
|
|
140
156
|
type: z.ZodLiteral<"recording-stopped">;
|
|
141
157
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
type: z.ZodLiteral<"ui-request">;
|
|
160
|
+
requestId: z.ZodString;
|
|
161
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
162
|
+
kind: z.ZodLiteral<"open">;
|
|
163
|
+
path: z.ZodString;
|
|
164
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
166
|
+
kind: z.ZodLiteral<"pick">;
|
|
167
|
+
recipeId: z.ZodString;
|
|
168
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
169
|
+
text: z.ZodOptional<z.ZodString>;
|
|
170
|
+
add: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strip>], "kind">;
|
|
142
172
|
}, z.core.$strip>], "type">;
|
|
173
|
+
export type UiRequestEvent = z.infer<typeof uiRequestEventSchema>;
|
|
143
174
|
export type StoppedBy = z.infer<typeof stoppedBySchema>;
|
|
144
175
|
export type TraceLineEvent = z.infer<typeof traceLineEventSchema>;
|
|
145
176
|
export type FieldTraceView = z.infer<typeof fieldTraceSchema>;
|
|
@@ -1,13 +1,13 @@
|
|
|
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';
|
|
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, askUiCommandSchema, uiReportCommandSchema, uiOutcomeCommandSchema, studioStatusCommandSchema, runStatusCommandSchema, 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, AskUiCommand, UiReportCommand, UiOutcomeCommand, StudioStatusCommand, RunStatusCommand, 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
7
|
export { fieldPickSchema, inferSelectorViewSchema, selectorAlternativeSchema } from './infer-selector-view.contract';
|
|
8
8
|
export type { FieldPick, InferSelectorView, SelectorAlternative } from './infer-selector-view.contract';
|
|
9
|
-
export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, studioEventSchema } from './event.contract';
|
|
10
|
-
export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, StudioEvent } from './event.contract';
|
|
9
|
+
export { stoppedBySchema, fieldTraceSchema, traceLineEventSchema, recordEventSchema, recordRejectedEventSchema, runFinishedEventSchema, workspaceChangedEventSchema, recordingCardEventSchema, recordingNoteEventSchema, recordingStoppedEventSchema, uiRequestEventSchema, studioEventSchema } from './event.contract';
|
|
10
|
+
export type { StoppedBy, FieldTraceView, TraceLineEvent, RecordEvent, RecordRejectedEvent, RunFinishedEvent, WorkspaceChangedEvent, RecordingCardEvent, RecordingNoteEvent, RecordingStoppedEvent, UiRequestEvent, 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
13
|
export { chooseFolderViewSchema } from './choose-folder-view.contract';
|
|
@@ -46,4 +46,8 @@ export { deckShapeViewSchema, deckChartSeriesViewSchema, deckChartViewSchema, de
|
|
|
46
46
|
export type { DeckShapeView, DeckChartSeriesView, DeckChartView, DeckSlideView, DeckDocumentView } from './deck-view.contract';
|
|
47
47
|
export { deckTablePreviewMatchSchema, deckTablePreviewViewSchema } from './deck-preview-view.contract';
|
|
48
48
|
export type { DeckTablePreviewMatchView, DeckTablePreviewView } from './deck-preview-view.contract';
|
|
49
|
+
export { uiRequestSchema } from './ui-request.contract';
|
|
50
|
+
export type { UiRequest } from './ui-request.contract';
|
|
51
|
+
export { askUiViewSchema, uiOutcomeViewSchema, studioStatusViewSchema, runStatusViewSchema } from './studio-control-view.contract';
|
|
52
|
+
export type { AskUiView, UiOutcomeView, StudioStatusView, RunStatusView } from './studio-control-view.contract';
|
|
49
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** How many pages were listening when a controller asked them to do something: none means nobody has Studio open. */
|
|
3
|
+
export declare const askUiViewSchema: z.ZodObject<{
|
|
4
|
+
pages: z.ZodNumber;
|
|
5
|
+
requestId: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
/** How a controller's request went: `pending` until a page reported, then what it said. */
|
|
8
|
+
export declare const uiOutcomeViewSchema: z.ZodObject<{
|
|
9
|
+
state: z.ZodEnum<{
|
|
10
|
+
done: "done";
|
|
11
|
+
pending: "pending";
|
|
12
|
+
}>;
|
|
13
|
+
ok: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
message: z.ZodOptional<z.ZodString>;
|
|
15
|
+
detail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
/** What Studio is doing: its workspace, how many pages are open, and the recipe whose sample run is in progress. */
|
|
18
|
+
export declare const studioStatusViewSchema: z.ZodObject<{
|
|
19
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
20
|
+
pages: z.ZodNumber;
|
|
21
|
+
running: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/** How a recipe's sample run is going; `result` only once it finished: the counts, the first records and the first rejections (the rest are in Studio). */
|
|
24
|
+
export declare const runStatusViewSchema: z.ZodObject<{
|
|
25
|
+
recipeId: z.ZodString;
|
|
26
|
+
state: z.ZodEnum<{
|
|
27
|
+
finished: "finished";
|
|
28
|
+
"never-run": "never-run";
|
|
29
|
+
running: "running";
|
|
30
|
+
}>;
|
|
31
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
emitted: z.ZodNumber;
|
|
33
|
+
rejected: z.ZodNumber;
|
|
34
|
+
duplicates: z.ZodNumber;
|
|
35
|
+
durationMs: z.ZodNumber;
|
|
36
|
+
error: z.ZodOptional<z.ZodString>;
|
|
37
|
+
stoppedBy: z.ZodOptional<z.ZodString>;
|
|
38
|
+
records: z.ZodArray<z.ZodObject<{
|
|
39
|
+
key: z.ZodNullable<z.ZodString>;
|
|
40
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
rejections: z.ZodArray<z.ZodObject<{
|
|
43
|
+
field: z.ZodString;
|
|
44
|
+
reason: z.ZodString;
|
|
45
|
+
url: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type UiOutcomeView = z.infer<typeof uiOutcomeViewSchema>;
|
|
50
|
+
export type AskUiView = z.infer<typeof askUiViewSchema>;
|
|
51
|
+
export type StudioStatusView = z.infer<typeof studioStatusViewSchema>;
|
|
52
|
+
export type RunStatusView = z.infer<typeof runStatusViewSchema>;
|
|
53
|
+
//# sourceMappingURL=studio-control-view.contract.d.ts.map
|