@owlmeans/agent-common 0.1.18-rc.46 → 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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/agent-common/SKILL.md +1 -1
  4. package/build/consts.d.ts +69 -0
  5. package/build/consts.d.ts.map +1 -1
  6. package/build/consts.js +156 -0
  7. package/build/consts.js.map +1 -1
  8. package/build/consts.local.d.ts +9 -0
  9. package/build/consts.local.d.ts.map +1 -0
  10. package/build/consts.local.js +9 -0
  11. package/build/consts.local.js.map +1 -0
  12. package/build/errors.d.ts +1 -1
  13. package/build/errors.js +1 -1
  14. package/build/helpers/conversation.d.ts +0 -9
  15. package/build/helpers/conversation.d.ts.map +1 -1
  16. package/build/helpers/conversation.js +0 -28
  17. package/build/helpers/conversation.js.map +1 -1
  18. package/build/helpers/truncate.d.ts +10 -0
  19. package/build/helpers/truncate.d.ts.map +1 -0
  20. package/build/helpers/truncate.js +29 -0
  21. package/build/helpers/truncate.js.map +1 -0
  22. package/build/index.d.ts +4 -1
  23. package/build/index.d.ts.map +1 -1
  24. package/build/index.js +2 -1
  25. package/build/index.js.map +1 -1
  26. package/build/models/pipeline-spec/types.d.ts +57 -0
  27. package/build/models/pipeline-spec/types.d.ts.map +1 -0
  28. package/build/models/pipeline-spec/types.js +2 -0
  29. package/build/models/pipeline-spec/types.js.map +1 -0
  30. package/build/models/pipeline-spec.d.ts +4 -0
  31. package/build/models/pipeline-spec.d.ts.map +1 -0
  32. package/build/models/pipeline-spec.js +171 -0
  33. package/build/models/pipeline-spec.js.map +1 -0
  34. package/build/pipeline.d.ts +5 -195
  35. package/build/pipeline.d.ts.map +1 -1
  36. package/build/pipeline.js +9 -222
  37. package/build/pipeline.js.map +1 -1
  38. package/build/results/types.d.ts +211 -0
  39. package/build/results/types.d.ts.map +1 -0
  40. package/build/results/types.js +2 -0
  41. package/build/results/types.js.map +1 -0
  42. package/build/results.d.ts +3 -238
  43. package/build/results.d.ts.map +1 -1
  44. package/build/results.js +204 -295
  45. package/build/results.js.map +1 -1
  46. package/build/types.d.ts +136 -1
  47. package/build/types.d.ts.map +1 -1
  48. package/package.json +7 -7
  49. package/src/consts.local.ts +15 -0
  50. package/src/consts.ts +166 -0
  51. package/src/errors.ts +1 -1
  52. package/src/helpers/conversation.ts +0 -32
  53. package/src/helpers/truncate.ts +31 -0
  54. package/src/index.ts +4 -1
  55. package/src/models/pipeline-spec/types.ts +58 -0
  56. package/src/models/pipeline-spec.ts +202 -0
  57. package/src/pipeline.ts +11 -390
  58. package/src/results/types.ts +221 -0
  59. package/src/results.ts +229 -466
  60. package/src/types.ts +143 -1
  61. package/tests/pipeline.spec.ts +26 -29
  62. package/tests/results.spec.ts +24 -26
  63. package/build/flows.d.ts +0 -21
  64. package/build/flows.d.ts.map +0 -1
  65. package/build/flows.js +0 -105
  66. package/build/flows.js.map +0 -1
  67. 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.47
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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/agent-common",
4
- "version": "0.1.18-rc.46",
5
- "generatedAt": "2026-10-03T20:05:07.585Z",
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.46"` in `dependencies`
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
  *
@@ -108,4 +109,72 @@ export declare const DEFAULT_MEMORY_NODE_CHARS = 2000;
108
109
  export declare const DEFAULT_MEMORY_EVENTS_LIMIT = 50;
109
110
  /** Separator between a dedication's kind and its target — `project:<id>`. */
110
111
  export declare const SCOPE_SEP = ":";
