@owlmeans/agent-common 0.1.18-rc.47 → 0.1.18-rc.48
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 +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/agent-common/SKILL.md +1 -1
- package/build/consts.d.ts +20 -0
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +103 -0
- package/build/consts.js.map +1 -1
- package/build/errors.d.ts +1 -1
- package/build/errors.js +1 -1
- package/build/helpers/conversation.d.ts +0 -9
- package/build/helpers/conversation.d.ts.map +1 -1
- package/build/helpers/conversation.js +0 -28
- package/build/helpers/conversation.js.map +1 -1
- package/build/helpers/truncate.d.ts +10 -0
- package/build/helpers/truncate.d.ts.map +1 -0
- package/build/helpers/truncate.js +29 -0
- package/build/helpers/truncate.js.map +1 -0
- package/build/index.d.ts +4 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/models/pipeline-spec/types.d.ts +57 -0
- package/build/models/pipeline-spec/types.d.ts.map +1 -0
- package/build/models/pipeline-spec/types.js +2 -0
- package/build/models/pipeline-spec/types.js.map +1 -0
- package/build/models/pipeline-spec.d.ts +4 -0
- package/build/models/pipeline-spec.d.ts.map +1 -0
- package/build/models/pipeline-spec.js +171 -0
- package/build/models/pipeline-spec.js.map +1 -0
- package/build/pipeline.d.ts +4 -43
- package/build/pipeline.d.ts.map +1 -1
- package/build/pipeline.js +9 -205
- package/build/pipeline.js.map +1 -1
- package/build/results/types.d.ts +211 -0
- package/build/results/types.d.ts.map +1 -0
- package/build/results/types.js +2 -0
- package/build/results/types.js.map +1 -0
- package/build/results.d.ts +3 -55
- package/build/results.d.ts.map +1 -1
- package/build/results.js +202 -250
- package/build/results.js.map +1 -1
- package/build/types.d.ts +1 -137
- package/build/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/consts.ts +113 -0
- package/src/errors.ts +1 -1
- package/src/helpers/conversation.ts +0 -32
- package/src/helpers/truncate.ts +31 -0
- package/src/index.ts +4 -1
- package/src/models/pipeline-spec/types.ts +58 -0
- package/src/models/pipeline-spec.ts +202 -0
- package/src/pipeline.ts +10 -231
- package/src/results/types.ts +221 -0
- package/src/results.ts +229 -274
- package/src/types.ts +2 -147
- package/tests/pipeline.spec.ts +26 -29
- package/tests/results.spec.ts +24 -26
- package/build/flows.d.ts +0 -21
- package/build/flows.d.ts.map +0 -1
- package/build/flows.js +0 -105
- package/build/flows.js.map +0 -1
- package/src/flows.ts +0 -113
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
46
46
|
your project's skill store (`.agents/skills/`):
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
49
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.49
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/agent-common",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.48",
|
|
5
|
+
"generatedAt": "2026-10-05T21:03:06.368Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/agent-common
|
|
9
9
|
|
|
10
10
|
**Layer:** Cross-cutting domain
|
|
11
|
-
**Install:** `"@owlmeans/agent-common": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/agent-common": "^0.1.18-rc.48"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
Serializable contracts for the agent family. No LangChain, no LangGraph, no storage driver — a
|
|
14
14
|
backend or a browser bundle imports these to read what an agent wrote without pulling the runtime.
|
package/build/consts.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ShallowFlow } from '@owlmeans/flow';
|
|
1
2
|
/**
|
|
2
3
|
* The agent service alias.
|
|
3
4
|
*
|
|
@@ -157,4 +158,23 @@ export declare enum CumulativeFactKind {
|
|
|
157
158
|
Resource = "resource",
|
|
158
159
|
File = "file"
|
|
159
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* The lifecycle of one agent run.
|
|
163
|
+
*
|
|
164
|
+
* Read it as "how far did this run get", not "what did it say". Everything conversational happens
|
|
165
|
+
* inside `Working`; the steps exist so a plugin reading `onFinish` can say where a run ended.
|
|
166
|
+
* `Fail` is reachable from every working step and is TERMINAL — see the note on that step.
|
|
167
|
+
*
|
|
168
|
+
* `service` is left as the flow name on every step. A flow step normally binds to a service or an
|
|
169
|
+
* entrypoint, but an agent run is driven by whoever holds the model — there is no second party to
|
|
170
|
+
* hand control to, and inventing one would put a name in the serialized state that nothing
|
|
171
|
+
* resolves.
|
|
172
|
+
*
|
|
173
|
+
* Each working step keeps exactly ONE non-explicit outgoing transition, so `FlowModel.next()`
|
|
174
|
+
* always has an unambiguous answer: that is what lets a driver advance the run without knowing the
|
|
175
|
+
* vocabulary. `Fail` is marked explicit precisely so it never becomes that automatic answer.
|
|
176
|
+
*/
|
|
177
|
+
export declare const agentRunFlow: ShallowFlow;
|
|
178
|
+
/** Every flow this package declares, for a provider to serve. */
|
|
179
|
+
export declare const agentFlows: ShallowFlow[];
|
|
160
180
|
//# sourceMappingURL=consts.d.ts.map
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,WAAW,CAAA;AAEtC;;;;;;GAMG;AACH,eA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AC5F,OAAO,YAAY;IACnB;;;;;;OAMG;IACH,OAAO,YAAY;CACpB;AAED,6CAA6C;AAC7C,oBAAY,sBAAsB;IAChC,2EAA2E;IAC3E,SAAS,cAAc;IACvB;;;OAGG;IACH,OAAO,YAAY;IACnB,8EAA8E;IAC9E,MAAM,WAAW;IACjB,0EAA0E;IAC1E,UAAU,eAAe;CAC1B;AAED,4DAA4D;AAC5D,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,mCAAmC;IACnC,OAAO,YAAY;IACnB,uEAAuE;IACvE,OAAO,YAAY;CACpB;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,EAAE,WA0F1B,CAAA;AAED,iEAAiE;AACjE,eAAO,MAAM,UAAU,EAAE,WAAW,EAAmB,CAAA"}
|
package/build/consts.js
CHANGED
|
@@ -164,4 +164,107 @@ export var CumulativeFactKind;
|
|
|
164
164
|
CumulativeFactKind["Resource"] = "resource";
|
|
165
165
|
CumulativeFactKind["File"] = "file";
|
|
166
166
|
})(CumulativeFactKind || (CumulativeFactKind = {}));
|
|
167
|
+
/**
|
|
168
|
+
* The lifecycle of one agent run.
|
|
169
|
+
*
|
|
170
|
+
* Read it as "how far did this run get", not "what did it say". Everything conversational happens
|
|
171
|
+
* inside `Working`; the steps exist so a plugin reading `onFinish` can say where a run ended.
|
|
172
|
+
* `Fail` is reachable from every working step and is TERMINAL — see the note on that step.
|
|
173
|
+
*
|
|
174
|
+
* `service` is left as the flow name on every step. A flow step normally binds to a service or an
|
|
175
|
+
* entrypoint, but an agent run is driven by whoever holds the model — there is no second party to
|
|
176
|
+
* hand control to, and inventing one would put a name in the serialized state that nothing
|
|
177
|
+
* resolves.
|
|
178
|
+
*
|
|
179
|
+
* Each working step keeps exactly ONE non-explicit outgoing transition, so `FlowModel.next()`
|
|
180
|
+
* always has an unambiguous answer: that is what lets a driver advance the run without knowing the
|
|
181
|
+
* vocabulary. `Fail` is marked explicit precisely so it never becomes that automatic answer.
|
|
182
|
+
*/
|
|
183
|
+
export const agentRunFlow = {
|
|
184
|
+
flow: AGENT_RUN_FLOW,
|
|
185
|
+
initialStep: AgentRunStep.Received,
|
|
186
|
+
steps: {
|
|
187
|
+
[AgentRunStep.Received]: {
|
|
188
|
+
index: 0,
|
|
189
|
+
step: AgentRunStep.Received,
|
|
190
|
+
service: AGENT_RUN_FLOW,
|
|
191
|
+
initial: true,
|
|
192
|
+
transitions: {
|
|
193
|
+
[AgentRunTransition.Prepare]: {
|
|
194
|
+
transition: AgentRunTransition.Prepare,
|
|
195
|
+
step: AgentRunStep.Prepared,
|
|
196
|
+
},
|
|
197
|
+
[AgentRunTransition.Fail]: {
|
|
198
|
+
transition: AgentRunTransition.Fail,
|
|
199
|
+
step: AgentRunStep.Failed,
|
|
200
|
+
explicit: true,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
[AgentRunStep.Prepared]: {
|
|
205
|
+
index: 1,
|
|
206
|
+
step: AgentRunStep.Prepared,
|
|
207
|
+
service: AGENT_RUN_FLOW,
|
|
208
|
+
transitions: {
|
|
209
|
+
[AgentRunTransition.Work]: {
|
|
210
|
+
transition: AgentRunTransition.Work,
|
|
211
|
+
step: AgentRunStep.Working,
|
|
212
|
+
},
|
|
213
|
+
[AgentRunTransition.Fail]: {
|
|
214
|
+
transition: AgentRunTransition.Fail,
|
|
215
|
+
step: AgentRunStep.Failed,
|
|
216
|
+
explicit: true,
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
[AgentRunStep.Working]: {
|
|
221
|
+
index: 2,
|
|
222
|
+
step: AgentRunStep.Working,
|
|
223
|
+
service: AGENT_RUN_FLOW,
|
|
224
|
+
transitions: {
|
|
225
|
+
[AgentRunTransition.Finalize]: {
|
|
226
|
+
transition: AgentRunTransition.Finalize,
|
|
227
|
+
step: AgentRunStep.Finalizing,
|
|
228
|
+
},
|
|
229
|
+
[AgentRunTransition.Fail]: {
|
|
230
|
+
transition: AgentRunTransition.Fail,
|
|
231
|
+
step: AgentRunStep.Failed,
|
|
232
|
+
explicit: true,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
[AgentRunStep.Finalizing]: {
|
|
237
|
+
index: 3,
|
|
238
|
+
step: AgentRunStep.Finalizing,
|
|
239
|
+
service: AGENT_RUN_FLOW,
|
|
240
|
+
transitions: {
|
|
241
|
+
[AgentRunTransition.Finish]: {
|
|
242
|
+
transition: AgentRunTransition.Finish,
|
|
243
|
+
step: AgentRunStep.Finished,
|
|
244
|
+
},
|
|
245
|
+
[AgentRunTransition.Fail]: {
|
|
246
|
+
transition: AgentRunTransition.Fail,
|
|
247
|
+
step: AgentRunStep.Failed,
|
|
248
|
+
explicit: true,
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
[AgentRunStep.Finished]: {
|
|
253
|
+
index: 4,
|
|
254
|
+
step: AgentRunStep.Finished,
|
|
255
|
+
service: AGENT_RUN_FLOW,
|
|
256
|
+
transitions: {},
|
|
257
|
+
},
|
|
258
|
+
[AgentRunStep.Failed]: {
|
|
259
|
+
index: 5,
|
|
260
|
+
step: AgentRunStep.Failed,
|
|
261
|
+
service: AGENT_RUN_FLOW,
|
|
262
|
+
// Terminal. Nothing resumes a ReAct run — its tool results are side effects already applied
|
|
263
|
+
// to the world, so re-entering it re-applies them. Resumable work is a pipeline.
|
|
264
|
+
transitions: {},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
/** Every flow this package declares, for a provider to serve. */
|
|
269
|
+
export const agentFlows = [agentRunFlow];
|
|
167
270
|
//# sourceMappingURL=consts.js.map
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAClE,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAClE,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,+BAA+B,CAAA;AAE5E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAA;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAA;AAC/C,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;AAC/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAA;AACvC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;AAE/C,qGAAqG;AACrG,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA;AAE7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAN,IAA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,IAAI;iBACf;aACF;SACF;QAED,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;YACvB,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,YAAY,CAAC,QAAQ;YAC3B,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,EAAE;SAChB;QAED,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;YACrB,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,YAAY,CAAC,MAAM;YACzB,OAAO,EAAE,cAAc;YACvB,4FAA4F;YAC5F,iFAAiF;YACjF,WAAW,EAAE,EAAE;SAChB;KACF;CACF,CAAA;AAED,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAkB,CAAC,YAAY,CAAC,CAAA"}
|
package/build/errors.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class AgentRunStateError extends AgentCommonError {
|
|
|
11
11
|
/**
|
|
12
12
|
* A pipeline declaration is not runnable.
|
|
13
13
|
*
|
|
14
|
-
* Thrown by {@link import('./pipeline.js').
|
|
14
|
+
* Thrown by {@link import('./models/pipeline-spec/types.js').PipelineSpecModel.validate} and by the runner's own build
|
|
15
15
|
* step, and it always names EVERY fault it found rather than the first: a spec is authored once and
|
|
16
16
|
* fixed once, and reporting faults one per build turns a five-minute edit into five builds.
|
|
17
17
|
*/
|
package/build/errors.js
CHANGED
|
@@ -16,7 +16,7 @@ export class AgentRunStateError extends AgentCommonError {
|
|
|
16
16
|
/**
|
|
17
17
|
* A pipeline declaration is not runnable.
|
|
18
18
|
*
|
|
19
|
-
* Thrown by {@link import('./pipeline.js').
|
|
19
|
+
* Thrown by {@link import('./models/pipeline-spec/types.js').PipelineSpecModel.validate} and by the runner's own build
|
|
20
20
|
* step, and it always names EVERY fault it found rather than the first: a spec is authored once and
|
|
21
21
|
* fixed once, and reporting faults one per build turns a five-minute edit into five builds.
|
|
22
22
|
*/
|
|
@@ -14,13 +14,4 @@ import type { ConversationRef } from '../types.js';
|
|
|
14
14
|
* dedication.
|
|
15
15
|
*/
|
|
16
16
|
export declare const conversationFor: (purpose: LlmPurpose | undefined, override?: Partial<ConversationRef>) => ConversationRef;
|
|
17
|
-
/**
|
|
18
|
-
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
19
|
-
*
|
|
20
|
-
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
21
|
-
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
22
|
-
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
23
|
-
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
24
|
-
*/
|
|
25
|
-
export declare const truncateAt: (text: string, max: number) => string;
|
|
26
17
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,YACjB,UAAU,GAAG,SAAS,aACpB,OAAO,CAAC,eAAe,CAAC,KAClC,eASF,CAAA
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,YACjB,UAAU,GAAG,SAAS,aACpB,OAAO,CAAC,eAAe,CAAC,KAClC,eASF,CAAA"}
|
|
@@ -21,32 +21,4 @@ export const conversationFor = (purpose, override) => {
|
|
|
21
21
|
scope: override?.scope ?? (target !== '' ? target : 'anonymous'),
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
26
|
-
*
|
|
27
|
-
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
28
|
-
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
29
|
-
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
30
|
-
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
31
|
-
*/
|
|
32
|
-
export const truncateAt = (text, max) => {
|
|
33
|
-
const trimmed = text.trim();
|
|
34
|
-
if (trimmed.length <= max) {
|
|
35
|
-
return trimmed;
|
|
36
|
-
}
|
|
37
|
-
if (max <= 1) {
|
|
38
|
-
return trimmed.slice(0, Math.max(0, max));
|
|
39
|
-
}
|
|
40
|
-
const ellipsis = '…';
|
|
41
|
-
const budget = max - ellipsis.length;
|
|
42
|
-
const head = trimmed.slice(0, budget);
|
|
43
|
-
const floor = Math.floor(budget * 0.75);
|
|
44
|
-
for (const boundary of ['\n\n', '\n', '. ', ' ']) {
|
|
45
|
-
const at = head.lastIndexOf(boundary);
|
|
46
|
-
if (at >= floor) {
|
|
47
|
-
return head.slice(0, boundary === '. ' ? at + 1 : at).trimEnd() + ellipsis;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return head.trimEnd() + ellipsis;
|
|
51
|
-
};
|
|
52
24
|
//# sourceMappingURL=conversation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAA+B,EAC/B,QAAmC,EAClB,EAAE;IACnB,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,EAAE,CAAA;IAC5C,MAAM,SAAS,GAAG,UAAU,CAAC,OA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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
3
|
+
*
|
|
4
|
+
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
5
|
+
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
6
|
+
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
7
|
+
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare const truncateAt: (text: string, max: number) => string;
|
|
10
|
+
//# sourceMappingURL=truncate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncate.d.ts","sourceRoot":"","sources":["../../src/helpers/truncate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,OAAO,MAAM,KAAG,MAsBtD,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
3
|
+
*
|
|
4
|
+
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
5
|
+
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
6
|
+
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
7
|
+
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
8
|
+
*/
|
|
9
|
+
export const truncateAt = (text, max) => {
|
|
10
|
+
const trimmed = text.trim();
|
|
11
|
+
if (trimmed.length <= max) {
|
|
12
|
+
return trimmed;
|
|
13
|
+
}
|
|
14
|
+
if (max <= 1) {
|
|
15
|
+
return trimmed.slice(0, Math.max(0, max));
|
|
16
|
+
}
|
|
17
|
+
const ellipsis = '…';
|
|
18
|
+
const budget = max - ellipsis.length;
|
|
19
|
+
const head = trimmed.slice(0, budget);
|
|
20
|
+
const floor = Math.floor(budget * 0.75);
|
|
21
|
+
for (const boundary of ['\n\n', '\n', '. ', ' ']) {
|
|
22
|
+
const at = head.lastIndexOf(boundary);
|
|
23
|
+
if (at >= floor) {
|
|
24
|
+
return head.slice(0, boundary === '. ' ? at + 1 : at).trimEnd() + ellipsis;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return head.trimEnd() + ellipsis;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=truncate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncate.js","sourceRoot":"","sources":["../../src/helpers/truncate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,GAAW,EAAU,EAAE;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC3B,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QACb,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAA;IACpB,MAAM,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAA;IACpC,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEvC,KAAK,MAAM,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QACrC,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAA;QAC5E,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAA;AAClC,CAAC,CAAA"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from './consts.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
3
|
export type * from './types.js';
|
|
4
|
+
export type * from './results/types.js';
|
|
5
|
+
export type * from './models/pipeline-spec/types.js';
|
|
6
|
+
export * from './models/pipeline-spec.js';
|
|
4
7
|
export * from './pipeline.js';
|
|
5
8
|
export * from './results.js';
|
|
6
|
-
export * from './flows.js';
|
|
7
9
|
export * from './helpers/conversation.js';
|
|
10
|
+
export * from './helpers/truncate.js';
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,oBAAoB,CAAA;AACvC,mBAAmB,iCAAiC,CAAA;AACpD,cAAc,2BAA2B,CAAA;AACzC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './consts.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
|
+
export * from './models/pipeline-spec.js';
|
|
3
4
|
export * from './pipeline.js';
|
|
4
5
|
export * from './results.js';
|
|
5
|
-
export * from './flows.js';
|
|
6
6
|
export * from './helpers/conversation.js';
|
|
7
|
+
export * from './helpers/truncate.js';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAI3B,cAAc,2BAA2B,CAAA;AACzC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PipelineSpec, PipelineStepSpec } from '../../types.js';
|
|
2
|
+
/** One step a step transitively waits on, with the fewest `after` edges between the two. */
|
|
3
|
+
export interface PipelineStepDepth {
|
|
4
|
+
step: string;
|
|
5
|
+
depth: number;
|
|
6
|
+
}
|
|
7
|
+
/** The rules of one pipeline declaration: its validity, its order and the graph of its steps. */
|
|
8
|
+
export interface PipelineSpecModel {
|
|
9
|
+
readonly record: PipelineSpec;
|
|
10
|
+
/**
|
|
11
|
+
* Every fault in one message, or nothing.
|
|
12
|
+
*
|
|
13
|
+
* Total and IO-free, so a spec can be checked by a test in microseconds and by the runner at build
|
|
14
|
+
* time. It reports EVERY fault it finds rather than the first, because a spec is authored once and
|
|
15
|
+
* a build that names one fault per run turns a five-minute edit into five builds.
|
|
16
|
+
*
|
|
17
|
+
* @throws {PipelineSpecError}
|
|
18
|
+
*/
|
|
19
|
+
validate: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* The steps in an order that respects every `after`, with declaration order as the tie-break.
|
|
22
|
+
*
|
|
23
|
+
* Deterministic on purpose: the order decides what a progress report calls "step 3 of 16" and what
|
|
24
|
+
* a resume considers already behind it, and an order that depends on a `Set`'s iteration would make
|
|
25
|
+
* both drift between processes.
|
|
26
|
+
*
|
|
27
|
+
* @throws {PipelineSpecError} on a cycle or an unknown `after`.
|
|
28
|
+
*/
|
|
29
|
+
orderSteps: () => string[];
|
|
30
|
+
/**
|
|
31
|
+
* `step` and everything that transitively waits on it.
|
|
32
|
+
*
|
|
33
|
+
* What a resume has to re-run when an operator names a step: re-entering a step without re-entering
|
|
34
|
+
* what read its output leaves the run describing a state that no longer follows from itself.
|
|
35
|
+
*
|
|
36
|
+
* @throws {PipelineUnknownStepError} when the spec does not declare `step`.
|
|
37
|
+
*/
|
|
38
|
+
descendants: (step: string) => string[];
|
|
39
|
+
/**
|
|
40
|
+
* Every step `step` transitively waits on, with its DEPTH — the fewest `after` edges between the
|
|
41
|
+
* two — in topological order.
|
|
42
|
+
*
|
|
43
|
+
* The mirror of {@link PipelineSpecModel.descendants}, with one deliberate asymmetry: the named step
|
|
44
|
+
* itself is NOT included. A re-run re-enters the step it names, so the descendants include it;
|
|
45
|
+
* nothing is its own predecessor, so the ancestors do not. The depth is what a consumer uses to
|
|
46
|
+
* decide how much of a predecessor's output it needs to be told — a direct predecessor is depth 1
|
|
47
|
+
* however far apart the two sit in the topological order.
|
|
48
|
+
*
|
|
49
|
+
* @throws {PipelineUnknownStepError} when the spec does not declare `step`.
|
|
50
|
+
*/
|
|
51
|
+
ancestry: (step: string) => PipelineStepDepth[];
|
|
52
|
+
/** The names from {@link PipelineSpecModel.ancestry}: what must finish before `step` may start, in order. */
|
|
53
|
+
ancestors: (step: string) => string[];
|
|
54
|
+
/** The declaration of one step, by name. `null` when the spec does not declare it. */
|
|
55
|
+
stepOf: (step: string) => PipelineStepSpec | null;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/models/pipeline-spec/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEpE,4FAA4F;AAC5F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,iGAAiG;AACjG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B;;;;;;;;OAQG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB;;;;;;;;OAQG;IACH,UAAU,EAAE,MAAM,MAAM,EAAE,CAAA;IAC1B;;;;;;;OAOG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;IACvC;;;;;;;;;;;OAWG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,EAAE,CAAA;IAC/C,6GAA6G;IAC7G,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAA;IACrC,sFAAsF;IACtF,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAAgB,GAAG,IAAI,CAAA;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/models/pipeline-spec/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-spec.d.ts","sourceRoot":"","sources":["../../src/models/pipeline-spec.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAqB,MAAM,0BAA0B,CAAA;AAEpF,eAAO,MAAM,qBAAqB,SAAU,YAAY,KAAG,iBAoM1D,CAAA"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { DEFAULT_STEP_ATTEMPTS } from '../consts.js';
|
|
2
|
+
import { PipelineSpecError, PipelineUnknownStepError } from '../errors.js';
|
|
3
|
+
export const makePipelineSpecModel = (spec) => {
|
|
4
|
+
const fault = (faults, message) => {
|
|
5
|
+
faults.push(message);
|
|
6
|
+
};
|
|
7
|
+
const validate = () => {
|
|
8
|
+
const faults = [];
|
|
9
|
+
if (spec.alias == null || spec.alias.trim() === '') {
|
|
10
|
+
fault(faults, 'alias is empty');
|
|
11
|
+
}
|
|
12
|
+
if (!Number.isInteger(spec.version) || spec.version < 1) {
|
|
13
|
+
fault(faults, `version must be a positive integer, got ${String(spec.version)}`);
|
|
14
|
+
}
|
|
15
|
+
if (!Array.isArray(spec.steps) || spec.steps.length === 0) {
|
|
16
|
+
fault(faults, 'no steps declared');
|
|
17
|
+
throw new PipelineSpecError(`${spec.alias ?? '?'}: ${faults.join('; ')}`);
|
|
18
|
+
}
|
|
19
|
+
const seen = new Set();
|
|
20
|
+
for (const step of spec.steps) {
|
|
21
|
+
if (step.step == null || step.step.trim() === '') {
|
|
22
|
+
fault(faults, 'a step has an empty name');
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (seen.has(step.step)) {
|
|
26
|
+
fault(faults, `duplicate step "${step.step}"`);
|
|
27
|
+
}
|
|
28
|
+
seen.add(step.step);
|
|
29
|
+
}
|
|
30
|
+
for (const step of spec.steps) {
|
|
31
|
+
for (const dependency of step.after ?? []) {
|
|
32
|
+
if (dependency === step.step) {
|
|
33
|
+
fault(faults, `step "${step.step}" declares itself in \`after\``);
|
|
34
|
+
}
|
|
35
|
+
else if (!seen.has(dependency)) {
|
|
36
|
+
fault(faults, `step "${step.step}" waits on unknown step "${dependency}"`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const attempts = step.attempts ?? DEFAULT_STEP_ATTEMPTS;
|
|
40
|
+
if (!Number.isInteger(attempts) || attempts < 1) {
|
|
41
|
+
fault(faults, `step "${step.step}" declares attempts ${String(step.attempts)}`);
|
|
42
|
+
}
|
|
43
|
+
if (step.nonIdempotent === true && attempts > 1) {
|
|
44
|
+
fault(faults, `step "${step.step}" is nonIdempotent and declares attempts ${attempts} — an automatic `
|
|
45
|
+
+ 'retry is exactly what that flag says must not happen');
|
|
46
|
+
}
|
|
47
|
+
if (step.timeout != null && (!Number.isFinite(step.timeout) || step.timeout <= 0)) {
|
|
48
|
+
fault(faults, `step "${step.step}" declares timeout ${String(step.timeout)}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// A cycle is reported here rather than left to the sort, so one message carries every fault.
|
|
52
|
+
if (faults.every(entry => !entry.includes('unknown step'))) {
|
|
53
|
+
const cycle = detectCycle();
|
|
54
|
+
if (cycle != null) {
|
|
55
|
+
fault(faults, `cycle: ${cycle.join(' → ')}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (faults.length > 0) {
|
|
59
|
+
throw new PipelineSpecError(`${spec.alias}: ${faults.join('; ')}`);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const detectCycle = () => {
|
|
63
|
+
const after = new Map(spec.steps.map(step => [step.step, step.after ?? []]));
|
|
64
|
+
const state = new Map();
|
|
65
|
+
const path = [];
|
|
66
|
+
const walk = (name) => {
|
|
67
|
+
const mark = state.get(name);
|
|
68
|
+
if (mark === 2)
|
|
69
|
+
return null;
|
|
70
|
+
if (mark === 1)
|
|
71
|
+
return [...path.slice(path.indexOf(name)), name];
|
|
72
|
+
state.set(name, 1);
|
|
73
|
+
path.push(name);
|
|
74
|
+
for (const dependency of after.get(name) ?? []) {
|
|
75
|
+
const found = walk(dependency);
|
|
76
|
+
if (found != null)
|
|
77
|
+
return found;
|
|
78
|
+
}
|
|
79
|
+
path.pop();
|
|
80
|
+
state.set(name, 2);
|
|
81
|
+
return null;
|
|
82
|
+
};
|
|
83
|
+
for (const step of spec.steps) {
|
|
84
|
+
const found = walk(step.step);
|
|
85
|
+
if (found != null)
|
|
86
|
+
return found.reverse();
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
};
|
|
90
|
+
const orderSteps = () => {
|
|
91
|
+
const names = spec.steps.map(step => step.step);
|
|
92
|
+
const known = new Set(names);
|
|
93
|
+
const pending = new Map();
|
|
94
|
+
const dependents = new Map();
|
|
95
|
+
for (const step of spec.steps) {
|
|
96
|
+
const dependencies = new Set();
|
|
97
|
+
for (const dependency of step.after ?? []) {
|
|
98
|
+
if (!known.has(dependency)) {
|
|
99
|
+
throw new PipelineSpecError(`${spec.alias}: step "${step.step}" waits on unknown step "${dependency}"`);
|
|
100
|
+
}
|
|
101
|
+
dependencies.add(dependency);
|
|
102
|
+
dependents.set(dependency, [...(dependents.get(dependency) ?? []), step.step]);
|
|
103
|
+
}
|
|
104
|
+
pending.set(step.step, dependencies);
|
|
105
|
+
}
|
|
106
|
+
const ordered = [];
|
|
107
|
+
const emitted = new Set();
|
|
108
|
+
while (ordered.length < names.length) {
|
|
109
|
+
// Declaration order among everything currently ready — never a set's own order.
|
|
110
|
+
const ready = names.filter(name => !emitted.has(name) && (pending.get(name)?.size ?? 0) === 0);
|
|
111
|
+
if (ready.length === 0) {
|
|
112
|
+
const cycle = detectCycle();
|
|
113
|
+
throw new PipelineSpecError(`${spec.alias}: cycle: ${(cycle ?? names.filter(name => !emitted.has(name))).join(' → ')}`);
|
|
114
|
+
}
|
|
115
|
+
for (const name of ready) {
|
|
116
|
+
ordered.push(name);
|
|
117
|
+
emitted.add(name);
|
|
118
|
+
for (const dependent of dependents.get(name) ?? []) {
|
|
119
|
+
pending.get(dependent)?.delete(name);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return ordered;
|
|
124
|
+
};
|
|
125
|
+
const descendants = (step) => {
|
|
126
|
+
if (!spec.steps.some(entry => entry.step === step)) {
|
|
127
|
+
throw new PipelineUnknownStepError(`${spec.alias}:${step}`);
|
|
128
|
+
}
|
|
129
|
+
const reached = new Set([step]);
|
|
130
|
+
let grew = true;
|
|
131
|
+
while (grew) {
|
|
132
|
+
grew = false;
|
|
133
|
+
for (const entry of spec.steps) {
|
|
134
|
+
if (reached.has(entry.step))
|
|
135
|
+
continue;
|
|
136
|
+
if ((entry.after ?? []).some(dependency => reached.has(dependency))) {
|
|
137
|
+
reached.add(entry.step);
|
|
138
|
+
grew = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return orderSteps().filter(name => reached.has(name));
|
|
143
|
+
};
|
|
144
|
+
const ancestry = (step) => {
|
|
145
|
+
if (!spec.steps.some(entry => entry.step === step)) {
|
|
146
|
+
throw new PipelineUnknownStepError(`${spec.alias}:${step}`);
|
|
147
|
+
}
|
|
148
|
+
const after = new Map(spec.steps.map(entry => [entry.step, entry.after ?? []]));
|
|
149
|
+
const depths = new Map();
|
|
150
|
+
let frontier = [step];
|
|
151
|
+
for (let depth = 1; frontier.length > 0; ++depth) {
|
|
152
|
+
const next = [];
|
|
153
|
+
for (const name of frontier) {
|
|
154
|
+
for (const dependency of after.get(name) ?? []) {
|
|
155
|
+
if (dependency !== step && !depths.has(dependency)) {
|
|
156
|
+
depths.set(dependency, depth);
|
|
157
|
+
next.push(dependency);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
frontier = next;
|
|
162
|
+
}
|
|
163
|
+
return orderSteps()
|
|
164
|
+
.filter(name => depths.has(name))
|
|
165
|
+
.map(name => ({ step: name, depth: depths.get(name) }));
|
|
166
|
+
};
|
|
167
|
+
const ancestors = (step) => ancestry(step).map(entry => entry.step);
|
|
168
|
+
const stepOf = (step) => spec.steps.find(entry => entry.step === step) ?? null;
|
|
169
|
+
return { record: spec, validate, orderSteps, descendants, ancestry, ancestors, stepOf };
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=pipeline-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline-spec.js","sourceRoot":"","sources":["../../src/models/pipeline-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAI1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAkB,EAAqB,EAAE;IAC7E,MAAM,KAAK,GAAG,CAAC,MAAgB,EAAE,OAAe,EAAQ,EAAE;QACxD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC,CAAA;IAED,MAAM,QAAQ,GAAG,GAAS,EAAE;QAC1B,MAAM,MAAM,GAAa,EAAE,CAAA;QAE3B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACnD,KAAK,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;QACjC,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;YACxD,KAAK,CAAC,MAAM,EAAE,2CAA2C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAClF,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1D,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;YAClC,MAAM,IAAI,iBAAiB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,GAAG,KAAK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