@opencraw/studio 0.0.33 → 0.0.36
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 +2 -0
- package/dist/index.esm.js +1053 -855
- package/dist/src/index.d.ts +2 -0
- package/dist/src/studio-api/command.contract.d.ts +33 -0
- package/dist/src/studio-api/event.contract.d.ts +17 -0
- package/dist/src/studio-api/index.d.ts +8 -4
- package/dist/src/studio-api/studio-control-view.contract.d.ts +41 -0
- package/dist/src/studio-api/ui-request.contract.d.ts +9 -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 +12 -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 +2 -0
- package/dist/studio-api/command.contract.d.ts +33 -0
- package/dist/studio-api/event.contract.d.ts +17 -0
- package/dist/studio-api/index.d.ts +8 -4
- package/dist/studio-api/studio-control-view.contract.d.ts +41 -0
- package/dist/studio-api/ui-request.contract.d.ts +9 -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 +12 -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 +2 -0
- package/dist/ui/assets/{index-Db6-8OgZ.js → index-cNoQIuRS.js} +29 -29
- package/dist/ui/assets/{pdf-rdp2xUbL.js → pdf-OWIvAVVv.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';
|
|
@@ -385,6 +385,24 @@ 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>], "kind">;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
/** Asks what Studio is doing: its workspace, how many pages are open and the run in progress. */
|
|
398
|
+
export declare const studioStatusCommandSchema: z.ZodObject<{
|
|
399
|
+
type: z.ZodLiteral<"studio-status">;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
/** Asks how a recipe's sample run is going: still running, finished (with its first records) or never run. */
|
|
402
|
+
export declare const runStatusCommandSchema: z.ZodObject<{
|
|
403
|
+
type: z.ZodLiteral<"run-status">;
|
|
404
|
+
recipeId: z.ZodString;
|
|
405
|
+
}, z.core.$strip>;
|
|
388
406
|
export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
389
407
|
type: z.ZodLiteral<"open-workspace">;
|
|
390
408
|
folder: z.ZodString;
|
|
@@ -542,6 +560,18 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
542
560
|
recipeId: z.ZodString;
|
|
543
561
|
}, z.core.$strip>, z.ZodObject<{
|
|
544
562
|
type: z.ZodLiteral<"stop-recording">;
|
|
563
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
564
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
565
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
566
|
+
kind: z.ZodLiteral<"open">;
|
|
567
|
+
path: z.ZodString;
|
|
568
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
569
|
+
}, z.core.$strip>], "kind">;
|
|
570
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
571
|
+
type: z.ZodLiteral<"studio-status">;
|
|
572
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
573
|
+
type: z.ZodLiteral<"run-status">;
|
|
574
|
+
recipeId: z.ZodString;
|
|
545
575
|
}, z.core.$strip>], "type">;
|
|
546
576
|
export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
|
|
547
577
|
export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
|
|
@@ -549,6 +579,9 @@ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
|
|
|
549
579
|
export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
|
|
550
580
|
export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
|
|
551
581
|
export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
|
|
582
|
+
export type AskUiCommand = z.infer<typeof askUiCommandSchema>;
|
|
583
|
+
export type StudioStatusCommand = z.infer<typeof studioStatusCommandSchema>;
|
|
584
|
+
export type RunStatusCommand = z.infer<typeof runStatusCommandSchema>;
|
|
552
585
|
export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
|
|
553
586
|
export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
|
|
554
587
|
export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
|
|
@@ -87,6 +87,15 @@ 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
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<"open">;
|
|
95
|
+
path: z.ZodString;
|
|
96
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>], "kind">;
|
|
98
|
+
}, z.core.$strip>;
|
|
90
99
|
export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
100
|
type: z.ZodLiteral<"trace-line">;
|
|
92
101
|
line: z.ZodString;
|
|
@@ -139,7 +148,15 @@ export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
148
|
}, z.core.$strip>, z.ZodObject<{
|
|
140
149
|
type: z.ZodLiteral<"recording-stopped">;
|
|
141
150
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
type: z.ZodLiteral<"ui-request">;
|
|
153
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"open">;
|
|
155
|
+
path: z.ZodString;
|
|
156
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>], "kind">;
|
|
142
158
|
}, z.core.$strip>], "type">;
|
|
159
|
+
export type UiRequestEvent = z.infer<typeof uiRequestEventSchema>;
|
|
143
160
|
export type StoppedBy = z.infer<typeof stoppedBySchema>;
|
|
144
161
|
export type TraceLineEvent = z.infer<typeof traceLineEventSchema>;
|
|
145
162
|
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, 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, 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, studioStatusViewSchema, runStatusViewSchema } from './studio-control-view.contract.js';
|
|
52
|
+
export type { AskUiView, StudioStatusView, RunStatusView } from './studio-control-view.contract.js';
|
|
49
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}, z.core.$strip>;
|
|
6
|
+
/** What Studio is doing: its workspace, how many pages are open, and the recipe whose sample run is in progress. */
|
|
7
|
+
export declare const studioStatusViewSchema: z.ZodObject<{
|
|
8
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
9
|
+
pages: z.ZodNumber;
|
|
10
|
+
running: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
/** 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). */
|
|
13
|
+
export declare const runStatusViewSchema: z.ZodObject<{
|
|
14
|
+
recipeId: z.ZodString;
|
|
15
|
+
state: z.ZodEnum<{
|
|
16
|
+
running: "running";
|
|
17
|
+
finished: "finished";
|
|
18
|
+
"never-run": "never-run";
|
|
19
|
+
}>;
|
|
20
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
emitted: z.ZodNumber;
|
|
22
|
+
rejected: z.ZodNumber;
|
|
23
|
+
duplicates: z.ZodNumber;
|
|
24
|
+
durationMs: z.ZodNumber;
|
|
25
|
+
error: z.ZodOptional<z.ZodString>;
|
|
26
|
+
stoppedBy: z.ZodOptional<z.ZodString>;
|
|
27
|
+
records: z.ZodArray<z.ZodObject<{
|
|
28
|
+
key: z.ZodNullable<z.ZodString>;
|
|
29
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
rejections: z.ZodArray<z.ZodObject<{
|
|
32
|
+
field: z.ZodString;
|
|
33
|
+
reason: z.ZodString;
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type AskUiView = z.infer<typeof askUiViewSchema>;
|
|
39
|
+
export type StudioStatusView = z.infer<typeof studioStatusViewSchema>;
|
|
40
|
+
export type RunStatusView = z.infer<typeof runStatusViewSchema>;
|
|
41
|
+
//# sourceMappingURL=studio-control-view.contract.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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>], "kind">;
|
|
8
|
+
export type UiRequest = z.infer<typeof uiRequestSchema>;
|
|
9
|
+
//# 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,12 @@
|
|
|
1
|
+
import type { AskUiCommand, AskUiView } 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.
|
|
6
|
+
*
|
|
7
|
+
* @param state - The server state holding the connected pages.
|
|
8
|
+
* @param command - What to ask the pages.
|
|
9
|
+
* @returns How many pages were listening; 0 means nobody has Studio open.
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleAskUi(state: StudioState, command: AskUiCommand): AskUiView;
|
|
12
|
+
//# 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
|
|
@@ -9,6 +9,8 @@ import type { WsConnection } from './websocket.client.js';
|
|
|
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>;
|
|
@@ -385,6 +385,24 @@ 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>], "kind">;
|
|
396
|
+
}, z.core.$strip>;
|
|
397
|
+
/** Asks what Studio is doing: its workspace, how many pages are open and the run in progress. */
|
|
398
|
+
export declare const studioStatusCommandSchema: z.ZodObject<{
|
|
399
|
+
type: z.ZodLiteral<"studio-status">;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
/** Asks how a recipe's sample run is going: still running, finished (with its first records) or never run. */
|
|
402
|
+
export declare const runStatusCommandSchema: z.ZodObject<{
|
|
403
|
+
type: z.ZodLiteral<"run-status">;
|
|
404
|
+
recipeId: z.ZodString;
|
|
405
|
+
}, z.core.$strip>;
|
|
388
406
|
export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
389
407
|
type: z.ZodLiteral<"open-workspace">;
|
|
390
408
|
folder: z.ZodString;
|
|
@@ -542,6 +560,18 @@ export declare const studioCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
542
560
|
recipeId: z.ZodString;
|
|
543
561
|
}, z.core.$strip>, z.ZodObject<{
|
|
544
562
|
type: z.ZodLiteral<"stop-recording">;
|
|
563
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
564
|
+
type: z.ZodLiteral<"ask-ui">;
|
|
565
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
566
|
+
kind: z.ZodLiteral<"open">;
|
|
567
|
+
path: z.ZodString;
|
|
568
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
569
|
+
}, z.core.$strip>], "kind">;
|
|
570
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
571
|
+
type: z.ZodLiteral<"studio-status">;
|
|
572
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
573
|
+
type: z.ZodLiteral<"run-status">;
|
|
574
|
+
recipeId: z.ZodString;
|
|
545
575
|
}, z.core.$strip>], "type">;
|
|
546
576
|
export type SampleBudget = z.infer<typeof sampleBudgetSchema>;
|
|
547
577
|
export type OpenWorkspaceCommand = z.infer<typeof openWorkspaceCommandSchema>;
|
|
@@ -549,6 +579,9 @@ export type ChooseFolderCommand = z.infer<typeof chooseFolderCommandSchema>;
|
|
|
549
579
|
export type OpenPathCommand = z.infer<typeof openPathCommandSchema>;
|
|
550
580
|
export type ImportDocumentCommand = z.infer<typeof importDocumentCommandSchema>;
|
|
551
581
|
export type RunSampleCommand = z.infer<typeof runSampleCommandSchema>;
|
|
582
|
+
export type AskUiCommand = z.infer<typeof askUiCommandSchema>;
|
|
583
|
+
export type StudioStatusCommand = z.infer<typeof studioStatusCommandSchema>;
|
|
584
|
+
export type RunStatusCommand = z.infer<typeof runStatusCommandSchema>;
|
|
552
585
|
export type StopRunCommand = z.infer<typeof stopRunCommandSchema>;
|
|
553
586
|
export type SaveRecipeCommand = z.infer<typeof saveRecipeCommandSchema>;
|
|
554
587
|
export type FetchStartPageCommand = z.infer<typeof fetchStartPageCommandSchema>;
|
|
@@ -87,6 +87,15 @@ 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
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<"open">;
|
|
95
|
+
path: z.ZodString;
|
|
96
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>], "kind">;
|
|
98
|
+
}, z.core.$strip>;
|
|
90
99
|
export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
100
|
type: z.ZodLiteral<"trace-line">;
|
|
92
101
|
line: z.ZodString;
|
|
@@ -139,7 +148,15 @@ export declare const studioEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
139
148
|
}, z.core.$strip>, z.ZodObject<{
|
|
140
149
|
type: z.ZodLiteral<"recording-stopped">;
|
|
141
150
|
steps: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
type: z.ZodLiteral<"ui-request">;
|
|
153
|
+
request: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"open">;
|
|
155
|
+
path: z.ZodString;
|
|
156
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>], "kind">;
|
|
142
158
|
}, z.core.$strip>], "type">;
|
|
159
|
+
export type UiRequestEvent = z.infer<typeof uiRequestEventSchema>;
|
|
143
160
|
export type StoppedBy = z.infer<typeof stoppedBySchema>;
|
|
144
161
|
export type TraceLineEvent = z.infer<typeof traceLineEventSchema>;
|
|
145
162
|
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, 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, 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, studioStatusViewSchema, runStatusViewSchema } from './studio-control-view.contract';
|
|
52
|
+
export type { AskUiView, StudioStatusView, RunStatusView } from './studio-control-view.contract';
|
|
49
53
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}, z.core.$strip>;
|
|
6
|
+
/** What Studio is doing: its workspace, how many pages are open, and the recipe whose sample run is in progress. */
|
|
7
|
+
export declare const studioStatusViewSchema: z.ZodObject<{
|
|
8
|
+
folder: z.ZodOptional<z.ZodString>;
|
|
9
|
+
pages: z.ZodNumber;
|
|
10
|
+
running: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
/** 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). */
|
|
13
|
+
export declare const runStatusViewSchema: z.ZodObject<{
|
|
14
|
+
recipeId: z.ZodString;
|
|
15
|
+
state: z.ZodEnum<{
|
|
16
|
+
finished: "finished";
|
|
17
|
+
"never-run": "never-run";
|
|
18
|
+
running: "running";
|
|
19
|
+
}>;
|
|
20
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
emitted: z.ZodNumber;
|
|
22
|
+
rejected: z.ZodNumber;
|
|
23
|
+
duplicates: z.ZodNumber;
|
|
24
|
+
durationMs: z.ZodNumber;
|
|
25
|
+
error: z.ZodOptional<z.ZodString>;
|
|
26
|
+
stoppedBy: z.ZodOptional<z.ZodString>;
|
|
27
|
+
records: z.ZodArray<z.ZodObject<{
|
|
28
|
+
key: z.ZodNullable<z.ZodString>;
|
|
29
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
rejections: z.ZodArray<z.ZodObject<{
|
|
32
|
+
field: z.ZodString;
|
|
33
|
+
reason: z.ZodString;
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type AskUiView = z.infer<typeof askUiViewSchema>;
|
|
39
|
+
export type StudioStatusView = z.infer<typeof studioStatusViewSchema>;
|
|
40
|
+
export type RunStatusView = z.infer<typeof runStatusViewSchema>;
|
|
41
|
+
//# sourceMappingURL=studio-control-view.contract.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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>], "kind">;
|
|
8
|
+
export type UiRequest = z.infer<typeof uiRequestSchema>;
|
|
9
|
+
//# sourceMappingURL=ui-request.contract.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StudioInstance } from './studio-instance.contract';
|
|
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,12 @@
|
|
|
1
|
+
import type { AskUiCommand, AskUiView } from '../studio-api';
|
|
2
|
+
import type { StudioState } from './workspace.store';
|
|
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.
|
|
6
|
+
*
|
|
7
|
+
* @param state - The server state holding the connected pages.
|
|
8
|
+
* @param command - What to ask the pages.
|
|
9
|
+
* @returns How many pages were listening; 0 means nobody has Studio open.
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleAskUi(state: StudioState, command: AskUiCommand): AskUiView;
|
|
12
|
+
//# sourceMappingURL=ask-ui.handler.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RunStatusCommand, RunStatusView } from '../studio-api';
|
|
2
|
+
import type { StudioState } from './workspace.store';
|
|
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';
|
|
2
|
+
import type { StudioState } from './workspace.store';
|
|
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
|
|
@@ -9,6 +9,8 @@ import type { WsConnection } from './websocket.client';
|
|
|
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>;
|