@procedures/lib 0.3.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/CHANGELOG.md +37 -0
- package/README.md +7 -43
- package/dist/.tsbuildinfo +1 -1
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +4 -50
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +0 -58
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -92
- package/dist/types.js.map +1 -1
- package/package.json +8 -8
- package/src/module.ts +3 -60
- package/src/types.ts +1 -150
- package/dist/procedures/core/catch.d.ts +0 -33
- package/dist/procedures/core/catch.d.ts.map +0 -1
- package/dist/procedures/core/catch.js +0 -118
- package/dist/procedures/core/catch.js.map +0 -1
- package/dist/procedures/core/index.d.ts +0 -9
- package/dist/procedures/core/index.d.ts.map +0 -1
- package/dist/procedures/core/index.js +0 -8
- package/dist/procedures/core/index.js.map +0 -1
- package/dist/procedures/dag/index.d.ts +0 -5
- package/dist/procedures/dag/index.d.ts.map +0 -1
- package/dist/procedures/dag/index.js +0 -5
- package/dist/procedures/dag/index.js.map +0 -1
- package/dist/procedures/dag/traverse.d.ts +0 -54
- package/dist/procedures/dag/traverse.d.ts.map +0 -1
- package/dist/procedures/dag/traverse.js +0 -252
- package/dist/procedures/dag/traverse.js.map +0 -1
- package/src/procedures/core/catch.ts +0 -142
- package/src/procedures/core/index.ts +0 -9
- package/src/procedures/dag/index.ts +0 -5
- package/src/procedures/dag/traverse.ts +0 -281
package/src/types.ts
CHANGED
|
@@ -265,130 +265,7 @@ export interface LibAuditOutput {
|
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
//
|
|
269
|
-
// dag.traverse Types
|
|
270
|
-
// =============================================================================
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Schema for $proc references with $when control.
|
|
274
|
-
*/
|
|
275
|
-
const ProcRefSchema: z.ZodObject<{
|
|
276
|
-
$proc: z.ZodArray<z.ZodString>;
|
|
277
|
-
input: z.ZodOptional<z.ZodUnknown>;
|
|
278
|
-
$when: z.ZodOptional<z.ZodString>;
|
|
279
|
-
$name: z.ZodOptional<z.ZodString>;
|
|
280
|
-
}> = z.object({
|
|
281
|
-
$proc: z.array(z.string()),
|
|
282
|
-
input: z.unknown().optional(),
|
|
283
|
-
$when: z.string().optional(),
|
|
284
|
-
$name: z.string().optional(),
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
export const DagTraverseInputSchema: z.ZodObject<{
|
|
288
|
-
visit: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, typeof ProcRefSchema]>;
|
|
289
|
-
filter: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
290
|
-
root: z.ZodOptional<z.ZodString>;
|
|
291
|
-
rootPath: z.ZodOptional<z.ZodString>;
|
|
292
|
-
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
293
|
-
serialize: z.ZodDefault<z.ZodEnum<{ auto: "auto"; repository: "repository"; none: "none" }>>;
|
|
294
|
-
continueOnError: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
-
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
296
|
-
}> = z.object({
|
|
297
|
-
/**
|
|
298
|
-
* Procedure to execute for each node.
|
|
299
|
-
* - Array: procedure path, e.g., ["git", "add"]
|
|
300
|
-
* - $proc with $when: "$never" or "$parent": deferred, executed per-node
|
|
301
|
-
*
|
|
302
|
-
* Example:
|
|
303
|
-
* ```json
|
|
304
|
-
* { "$proc": ["git", "add"], "input": { "all": true }, "$when": "$parent" }
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
visit: z.union([
|
|
308
|
-
z.array(z.string()),
|
|
309
|
-
ProcRefSchema,
|
|
310
|
-
]).describe("Procedure to execute for each node. - Array: procedure path, e.g., [\"git\", \"add\"] - $proc with $when: \"$never\" or \"$parent\": deferred, executed per-node Example: ```json { \"$proc\": [\"git\", \"add\"], \"input\": { \"all\": true }, \"$when\": \"$parent\" } ```"),
|
|
311
|
-
/** Filter to specific package names */
|
|
312
|
-
filter: z.array(z.string()).optional().describe("Filter to specific package names"),
|
|
313
|
-
/** Start from specific root package */
|
|
314
|
-
root: z.string().optional().describe("Start from specific root package"),
|
|
315
|
-
/** Workspace root (defaults to the pnpm workspace that contains client-lib) */
|
|
316
|
-
rootPath: z.string().optional().describe("Workspace root (defaults to the pnpm workspace that contains client-lib)"),
|
|
317
|
-
/** Max parallel operations (default: 4) */
|
|
318
|
-
concurrency: z.number().default(4).describe("Max parallel operations (default: 4)"),
|
|
319
|
-
/**
|
|
320
|
-
* When the visits of nodes in one git repository run one at a time (default: "auto").
|
|
321
|
-
* - "auto": when the visit calls a `git` procedure (git locks the index of the repository)
|
|
322
|
-
* - "repository": always
|
|
323
|
-
* - "none": never
|
|
324
|
-
*/
|
|
325
|
-
serialize: z.enum(["auto", "repository", "none"]).default("auto").describe("When the visits of nodes in one git repository run one at a time (default: \"auto\"). - \"auto\": when the visit calls a `git` procedure (git locks the index of the repository) - \"repository\": always - \"none\": never"),
|
|
326
|
-
/** Continue on error (default: false) */
|
|
327
|
-
continueOnError: z.boolean().default(false).describe("Continue on error (default: false)"),
|
|
328
|
-
/** Preview without executing (default: false) */
|
|
329
|
-
dryRun: z.boolean().default(false).describe("Preview without executing (default: false)"),
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
export type DagTraverseInput = z.infer<typeof DagTraverseInputSchema>;
|
|
333
|
-
|
|
334
|
-
export interface TraverseNodeResult {
|
|
335
|
-
name: string;
|
|
336
|
-
path: string;
|
|
337
|
-
success: boolean;
|
|
338
|
-
duration: number;
|
|
339
|
-
error?: string | undefined;
|
|
340
|
-
output?: unknown | undefined;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export interface DagTraverseOutput {
|
|
344
|
-
success: boolean;
|
|
345
|
-
results: TraverseNodeResult[];
|
|
346
|
-
totalDuration: number;
|
|
347
|
-
visited: number;
|
|
348
|
-
failed: number;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// =============================================================================
|
|
352
|
-
// core.catch Types
|
|
353
|
-
// =============================================================================
|
|
354
|
-
|
|
355
|
-
export const CoreCatchInputSchema: z.ZodObject<{
|
|
356
|
-
try: z.ZodUnknown;
|
|
357
|
-
handler: z.ZodOptional<z.ZodUnknown>;
|
|
358
|
-
cwd: z.ZodOptional<z.ZodString>;
|
|
359
|
-
}> = z.object({
|
|
360
|
-
/**
|
|
361
|
-
* Procedure ref to try executing.
|
|
362
|
-
* Should use $when: "catch" so it's not auto-executed during hydration.
|
|
363
|
-
*
|
|
364
|
-
* Example:
|
|
365
|
-
* ```json
|
|
366
|
-
* { "$proc": ["git", "commit"], "input": { "message": "auto" }, "$when": "catch" }
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
|
-
try: z.unknown().describe("Procedure ref to try executing. Should use $when: \"catch\" so it's not auto-executed during hydration. Example: ```json { \"$proc\": [\"git\", \"commit\"], \"input\": { \"message\": \"auto\" }, \"$when\": \"catch\" } ```"),
|
|
370
|
-
/**
|
|
371
|
-
* Handler procedure ref called on error.
|
|
372
|
-
* Receives StepResultInfo (success, error, proc) merged with its input.
|
|
373
|
-
* Should return ContinueDecision { continue: boolean }.
|
|
374
|
-
*/
|
|
375
|
-
handler: z.unknown().optional().describe("Handler procedure ref called on error. Receives StepResultInfo (success, error, proc) merged with its input. Should return ContinueDecision { continue: boolean }."),
|
|
376
|
-
/** Working directory for procedure execution */
|
|
377
|
-
cwd: z.string().optional().describe("Working directory for procedure execution"),
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
export type CoreCatchInput = z.infer<typeof CoreCatchInputSchema>;
|
|
381
|
-
|
|
382
|
-
export interface CoreCatchOutput {
|
|
383
|
-
/** Whether the try succeeded */
|
|
384
|
-
success: boolean;
|
|
385
|
-
/** Result from try (if success) or handler decision */
|
|
386
|
-
result?: unknown | undefined;
|
|
387
|
-
/** Error message if failed */
|
|
388
|
-
error?: string | undefined;
|
|
389
|
-
/** Whether execution should continue (from handler) */
|
|
390
|
-
continue: boolean;
|
|
391
|
-
}
|
|
268
|
+
// The types of dag.traverse are in @procedures/dag. core.catch is removed: use client.tryCatch.
|
|
392
269
|
|
|
393
270
|
// =============================================================================
|
|
394
271
|
// Output schemas (roadmap 2.1)
|
|
@@ -499,32 +376,6 @@ export const LibAuditOutputSchema: z.ZodType<LibAuditOutput> = z.looseObject({
|
|
|
499
376
|
.describe("The counts"),
|
|
500
377
|
});
|
|
501
378
|
|
|
502
|
-
export const DagTraverseOutputSchema: z.ZodType<DagTraverseOutput> = z.looseObject({
|
|
503
|
-
success: z.boolean().describe("True when every visit succeeded"),
|
|
504
|
-
results: z
|
|
505
|
-
.array(
|
|
506
|
-
z.looseObject({
|
|
507
|
-
name: z.string().describe("The package name of the node"),
|
|
508
|
-
path: z.string().describe("The folder of the node"),
|
|
509
|
-
success: z.boolean().describe("True when the visit succeeded"),
|
|
510
|
-
duration: z.number().describe("The time of the visit, in milliseconds"),
|
|
511
|
-
error: z.string().optional().describe("The error of a failed visit"),
|
|
512
|
-
output: z.unknown().optional().describe("The result of the visit"),
|
|
513
|
-
})
|
|
514
|
-
)
|
|
515
|
-
.describe("The result of each visited node"),
|
|
516
|
-
totalDuration: z.number().describe("The time of the traversal, in milliseconds"),
|
|
517
|
-
visited: z.number().describe("The number of visited nodes"),
|
|
518
|
-
failed: z.number().describe("The number of failed visits"),
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
export const CoreCatchOutputSchema: z.ZodType<CoreCatchOutput> = z.looseObject({
|
|
522
|
-
success: z.boolean().describe("True when the try operand succeeded"),
|
|
523
|
-
result: z.unknown().optional().describe("The result of try, or the decision of the handler"),
|
|
524
|
-
error: z.string().optional().describe("The error of try, when it failed"),
|
|
525
|
-
continue: z.boolean().describe("True when the caller can continue"),
|
|
526
|
-
});
|
|
527
|
-
|
|
528
379
|
// =============================================================================
|
|
529
380
|
// lib.graph Types (roadmap R44)
|
|
530
381
|
// =============================================================================
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* core.catch procedure
|
|
3
|
-
*
|
|
4
|
-
* Wraps a procedure execution with error handling.
|
|
5
|
-
* The `try` procedure ref should use `$when: "catch"` so it's not
|
|
6
|
-
* executed during hydration but instead by this procedure.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* {
|
|
11
|
-
* $proc: ["core", "catch"],
|
|
12
|
-
* input: {
|
|
13
|
-
* try: {
|
|
14
|
-
* $proc: ["git", "commit"],
|
|
15
|
-
* input: { message: "auto" },
|
|
16
|
-
* $when: "catch" // Defer execution to catch procedure
|
|
17
|
-
* },
|
|
18
|
-
* handler: {
|
|
19
|
-
* $proc: ["core", "identity"],
|
|
20
|
-
* input: { value: { continue: true } },
|
|
21
|
-
* $when: "catch"
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
import type { ProcedureContext } from "@procedures/client";
|
|
28
|
-
import type { CoreCatchInput, CoreCatchOutput } from "../../types.js";
|
|
29
|
-
/**
|
|
30
|
-
* Execute a procedure with error handling
|
|
31
|
-
*/
|
|
32
|
-
export declare function coreCatch(input: CoreCatchInput, ctx: ProcedureContext): Promise<CoreCatchOutput>;
|
|
33
|
-
//# sourceMappingURL=catch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catch.d.ts","sourceRoot":"","sources":["../../../src/procedures/core/catch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,oBAAoB,CAAC;AAS1E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,eAAe,CAAC,CAiG1B"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* core.catch procedure
|
|
3
|
-
*
|
|
4
|
-
* Wraps a procedure execution with error handling.
|
|
5
|
-
* The `try` procedure ref should use `$when: "catch"` so it's not
|
|
6
|
-
* executed during hydration but instead by this procedure.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* {
|
|
11
|
-
* $proc: ["core", "catch"],
|
|
12
|
-
* input: {
|
|
13
|
-
* try: {
|
|
14
|
-
* $proc: ["git", "commit"],
|
|
15
|
-
* input: { message: "auto" },
|
|
16
|
-
* $when: "catch" // Defer execution to catch procedure
|
|
17
|
-
* },
|
|
18
|
-
* handler: {
|
|
19
|
-
* $proc: ["core", "identity"],
|
|
20
|
-
* input: { value: { continue: true } },
|
|
21
|
-
* $when: "catch"
|
|
22
|
-
* }
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
import { isAnyProcedureRef, normalizeRef, hydrateInput, scopeOf, } from "@procedures/client";
|
|
28
|
-
/**
|
|
29
|
-
* Execute a procedure with error handling
|
|
30
|
-
*/
|
|
31
|
-
export async function coreCatch(input, ctx) {
|
|
32
|
-
const { try: tryRef, handler: handlerRef, cwd } = input;
|
|
33
|
-
// The names of the chain around this procedure: a `$ref` in an operand can read them
|
|
34
|
-
const scope = scopeOf(input);
|
|
35
|
-
// Validate try is a procedure ref
|
|
36
|
-
if (!isAnyProcedureRef(tryRef)) {
|
|
37
|
-
throw new Error("catch: 'try' must be a procedure reference with $when: \"catch\"");
|
|
38
|
-
}
|
|
39
|
-
// Create executor that uses client.call
|
|
40
|
-
const executor = async (path, inp) => {
|
|
41
|
-
// Inject cwd if provided
|
|
42
|
-
const inputWithCwd = cwd && typeof inp === "object" && inp !== null
|
|
43
|
-
? { ...inp, cwd }
|
|
44
|
-
: inp;
|
|
45
|
-
return ctx.client.call(path, inputWithCwd);
|
|
46
|
-
};
|
|
47
|
-
// Normalize the try ref
|
|
48
|
-
const normalizedTry = normalizeRef(tryRef);
|
|
49
|
-
// Build input for try, merging with cwd
|
|
50
|
-
const tryInput = {
|
|
51
|
-
...(typeof normalizedTry.input === "object" ? normalizedTry.input : {}),
|
|
52
|
-
...(cwd ? { cwd } : {}),
|
|
53
|
-
};
|
|
54
|
-
try {
|
|
55
|
-
// Hydrate the try input (execute any nested $immediate refs). The hydration is inside the
|
|
56
|
-
// `try`: a nested ref that throws is an error of the `try` step (deep dive DATA-22).
|
|
57
|
-
const hydratedTryInput = await hydrateInput(tryInput, executor, {
|
|
58
|
-
contextStack: ["catch"],
|
|
59
|
-
onRef: ctx.onRef,
|
|
60
|
-
scope,
|
|
61
|
-
});
|
|
62
|
-
// Execute the try procedure
|
|
63
|
-
const result = await ctx.client.call(normalizedTry.path, hydratedTryInput);
|
|
64
|
-
return {
|
|
65
|
-
success: true,
|
|
66
|
-
result,
|
|
67
|
-
continue: true,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
72
|
-
// If no handler, return error result with continue: false
|
|
73
|
-
if (!handlerRef || !isAnyProcedureRef(handlerRef)) {
|
|
74
|
-
return {
|
|
75
|
-
success: false,
|
|
76
|
-
error: errorMessage,
|
|
77
|
-
continue: false,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
// Build StepResultInfo for handler
|
|
81
|
-
const resultInfo = {
|
|
82
|
-
success: false,
|
|
83
|
-
error: errorMessage,
|
|
84
|
-
proc: normalizedTry.path,
|
|
85
|
-
};
|
|
86
|
-
// Execute handler with result info merged into its input
|
|
87
|
-
const normalizedHandler = normalizeRef(handlerRef);
|
|
88
|
-
const handlerInput = {
|
|
89
|
-
...(typeof normalizedHandler.input === "object" ? normalizedHandler.input : {}),
|
|
90
|
-
...resultInfo,
|
|
91
|
-
...(cwd ? { cwd } : {}),
|
|
92
|
-
};
|
|
93
|
-
try {
|
|
94
|
-
// Hydrate handler input (a failure here is a failure of the handler)
|
|
95
|
-
const hydratedHandlerInput = await hydrateInput(handlerInput, executor, {
|
|
96
|
-
contextStack: ["catch"],
|
|
97
|
-
onRef: ctx.onRef,
|
|
98
|
-
scope,
|
|
99
|
-
});
|
|
100
|
-
const decision = await ctx.client.call(normalizedHandler.path, hydratedHandlerInput);
|
|
101
|
-
return {
|
|
102
|
-
success: false,
|
|
103
|
-
error: errorMessage,
|
|
104
|
-
result: decision,
|
|
105
|
-
continue: decision.continue ?? false,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
catch (handlerError) {
|
|
109
|
-
// Handler itself failed
|
|
110
|
-
return {
|
|
111
|
-
success: false,
|
|
112
|
-
error: `Handler failed: ${handlerError instanceof Error ? handlerError.message : String(handlerError)}`,
|
|
113
|
-
continue: false,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=catch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"catch.js","sourceRoot":"","sources":["../../../src/procedures/core/catch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,OAAO,GAGR,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,KAAqB,EACrB,GAAqB;IAErB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IACxD,qFAAqF;IACrF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7B,kCAAkC;IAClC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EA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Q,EAAE,QAAQ,CAAC,QAAQ,IAAI,KAAK;aACrC,CAAC;QACJ,CAAC;QAAC,OAAO,YAAY,EAAE,CAAC;YACtB,wBAAwB;YACxB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,mBAAmB,YAAY,YAAY,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE;gBACvG,QAAQ,EAAE,KAAK;aAChB,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core control-flow procedures that require ProcedureContext
|
|
3
|
-
*
|
|
4
|
-
* These procedures need access to the client for executing procedure refs
|
|
5
|
-
* with proper error handling and control flow.
|
|
6
|
-
*/
|
|
7
|
-
export { coreCatch } from "./catch.js";
|
|
8
|
-
export type { CoreCatchInput, CoreCatchOutput } from "../../types.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/procedures/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core control-flow procedures that require ProcedureContext
|
|
3
|
-
*
|
|
4
|
-
* These procedures need access to the client for executing procedure refs
|
|
5
|
-
* with proper error handling and control flow.
|
|
6
|
-
*/
|
|
7
|
-
export { coreCatch } from "./catch.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/procedures/core/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/procedures/dag/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/procedures/dag/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dag.traverse procedure
|
|
3
|
-
*
|
|
4
|
-
* General-purpose DAG traversal that executes a visit procedure
|
|
5
|
-
* for each node in dependency order.
|
|
6
|
-
*
|
|
7
|
-
* This enables declarative composition of traversals:
|
|
8
|
-
* ```typescript
|
|
9
|
-
* // Execute git add on all packages (using $when: "$parent")
|
|
10
|
-
* await client.exec({
|
|
11
|
-
* $proc: ["dag", "traverse"],
|
|
12
|
-
* input: {
|
|
13
|
-
* visit: {
|
|
14
|
-
* $proc: ["git", "add"],
|
|
15
|
-
* input: { all: true },
|
|
16
|
-
* $when: "$parent" // Defer to dag.traverse
|
|
17
|
-
* }
|
|
18
|
-
* }
|
|
19
|
-
* });
|
|
20
|
-
*
|
|
21
|
-
* // Simple form with just procedure path
|
|
22
|
-
* await client.exec({
|
|
23
|
-
* $proc: ["dag", "traverse"],
|
|
24
|
-
* input: {
|
|
25
|
-
* visit: ["git", "add"]
|
|
26
|
-
* }
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* The `$when` field controls when nested $proc refs are executed:
|
|
31
|
-
* - "$immediate" (default): Execute during hydration
|
|
32
|
-
* - "$parent": Defer to parent procedure (dag.traverse executes per-node)
|
|
33
|
-
* - "$never": Never auto-execute, pass as pure data
|
|
34
|
-
*/
|
|
35
|
-
import type { ProcedureContext } from "@procedures/client";
|
|
36
|
-
import type { DagTraverseInput, DagTraverseOutput } from "../../types.js";
|
|
37
|
-
/** The folder of the git repository that holds `path` (it has `.git`), or `path` itself. */
|
|
38
|
-
export declare function repositoryRoot(path: string): string;
|
|
39
|
-
/** True when the value names a `git` procedure: a path, or a `$proc` ref at any depth. */
|
|
40
|
-
export declare function callsGit(value: unknown): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Run the tasks of one key one at a time, in the order of the calls. Tasks of other keys run
|
|
43
|
-
* in parallel.
|
|
44
|
-
*/
|
|
45
|
-
export declare function keyedLock(): <T>(key: string, task: () => Promise<T>) => Promise<T>;
|
|
46
|
-
/**
|
|
47
|
-
* Execute a DAG traversal with a custom visit procedure
|
|
48
|
-
*
|
|
49
|
-
* The visits of nodes in one git repository run one at a time when the visit calls git (or
|
|
50
|
-
* with `serialize: "repository"`). All the packages of a workspace share one repository, and
|
|
51
|
-
* concurrent `git add` calls failed on `index.lock` (deep dive DATA-17).
|
|
52
|
-
*/
|
|
53
|
-
export declare function dagTraverse(input: DagTraverseInput, ctx: ProcedureContext): Promise<DagTraverseOutput>;
|
|
54
|
-
//# sourceMappingURL=traverse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../../src/procedures/dag/traverse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AAUxB,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQnD;AAED,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAShD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAkBlF;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,gBAAgB,EACvB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAyK5B"}
|