112
+ /** How a run ended, or that it has not. */
113
+ export declare enum PipelineRunStatus {
114
+ Running = "running",
115
+ Done = "done",
116
+ Failed = "failed",
117
+ /** Stopped on purpose with work left — a budget expired, or the caller asked. Resumable. */
118
+ Aborted = "aborted",
119
+ /**
120
+ * Stopped on purpose, waiting for an answer to {@link PipelineRun.inquiry}.
121
+ *
122
+ * Resumable, and NOT stale: a waiting run has no process behind it and its `heartbeatAt` will not
123
+ * move again until somebody answers. A reconciler that reads staleness alone would take this for
124
+ * a crashed run and repair what is merely waiting.
125
+ */
126
+ Waiting = "waiting"
127
+ }
128
+ /** Where the facts of an entry came from. */
129
+ export declare enum CumulativeResultSource {
130
+ /** Read by code from what the step left behind, when the step finished. */
131
+ Extracted = "extracted",
132
+ /**
133
+ * Read by code from the step's DURABLE inputs, after the fact — on a resume that found no stored
134
+ * entry, or for a step whose guard skipped it. The same facts an extraction would have found.
135
+ */
136
+ Rebuilt = "rebuilt",
137
+ /** Supplied before any step of the run ran — the caller already knew them. */
138
+ Seeded = "seeded",
139
+ /** No facts at all; only a model's summary, which nothing has checked. */
140
+ Summarized = "summarized"
141
+ }
142
+ /** How one entry appears in a view cut for a given step. */
143
+ export declare enum ResultViewMode {
144
+ Full = "full",
145
+ /** Names only, grouped by kind. */
146
+ Compact = "compact",
147
+ /** Not in the prompt. Still answered by a programmatic facts query. */
148
+ Omitted = "omitted"
149
+ }
150
+ /**
151
+ * Kinds an extractor is encouraged to use. `CumulativeResultFact.kind` is an open string — declare
152
+ * your own — but two extractors naming the same thing differently split one fact into two.
153
+ */
154
+ export declare enum CumulativeFactKind {
155
+ Type = "type",
156
+ Symbol = "symbol",
157
+ Endpoint = "endpoint",
158
+ Resource = "resource",
159
+ File = "file"
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[];
111
180
  //# sourceMappingURL=consts.d.ts.map
@@ -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,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;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F;AAC3F,oBAAY,cAAc;IACxB,EAAE,OAAO;IACT,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAA;AACzC,eAAO,MAAM,oBAAoB,MAAM,CAAA;AACvC,eAAO,MAAM,oBAAoB,IAAI,CAAA;AACrC,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAC7C,eAAO,MAAM,2BAA2B,KAAK,CAAA;AAE7C,6EAA6E;AAC7E,eAAO,MAAM,SAAS,MAAM,CAAA;AAE5B,2CAA2C;AAC3C,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,4FAA4F;IAC5F,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
@@ -111,4 +111,160 @@ export const DEFAULT_MEMORY_NODE_CHARS = 2000;
111
111
  export const DEFAULT_MEMORY_EVENTS_LIMIT = 50;
112
112
  /** Separator between a dedication's kind and its target — `project:<id>`. */
113
113
  export const SCOPE_SEP = ':';
114
+ /** How a run ended, or that it has not. */
115
+ export var PipelineRunStatus;
116
+ (function (PipelineRunStatus) {
117
+ PipelineRunStatus["Running"] = "running";
118
+ PipelineRunStatus["Done"] = "done";
119
+ PipelineRunStatus["Failed"] = "failed";
120
+ /** Stopped on purpose with work left — a budget expired, or the caller asked. Resumable. */
121
+ PipelineRunStatus["Aborted"] = "aborted";
122
+ /**
123
+ * Stopped on purpose, waiting for an answer to {@link PipelineRun.inquiry}.
124
+ *
125
+ * Resumable, and NOT stale: a waiting run has no process behind it and its `heartbeatAt` will not
126
+ * move again until somebody answers. A reconciler that reads staleness alone would take this for
127
+ * a crashed run and repair what is merely waiting.
128
+ */
129
+ PipelineRunStatus["Waiting"] = "waiting";
130
+ })(PipelineRunStatus || (PipelineRunStatus = {}));
131
+ /** Where the facts of an entry came from. */
132
+ export var CumulativeResultSource;
133
+ (function (CumulativeResultSource) {
134
+ /** Read by code from what the step left behind, when the step finished. */
135
+ CumulativeResultSource["Extracted"] = "extracted";
136
+ /**
137
+ * Read by code from the step's DURABLE inputs, after the fact — on a resume that found no stored
138
+ * entry, or for a step whose guard skipped it. The same facts an extraction would have found.
139
+ */
140
+ CumulativeResultSource["Rebuilt"] = "rebuilt";
141
+ /** Supplied before any step of the run ran — the caller already knew them. */
142
+ CumulativeResultSource["Seeded"] = "seeded";
143
+ /** No facts at all; only a model's summary, which nothing has checked. */
144
+ CumulativeResultSource["Summarized"] = "summarized";
145
+ })(CumulativeResultSource || (CumulativeResultSource = {}));
146
+ /** How one entry appears in a view cut for a given step. */
147
+ export var ResultViewMode;
148
+ (function (ResultViewMode) {
149
+ ResultViewMode["Full"] = "full";
150
+ /** Names only, grouped by kind. */
151
+ ResultViewMode["Compact"] = "compact";
152
+ /** Not in the prompt. Still answered by a programmatic facts query. */
153
+ ResultViewMode["Omitted"] = "omitted";
154
+ })(ResultViewMode || (ResultViewMode = {}));
155
+ /**
156
+ * Kinds an extractor is encouraged to use. `CumulativeResultFact.kind` is an open string — declare
157
+ * your own — but two extractors naming the same thing differently split one fact into two.
158
+ */
159
+ export var CumulativeFactKind;
160
+ (function (CumulativeFactKind) {
161
+ CumulativeFactKind["Type"] = "type";
162
+ CumulativeFactKind["Symbol"] = "symbol";
163
+ CumulativeFactKind["Endpoint"] = "endpoint";
164
+ CumulativeFactKind["Resource"] = "resource";
165
+ CumulativeFactKind["File"] = "file";
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];
114
270
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH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oBAC7B,UAAU,EAAE,kBAAkB,CAAC,QAAQ;oBACvC,IAAI,EAAE,YAAY,CAAC,UAAU;iBAC9B;gBACD,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;oBACzB,UAAU,EAAE,kBAAkB,CAAC,IAAI;oBACnC,IAAI,EAAE,YAAY,CAAC,MAAM;oBACzB,QAAQ,EAAE,IAAI;iBACf;aACF;SACF;QAED,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE;YACzB,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,YAAY,CAAC,UAAU;YAC7B,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE;gBACX,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;oBAC3B,UAAU,EAAE,kBAAkB,CAAC,MAAM;oBACrC,IAAI,EAAE,YAAY,CAAC,QAAQ;iBAC5B;gBACD,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;oBACzB,UAAU,EAAE,kBAAkB,CAAC,IAAI;oBACnC,IAAI,EAAE,YAAY,CAAC,MAAM;oBACzB,QAAQ,EAAE,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"}
@@ -0,0 +1,9 @@
1
+ export declare const PARTIAL_WITH_FACTS = "partial: the step failed part-way; only what it left in the files is listed";
2
+ export declare const PARTIAL_EMPTY = "partial: the step failed part-way and left nothing that could be read";
3
+ export declare const SEEDED = "known before this run";
4
+ export declare const NOT_VERIFIED = "not verified";
5
+ export declare const NAMES_ONLY = "names only";
6
+ export declare const SUMMARY_LEFT_OUT = "summary left out for space";
7
+ export declare const SUMMARY_WITH_FACTS = "Summary (not verified \u2014 written by a model, never checked against the files):";
8
+ export declare const SUMMARY_ALONE = "Summary written by a model, never checked against the files:";
9
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,gFAAgF,CAAA;AAE/G,eAAO,MAAM,aAAa,0EAA0E,CAAA;AAEpG,eAAO,MAAM,MAAM,0BAA0B,CAAA;AAE7C,eAAO,MAAM,YAAY,iBAAiB,CAAA;AAE1C,eAAO,MAAM,UAAU,eAAe,CAAA;AAEtC,eAAO,MAAM,gBAAgB,+BAA+B,CAAA;AAE5D,eAAO,MAAM,kBAAkB,uFAAkF,CAAA;AAEjH,eAAO,MAAM,aAAa,iEAAiE,CAAA"}
@@ -0,0 +1,9 @@
1
+ export const PARTIAL_WITH_FACTS = 'partial: the step failed part-way; only what it left in the files is listed';
2
+ export const PARTIAL_EMPTY = 'partial: the step failed part-way and left nothing that could be read';
3
+ export const SEEDED = 'known before this run';
4
+ export const NOT_VERIFIED = 'not verified';
5
+ export const NAMES_ONLY = 'names only';
6
+ export const SUMMARY_LEFT_OUT = 'summary left out for space';
7
+ export const SUMMARY_WITH_FACTS = 'Summary (not verified — written by a model, never checked against the files):';
8
+ export const SUMMARY_ALONE = 'Summary written by a model, never checked against the files:';
9
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,6EAA6E,CAAA;AAE/G,MAAM,CAAC,MAAM,aAAa,GAAG,uEAAuE,CAAA;AAEpG,MAAM,CAAC,MAAM,MAAM,GAAG,uBAAuB,CAAA;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAA;AAE1C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,4BAA4B,CAAA;AAE5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,+EAA+E,CAAA;AAEjH,MAAM,CAAC,MAAM,aAAa,GAAG,8DAA8D,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').validatePipelineSpec} and by the runner's own build
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').validatePipelineSpec} and by the runner's own build
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;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,SAAU,MAAM,OAAO,MAAM,KAAG,MAsBtD,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,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/C,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;IAE3E,OAAO;QACL,cAAc,EAAE,QAAQ,EAAE,cAAc,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1F,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;KACjE,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,G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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,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/C,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;IAE3E,OAAO;QACL,cAAc,EAAE,QAAQ,EAAE,cAAc,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1F,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;KACjE,CAAA;AACH,CAAC,CAAA"}
@@ -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
@@ -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,YAAY,CAAA;AAC1B,cAAc,2BAA2B,CAAA"}
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAE3B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,2BAA2B,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,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/models/pipeline-spec/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { PipelineSpec } from '../types.js';
2
+ import type { PipelineSpecModel } from './pipeline-spec/types.js';
3
+ export declare const makePipelineSpecModel: (spec: PipelineSpec) => PipelineSpecModel;
4
+ //# sourceMappingURL=pipeline-spec.d.ts.map
@@ -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"}