@michaelrwalker/stagehand 0.2.0 → 0.4.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 +387 -67
- package/dist/cache.d.ts +33 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +120 -0
- package/dist/cache.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +14 -2
- package/dist/context.js.map +1 -1
- package/dist/errors.d.ts +23 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +32 -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 +149 -9
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +273 -14
- package/dist/script.js.map +1 -1
- package/dist/state.d.ts +17 -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 +175 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/ui/frame.d.ts +1 -6
- package/dist/ui/frame.d.ts.map +1 -1
- package/dist/ui/frame.js +55 -16
- package/dist/ui/frame.js.map +1 -1
- package/dist/ui/renderer.d.ts +8 -4
- package/dist/ui/renderer.d.ts.map +1 -1
- package/dist/ui/renderer.js +36 -10
- 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 +9 -2
package/dist/cache.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
/* -------------------------------------------------------------------------- */
|
|
4
|
+
/* Stores */
|
|
5
|
+
/* -------------------------------------------------------------------------- */
|
|
6
|
+
/** Lives for the lifetime of the process. Useful in tests, and for re-runs. */
|
|
7
|
+
export function memoryStore() {
|
|
8
|
+
const slots = new Map();
|
|
9
|
+
return {
|
|
10
|
+
read: (slot) => slots.get(slot),
|
|
11
|
+
write: (slot, entry) => {
|
|
12
|
+
slots.set(slot, entry);
|
|
13
|
+
},
|
|
14
|
+
clear: (slot) => {
|
|
15
|
+
slots.delete(slot);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One JSON file, holding every slot that points at it. Several phases may
|
|
21
|
+
* share a path safely.
|
|
22
|
+
*
|
|
23
|
+
* A missing, unreadable or malformed file all mean the same thing — no cache
|
|
24
|
+
* yet — so deleting the file is always a valid way to start over. Values must
|
|
25
|
+
* survive `JSON.stringify`; anything that does not (a `Date`, a class
|
|
26
|
+
* instance) comes back as its JSON shape, which is what `schema` is for.
|
|
27
|
+
*/
|
|
28
|
+
export function fileStore(filePath) {
|
|
29
|
+
const target = resolve(filePath);
|
|
30
|
+
const readAll = async () => {
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(await readFile(target, "utf8"));
|
|
33
|
+
if (parsed === null || typeof parsed !== "object")
|
|
34
|
+
return {};
|
|
35
|
+
return parsed;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// Written through a temp file so an interrupted run cannot leave a
|
|
42
|
+
// half-serialised cache behind for the next one to choke on.
|
|
43
|
+
const writeAll = async (data) => {
|
|
44
|
+
await mkdir(dirname(target), { recursive: true });
|
|
45
|
+
const temp = `${target}.${process.pid}.tmp`;
|
|
46
|
+
await writeFile(temp, `${JSON.stringify(data, null, 2)}\n`, "utf8");
|
|
47
|
+
await rename(temp, target);
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
async read(slot) {
|
|
51
|
+
const entry = (await readAll())[slot];
|
|
52
|
+
return isEntry(entry) ? entry : undefined;
|
|
53
|
+
},
|
|
54
|
+
async write(slot, entry) {
|
|
55
|
+
const data = await readAll();
|
|
56
|
+
data[slot] = entry;
|
|
57
|
+
await writeAll(data);
|
|
58
|
+
},
|
|
59
|
+
async clear(slot) {
|
|
60
|
+
const data = await readAll();
|
|
61
|
+
if (!Object.hasOwn(data, slot))
|
|
62
|
+
return;
|
|
63
|
+
delete data[slot];
|
|
64
|
+
await writeAll(data);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/** A hand-edited or older-format file should read as a miss, not as a crash. */
|
|
69
|
+
function isEntry(value) {
|
|
70
|
+
return (typeof value === "object" &&
|
|
71
|
+
value !== null &&
|
|
72
|
+
"value" in value &&
|
|
73
|
+
typeof value.savedAt === "number");
|
|
74
|
+
}
|
|
75
|
+
/* -------------------------------------------------------------------------- */
|
|
76
|
+
/* Runtime */
|
|
77
|
+
/* -------------------------------------------------------------------------- */
|
|
78
|
+
/** `cache: someStore` is shorthand for `cache: { store: someStore }`. */
|
|
79
|
+
export function normalizeCache(source) {
|
|
80
|
+
if (!source)
|
|
81
|
+
return undefined;
|
|
82
|
+
if (typeof source.read === "function") {
|
|
83
|
+
return { store: source };
|
|
84
|
+
}
|
|
85
|
+
return source;
|
|
86
|
+
}
|
|
87
|
+
const MISS = { hit: false };
|
|
88
|
+
/**
|
|
89
|
+
* Read an entry and put it through every gate. A failure at any gate is a
|
|
90
|
+
* miss — the work runs and the entry is replaced — never an error.
|
|
91
|
+
*/
|
|
92
|
+
export async function readCache(cache, slot, input, ctx, mode) {
|
|
93
|
+
if (mode === "off" || mode === "refresh")
|
|
94
|
+
return MISS;
|
|
95
|
+
const entry = await cache.store.read(slot);
|
|
96
|
+
if (!entry)
|
|
97
|
+
return MISS;
|
|
98
|
+
let value = entry.value;
|
|
99
|
+
if (cache.schema) {
|
|
100
|
+
const result = await cache.schema["~standard"].validate(value);
|
|
101
|
+
if (result.issues)
|
|
102
|
+
return MISS;
|
|
103
|
+
value = result.value;
|
|
104
|
+
}
|
|
105
|
+
const ageMs = Math.max(0, Date.now() - entry.savedAt);
|
|
106
|
+
if (cache.stale && (await cache.stale({ value, input, ctx, savedAt: entry.savedAt, ageMs }))) {
|
|
107
|
+
return MISS;
|
|
108
|
+
}
|
|
109
|
+
return { hit: true, value, ageMs };
|
|
110
|
+
}
|
|
111
|
+
/** Only ever called after the phase or step has fully succeeded. */
|
|
112
|
+
export async function writeCache(cache, slot, value, mode) {
|
|
113
|
+
if (mode === "off" || mode === "read-only")
|
|
114
|
+
return;
|
|
115
|
+
await cache.store.write(slot, { value, savedAt: Date.now() });
|
|
116
|
+
}
|
|
117
|
+
/** Identifies a phase's entry. Steps hang off their phase to avoid collisions. */
|
|
118
|
+
export const phaseSlot = (phase) => phase;
|
|
119
|
+
export const stepSlot = (phase, step) => `${phase}::${step}`;
|
|
120
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAU7C,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAEhF,+EAA+E;AAC/E,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC7C,OAAO;QACL,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/B,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACrB,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;YACd,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,C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C,KAAK,CAAC;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,KAAK,KAAK,IAAI,EAAE,CAAC"}
|
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,
|
|
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;CACnB;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,CA2BtB;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,CAkB/B"}
|
package/dist/context.js
CHANGED
|
@@ -78,9 +78,19 @@ function createTaskList(step, renderer, labels) {
|
|
|
78
78
|
get: (key) => map[key],
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
+
/** Set (or, given "", clear) the step's persistent title annotation. */
|
|
82
|
+
function annotate(step, renderer, message) {
|
|
83
|
+
if (message === "")
|
|
84
|
+
delete step.note;
|
|
85
|
+
else
|
|
86
|
+
step.note = message;
|
|
87
|
+
renderer.refresh();
|
|
88
|
+
}
|
|
81
89
|
export function createStepContext(deps, input, ctx, signal, attempt) {
|
|
82
90
|
const { renderer, step, phaseName } = deps;
|
|
83
|
-
|
|
91
|
+
// `step` is a routing hint: renderers that place logs on the step itself
|
|
92
|
+
// (rather than the scrollback) need to know which one.
|
|
93
|
+
const emit = (level) => (message) => renderer.log({ level, message }, step);
|
|
84
94
|
return {
|
|
85
95
|
input,
|
|
86
96
|
ctx,
|
|
@@ -97,6 +107,7 @@ export function createStepContext(deps, input, ctx, signal, attempt) {
|
|
|
97
107
|
step.statusText = message;
|
|
98
108
|
renderer.refresh();
|
|
99
109
|
},
|
|
110
|
+
note: (message) => annotate(step, renderer, message),
|
|
100
111
|
progress: (options) => createProgress(step, renderer, options),
|
|
101
112
|
task: (label) => createTask(step, renderer, label),
|
|
102
113
|
tasks: (labels) => createTaskList(step, renderer, labels),
|
|
@@ -112,11 +123,12 @@ export function createRollbackContext(deps, input, ctx, output, error, signal) {
|
|
|
112
123
|
signal,
|
|
113
124
|
phase: phaseName,
|
|
114
125
|
step: step.name,
|
|
115
|
-
log: (message) => renderer.log({ level: "warn", message }),
|
|
126
|
+
log: (message) => renderer.log({ level: "warn", message }, step),
|
|
116
127
|
status(message) {
|
|
117
128
|
step.statusText = message;
|
|
118
129
|
renderer.refresh();
|
|
119
130
|
},
|
|
131
|
+
note: (message) => annotate(step, renderer, message),
|
|
120
132
|
progress: (options) => createProgress(step, renderer, options),
|
|
121
133
|
};
|
|
122
134
|
}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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M,UAAU,qBAAqB,CACnC,IAAiB,EACjB,KAAS,EACT,GAAQ,EACR,MAAW,EACX,KAAc,EACd,MAAmB;IAEnB,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC3C,OAAO;QACL,KAAK;QACL,GAAG;QACH,MAAM;QACN,KAAK;QACL,MAAM;QACN,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
|
@@ -4,6 +4,29 @@ export declare class SchemaValidationError extends Error {
|
|
|
4
4
|
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
5
5
|
constructor(issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* A step was declared in a way the script cannot honour — today, a `clean`
|
|
9
|
+
* naming a key some step reserved through `rollbackKeys`. Thrown by `addStep`,
|
|
10
|
+
* while the script is being built, long before anything runs.
|
|
11
|
+
*/
|
|
12
|
+
export declare class StepDefinitionError extends Error {
|
|
13
|
+
readonly step: string;
|
|
14
|
+
constructor(step: string, message: string);
|
|
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
|
+
}
|
|
7
30
|
/** A step's handler threw. `cause` holds whatever it actually threw. */
|
|
8
31
|
export declare class StepFailedError extends Error {
|
|
9
32
|
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,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,CAAC;IACtB,QAAQ,C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EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAMvE;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,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAM5C;AAED,4EAA4E;AAC5E,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAK3B;AAED,+EAA+E;AAC/E,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;gBAEpB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;CAOhF;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK/C"}
|
package/dist/errors.js
CHANGED
|
@@ -14,6 +14,38 @@ export class SchemaValidationError extends Error {
|
|
|
14
14
|
this.issues = issues;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A step was declared in a way the script cannot honour — today, a `clean`
|
|
19
|
+
* naming a key some step reserved through `rollbackKeys`. Thrown by `addStep`,
|
|
20
|
+
* while the script is being built, long before anything runs.
|
|
21
|
+
*/
|
|
22
|
+
export class StepDefinitionError extends Error {
|
|
23
|
+
step;
|
|
24
|
+
constructor(step, message) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.name = "StepDefinitionError";
|
|
27
|
+
this.step = step;
|
|
28
|
+
}
|
|
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
|
+
}
|
|
17
49
|
/** A step's handler threw. `cause` holds whatever it actually threw. */
|
|
18
50
|
export class StepFailedError extends Error {
|
|
19
51
|
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,CAA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}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { Script, script, stepFor, type RunOptions } from "./script.js";
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
1
|
+
export { Script, script, stepFor, routineFor, type MountOptions, type Routine, type RunOptions, } from "./script.js";
|
|
2
|
+
export { fileStore, memoryStore } from "./cache.js";
|
|
3
|
+
export { DuplicateNameError, RollbackFailedError, SchemaValidationError, ScriptAbortedError, StepDefinitionError, StepFailedError, StepTimeoutError, isAbort, } from "./errors.js";
|
|
4
|
+
export type { Awaitable, CacheMode, CacheOptions, CacheSource, CacheStore, CachedEntry, CleanField, Cleaned, LogPlacement, Merge, PhaseOptions, PhaseStatus, Prettify, ProgressHandle, RetryPolicy, RollbackContext, RollbackData, RollbackReport, RunResult, RunStatus, ScriptOptions, 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,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,SAAS,EACT,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,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 { 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,GAIX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,MAAM,aAAa,CAAC;AAiCrB,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,60 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
-
import type { Merge, PhaseOptions, RunResult, ScriptOptions, StepDef } from "./types.js";
|
|
2
|
+
import type { Awaitable, CacheMode, CleanField, Cleaned, Merge, PhaseOptions, RunResult, ScriptOptions, 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> {
|
|
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;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
}
|
|
32
|
+
export interface MountOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Prefix for the routine's phase names — `"Amazon"` turns `Fetch` into
|
|
35
|
+
* `Amazon / Fetch`. Required whenever the same routine is mounted twice,
|
|
36
|
+
* since phase names have to stay unique.
|
|
37
|
+
*/
|
|
38
|
+
as?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* What a mount feeds its fragment instead of the host's own input — either a
|
|
42
|
+
* fixed value or a function of the host's input and context, resolved once
|
|
43
|
+
* when the mount is reached.
|
|
44
|
+
*/
|
|
45
|
+
export type MountInput<In, Ctx, SubIn> = SubIn | ((context: {
|
|
46
|
+
input: In;
|
|
47
|
+
ctx: Ctx;
|
|
48
|
+
}) => Awaitable<SubIn>);
|
|
3
49
|
export interface RunOptions {
|
|
4
50
|
/** Cancel the run from the outside. */
|
|
5
51
|
signal?: AbortSignal;
|
|
52
|
+
/**
|
|
53
|
+
* What this run may do with the caches the script declares. Default `"on"`.
|
|
54
|
+
* Wire it to a flag — `cache: argv.includes("--no-cache") ? "off" : "on"` —
|
|
55
|
+
* to control caching without touching the script.
|
|
56
|
+
*/
|
|
57
|
+
cache?: CacheMode;
|
|
6
58
|
}
|
|
7
59
|
/**
|
|
8
60
|
* A saga-style script: phases of steps, each step optionally compensating when
|
|
@@ -27,10 +79,25 @@ export interface RunOptions {
|
|
|
27
79
|
* })
|
|
28
80
|
* .run({ userId: "u_1" });
|
|
29
81
|
* ```
|
|
82
|
+
*
|
|
83
|
+
* The third parameter is inferred too: it collects the keys steps reserved
|
|
84
|
+
* through `rollbackKeys`, which is how `clean` knows what it may not remove.
|
|
30
85
|
*/
|
|
31
|
-
export declare class Script<In = void, Ctx extends object = {}> {
|
|
86
|
+
export declare class Script<In = void, Ctx extends object = {}, Reserved extends PropertyKey = never> {
|
|
87
|
+
/**
|
|
88
|
+
* Phantom, erased at compile time. `run` is a *method*, so its parameter
|
|
89
|
+
* compares bivariantly and `In` would otherwise carry no safety across two
|
|
90
|
+
* `Script` types — a script needing `{ a, b }` would mount into a host
|
|
91
|
+
* offering only `{ a }`. A property-position function makes `In`
|
|
92
|
+
* contravariant, which is what `use()` relies on.
|
|
93
|
+
*/
|
|
94
|
+
readonly [REQUIRES]: (input: In) => void;
|
|
32
95
|
private readonly options;
|
|
33
96
|
private readonly definition;
|
|
97
|
+
private readonly reserved;
|
|
98
|
+
private readonly phaseNames;
|
|
99
|
+
/** False right after `use()`, so a bare `addStep` cannot land in a fragment. */
|
|
100
|
+
private openPhase;
|
|
34
101
|
private _schema;
|
|
35
102
|
constructor(options?: ScriptOptions | string);
|
|
36
103
|
/**
|
|
@@ -53,25 +120,70 @@ export declare class Script<In = void, Ctx extends object = {}> {
|
|
|
53
120
|
* });
|
|
54
121
|
* ```
|
|
55
122
|
*/
|
|
56
|
-
defineInput<TSchema>(schema: StandardSchemaV1<unknown, TSchema>): Script<TSchema, Ctx>;
|
|
123
|
+
defineInput<TSchema>(schema: StandardSchemaV1<unknown, TSchema>): Script<TSchema, Ctx, Reserved>;
|
|
57
124
|
/** Validate `input` against the schema from `defineInput`, if any. */
|
|
58
125
|
private validateInput;
|
|
59
126
|
/** Open a new phase. Subsequent `addStep` calls land in it. */
|
|
60
|
-
addPhase(name: string, options?: PhaseOptions<In, Ctx>): Script<In, Ctx>;
|
|
127
|
+
addPhase(name: string, options?: PhaseOptions<In, Ctx>): Script<In, Ctx, Reserved>;
|
|
61
128
|
/** Open a phase and populate it inside a callback, keeping the type flow. */
|
|
62
|
-
addPhase<Next extends object>(name: string, build: (script: Script<In, Ctx>) => Script<In, Next>): Script<In, Next>;
|
|
63
|
-
addPhase<Next extends object>(name: string, options: PhaseOptions<In, Ctx>, build: (script: Script<In, Ctx>) => Script<In, Next>): Script<In, Next>;
|
|
129
|
+
addPhase<Next extends object, NextReserved extends PropertyKey>(name: string, build: (script: Script<In, Ctx, Reserved>) => Script<In, Next, NextReserved>): Script<In, Next, NextReserved>;
|
|
130
|
+
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>;
|
|
64
131
|
/**
|
|
65
132
|
* Append a step to the current phase. Whatever the handler resolves to is
|
|
66
|
-
* merged into the context and becomes visible to every later step
|
|
133
|
+
* merged into the context and becomes visible to every later step; whatever
|
|
134
|
+
* it lists in `clean` is dropped from both.
|
|
135
|
+
*
|
|
136
|
+
* @throws {StepDefinitionError} if `clean` names a key reserved by some
|
|
137
|
+
* step's `rollbackKeys`.
|
|
67
138
|
*/
|
|
68
|
-
addStep<Out extends object | void>(def: StepDef<In, Ctx, Out>): Script<In, Merge<Ctx, Out
|
|
139
|
+
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]>;
|
|
140
|
+
/**
|
|
141
|
+
* Splice a reusable fragment into this script. Its phases land here in
|
|
142
|
+
* order, and everything it produced is merged into the context — so the
|
|
143
|
+
* steps that follow see it, typed, exactly as if they had been written
|
|
144
|
+
* inline.
|
|
145
|
+
*
|
|
146
|
+
* The fragment states what it needs and TypeScript checks it at the mount
|
|
147
|
+
* site: a routine declared `routineFor<{ name: string }, { hash: string }>()`
|
|
148
|
+
* refuses to mount into a script whose input lacks `name`, or which has not
|
|
149
|
+
* produced `hash` yet.
|
|
150
|
+
*
|
|
151
|
+
* ```ts
|
|
152
|
+
* new Script<Input>({ name: "monthly report" })
|
|
153
|
+
* .use(fetchChannel)
|
|
154
|
+
* .addPhase("Report")
|
|
155
|
+
* .addStep({ name: "aggregate", handler: ({ ctx }) => summarise(ctx.orders) });
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* A plain {@link Script} mounts too, which is what keeps a reusable pipeline
|
|
159
|
+
* runnable on its own. Its own {@link ScriptOptions} — rollback mode,
|
|
160
|
+
* `logPlacement`, `silent` — are ignored in favour of the host's; only its
|
|
161
|
+
* phases and steps come across.
|
|
162
|
+
*
|
|
163
|
+
* @throws {DuplicateNameError} if a phase it brings is already defined here.
|
|
164
|
+
* Mount the same routine twice by naming each mount with `as`.
|
|
165
|
+
*/
|
|
166
|
+
use<SubIn, Out extends object, R extends PropertyKey>(routine: Routine<SubIn, Ctx, Out, R>, options: MountOptions & {
|
|
167
|
+
input: MountInput<In, Ctx, SubIn>;
|
|
168
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R>;
|
|
169
|
+
use<SubIn, Out extends object, R extends PropertyKey>(script: Script<SubIn, Out, R>, options: MountOptions & {
|
|
170
|
+
input: MountInput<In, Ctx, SubIn>;
|
|
171
|
+
}): Script<In, Merge<Ctx, Out>, Reserved | R>;
|
|
172
|
+
use<Out extends object, R extends PropertyKey>(script: Script<In, Out, R>, options?: MountOptions): Script<In, Merge<Ctx, Out>, Reserved | R>;
|
|
173
|
+
use<Out extends object, R extends PropertyKey>(routine: Routine<In, Ctx, Out, R>, options?: MountOptions): Script<In, Merge<Ctx, Out>, Reserved | R>;
|
|
69
174
|
/** Every step name, in execution order — handy for tests and docs. */
|
|
70
175
|
outline(): Array<{
|
|
71
176
|
phase: string;
|
|
72
177
|
steps: string[];
|
|
73
178
|
}>;
|
|
74
179
|
private currentPhase;
|
|
180
|
+
/**
|
|
181
|
+
* Phase names have to be unique: they are what the frame labels, what
|
|
182
|
+
* `outline()` reports, and — since the cache landed — what identifies a
|
|
183
|
+
* phase's stored entry. Two phases sharing a name share a cache slot, which
|
|
184
|
+
* reads as wrong data rather than as an error.
|
|
185
|
+
*/
|
|
186
|
+
private claimPhaseName;
|
|
75
187
|
run(input: In, runOptions?: RunOptions): Promise<RunResult<Ctx>>;
|
|
76
188
|
/** Retry + timeout wrapper around a single handler invocation. */
|
|
77
189
|
private executeStep;
|
|
@@ -93,8 +205,36 @@ export declare class Script<In = void, Ctx extends object = {}> {
|
|
|
93
205
|
* handler: async ({ ctx }) => ({ verified: ctx.user.id }),
|
|
94
206
|
* });
|
|
95
207
|
* ```
|
|
208
|
+
*
|
|
209
|
+
* `rollbackKeys` works the same here, and the keys it names stay reserved once
|
|
210
|
+
* the step is handed to `addStep`.
|
|
211
|
+
*/
|
|
212
|
+
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>;
|
|
213
|
+
/**
|
|
214
|
+
* Declare phases and steps away from any particular script, then mount them
|
|
215
|
+
* with {@link Script.use}.
|
|
216
|
+
*
|
|
217
|
+
* The two parameters are the *minimum* the fragment needs — the input it
|
|
218
|
+
* reads, and the context it expects to already exist — exactly as they are for
|
|
219
|
+
* {@link stepFor}. Whatever it produces flows on into whichever script mounts
|
|
220
|
+
* it, and any script that cannot satisfy the requirement is a compile error at
|
|
221
|
+
* the `use()` call, not an `undefined` at run time.
|
|
222
|
+
*
|
|
223
|
+
* ```ts
|
|
224
|
+
* export const fetchChannel = routineFor<{ channel: string }>()("fetch channel", (s) =>
|
|
225
|
+
* s
|
|
226
|
+
* .addPhase("Fetch")
|
|
227
|
+
* .addStep({ name: "authenticate", handler: … })
|
|
228
|
+
* .addStep({ name: "pull orders", handler: … })
|
|
229
|
+
* .addPhase("Normalize")
|
|
230
|
+
* .addStep({ name: "dedupe", handler: … }),
|
|
231
|
+
* );
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* A routine owns whole phases, so phase-level options — `when`, `cache` —
|
|
235
|
+
* travel with it.
|
|
96
236
|
*/
|
|
97
|
-
export declare function
|
|
237
|
+
export declare function routineFor<In, Ctx extends object = {}>(): <Out extends object, R extends PropertyKey>(name: string, build: (script: Script<In, Ctx, never>) => Script<In, Out, R>) => Routine<In, Ctx, Out, R>;
|
|
98
238
|
/** Convenience factory so callers can skip `new`. */
|
|
99
239
|
export declare function script<In = void>(options?: ScriptOptions | string): Script<In, {}>;
|
|
100
240
|
//# 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;AAY9D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EAET,UAAU,EACV,OAAO,EACP,KAAK,EACL,YAAY,EAIZ,SAAS,EACT,aAAa,EACb,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;IAE5B;;;;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,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