@michaelrwalker/stagehand 0.3.0 → 0.5.0
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/README.md +280 -2
- package/dist/cache.d.ts +65 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +251 -0
- package/dist/cache.js.map +1 -0
- package/dist/context.d.ts +3 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +4 -2
- package/dist/context.js.map +1 -1
- package/dist/errors.d.ts +28 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +41 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/script.d.ts +191 -7
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +245 -16
- package/dist/script.js.map +1 -1
- package/dist/state.d.ts +6 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +18 -1
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +160 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/frame.d.ts.map +1 -1
- package/dist/ui/frame.js +28 -7
- package/dist/ui/frame.js.map +1 -1
- package/dist/ui/renderer.d.ts.map +1 -1
- package/dist/ui/renderer.js +9 -6
- package/dist/ui/renderer.js.map +1 -1
- package/dist/ui/theme.d.ts +1 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +2 -0
- package/dist/ui/theme.js.map +1 -1
- package/package.json +6 -9
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,SAAS,EAAa,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAEV,eAAe,EACf,WAAW,EAGZ,MAAM,YAAY,CAAC;AA6FpB,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAA2B,SAAS,EAAa,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAEV,eAAe,EACf,WAAW,EAGZ,MAAM,YAAY,CAAC;AA6FpB,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7C;AASD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,GAAG,EACvC,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,EAAE,EACT,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,GACd,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CA4BtB;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAChD,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,EAAE,EACT,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,WAAW,GAClB,eAAe,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAmB/B"}
|
package/dist/context.js
CHANGED
|
@@ -87,7 +87,7 @@ function annotate(step, renderer, message) {
|
|
|
87
87
|
renderer.refresh();
|
|
88
88
|
}
|
|
89
89
|
export function createStepContext(deps, input, ctx, signal, attempt) {
|
|
90
|
-
const { renderer, step, phaseName } = deps;
|
|
90
|
+
const { renderer, step, phaseName, cache } = deps;
|
|
91
91
|
// `step` is a routing hint: renderers that place logs on the step itself
|
|
92
92
|
// (rather than the scrollback) need to know which one.
|
|
93
93
|
const emit = (level) => (message) => renderer.log({ level, message }, step);
|
|
@@ -96,6 +96,7 @@ export function createStepContext(deps, input, ctx, signal, attempt) {
|
|
|
96
96
|
ctx,
|
|
97
97
|
signal,
|
|
98
98
|
attempt,
|
|
99
|
+
cache,
|
|
99
100
|
phase: phaseName,
|
|
100
101
|
step: step.name,
|
|
101
102
|
log: emit("log"),
|
|
@@ -114,13 +115,14 @@ export function createStepContext(deps, input, ctx, signal, attempt) {
|
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
117
|
export function createRollbackContext(deps, input, ctx, output, error, signal) {
|
|
117
|
-
const { renderer, step, phaseName } = deps;
|
|
118
|
+
const { renderer, step, phaseName, cache } = deps;
|
|
118
119
|
return {
|
|
119
120
|
input,
|
|
120
121
|
ctx,
|
|
121
122
|
output,
|
|
122
123
|
error,
|
|
123
124
|
signal,
|
|
125
|
+
cache,
|
|
124
126
|
phase: phaseName,
|
|
125
127
|
step: step.name,
|
|
126
128
|
log: (message) => renderer.log({ level: "warn", message }, step),
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAWA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,cAAc,CACrB,I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L,MAAM;QACN,KAAK;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC;QAChE,MAAM,CAAC,OAAO;YACZ,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;YAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;QACD,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;QACpD,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC;KAC/D,CAAC;AACJ,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -13,6 +13,34 @@ export declare class StepDefinitionError extends Error {
|
|
|
13
13
|
readonly step: string;
|
|
14
14
|
constructor(step: string, message: string);
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Two phases, or two steps within one phase, were given the same name. Thrown
|
|
18
|
+
* while the script is being built.
|
|
19
|
+
*
|
|
20
|
+
* Names are not decoration: they label the frame, they are what `outline()`
|
|
21
|
+
* reports, and they identify a phase's or step's cache entry. Two units
|
|
22
|
+
* sharing a name share a slot, which surfaces as wrong data rather than as a
|
|
23
|
+
* failure — so it is refused up front.
|
|
24
|
+
*/
|
|
25
|
+
export declare class DuplicateNameError extends Error {
|
|
26
|
+
readonly kind: "phase" | "step";
|
|
27
|
+
readonly duplicate: string;
|
|
28
|
+
constructor(kind: "phase" | "step", duplicate: string, message: string);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A cached value was read for a field it does not have.
|
|
32
|
+
*
|
|
33
|
+
* Without a `schema` a slot's type is inferred from the steps that produce it,
|
|
34
|
+
* which describes *today's* code — while the entry on disk was written by
|
|
35
|
+
* whatever the code looked like when it last ran. This is thrown at the exact
|
|
36
|
+
* property access where those two disagree, rather than letting an `undefined`
|
|
37
|
+
* travel somewhere less obvious.
|
|
38
|
+
*/
|
|
39
|
+
export declare class CacheShapeError extends Error {
|
|
40
|
+
readonly slot: string;
|
|
41
|
+
readonly path: string;
|
|
42
|
+
constructor(slot: string, path: string);
|
|
43
|
+
}
|
|
16
44
|
/** A step's handler threw. `cause` holds whatever it actually threw. */
|
|
17
45
|
export declare class StepFailedError extends Error {
|
|
18
46
|
readonly phase: string;
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,oFAAoF;AACpF,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAE3C,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,KAAK,CAAC;CAgB1D;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAED,wEAAwE;AACxE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAO1E;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM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
|
@@ -27,6 +27,47 @@ export class StepDefinitionError extends Error {
|
|
|
27
27
|
this.step = step;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Two phases, or two steps within one phase, were given the same name. Thrown
|
|
32
|
+
* while the script is being built.
|
|
33
|
+
*
|
|
34
|
+
* Names are not decoration: they label the frame, they are what `outline()`
|
|
35
|
+
* reports, and they identify a phase's or step's cache entry. Two units
|
|
36
|
+
* sharing a name share a slot, which surfaces as wrong data rather than as a
|
|
37
|
+
* failure — so it is refused up front.
|
|
38
|
+
*/
|
|
39
|
+
export class DuplicateNameError extends Error {
|
|
40
|
+
kind;
|
|
41
|
+
duplicate;
|
|
42
|
+
constructor(kind, duplicate, message) {
|
|
43
|
+
super(message);
|
|
44
|
+
this.name = "DuplicateNameError";
|
|
45
|
+
this.kind = kind;
|
|
46
|
+
this.duplicate = duplicate;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A cached value was read for a field it does not have.
|
|
51
|
+
*
|
|
52
|
+
* Without a `schema` a slot's type is inferred from the steps that produce it,
|
|
53
|
+
* which describes *today's* code — while the entry on disk was written by
|
|
54
|
+
* whatever the code looked like when it last ran. This is thrown at the exact
|
|
55
|
+
* property access where those two disagree, rather than letting an `undefined`
|
|
56
|
+
* travel somewhere less obvious.
|
|
57
|
+
*/
|
|
58
|
+
export class CacheShapeError extends Error {
|
|
59
|
+
slot;
|
|
60
|
+
path;
|
|
61
|
+
constructor(slot, path) {
|
|
62
|
+
super(`Read "${path}" from cache slot "${slot}", but the stored value has no such property. ` +
|
|
63
|
+
`The entry was probably written before this script's shape changed — ` +
|
|
64
|
+
`drop it with cache.clear("${slot}"), or declare a schema on the slot to have ` +
|
|
65
|
+
`mismatches rejected on read.`);
|
|
66
|
+
this.name = "CacheShapeError";
|
|
67
|
+
this.slot = slot;
|
|
68
|
+
this.path = path;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
30
71
|
/** A step's handler threw. `cause` holds whatever it actually threw. */
|
|
31
72
|
export class StepFailedError extends Error {
|
|
32
73
|
phase;
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,MAAM,CAAwC;IAEvD,YAAY,MAA6C;QACvD,KAAK,CACH,MAAM;aACH,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI;gBACrB,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAChB,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAChF;iBACA,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QAC5D,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACnC,IAAI,CAAS;IAEtB,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,wEAAwE;AACxE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,KAAK,CAAS;IACd,IAAI,CAAS;IACb,QAAQ,C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ptions } from "./script.js";
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { Script, script, stepFor, routineFor, type MountInput, type MountOptions, type Routine, type RunOptions, } from "./script.js";
|
|
2
|
+
export { fileStore, memoryStore } from "./cache.js";
|
|
3
|
+
export { CacheShapeError, DuplicateNameError, RollbackFailedError, SchemaValidationError, ScriptAbortedError, StepDefinitionError, StepFailedError, StepTimeoutError, isAbort, } from "./errors.js";
|
|
4
|
+
export type { Awaitable, CacheHandle, CacheMode, CacheOptions, CacheSource, CacheStore, CachedEntry, CleanField, Cleaned, LogPlacement, Merge, PhaseOptions, PhaseStatus, Prettify, ProgressHandle, RetryPolicy, RollbackContext, RollbackData, RollbackReport, RunResult, RunStatus, ScriptOptions, SlotValue, StaleContext, StepContext, StepDef, StepReport, StepStatus, TaskHandle, TaskListHandle, } from "./types.js";
|
|
4
5
|
export { formatDuration } from "./state.js";
|
|
5
6
|
export { setColorEnabled, isColorEnabled } from "./ui/ansi.js";
|
|
6
7
|
export { palette, symbols } from "./ui/theme.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,WAAW,EACX,UAAU,EACV,OAAO,EACP,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { Script, script, stepFor } from "./script.js";
|
|
2
|
-
export {
|
|
1
|
+
export { Script, script, stepFor, routineFor, } from "./script.js";
|
|
2
|
+
export { fileStore, memoryStore } from "./cache.js";
|
|
3
|
+
export { CacheShapeError, DuplicateNameError, RollbackFailedError, SchemaValidationError, ScriptAbortedError, StepDefinitionError, StepFailedError, StepTimeoutError, isAbort, } from "./errors.js";
|
|
3
4
|
export { formatDuration } from "./state.js";
|
|
4
5
|
export { setColorEnabled, isColorEnabled } from "./ui/ansi.js";
|
|
5
6
|
export { palette, symbols } from "./ui/theme.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,UAAU,GAKX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,MAAM,aAAa,CAAC;AAmCrB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/script.d.ts
CHANGED
|
@@ -1,8 +1,95 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
-
import type { CleanField, Cleaned, Merge, PhaseOptions, RunResult, ScriptOptions, StepDef } from "./types.js";
|
|
2
|
+
import type { Awaitable, CacheMode, CacheSource, CleanField, Cleaned, Merge, PhaseOptions, RunResult, ScriptOptions, SlotValue, StepDef } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Keys for the phantom markers on {@link Script} and {@link Routine}. Exported
|
|
5
|
+
* only because declaration emit has to name them; there is no runtime value
|
|
6
|
+
* behind either and nothing should import them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REQUIRES: unique symbol;
|
|
9
|
+
export declare const PRODUCES: unique symbol;
|
|
10
|
+
/**
|
|
11
|
+
* Phases and steps recorded away from any particular script, ready to be
|
|
12
|
+
* spliced into one with {@link Script.use}.
|
|
13
|
+
*
|
|
14
|
+
* All four parameters are inferred — `In` and `Ctx` from the `routineFor<In,
|
|
15
|
+
* Ctx>()` call that declared the routine, `Out` and `Reserved` from the steps
|
|
16
|
+
* it went on to add.
|
|
17
|
+
*/
|
|
18
|
+
export interface Routine<In, Ctx extends object, Out extends object, Reserved extends PropertyKey, Slots = {}> {
|
|
19
|
+
/**
|
|
20
|
+
* Phantom. `In` and `Ctx` sit in contravariant position here, which is what
|
|
21
|
+
* makes a mount site prove it already offers at least this much input and
|
|
22
|
+
* context. Erased at compile time.
|
|
23
|
+
*/
|
|
24
|
+
readonly [REQUIRES]: (context: {
|
|
25
|
+
input: In;
|
|
26
|
+
ctx: Ctx;
|
|
27
|
+
}) => void;
|
|
28
|
+
/** Phantom. Carries what the routine contributes so `use` can infer it. */
|
|
29
|
+
readonly [PRODUCES]: [Out, Slots];
|
|
30
|
+
readonly name: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A mounted fragment's slots, as the host addresses them. `as` renames the
|
|
34
|
+
* phases, so it has to rename their slots too — otherwise every
|
|
35
|
+
* `cache.clear("Fetch")` written against an unprefixed mount would keep
|
|
36
|
+
* compiling while silently addressing nothing.
|
|
37
|
+
*/
|
|
38
|
+
export type Mounted<As extends string | undefined, Slots> = [As] extends [string] ? {
|
|
39
|
+
[K in keyof Slots as `${As} / ${K & string}`]: Slots[K];
|
|
40
|
+
} : Slots;
|
|
41
|
+
export interface MountOptions {
|
|
42
|
+
/**
|
|
43
|
+
* Prefix for the routine's phase names — `"Amazon"` turns `Fetch` into
|
|
44
|
+
* `Amazon / Fetch`. Required whenever the same routine is mounted twice,
|
|
45
|
+
* since phase names have to stay unique.
|
|
46
|
+
*/
|
|
47
|
+
as?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What a mount feeds its fragment instead of the host's own input — either a
|
|
51
|
+
* fixed value or a function of the host's input and context, resolved once
|
|
52
|
+
* when the mount is reached.
|
|
53
|
+
*/
|
|
54
|
+
export type MountInput<In, Ctx, SubIn> = SubIn | ((context: {
|
|
55
|
+
input: In;
|
|
56
|
+
ctx: Ctx;
|
|
57
|
+
}) => Awaitable<SubIn>);
|
|
58
|
+
/**
|
|
59
|
+
* The phase currently being built, carried so its slot can be committed once
|
|
60
|
+
* the phase closes — which is the first moment its delta is fully known.
|
|
61
|
+
*
|
|
62
|
+
* `name` is `never` for a phase that declared no cache, so committing it adds
|
|
63
|
+
* nothing: `Record<never, V>` is `{}`. That is also the starting state, which
|
|
64
|
+
* is why no separate "is anything open" flag is needed.
|
|
65
|
+
*/
|
|
66
|
+
export interface OpenPhase {
|
|
67
|
+
name: string | never;
|
|
68
|
+
/** The `schema`'s output type, or `unknown` when none was declared. */
|
|
69
|
+
schema: unknown;
|
|
70
|
+
/** What this phase's steps have contributed so far. */
|
|
71
|
+
delta: object;
|
|
72
|
+
}
|
|
73
|
+
export type ClosedPhase = {
|
|
74
|
+
name: never;
|
|
75
|
+
schema: unknown;
|
|
76
|
+
delta: {};
|
|
77
|
+
};
|
|
78
|
+
/** Fold the open phase's slot into the map. A no-op for uncached phases. */
|
|
79
|
+
export type Commit<Slots, Open extends OpenPhase> = Slots & Record<Open["name"], SlotValue<Open["schema"], Open["delta"]>>;
|
|
80
|
+
/** Phase options with `cache` required, so the cached overload is unambiguous. */
|
|
81
|
+
export type CachedPhaseOptions<In, Ctx, Value> = Omit<PhaseOptions<In, Ctx>, "cache"> & {
|
|
82
|
+
cache: CacheSource<In, Ctx, Value>;
|
|
83
|
+
};
|
|
3
84
|
export interface RunOptions {
|
|
4
85
|
/** Cancel the run from the outside. */
|
|
5
86
|
signal?: AbortSignal;
|
|
87
|
+
/**
|
|
88
|
+
* What this run may do with the caches the script declares. Default `"on"`.
|
|
89
|
+
* Wire it to a flag — `cache: argv.includes("--no-cache") ? "off" : "on"` —
|
|
90
|
+
* to control caching without touching the script.
|
|
91
|
+
*/
|
|
92
|
+
cache?: CacheMode;
|
|
6
93
|
}
|
|
7
94
|
/**
|
|
8
95
|
* A saga-style script: phases of steps, each step optionally compensating when
|
|
@@ -31,10 +118,21 @@ export interface RunOptions {
|
|
|
31
118
|
* The third parameter is inferred too: it collects the keys steps reserved
|
|
32
119
|
* through `rollbackKeys`, which is how `clean` knows what it may not remove.
|
|
33
120
|
*/
|
|
34
|
-
export declare class Script<In = void, Ctx extends object = {}, Reserved extends PropertyKey = never> {
|
|
121
|
+
export declare class Script<In = void, Ctx extends object = {}, Reserved extends PropertyKey = never, Slots = {}, Open extends OpenPhase = ClosedPhase> {
|
|
122
|
+
/**
|
|
123
|
+
* Phantom, erased at compile time. `run` is a *method*, so its parameter
|
|
124
|
+
* compares bivariantly and `In` would otherwise carry no safety across two
|
|
125
|
+
* `Script` types — a script needing `{ a, b }` would mount into a host
|
|
126
|
+
* offering only `{ a }`. A property-position function makes `In`
|
|
127
|
+
* contravariant, which is what `use()` relies on.
|
|
128
|
+
*/
|
|
129
|
+
readonly [REQUIRES]: (input: In) => void;
|
|
35
130
|
private readonly options;
|
|
36
131
|
private readonly definition;
|
|
37
132
|
private readonly reserved;
|
|
133
|
+
private readonly phaseNames;
|
|
134
|
+
/** False right after `use()`, so a bare `addStep` cannot land in a fragment. */
|
|
135
|
+
private openPhase;
|
|
38
136
|
private _schema;
|
|
39
137
|
constructor(options?: ScriptOptions | string);
|
|
40
138
|
/**
|
|
@@ -60,11 +158,21 @@ export declare class Script<In = void, Ctx extends object = {}, Reserved extends
|
|
|
60
158
|
defineInput<TSchema>(schema: StandardSchemaV1<unknown, TSchema>): Script<TSchema, Ctx, Reserved>;
|
|
61
159
|
/** Validate `input` against the schema from `defineInput`, if any. */
|
|
62
160
|
private validateInput;
|
|
161
|
+
/**
|
|
162
|
+
* Open a cached phase. Its name becomes a slot addressable through
|
|
163
|
+
* `context.cache` in every step declared after it — typed as the phase's own
|
|
164
|
+
* delta, or as the `schema`'s output when one is given.
|
|
165
|
+
*/
|
|
166
|
+
addPhase<const Name extends string, Value = unknown>(name: Name, options: CachedPhaseOptions<In, Ctx, Value>): Script<In, Ctx, Reserved, Commit<Slots, Open>, {
|
|
167
|
+
name: Name;
|
|
168
|
+
schema: Value;
|
|
169
|
+
delta: {};
|
|
170
|
+
}>;
|
|
63
171
|
/** Open a new phase. Subsequent `addStep` calls land in it. */
|
|
64
|
-
addPhase(name: string, options?: PhaseOptions<In, Ctx>): Script<In, Ctx, Reserved>;
|
|
172
|
+
addPhase(name: string, options?: PhaseOptions<In, Ctx>): Script<In, Ctx, Reserved, Commit<Slots, Open>, ClosedPhase>;
|
|
65
173
|
/** Open a phase and populate it inside a callback, keeping the type flow. */
|
|
66
|
-
addPhase<Next extends object, NextReserved extends PropertyKey>(name: string, build: (script: Script<In, Ctx, Reserved>) => Script<In, Next, NextReserved>): Script<In, Next, NextReserved>;
|
|
67
|
-
addPhase<Next extends object, NextReserved extends PropertyKey>(name: string, options: PhaseOptions<In, Ctx>, build: (script: Script<In, Ctx, Reserved>) => Script<In, Next, NextReserved>): Script<In, Next, NextReserved>;
|
|
174
|
+
addPhase<Next extends object, NextReserved extends PropertyKey, NextSlots, NextOpen extends OpenPhase>(name: string, build: (script: Script<In, Ctx, Reserved, Commit<Slots, Open>, ClosedPhase>) => Script<In, Next, NextReserved, NextSlots, NextOpen>): Script<In, Next, NextReserved, NextSlots, NextOpen>;
|
|
175
|
+
addPhase<Next extends object, NextReserved extends PropertyKey, NextSlots, NextOpen extends OpenPhase>(name: string, options: PhaseOptions<In, Ctx>, build: (script: Script<In, Ctx, Reserved, Commit<Slots, Open>, ClosedPhase>) => Script<In, Next, NextReserved, NextSlots, NextOpen>): Script<In, Next, NextReserved, NextSlots, NextOpen>;
|
|
68
176
|
/**
|
|
69
177
|
* Append a step to the current phase. Whatever the handler resolves to is
|
|
70
178
|
* merged into the context and becomes visible to every later step; whatever
|
|
@@ -73,13 +181,64 @@ export declare class Script<In = void, Ctx extends object = {}, Reserved extends
|
|
|
73
181
|
* @throws {StepDefinitionError} if `clean` names a key reserved by some
|
|
74
182
|
* step's `rollbackKeys`.
|
|
75
183
|
*/
|
|
76
|
-
addStep<Out extends object | void, const RollbackKeys extends readonly PropertyKey[] = readonly [], const CleanKeys extends readonly PropertyKey[] = readonly []>(def: StepDef<In, Ctx, Out, RollbackKeys> & CleanField<Ctx, Reserved, CleanKeys>): Script<In, Cleaned<Merge<Ctx, Out>, CleanKeys[number]>, Reserved | RollbackKeys[number]
|
|
184
|
+
addStep<Out extends object | void, const RollbackKeys extends readonly PropertyKey[] = readonly [], const CleanKeys extends readonly PropertyKey[] = readonly []>(def: StepDef<In, Ctx, Out, RollbackKeys, Slots> & CleanField<Ctx, Reserved, CleanKeys>): Script<In, Cleaned<Merge<Ctx, Out>, CleanKeys[number]>, Reserved | RollbackKeys[number], Slots, {
|
|
185
|
+
name: Open["name"];
|
|
186
|
+
schema: Open["schema"];
|
|
187
|
+
delta: Cleaned<Merge<Open["delta"], Out>, CleanKeys[number]>;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Splice a reusable fragment into this script. Its phases land here in
|
|
191
|
+
* order, and everything it produced is merged into the context — so the
|
|
192
|
+
* steps that follow see it, typed, exactly as if they had been written
|
|
193
|
+
* inline.
|
|
194
|
+
*
|
|
195
|
+
* The fragment states what it needs and TypeScript checks it at the mount
|
|
196
|
+
* site: a routine declared `routineFor<{ name: string }, { hash: string }>()`
|
|
197
|
+
* refuses to mount into a script whose input lacks `name`, or which has not
|
|
198
|
+
* produced `hash` yet.
|
|
199
|
+
*
|
|
200
|
+
* ```ts
|
|
201
|
+
* new Script<Input>({ name: "monthly report" })
|
|
202
|
+
* .use(fetchChannel)
|
|
203
|
+
* .addPhase("Report")
|
|
204
|
+
* .addStep({ name: "aggregate", handler: ({ ctx }) => summarise(ctx.orders) });
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* A plain {@link Script} mounts too, which is what keeps a reusable pipeline
|
|
208
|
+
* runnable on its own. Its own {@link ScriptOptions} — rollback mode,
|
|
209
|
+
* `logPlacement`, `silent` — are ignored in favour of the host's; only its
|
|
210
|
+
* phases and steps come across.
|
|
211
|
+
*
|
|
212
|
+
* @throws {DuplicateNameError} if a phase it brings is already defined here.
|
|
213
|
+
* Mount the same routine twice by naming each mount with `as`.
|
|
214
|
+
*/
|
|
215
|
+
use<SubIn, Out extends object, R extends PropertyKey, RS, const As extends string | undefined = undefined>(routine: Routine<SubIn, Ctx, Out, R, RS>, options: {
|
|
216
|
+
as?: As;
|
|
217
|
+
input: MountInput<In, Ctx, SubIn>;
|
|
218
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R, Commit<Slots, Open> & Mounted<As, RS>, ClosedPhase>;
|
|
219
|
+
use<SubIn, Out extends object, R extends PropertyKey, SS, SO extends OpenPhase, const As extends string | undefined = undefined>(script: Script<SubIn, Out, R, SS, SO>, options: {
|
|
220
|
+
as?: As;
|
|
221
|
+
input: MountInput<In, Ctx, SubIn>;
|
|
222
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R, Commit<Slots, Open> & Mounted<As, Commit<SS, SO>>, ClosedPhase>;
|
|
223
|
+
use<Out extends object, R extends PropertyKey, SS, SO extends OpenPhase, const As extends string | undefined = undefined>(script: Script<In, Out, R, SS, SO>, options?: {
|
|
224
|
+
as?: As;
|
|
225
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R, Commit<Slots, Open> & Mounted<As, Commit<SS, SO>>, ClosedPhase>;
|
|
226
|
+
use<Out extends object, R extends PropertyKey, RS, const As extends string | undefined = undefined>(routine: Routine<In, Ctx, Out, R, RS>, options?: {
|
|
227
|
+
as?: As;
|
|
228
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R, Commit<Slots, Open> & Mounted<As, RS>, ClosedPhase>;
|
|
77
229
|
/** Every step name, in execution order — handy for tests and docs. */
|
|
78
230
|
outline(): Array<{
|
|
79
231
|
phase: string;
|
|
80
232
|
steps: string[];
|
|
81
233
|
}>;
|
|
82
234
|
private currentPhase;
|
|
235
|
+
/**
|
|
236
|
+
* Phase names have to be unique: they are what the frame labels, what
|
|
237
|
+
* `outline()` reports, and — since the cache landed — what identifies a
|
|
238
|
+
* phase's stored entry. Two phases sharing a name share a cache slot, which
|
|
239
|
+
* reads as wrong data rather than as an error.
|
|
240
|
+
*/
|
|
241
|
+
private claimPhaseName;
|
|
83
242
|
run(input: In, runOptions?: RunOptions): Promise<RunResult<Ctx>>;
|
|
84
243
|
/** Retry + timeout wrapper around a single handler invocation. */
|
|
85
244
|
private executeStep;
|
|
@@ -105,7 +264,32 @@ export declare class Script<In = void, Ctx extends object = {}, Reserved extends
|
|
|
105
264
|
* `rollbackKeys` works the same here, and the keys it names stay reserved once
|
|
106
265
|
* the step is handed to `addStep`.
|
|
107
266
|
*/
|
|
108
|
-
export declare function stepFor<In, Ctx extends object = {}>(): <Out extends object | void, const RollbackKeys extends readonly PropertyKey[] = readonly []>(def: StepDef<In, Ctx, Out, RollbackKeys>) => StepDef<In, Ctx, Out, RollbackKeys>;
|
|
267
|
+
export declare function stepFor<In, Ctx extends object = {}, Slots = {}>(): <Out extends object | void, const RollbackKeys extends readonly PropertyKey[] = readonly []>(def: StepDef<In, Ctx, Out, RollbackKeys, Slots>) => StepDef<In, Ctx, Out, RollbackKeys, Slots>;
|
|
268
|
+
/**
|
|
269
|
+
* Declare phases and steps away from any particular script, then mount them
|
|
270
|
+
* with {@link Script.use}.
|
|
271
|
+
*
|
|
272
|
+
* The two parameters are the *minimum* the fragment needs — the input it
|
|
273
|
+
* reads, and the context it expects to already exist — exactly as they are for
|
|
274
|
+
* {@link stepFor}. Whatever it produces flows on into whichever script mounts
|
|
275
|
+
* it, and any script that cannot satisfy the requirement is a compile error at
|
|
276
|
+
* the `use()` call, not an `undefined` at run time.
|
|
277
|
+
*
|
|
278
|
+
* ```ts
|
|
279
|
+
* export const fetchChannel = routineFor<{ channel: string }>()("fetch channel", (s) =>
|
|
280
|
+
* s
|
|
281
|
+
* .addPhase("Fetch")
|
|
282
|
+
* .addStep({ name: "authenticate", handler: … })
|
|
283
|
+
* .addStep({ name: "pull orders", handler: … })
|
|
284
|
+
* .addPhase("Normalize")
|
|
285
|
+
* .addStep({ name: "dedupe", handler: … }),
|
|
286
|
+
* );
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* A routine owns whole phases, so phase-level options — `when`, `cache` —
|
|
290
|
+
* travel with it.
|
|
291
|
+
*/
|
|
292
|
+
export declare function routineFor<In, Ctx extends object = {}>(): <Out extends object, R extends PropertyKey, S, O extends OpenPhase>(name: string, build: (script: Script<In, Ctx, never>) => Script<In, Out, R, S, O>) => Routine<In, Ctx, Out, R, Commit<S, O>>;
|
|
109
293
|
/** Convenience factory so callers can skip `new`. */
|
|
110
294
|
export declare function script<In = void>(options?: ScriptOptions | string): Script<In, {}>;
|
|
111
295
|
//# sourceMappingURL=script.d.ts.map
|
package/dist/script.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../src/script.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAoB9D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,UAAU,EACV,OAAO,EACP,KAAK,EACL,YAAY,EAIZ,SAAS,EACT,aAAa,EACb,SAAS,EACT,OAAO,EAER,MAAM,YAAY,CAAC;AAsCpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,MAAM,CAAC;AAC7C,MAAM,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,MAAM,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,WAAW,OAAO,CACtB,EAAE,EACF,GAAG,SAAS,MAAM,EAClB,GAAG,SAAS,MAAM,EAClB,QAAQ,SAAS,WAAW,EAC5B,KAAK,GAAG,EAAE;IAEV;;;;OAIG;IACH,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,EAAE,CAAC;QAAC,GAAG,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,CAAC,QAAQ,CAAC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