@histoire/cli 0.0.0-stage → 1.0.0-beta.2
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/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +88 -0
- package/dist/commands/dev.d.ts +44 -0
- package/dist/commands/dev.js +115 -0
- package/dist/commands/host.d.ts +66 -0
- package/dist/commands/host.js +1 -0
- package/dist/commands/screenshot-setup-args.d.ts +4 -0
- package/dist/commands/screenshot-setup-args.js +35 -0
- package/dist/commands/signal-guard.d.ts +29 -0
- package/dist/commands/signal-guard.js +52 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/terminal/actions.d.ts +51 -0
- package/dist/terminal/actions.js +60 -0
- package/dist/terminal/banner.d.ts +19 -0
- package/dist/terminal/banner.js +48 -0
- package/dist/terminal/bridge.d.ts +58 -0
- package/dist/terminal/bridge.js +103 -0
- package/dist/terminal/clipboard.d.ts +46 -0
- package/dist/terminal/clipboard.js +85 -0
- package/dist/terminal/diagnostics/attach.d.ts +9 -0
- package/dist/terminal/diagnostics/attach.js +46 -0
- package/dist/terminal/diagnostics/client.d.ts +12 -0
- package/dist/terminal/diagnostics/client.js +19 -0
- package/dist/terminal/diagnostics/lines.d.ts +17 -0
- package/dist/terminal/diagnostics/lines.js +61 -0
- package/dist/terminal/dispatch.d.ts +28 -0
- package/dist/terminal/dispatch.js +52 -0
- package/dist/terminal/feedback.d.ts +14 -0
- package/dist/terminal/feedback.js +27 -0
- package/dist/terminal/history/bounded.d.ts +37 -0
- package/dist/terminal/history/bounded.js +54 -0
- package/dist/terminal/host-extras.d.ts +14 -0
- package/dist/terminal/host-extras.js +26 -0
- package/dist/terminal/info/client.d.ts +20 -0
- package/dist/terminal/info/client.js +25 -0
- package/dist/terminal/info/generation-client.d.ts +33 -0
- package/dist/terminal/info/generation-client.js +32 -0
- package/dist/terminal/info/lines.d.ts +19 -0
- package/dist/terminal/info/lines.js +33 -0
- package/dist/terminal/info/network.d.ts +17 -0
- package/dist/terminal/info/network.js +48 -0
- package/dist/terminal/info/qr.d.ts +7 -0
- package/dist/terminal/info/qr.js +14 -0
- package/dist/terminal/keys.d.ts +44 -0
- package/dist/terminal/keys.js +60 -0
- package/dist/terminal/logs/browser-options.d.ts +9 -0
- package/dist/terminal/logs/browser-options.js +19 -0
- package/dist/terminal/navigation/browser.d.ts +69 -0
- package/dist/terminal/navigation/browser.js +193 -0
- package/dist/terminal/navigation/list.d.ts +53 -0
- package/dist/terminal/navigation/list.js +104 -0
- package/dist/terminal/navigation/search.d.ts +22 -0
- package/dist/terminal/navigation/search.js +44 -0
- package/dist/terminal/output/decoder.d.ts +24 -0
- package/dist/terminal/output/decoder.js +63 -0
- package/dist/terminal/output/history.d.ts +43 -0
- package/dist/terminal/output/history.js +21 -0
- package/dist/terminal/output/pipeline.d.ts +33 -0
- package/dist/terminal/output/pipeline.js +59 -0
- package/dist/terminal/output/sanitize.d.ts +32 -0
- package/dist/terminal/output/sanitize.js +142 -0
- package/dist/terminal/panel-model.d.ts +20 -0
- package/dist/terminal/panel-model.js +38 -0
- package/dist/terminal/panel.d.ts +30 -0
- package/dist/terminal/panel.js +53 -0
- package/dist/terminal/plain.d.ts +29 -0
- package/dist/terminal/plain.js +68 -0
- package/dist/terminal/progress/format.d.ts +28 -0
- package/dist/terminal/progress/format.js +77 -0
- package/dist/terminal/progress/state.d.ts +71 -0
- package/dist/terminal/progress/state.js +150 -0
- package/dist/terminal/protocol/catalog.d.ts +143 -0
- package/dist/terminal/protocol/catalog.js +61 -0
- package/dist/terminal/protocol/core.d.ts +117 -0
- package/dist/terminal/protocol/core.js +98 -0
- package/dist/terminal/protocol/diagnostics.d.ts +79 -0
- package/dist/terminal/protocol/diagnostics.js +31 -0
- package/dist/terminal/protocol/index.d.ts +22 -0
- package/dist/terminal/protocol/index.js +1 -0
- package/dist/terminal/protocol/progress.d.ts +67 -0
- package/dist/terminal/protocol/progress.js +52 -0
- package/dist/terminal/protocol/requests.d.ts +30 -0
- package/dist/terminal/protocol/requests.js +13 -0
- package/dist/terminal/protocol/session.d.ts +55 -0
- package/dist/terminal/protocol/session.js +28 -0
- package/dist/terminal/protocol/tests.d.ts +212 -0
- package/dist/terminal/protocol/tests.js +87 -0
- package/dist/terminal/protocol/watch.d.ts +60 -0
- package/dist/terminal/protocol/watch.js +40 -0
- package/dist/terminal/requests/browser-options.d.ts +8 -0
- package/dist/terminal/requests/browser-options.js +24 -0
- package/dist/terminal/requests/history.d.ts +30 -0
- package/dist/terminal/requests/history.js +53 -0
- package/dist/terminal/retained.d.ts +27 -0
- package/dist/terminal/retained.js +21 -0
- package/dist/terminal/session-types.d.ts +76 -0
- package/dist/terminal/session-types.js +1 -0
- package/dist/terminal/session.d.ts +8 -0
- package/dist/terminal/session.js +282 -0
- package/dist/terminal/shutdown.d.ts +12 -0
- package/dist/terminal/shutdown.js +30 -0
- package/dist/terminal/stories/client.d.ts +26 -0
- package/dist/terminal/stories/client.js +28 -0
- package/dist/terminal/stories/handoff.d.ts +39 -0
- package/dist/terminal/stories/handoff.js +40 -0
- package/dist/terminal/stories/paged.d.ts +70 -0
- package/dist/terminal/stories/paged.js +137 -0
- package/dist/terminal/stories/render.d.ts +39 -0
- package/dist/terminal/stories/render.js +94 -0
- package/dist/terminal/stories/state.d.ts +93 -0
- package/dist/terminal/stories/state.js +191 -0
- package/dist/terminal/stories/target.d.ts +24 -0
- package/dist/terminal/stories/target.js +29 -0
- package/dist/terminal/style.d.ts +45 -0
- package/dist/terminal/style.js +82 -0
- package/dist/terminal/support.d.ts +53 -0
- package/dist/terminal/support.js +66 -0
- package/dist/terminal/surface.d.ts +41 -0
- package/dist/terminal/surface.js +200 -0
- package/dist/terminal/tests/client.d.ts +21 -0
- package/dist/terminal/tests/client.js +12 -0
- package/dist/terminal/tests/console.d.ts +95 -0
- package/dist/terminal/tests/console.js +202 -0
- package/dist/terminal/tests/format.d.ts +18 -0
- package/dist/terminal/tests/format.js +55 -0
- package/dist/terminal/tests/header.d.ts +16 -0
- package/dist/terminal/tests/header.js +90 -0
- package/dist/terminal/tests/reporter.d.ts +17 -0
- package/dist/terminal/tests/reporter.js +99 -0
- package/dist/terminal/tests/results.d.ts +44 -0
- package/dist/terminal/tests/results.js +104 -0
- package/dist/terminal/tests/scope.d.ts +25 -0
- package/dist/terminal/tests/scope.js +25 -0
- package/dist/terminal/tests/session.d.ts +11 -0
- package/dist/terminal/tests/session.js +24 -0
- package/dist/terminal/tests/state.d.ts +57 -0
- package/dist/terminal/tests/state.js +134 -0
- package/dist/terminal/views/clear-history.d.ts +6 -0
- package/dist/terminal/views/clear-history.js +10 -0
- package/dist/terminal/views/error.d.ts +8 -0
- package/dist/terminal/views/error.js +24 -0
- package/dist/terminal/views/frame.d.ts +20 -0
- package/dist/terminal/views/frame.js +23 -0
- package/dist/terminal/views/help.d.ts +3 -0
- package/dist/terminal/views/help.js +32 -0
- package/dist/terminal/views/index.d.ts +6 -0
- package/dist/terminal/views/index.js +13 -0
- package/dist/terminal/views/logs.d.ts +3 -0
- package/dist/terminal/views/logs.js +7 -0
- package/dist/terminal/views/registry.d.ts +114 -0
- package/dist/terminal/views/registry.js +40 -0
- package/dist/terminal/views/requests.d.ts +8 -0
- package/dist/terminal/views/requests.js +15 -0
- package/dist/terminal/views/session.d.ts +9 -0
- package/dist/terminal/views/session.js +133 -0
- package/dist/terminal/views/stories.d.ts +9 -0
- package/dist/terminal/views/stories.js +172 -0
- package/dist/terminal/views/tests.d.ts +9 -0
- package/dist/terminal/views/tests.js +105 -0
- package/dist/terminal/watch/client.d.ts +12 -0
- package/dist/terminal/watch/client.js +7 -0
- package/dist/terminal/watch/controller.d.ts +30 -0
- package/dist/terminal/watch/controller.js +157 -0
- package/dist/terminal/watch/format.d.ts +15 -0
- package/dist/terminal/watch/format.js +37 -0
- package/dist/terminal/watch/session.d.ts +17 -0
- package/dist/terminal/watch/session.js +12 -0
- package/dist/terminal/width.d.ts +24 -0
- package/dist/terminal/width.js +171 -0
- package/dist/workbench-url.d.ts +30 -0
- package/dist/workbench-url.js +55 -0
- package/package.json +54 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CatalogEvents, CatalogOperations } from './catalog.js';
|
|
2
|
+
import type { CoreEvents, CoreOperations } from './core.js';
|
|
3
|
+
import type { DiagnosticsOperations } from './diagnostics.js';
|
|
4
|
+
import type { ProgressEvents } from './progress.js';
|
|
5
|
+
import type { SessionOperations } from './session.js';
|
|
6
|
+
import type { TestEvents, TestOperations } from './tests.js';
|
|
7
|
+
import type { WatchEvents, WatchOperations } from './watch.js';
|
|
8
|
+
export type { CatalogEvents, CatalogListArgs, CatalogListPage, CatalogOperations, CatalogStateDto, CatalogStoryDto, CatalogVariantDto, CatalogVariantsArgs, CatalogVariantsPage, CatalogWorkbenchDto, } from './catalog.js';
|
|
9
|
+
/** Flattens an intersection into one anonymous object type, which (unlike the intersection) satisfies `TerminalOperationMap`'s index signature. */
|
|
10
|
+
type Flatten<T> = {
|
|
11
|
+
[K in keyof T]: T[K];
|
|
12
|
+
};
|
|
13
|
+
/** Every operation the parent may send; domain slices intersect their map here. */
|
|
14
|
+
export type TerminalOperations = Flatten<CoreOperations & CatalogOperations & SessionOperations & DiagnosticsOperations & TestOperations & WatchOperations>;
|
|
15
|
+
/** Every event the child may emit; domain slices intersect their map here. */
|
|
16
|
+
export type TerminalEvents = CoreEvents & CatalogEvents & ProgressEvents & TestEvents & WatchEvents;
|
|
17
|
+
export type { CoreEvents, CoreOperations, TerminalErrorCode, TerminalEventMap, TerminalLogEvent, TerminalLogLevel, TerminalOperationDefinition, TerminalOperationMap, } from './core.js';
|
|
18
|
+
export type { DiagnosticIssueDto, DiagnosticsCollectionDto, DiagnosticsDto, DiagnosticsMcpDto, DiagnosticsOperations } from './diagnostics.js';
|
|
19
|
+
export type { ProgressEvent, ProgressEvents, ProgressStatus, RestartCause, RestartCauseKind, RestartRequest, StartupPhaseId, } from './progress.js';
|
|
20
|
+
export type { SessionCollectionDto, SessionInfoDto, SessionMcpDto, SessionOperations } from './session.js';
|
|
21
|
+
export type { TestCaseDto, TestEvents, TestOperationDto, TestOperations, TestOperationState, TestProgressDto, TestResultsPage, TestSummaryDto, TestTarget, TestTargetDto, } from './tests.js';
|
|
22
|
+
export type { WatchEvents, WatchOperations, WatchPhase, WatchSetArgs, WatchStateDto } from './watch.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Startup progress and restart-cause DTOs. Type-and-constant only, so the parent
|
|
3
|
+
* can load it before binding its listener.
|
|
4
|
+
*/
|
|
5
|
+
import type { RestartCause, RestartCauseKind, RestartRequest } from '@histoire/dev-proxy/protocol';
|
|
6
|
+
export type { RestartCause, RestartCauseKind, RestartRequest };
|
|
7
|
+
/** Real units of startup work, in the order they usually begin. Several may run at once. */
|
|
8
|
+
declare const STARTUP_PHASES: readonly [
|
|
9
|
+
/** Loading Histoire and Vite configuration (including plugin construction). */
|
|
10
|
+
'config',
|
|
11
|
+
/** Creating the collection and client Vite servers. */
|
|
12
|
+
'vite',
|
|
13
|
+
/** Scanning story files. */
|
|
14
|
+
'scan',
|
|
15
|
+
/** Associating Markdown files with stories. */
|
|
16
|
+
'markdown',
|
|
17
|
+
/** Running plugin `onDev` hooks; the label names the current plugin. */
|
|
18
|
+
'plugins',
|
|
19
|
+
/** Listening, which includes Vite dependency pre-bundling. */
|
|
20
|
+
'listen',
|
|
21
|
+
/** Restoring the cached catalog; `skipped` when bypassed or unusable. */
|
|
22
|
+
'restore',
|
|
23
|
+
/** Collecting stories; carries loaded/total file counts. */
|
|
24
|
+
'collect',
|
|
25
|
+
/** Warming the client (foreground, gates readiness). */
|
|
26
|
+
'warmup',
|
|
27
|
+
/** Attaching the canonical catalog and optional services. */
|
|
28
|
+
'attach',
|
|
29
|
+
/** Background revalidation of a restored catalog; never gates readiness. */
|
|
30
|
+
'revalidate'];
|
|
31
|
+
/** Identifier of one startup phase. */
|
|
32
|
+
export type StartupPhaseId = typeof STARTUP_PHASES[number];
|
|
33
|
+
/** Lifecycle step of one phase. */
|
|
34
|
+
export type ProgressStatus = 'started' | 'updated' | 'completed' | 'failed' | 'skipped';
|
|
35
|
+
/** Payload of the `progress` runtime event; the envelope carries the generation. */
|
|
36
|
+
export interface ProgressEvent {
|
|
37
|
+
phase: StartupPhaseId;
|
|
38
|
+
status: ProgressStatus;
|
|
39
|
+
/** Current detail such as a plugin name or sub-step. */
|
|
40
|
+
label?: string;
|
|
41
|
+
/** Loaded units; only sent together with a real `total`. */
|
|
42
|
+
current?: number;
|
|
43
|
+
/** Real denominator (collector story file count). */
|
|
44
|
+
total?: number;
|
|
45
|
+
/** Monotonic child-side duration, on `completed` and `failed`. */
|
|
46
|
+
durationMs?: number;
|
|
47
|
+
/** Work that does not gate readiness. */
|
|
48
|
+
background?: boolean;
|
|
49
|
+
/** First line of the failure (bounded), on `failed`. */
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Events added by this slice to the terminal event map. */
|
|
53
|
+
export interface ProgressEvents {
|
|
54
|
+
progress: ProgressEvent;
|
|
55
|
+
}
|
|
56
|
+
/** Longest retained failure line. */
|
|
57
|
+
export declare const PROGRESS_ERROR_LENGTH = 512;
|
|
58
|
+
/**
|
|
59
|
+
* First line of an error, bounded for the wire.
|
|
60
|
+
* @param error Thrown value.
|
|
61
|
+
*/
|
|
62
|
+
export declare function describeProgressError(error: unknown): string;
|
|
63
|
+
/**
|
|
64
|
+
* Validates an untrusted `progress` event payload from the child.
|
|
65
|
+
* @param value Candidate payload.
|
|
66
|
+
*/
|
|
67
|
+
export declare function isProgressEvent(value: unknown): value is ProgressEvent;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { truncateText } from './core.js';
|
|
2
|
+
/** Real units of startup work, in the order they usually begin. Several may run at once. */
|
|
3
|
+
const STARTUP_PHASES = [
|
|
4
|
+
/** Loading Histoire and Vite configuration (including plugin construction). */
|
|
5
|
+
'config',
|
|
6
|
+
/** Creating the collection and client Vite servers. */
|
|
7
|
+
'vite',
|
|
8
|
+
/** Scanning story files. */
|
|
9
|
+
'scan',
|
|
10
|
+
/** Associating Markdown files with stories. */
|
|
11
|
+
'markdown',
|
|
12
|
+
/** Running plugin `onDev` hooks; the label names the current plugin. */
|
|
13
|
+
'plugins',
|
|
14
|
+
/** Listening, which includes Vite dependency pre-bundling. */
|
|
15
|
+
'listen',
|
|
16
|
+
/** Restoring the cached catalog; `skipped` when bypassed or unusable. */
|
|
17
|
+
'restore',
|
|
18
|
+
/** Collecting stories; carries loaded/total file counts. */
|
|
19
|
+
'collect',
|
|
20
|
+
/** Warming the client (foreground, gates readiness). */
|
|
21
|
+
'warmup',
|
|
22
|
+
/** Attaching the canonical catalog and optional services. */
|
|
23
|
+
'attach',
|
|
24
|
+
/** Background revalidation of a restored catalog; never gates readiness. */
|
|
25
|
+
'revalidate',
|
|
26
|
+
];
|
|
27
|
+
/** Longest retained failure line. */
|
|
28
|
+
export const PROGRESS_ERROR_LENGTH = 512;
|
|
29
|
+
/**
|
|
30
|
+
* First line of an error, bounded for the wire.
|
|
31
|
+
* @param error Thrown value.
|
|
32
|
+
*/
|
|
33
|
+
export function describeProgressError(error) {
|
|
34
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
35
|
+
return truncateText(message.split('\n')[0], PROGRESS_ERROR_LENGTH).text;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Validates an untrusted `progress` event payload from the child.
|
|
39
|
+
* @param value Candidate payload.
|
|
40
|
+
*/
|
|
41
|
+
export function isProgressEvent(value) {
|
|
42
|
+
if (!value || typeof value !== 'object')
|
|
43
|
+
return false;
|
|
44
|
+
const event = value;
|
|
45
|
+
const number = (field) => field === undefined || (typeof field === 'number' && Number.isFinite(field) && field >= 0);
|
|
46
|
+
return STARTUP_PHASES.includes(event.phase)
|
|
47
|
+
&& ['started', 'updated', 'completed', 'failed', 'skipped'].includes(event.status)
|
|
48
|
+
&& (event.label === undefined || typeof event.label === 'string')
|
|
49
|
+
&& number(event.current) && number(event.total) && number(event.durationMs)
|
|
50
|
+
&& (event.background === undefined || typeof event.background === 'boolean')
|
|
51
|
+
&& (event.error === undefined || typeof event.error === 'string');
|
|
52
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP request record (slice 06). Type-and-constant only so the parent can load it before
|
|
3
|
+
* binding its listener. A record holds no query, header, cookie, body or credential.
|
|
4
|
+
*/
|
|
5
|
+
/** How a public HTTP exchange ended. */
|
|
6
|
+
export type RequestOutcome = 'completed' | 'failed' | 'aborted';
|
|
7
|
+
/** Retained summary of one public HTTP exchange. */
|
|
8
|
+
export interface RequestRecord {
|
|
9
|
+
/** Stable, strictly increasing session identifier (parent-assigned). */
|
|
10
|
+
id: number;
|
|
11
|
+
/** HTTP method. */
|
|
12
|
+
method: string;
|
|
13
|
+
/** Sanitized pathname without query or fragment, possibly cut at {@link REQUEST_BOUNDS.pathLength}. */
|
|
14
|
+
pathname: string;
|
|
15
|
+
/** Response status when headers were sent. */
|
|
16
|
+
status?: number;
|
|
17
|
+
/** Completed, failed (5xx or proxy failure) or aborted (client response incomplete). */
|
|
18
|
+
outcome: RequestOutcome;
|
|
19
|
+
/** Monotonic duration in milliseconds. */
|
|
20
|
+
durationMs: number;
|
|
21
|
+
}
|
|
22
|
+
/** Bounds of request retention beyond the 500 completed entries of the shared contract. */
|
|
23
|
+
export declare const REQUEST_BOUNDS: {
|
|
24
|
+
/** Longest retained pathname (UTF-16 units). */
|
|
25
|
+
readonly pathLength: 1024;
|
|
26
|
+
/** Longest retained method. */
|
|
27
|
+
readonly methodLength: 16;
|
|
28
|
+
/** In-flight exchanges tracked at once; older ones stop being tracked but still produce their record when they end. */
|
|
29
|
+
readonly inFlight: 256;
|
|
30
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP request record (slice 06). Type-and-constant only so the parent can load it before
|
|
3
|
+
* binding its listener. A record holds no query, header, cookie, body or credential.
|
|
4
|
+
*/
|
|
5
|
+
/** Bounds of request retention beyond the 500 completed entries of the shared contract. */
|
|
6
|
+
export const REQUEST_BOUNDS = {
|
|
7
|
+
/** Longest retained pathname (UTF-16 units). */
|
|
8
|
+
pathLength: 1024,
|
|
9
|
+
/** Longest retained method. */
|
|
10
|
+
methodLength: 16,
|
|
11
|
+
/** In-flight exchanges tracked at once; older ones stop being tracked but still produce their record when they end. */
|
|
12
|
+
inFlight: 256,
|
|
13
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Longest retained string of the session DTO (paths, versions, URLs). */
|
|
2
|
+
export declare const SESSION_TEXT_MAX = 1024;
|
|
3
|
+
/** Collection summary of the current generation; absent until a collection completed. */
|
|
4
|
+
export interface SessionCollectionDto {
|
|
5
|
+
/** Registered stories in the completed catalog. */
|
|
6
|
+
stories: number;
|
|
7
|
+
/** Variants across those stories. */
|
|
8
|
+
variants: number;
|
|
9
|
+
/** Completed collection category. */
|
|
10
|
+
outcome: 'success' | 'partial' | 'failed';
|
|
11
|
+
/** Bounded safe issues of the collection. */
|
|
12
|
+
diagnostics: number;
|
|
13
|
+
}
|
|
14
|
+
/** Optional MCP adapter state; the bearer credential is never part of it. */
|
|
15
|
+
export interface SessionMcpDto {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
/** Actual bound URL when the adapter listens. */
|
|
18
|
+
url?: string;
|
|
19
|
+
/** A bearer token is required by clients. */
|
|
20
|
+
tokenRequired?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Result of `session.get`: facts only the current runtime generation knows. */
|
|
23
|
+
export interface SessionInfoDto {
|
|
24
|
+
/** Installed Histoire version of the runtime. */
|
|
25
|
+
histoire: string;
|
|
26
|
+
/** Node.js version of the runtime process. */
|
|
27
|
+
node: string;
|
|
28
|
+
/** Vite version loaded by the runtime. */
|
|
29
|
+
vite: string;
|
|
30
|
+
/** Project root. */
|
|
31
|
+
root: string;
|
|
32
|
+
/** Resolved Histoire config file; absent when none exists. */
|
|
33
|
+
configFile?: string;
|
|
34
|
+
/** Completed collection summary. */
|
|
35
|
+
collection?: SessionCollectionDto;
|
|
36
|
+
/** MCP adapter state. */
|
|
37
|
+
mcp: SessionMcpDto;
|
|
38
|
+
}
|
|
39
|
+
/** Operations added by the session domain. */
|
|
40
|
+
export interface SessionOperations {
|
|
41
|
+
'session.get': {
|
|
42
|
+
args: Record<string, never>;
|
|
43
|
+
result: SessionInfoDto;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Bounds a text field of the DTO.
|
|
48
|
+
* @param value Candidate text.
|
|
49
|
+
*/
|
|
50
|
+
export declare function boundSessionText(value: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Validates an untrusted `session.get` result in the parent; anything else is discarded.
|
|
53
|
+
* @param value Candidate payload.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isSessionInfo(value: unknown): value is SessionInfoDto;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session information DTOs (slice 04). Type-and-constant only, so the parent can
|
|
3
|
+
* load it before binding its listener. Contains no credentials and no environment.
|
|
4
|
+
*/
|
|
5
|
+
import { TERMINAL_BOUNDS, truncateText } from './core.js';
|
|
6
|
+
/** Longest retained string of the session DTO (paths, versions, URLs). */
|
|
7
|
+
export const SESSION_TEXT_MAX = 1024;
|
|
8
|
+
/**
|
|
9
|
+
* Bounds a text field of the DTO.
|
|
10
|
+
* @param value Candidate text.
|
|
11
|
+
*/
|
|
12
|
+
export function boundSessionText(value) {
|
|
13
|
+
return truncateText(value, SESSION_TEXT_MAX).text;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Validates an untrusted `session.get` result in the parent; anything else is discarded.
|
|
17
|
+
* @param value Candidate payload.
|
|
18
|
+
*/
|
|
19
|
+
export function isSessionInfo(value) {
|
|
20
|
+
if (!value || typeof value !== 'object')
|
|
21
|
+
return false;
|
|
22
|
+
const info = value;
|
|
23
|
+
const text = (field) => typeof field === 'string' && field.length <= TERMINAL_BOUNDS.logTextLength;
|
|
24
|
+
const mcp = info.mcp;
|
|
25
|
+
return text(info.histoire) && text(info.node) && text(info.vite) && text(info.root)
|
|
26
|
+
&& (info.configFile === undefined || text(info.configFile))
|
|
27
|
+
&& !!mcp && typeof mcp === 'object' && typeof mcp.enabled === 'boolean' && (mcp.url === undefined || text(mcp.url));
|
|
28
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { TerminalOperationDefinition } from './core.js';
|
|
2
|
+
/** Lifecycle of one terminal test operation; `cancelling` lasts until cleanup is confirmed. */
|
|
3
|
+
export type TestOperationState = 'queued' | 'running' | 'cancelling' | 'completed' | 'failed' | 'cancelled';
|
|
4
|
+
/** Operation states that never change again. */
|
|
5
|
+
export declare const TEST_FINAL_STATES: readonly TestOperationState[];
|
|
6
|
+
/** Exact target a parent may request. */
|
|
7
|
+
export type TestTarget = {
|
|
8
|
+
scope: 'all';
|
|
9
|
+
} | {
|
|
10
|
+
scope: 'story';
|
|
11
|
+
storyId: string;
|
|
12
|
+
} | {
|
|
13
|
+
scope: 'variant';
|
|
14
|
+
storyId: string;
|
|
15
|
+
variantId: string;
|
|
16
|
+
};
|
|
17
|
+
/** Target as reported back; affected batches (child-internal) carry a bounded story list. */
|
|
18
|
+
export type TestTargetDto = TestTarget | {
|
|
19
|
+
scope: 'affected';
|
|
20
|
+
count: number;
|
|
21
|
+
storyIds: string[];
|
|
22
|
+
};
|
|
23
|
+
/** Most story IDs echoed for an affected batch; `count` keeps the real size. */
|
|
24
|
+
export declare const TEST_AFFECTED_ECHO = 20;
|
|
25
|
+
/** Progress of a running operation; counters never mix collection with run totals. */
|
|
26
|
+
export interface TestProgressDto {
|
|
27
|
+
/** Phase of the story currently executing. */
|
|
28
|
+
phase: 'collect' | 'run';
|
|
29
|
+
/** Specs finished in that phase for the current story (or the whole run). */
|
|
30
|
+
completed: number;
|
|
31
|
+
/** Specs in that phase. */
|
|
32
|
+
total: number;
|
|
33
|
+
/** Stories finished of an affected batch; absent for single-target runs. */
|
|
34
|
+
stories?: {
|
|
35
|
+
completed: number;
|
|
36
|
+
total: number;
|
|
37
|
+
current?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Why a result is not (or no longer) readable (`retired` is produced by the parent for a replaced generation). */
|
|
41
|
+
export type TestUnavailableReason = 'evicted' | 'unknown' | 'running' | 'retired';
|
|
42
|
+
/** Machine-readable operation failure. */
|
|
43
|
+
export interface TestFailureDto {
|
|
44
|
+
/** Stable code (SDK error code, `CANCELLED`, `RUNTIME_CHANGED`, ...). */
|
|
45
|
+
code: string;
|
|
46
|
+
/** First line of the failure, bounded. */
|
|
47
|
+
message: string;
|
|
48
|
+
}
|
|
49
|
+
/** One story that could not be collected, so its tests are unknown. */
|
|
50
|
+
export interface TestUncollectedDto {
|
|
51
|
+
/** Story path relative to the project root. */
|
|
52
|
+
relativePath: string;
|
|
53
|
+
/** Bounded reason. */
|
|
54
|
+
error: string;
|
|
55
|
+
}
|
|
56
|
+
/** Aggregate of a completed run; totals are exact even when cases are omitted. */
|
|
57
|
+
export interface TestSummaryDto {
|
|
58
|
+
/** No failed assertion, run error or uncollected story. */
|
|
59
|
+
ok: boolean;
|
|
60
|
+
/** Total executed cases. */
|
|
61
|
+
total: number;
|
|
62
|
+
/** Passed cases. */
|
|
63
|
+
passed: number;
|
|
64
|
+
/** Failed cases. */
|
|
65
|
+
failed: number;
|
|
66
|
+
/** Skipped cases. */
|
|
67
|
+
skipped: number;
|
|
68
|
+
/** Cases retained and pageable (failures first). */
|
|
69
|
+
retainedCases: number;
|
|
70
|
+
/** Cases dropped by retention bounds; their counts remain in the totals. */
|
|
71
|
+
omittedCases: number;
|
|
72
|
+
/** Run-level errors that no case owns (bounded text). */
|
|
73
|
+
runErrors: string[];
|
|
74
|
+
/** Run-level errors beyond the retained ones. */
|
|
75
|
+
omittedRunErrors: number;
|
|
76
|
+
/** Uncollected stories (bounded list). */
|
|
77
|
+
uncollected: TestUncollectedDto[];
|
|
78
|
+
/** Uncollected stories beyond the retained ones. */
|
|
79
|
+
omittedUncollected: number;
|
|
80
|
+
}
|
|
81
|
+
/** Detached snapshot of one operation; carried by replies and `tests.state` events. */
|
|
82
|
+
export interface TestOperationDto {
|
|
83
|
+
/** Opaque ID, unique within the generation. */
|
|
84
|
+
id: string;
|
|
85
|
+
/** Current lifecycle state. */
|
|
86
|
+
state: TestOperationState;
|
|
87
|
+
/** Requested target. */
|
|
88
|
+
target: TestTargetDto;
|
|
89
|
+
/** Runtime epoch that admitted the operation. */
|
|
90
|
+
epoch: string;
|
|
91
|
+
/** Catalog revision captured at admission. */
|
|
92
|
+
revision: string;
|
|
93
|
+
/** Cancellation was requested (state may still be running until cleanup). */
|
|
94
|
+
cancelRequested: boolean;
|
|
95
|
+
/** Latest progress, while queued/running/cancelling. */
|
|
96
|
+
progress?: TestProgressDto;
|
|
97
|
+
/** Aggregate, only when `completed`. */
|
|
98
|
+
summary?: TestSummaryDto;
|
|
99
|
+
/** Failure, only when `failed` (or cancelled by a fence). */
|
|
100
|
+
failure?: TestFailureDto;
|
|
101
|
+
/** Admission time, ms since epoch. */
|
|
102
|
+
queuedAt: number;
|
|
103
|
+
/** Lane start, ms since epoch. */
|
|
104
|
+
startedAt?: number;
|
|
105
|
+
/** Terminal time, ms since epoch. */
|
|
106
|
+
finishedAt?: number;
|
|
107
|
+
}
|
|
108
|
+
/** One pageable case result. */
|
|
109
|
+
export interface TestCaseDto {
|
|
110
|
+
/** Test identity within its variant. */
|
|
111
|
+
id: string;
|
|
112
|
+
/** Display name. */
|
|
113
|
+
name: string;
|
|
114
|
+
/** Suite-qualified name. */
|
|
115
|
+
fullName: string;
|
|
116
|
+
/** Assertion state. */
|
|
117
|
+
state: 'passed' | 'failed' | 'skipped';
|
|
118
|
+
/** Story owning the case. */
|
|
119
|
+
storyId?: string;
|
|
120
|
+
/** Variant owning the case. */
|
|
121
|
+
variantId?: string;
|
|
122
|
+
/** Bounded failure text blocks. */
|
|
123
|
+
errors: string[];
|
|
124
|
+
/** Set when one entry exceeded its byte bound and its errors were dropped. */
|
|
125
|
+
unavailable?: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** Arguments of `tests.run`. */
|
|
128
|
+
export interface TestRunArgs {
|
|
129
|
+
/** Exact target. */
|
|
130
|
+
target: TestTarget;
|
|
131
|
+
/** Refuse admission when the catalog moved past this revision. */
|
|
132
|
+
expectedRevision?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Arguments of `tests.get` and `tests.cancel`. */
|
|
135
|
+
export interface TestOperationArgs {
|
|
136
|
+
/** Exact operation. */
|
|
137
|
+
operationId: string;
|
|
138
|
+
}
|
|
139
|
+
/** Arguments of `tests.results`. */
|
|
140
|
+
export interface TestResultsArgs {
|
|
141
|
+
/** Exact operation. */
|
|
142
|
+
operationId: string;
|
|
143
|
+
/** Opaque cursor from the previous page; absent for the first. */
|
|
144
|
+
cursor?: string;
|
|
145
|
+
/** Cases per page, 1..100 (default 100); also byte-bounded. */
|
|
146
|
+
limit?: number;
|
|
147
|
+
/** Only failed cases. */
|
|
148
|
+
failedOnly?: boolean;
|
|
149
|
+
}
|
|
150
|
+
/** Result of `tests.results`. */
|
|
151
|
+
export interface TestResultsPage {
|
|
152
|
+
/** Exact operation. */
|
|
153
|
+
operationId: string;
|
|
154
|
+
/** Absent when the page is readable; otherwise why not. Never an instruction to rerun. */
|
|
155
|
+
unavailable?: TestUnavailableReason;
|
|
156
|
+
/** Cases of this page. */
|
|
157
|
+
cases: TestCaseDto[];
|
|
158
|
+
/** Cursor of the next page, absent at the end. */
|
|
159
|
+
next?: string;
|
|
160
|
+
/** Cases matching the filter, retained. */
|
|
161
|
+
total: number;
|
|
162
|
+
}
|
|
163
|
+
/** Operation map merged into `TerminalOperations`. */
|
|
164
|
+
export interface TestOperations {
|
|
165
|
+
'tests.run': TerminalOperationDefinition<TestRunArgs, TestOperationDto>;
|
|
166
|
+
'tests.get': TerminalOperationDefinition<TestOperationArgs, TestOperationDto>;
|
|
167
|
+
'tests.results': TerminalOperationDefinition<TestResultsArgs, TestResultsPage>;
|
|
168
|
+
'tests.cancel': TerminalOperationDefinition<TestOperationArgs, TestOperationDto>;
|
|
169
|
+
}
|
|
170
|
+
/** Payload of the `tests.progress` event (throttled). */
|
|
171
|
+
export interface TestProgressEvent {
|
|
172
|
+
/** Operation the progress belongs to. */
|
|
173
|
+
operationId: string;
|
|
174
|
+
/** Latest progress. */
|
|
175
|
+
progress: TestProgressDto;
|
|
176
|
+
}
|
|
177
|
+
/** Events merged into `TerminalEvents`. */
|
|
178
|
+
export interface TestEvents {
|
|
179
|
+
/** Every state transition, with the full operation snapshot. */
|
|
180
|
+
'tests.state': TestOperationDto;
|
|
181
|
+
/** Progress while running. */
|
|
182
|
+
'tests.progress': TestProgressEvent;
|
|
183
|
+
}
|
|
184
|
+
/** Largest page of cases by serialized UTF-8 bytes, below the frame bound. */
|
|
185
|
+
export declare const TEST_PAGE_BYTES: number;
|
|
186
|
+
/** Longest affected story list accepted by the child-internal batch. */
|
|
187
|
+
export declare const TEST_AFFECTED_MAX = 2000;
|
|
188
|
+
/**
|
|
189
|
+
* Validates untrusted `tests.run` arguments.
|
|
190
|
+
* @param value Detached JSON from the parent.
|
|
191
|
+
*/
|
|
192
|
+
export declare function parseTestRunArgs(value: unknown): TestRunArgs;
|
|
193
|
+
/**
|
|
194
|
+
* Validates untrusted `tests.get`/`tests.cancel` arguments.
|
|
195
|
+
* @param value Detached JSON from the parent.
|
|
196
|
+
*/
|
|
197
|
+
export declare function parseTestOperationArgs(value: unknown): TestOperationArgs;
|
|
198
|
+
/**
|
|
199
|
+
* Validates untrusted `tests.results` arguments.
|
|
200
|
+
* @param value Detached JSON from the parent.
|
|
201
|
+
*/
|
|
202
|
+
export declare function parseTestResultsArgs(value: unknown): TestResultsArgs;
|
|
203
|
+
/**
|
|
204
|
+
* Shape check for an operation snapshot arriving from the child (events/replies).
|
|
205
|
+
* @param value Candidate payload.
|
|
206
|
+
*/
|
|
207
|
+
export declare function isTestOperationDto(value: unknown): value is TestOperationDto;
|
|
208
|
+
/**
|
|
209
|
+
* Shape check for a `tests.progress` event payload.
|
|
210
|
+
* @param value Candidate payload.
|
|
211
|
+
*/
|
|
212
|
+
export declare function isTestProgressEvent(value: unknown): value is TestProgressEvent;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { invalidArgument, isTerminalId, rejectUnknownKeys, requireRecord, TERMINAL_BOUNDS } from './core.js';
|
|
2
|
+
/** Operation states that never change again. */
|
|
3
|
+
export const TEST_FINAL_STATES = ['completed', 'failed', 'cancelled'];
|
|
4
|
+
/** Most story IDs echoed for an affected batch; `count` keeps the real size. */
|
|
5
|
+
export const TEST_AFFECTED_ECHO = 20;
|
|
6
|
+
/** Largest page of cases by serialized UTF-8 bytes, below the frame bound. */
|
|
7
|
+
export const TEST_PAGE_BYTES = 192 * 1024;
|
|
8
|
+
/** Longest affected story list accepted by the child-internal batch. */
|
|
9
|
+
export const TEST_AFFECTED_MAX = 2000;
|
|
10
|
+
/**
|
|
11
|
+
* Validates untrusted `tests.run` arguments.
|
|
12
|
+
* @param value Detached JSON from the parent.
|
|
13
|
+
*/
|
|
14
|
+
export function parseTestRunArgs(value) {
|
|
15
|
+
const args = requireRecord(value);
|
|
16
|
+
rejectUnknownKeys(args, ['target', 'expectedRevision']);
|
|
17
|
+
const target = requireRecord(args.target);
|
|
18
|
+
if (args.expectedRevision !== undefined && typeof args.expectedRevision !== 'string')
|
|
19
|
+
invalidArgument('expectedRevision must be a string');
|
|
20
|
+
const expectedRevision = args.expectedRevision;
|
|
21
|
+
if (target.scope === 'all') {
|
|
22
|
+
rejectUnknownKeys(target, ['scope']);
|
|
23
|
+
return { target: { scope: 'all' }, expectedRevision };
|
|
24
|
+
}
|
|
25
|
+
if (target.scope === 'story' || target.scope === 'variant') {
|
|
26
|
+
rejectUnknownKeys(target, target.scope === 'story' ? ['scope', 'storyId'] : ['scope', 'storyId', 'variantId']);
|
|
27
|
+
const ids = target.scope === 'story' ? ['storyId'] : ['storyId', 'variantId'];
|
|
28
|
+
// Test IDs are story IDs (up to 1 KiB), not the 100-character transport identifiers.
|
|
29
|
+
for (const key of ids) {
|
|
30
|
+
if (typeof target[key] !== 'string' || !target[key].length || !target[key].isWellFormed() || target[key].length > 1024)
|
|
31
|
+
invalidArgument(`${key} must be a non-empty string`);
|
|
32
|
+
}
|
|
33
|
+
return { target: target, expectedRevision };
|
|
34
|
+
}
|
|
35
|
+
return invalidArgument('Unknown test scope');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Validates untrusted `tests.get`/`tests.cancel` arguments.
|
|
39
|
+
* @param value Detached JSON from the parent.
|
|
40
|
+
*/
|
|
41
|
+
export function parseTestOperationArgs(value) {
|
|
42
|
+
const args = requireRecord(value);
|
|
43
|
+
rejectUnknownKeys(args, ['operationId']);
|
|
44
|
+
if (!isTerminalId(args.operationId))
|
|
45
|
+
invalidArgument('operationId must be a valid identifier');
|
|
46
|
+
return { operationId: args.operationId };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Validates untrusted `tests.results` arguments.
|
|
50
|
+
* @param value Detached JSON from the parent.
|
|
51
|
+
*/
|
|
52
|
+
export function parseTestResultsArgs(value) {
|
|
53
|
+
const args = requireRecord(value);
|
|
54
|
+
rejectUnknownKeys(args, ['operationId', 'cursor', 'limit', 'failedOnly']);
|
|
55
|
+
if (!isTerminalId(args.operationId))
|
|
56
|
+
invalidArgument('operationId must be a valid identifier');
|
|
57
|
+
if (args.cursor !== undefined && (typeof args.cursor !== 'string' || args.cursor.length > TERMINAL_BOUNDS.idLength))
|
|
58
|
+
invalidArgument('cursor must be a short string');
|
|
59
|
+
if (args.limit !== undefined && (!Number.isInteger(args.limit) || args.limit < 1 || args.limit > TERMINAL_BOUNDS.pageItems))
|
|
60
|
+
invalidArgument(`limit must be 1..${TERMINAL_BOUNDS.pageItems}`);
|
|
61
|
+
if (args.failedOnly !== undefined && typeof args.failedOnly !== 'boolean')
|
|
62
|
+
invalidArgument('failedOnly must be a boolean');
|
|
63
|
+
return { operationId: args.operationId, cursor: args.cursor, limit: args.limit, failedOnly: args.failedOnly };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Shape check for an operation snapshot arriving from the child (events/replies).
|
|
67
|
+
* @param value Candidate payload.
|
|
68
|
+
*/
|
|
69
|
+
export function isTestOperationDto(value) {
|
|
70
|
+
if (!value || typeof value !== 'object')
|
|
71
|
+
return false;
|
|
72
|
+
const op = value;
|
|
73
|
+
return isTerminalId(op.id) && ['queued', 'running', 'cancelling', 'completed', 'failed', 'cancelled'].includes(op.state)
|
|
74
|
+
&& typeof op.target === 'object' && op.target !== null && typeof op.epoch === 'string' && typeof op.revision === 'string'
|
|
75
|
+
&& typeof op.cancelRequested === 'boolean' && typeof op.queuedAt === 'number';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Shape check for a `tests.progress` event payload.
|
|
79
|
+
* @param value Candidate payload.
|
|
80
|
+
*/
|
|
81
|
+
export function isTestProgressEvent(value) {
|
|
82
|
+
if (!value || typeof value !== 'object')
|
|
83
|
+
return false;
|
|
84
|
+
const event = value;
|
|
85
|
+
return isTerminalId(event.operationId) && !!event.progress && (event.progress.phase === 'collect' || event.progress.phase === 'run')
|
|
86
|
+
&& Number.isFinite(event.progress.completed) && Number.isFinite(event.progress.total);
|
|
87
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TerminalOperationDefinition } from './core.js';
|
|
2
|
+
import type { TestTarget } from './tests.js';
|
|
3
|
+
/**
|
|
4
|
+
* Scheduler phase of the child watch. `idle` = enabled with nothing pending,
|
|
5
|
+
* `waiting` = pending work blocked by a barrier (collection, cleanup, queue),
|
|
6
|
+
* `paused` = needs a source change, recovery or explicit action to continue.
|
|
7
|
+
*/
|
|
8
|
+
export type WatchPhase = 'off' | 'idle' | 'waiting' | 'running' | 'paused';
|
|
9
|
+
/** Longest reason text carried by a state snapshot. */
|
|
10
|
+
export declare const WATCH_REASON_MAX = 240;
|
|
11
|
+
/** Watch state; independent of the server lifecycle and of any single test operation. */
|
|
12
|
+
export interface WatchStateDto {
|
|
13
|
+
/** Watching was requested for this generation. */
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
/** Scheduler phase. */
|
|
16
|
+
phase: WatchPhase;
|
|
17
|
+
/** Exact scope captured when watching was enabled. */
|
|
18
|
+
scope?: TestTarget;
|
|
19
|
+
/** Why the scheduler waits or is paused; bounded plain text. */
|
|
20
|
+
reason?: string;
|
|
21
|
+
/** Distinct stories waiting for the next run. */
|
|
22
|
+
pending: number;
|
|
23
|
+
/** Operation being run (or cancelled) by the watch right now. */
|
|
24
|
+
operationId?: string;
|
|
25
|
+
/** Runs admitted since watching was enabled. */
|
|
26
|
+
runs: number;
|
|
27
|
+
}
|
|
28
|
+
/** Arguments of `watch.set`. */
|
|
29
|
+
export interface WatchSetArgs {
|
|
30
|
+
/** Desired state. */
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
/** Exact scope; required when enabling, ignored when disabling. */
|
|
33
|
+
scope?: TestTarget;
|
|
34
|
+
}
|
|
35
|
+
/** Operation map merged into `TerminalOperations`. */
|
|
36
|
+
export interface WatchOperations {
|
|
37
|
+
/** Enables, retargets or disables watching; idempotent for an unchanged request. */
|
|
38
|
+
'watch.set': TerminalOperationDefinition<WatchSetArgs, WatchStateDto>;
|
|
39
|
+
}
|
|
40
|
+
/** Events merged into `TerminalEvents`. */
|
|
41
|
+
export interface WatchEvents {
|
|
42
|
+
/** Every state change, with the full snapshot. */
|
|
43
|
+
'watch.state': WatchStateDto;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validates untrusted `watch.set` arguments. The scope is validated exactly like a
|
|
47
|
+
* `tests.run` target, so the watch can never hold a scope a manual run could not name.
|
|
48
|
+
* @param value Detached JSON from the parent.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseWatchSetArgs(value: unknown): WatchSetArgs;
|
|
51
|
+
/**
|
|
52
|
+
* Bounds free text of a reason so a state snapshot always fits one frame.
|
|
53
|
+
* @param text Reason text.
|
|
54
|
+
*/
|
|
55
|
+
export declare function boundReason(text: string): string;
|
|
56
|
+
/**
|
|
57
|
+
* Shape check for a state arriving from the child.
|
|
58
|
+
* @param value Candidate payload.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isWatchState(value: unknown): value is WatchStateDto;
|