@owlmeans/agent-common 0.1.18-rc.17 → 0.1.18-rc.19
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 +3 -12
- package/build/consts.d.ts +0 -9
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +0 -9
- package/build/consts.js.map +1 -1
- package/build/errors.d.ts +0 -11
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +0 -15
- package/build/errors.js.map +1 -1
- package/build/pipeline.d.ts +1 -30
- package/build/pipeline.d.ts.map +1 -1
- package/build/pipeline.js +0 -8
- package/build/pipeline.js.map +1 -1
- package/package.json +5 -5
- package/src/consts.ts +0 -10
- package/src/errors.ts +0 -17
- package/src/pipeline.ts +0 -30
- package/tests/pipeline.spec.ts +1 -41
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.15
|
|
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-09-
|
|
4
|
+
"version": "0.1.18-rc.19",
|
|
5
|
+
"generatedAt": "2026-09-12T08:39:52.715Z",
|
|
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.19"` 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.
|
|
@@ -27,13 +27,12 @@ The runtime is `@owlmeans/agent`.
|
|
|
27
27
|
| `MemoryNode`, `MemoryEvent` (+ `MemoryEventInput`) | Agent-authored memory records. |
|
|
28
28
|
| `AgentRunMessage` | What a transport carries — a POINTER (`runId`, `conversationId`, optional `pipeline`/`step`), never state. |
|
|
29
29
|
| `PipelineStepSpec`, `PipelineSpec` | The declaration: named steps, `after: string[]` edges, `optional`, `nonIdempotent`, `attempts`, `timeout`. |
|
|
30
|
-
| `PipelineRun`, `PipelineRunStatus`, `PipelineProgress` | The persisted run row — `state` is JSON **text** plus `stateChars`; `completed`/`pending`/`warnings`; `heartbeatAt`.
|
|
31
|
-
| `PipelineRunInquiry` · `INQUIRY_ANSWERS_KEY` | What a `Waiting` run is waiting for (`step`, `askedAt`, the `Inquiry`), and the one state key answers live under. |
|
|
30
|
+
| `PipelineRun`, `PipelineRunStatus`, `PipelineProgress` | The persisted run row — `state` is JSON **text** plus `stateChars`; `completed`/`pending`/`warnings`; `heartbeatAt`. |
|
|
32
31
|
| `validatePipelineSpec`, `orderPipelineSteps`, `pipelineDescendants`, `pipelineStep` | Pure spec helpers — no runtime, no graph engine. |
|
|
33
32
|
| `AGENTS_SERVICE` | The service alias — **`agents`**, plural. |
|
|
34
33
|
| `AGENT_*_STORE` | Port names a consumer binds its storage under. |
|
|
35
34
|
| `AgentRunStatus` | `ok` / `failed`, written on a conversation event. |
|
|
36
|
-
| `AgentCommonError`, `AgentRunStateError`, `PipelineSpecError`, `PipelineVersionError`, `PipelineUnknownStepError`, `PipelineNotIdempotentError`, `PipelineStateTooLargeError
|
|
35
|
+
| `AgentCommonError`, `AgentRunStateError`, `PipelineSpecError`, `PipelineVersionError`, `PipelineUnknownStepError`, `PipelineNotIdempotentError`, `PipelineStateTooLargeError` | The error family. |
|
|
37
36
|
| `DEFAULT_SUMMARY_CHARS` (1200) · `DEFAULT_ADVICE_CHARS` (400) · `DEFAULT_EVENT_WINDOW` (3) · `DEFAULT_MEMORY_NODE_CHARS` (2000) · `DEFAULT_MEMORY_EVENTS_LIMIT` (50) | The caps the runtime's plugins default to. Override them per plugin; read them here rather than restating a number. |
|
|
38
37
|
| `DEFAULT_MAX_STATE_CHARS` (256_000) · `DEFAULT_STEP_ATTEMPTS` (1) · `DEFAULT_STEP_TIMEOUT` (30 min) | Pipeline defaults. The state cap is a TRIPWIRE, not a budget. |
|
|
39
38
|
|
|
@@ -60,13 +59,6 @@ a reconciler or an operator console must read to say where a run stands without
|
|
|
60
59
|
That is also why `PipelineRun.state` is JSON **text** with a `stateChars` beside it rather than a
|
|
61
60
|
subdocument: a run row crosses a `$jsonSchema`, and a state whose keys are dotted paths does not.
|
|
62
61
|
|
|
63
|
-
**A `Waiting` run is stopped on purpose and is NOT stale.** It has no process behind it and its
|
|
64
|
-
`heartbeatAt` will not move again until somebody answers `run.inquiry`, so anything that sweeps
|
|
65
|
-
stale runs must exclude it — reading it as a crashed run repairs what is merely waiting. The row
|
|
66
|
-
carries `inquiry` only while it waits, and the runner clears it on every entry: a row still
|
|
67
|
-
advertising an answered question has every reader offer it again. A pipeline with no run store
|
|
68
|
-
cannot wait at all, which is what `PipelineNotResumableError` says. See [[inquiry]].
|
|
69
|
-
|
|
70
62
|
**`validatePipelineSpec` names EVERY fault at once** — unknown `after` targets, cycles, duplicate
|
|
71
63
|
step names, `attempts > 1` on a `nonIdempotent` step. A spec is authored once and fixed once, and
|
|
72
64
|
reporting faults one per build turns a five-minute edit into five builds.
|
|
@@ -100,7 +92,6 @@ every other consumer of that package is client-side.
|
|
|
100
92
|
|
|
101
93
|
## Related
|
|
102
94
|
|
|
103
|
-
- [[inquiry]] — the human-in-the-loop primitive `Waiting` and `PipelineRunInquiry` belong to
|
|
104
95
|
- [[agent]] — the runtime that writes these records
|
|
105
96
|
- [[llm-common]] — `LlmPurpose` and `ExecutionState`, which a run's execution is built from
|
|
106
97
|
- [[flow]] — the flow model the run lifecycle is declared against
|
package/build/consts.d.ts
CHANGED
|
@@ -33,15 +33,6 @@ export declare const AGENT_CHECKPOINT_STORE = "agent-checkpoint-store";
|
|
|
33
33
|
export declare const DEFAULT_MAX_STATE_CHARS = 256000;
|
|
34
34
|
export declare const DEFAULT_STEP_ATTEMPTS = 1;
|
|
35
35
|
export declare const DEFAULT_STEP_TIMEOUT = 1800000;
|
|
36
|
-
/**
|
|
37
|
-
* Where a pipeline's answers live in its state.
|
|
38
|
-
*
|
|
39
|
-
* One key, named here rather than per pipeline, because an answer has to survive every hop it can
|
|
40
|
-
* take: a resume merges answers into it, a composing step forwards it to its child, and a reader
|
|
41
|
-
* looks a question up by id. Scalars and keys, like everything else a state holds — the answer's
|
|
42
|
-
* decision travels here and its prose belongs wherever that pipeline keeps its documents.
|
|
43
|
-
*/
|
|
44
|
-
export declare const INQUIRY_ANSWERS_KEY = "answers";
|
|
45
36
|
/** The lifecycle flow every agent run is driven through. */
|
|
46
37
|
export declare const AGENT_RUN_FLOW = "agent-run";
|
|
47
38
|
/**
|
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,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,wBAAwB,6BAA6B,C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A;AACrC,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAC7C,eAAO,MAAM,2BAA2B,KAAK,CAAA;AAE7C,6EAA6E;AAC7E,eAAO,MAAM,SAAS,MAAM,CAAA"}
|
package/build/consts.js
CHANGED
|
@@ -33,15 +33,6 @@ export const AGENT_CHECKPOINT_STORE = 'agent-checkpoint-store';
|
|
|
33
33
|
export const DEFAULT_MAX_STATE_CHARS = 256_000;
|
|
34
34
|
export const DEFAULT_STEP_ATTEMPTS = 1;
|
|
35
35
|
export const DEFAULT_STEP_TIMEOUT = 1_800_000;
|
|
36
|
-
/**
|
|
37
|
-
* Where a pipeline's answers live in its state.
|
|
38
|
-
*
|
|
39
|
-
* One key, named here rather than per pipeline, because an answer has to survive every hop it can
|
|
40
|
-
* take: a resume merges answers into it, a composing step forwards it to its child, and a reader
|
|
41
|
-
* looks a question up by id. Scalars and keys, like everything else a state holds — the answer's
|
|
42
|
-
* decision travels here and its prose belongs wherever that pipeline keeps its documents.
|
|
43
|
-
*/
|
|
44
|
-
export const INQUIRY_ANSWERS_KEY = 'answers';
|
|
45
36
|
/** The lifecycle flow every agent run is driven through. */
|
|
46
37
|
export const AGENT_RUN_FLOW = 'agent-run';
|
|
47
38
|
/**
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA;;;;;;;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;AAE9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CAAa,CAAA;AACf,CAAC,EANW,kBAAkB,KAAlB,kBAAkB,QAM7B;AAED,2FAA2F;AAC3F,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,2BAAS,CAAA;IACT,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAA;AACzC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAA;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAE7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAA"}
|
package/build/errors.d.ts
CHANGED
|
@@ -57,15 +57,4 @@ export declare class PipelineStateTooLargeError extends AgentCommonError {
|
|
|
57
57
|
static typeName: string;
|
|
58
58
|
constructor(message?: string);
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
61
|
-
* A run was asked to wait for an answer it has no way of being given.
|
|
62
|
-
*
|
|
63
|
-
* Thrown when a step asks a question, nobody is there to answer it, and the pipeline has no run
|
|
64
|
-
* store: parking would leave nothing behind to resume, so the step fails at once rather than
|
|
65
|
-
* stopping a run that could never be started again.
|
|
66
|
-
*/
|
|
67
|
-
export declare class PipelineNotResumableError extends AgentCommonError {
|
|
68
|
-
static typeName: string;
|
|
69
|
-
constructor(message?: string);
|
|
70
|
-
}
|
|
71
60
|
//# sourceMappingURL=errors.d.ts.map
|
package/build/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,qBAAa,gBAAiB,SAAQ,c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,MAAM,CAAyC;IAEhF,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,OAAuB,QAAQ,EAAE,MAAM,CAA6C;IAEpF,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,OAAuB,QAAQ,EAAE,MAAM,CAAgD;IAEvF,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,oFAAoF;AACpF,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,OAAuB,QAAQ,EAAE,MAAM,CAAoD;IAE3F,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAuB,QAAQ,EAAE,MAAM,CAAsD;IAE7F,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC9D,OAAuB,QAAQ,EAAE,MAAM,CAAsD;IAE7F,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
|
package/build/errors.js
CHANGED
|
@@ -77,20 +77,6 @@ export class PipelineStateTooLargeError extends AgentCommonError {
|
|
|
77
77
|
this.type = PipelineStateTooLargeError.typeName;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
/**
|
|
81
|
-
* A run was asked to wait for an answer it has no way of being given.
|
|
82
|
-
*
|
|
83
|
-
* Thrown when a step asks a question, nobody is there to answer it, and the pipeline has no run
|
|
84
|
-
* store: parking would leave nothing behind to resume, so the step fails at once rather than
|
|
85
|
-
* stopping a run that could never be started again.
|
|
86
|
-
*/
|
|
87
|
-
export class PipelineNotResumableError extends AgentCommonError {
|
|
88
|
-
static typeName = `PipelineNotResumable${AgentCommonError.typeName}`;
|
|
89
|
-
constructor(message = 'error') {
|
|
90
|
-
super(`pipeline-not-resumable:${message}`);
|
|
91
|
-
this.type = PipelineNotResumableError.typeName;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
80
|
ResilientError.registerErrorClass(AgentCommonError);
|
|
95
81
|
ResilientError.registerErrorClass(AgentRunStateError);
|
|
96
82
|
ResilientError.registerErrorClass(PipelineSpecError);
|
|
@@ -98,5 +84,4 @@ ResilientError.registerErrorClass(PipelineVersionError);
|
|
|
98
84
|
ResilientError.registerErrorClass(PipelineUnknownStepError);
|
|
99
85
|
ResilientError.registerErrorClass(PipelineNotIdempotentError);
|
|
100
86
|
ResilientError.registerErrorClass(PipelineStateTooLargeError);
|
|
101
|
-
ResilientError.registerErrorClass(PipelineNotResumableError);
|
|
102
87
|
//# sourceMappingURL=errors.js.map
|
package/build/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IAC3C,MAAM,CAAU,QAAQ,GAAW,QAAQ,cAAc,CAAC,QAAQ,EAAE,CAAA;IAE3E,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;CACF;AAED,qFAAqF;AACrF,MAAM,OAAO,kBAAmB,SAAQ,gBAAgB;IAC/C,MAAM,CAAU,QAAQ,GAAW,WAAW,gBAAgB,CAAC,QAAQ,EAAE,CAAA;IAEhF,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,aAAa,OAAO,EAAE,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAA;IACzC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAC9C,MAAM,CAA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AAC,CAAA;AAC3D,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA"}
|
package/build/pipeline.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Inquiry } from '@owlmeans/llm-common';
|
|
2
1
|
import type { ResourceRecord } from '@owlmeans/resource';
|
|
3
2
|
/**
|
|
4
3
|
* What a pipeline carries between its steps.
|
|
@@ -63,28 +62,7 @@ export declare enum PipelineRunStatus {
|
|
|
63
62
|
Done = "done",
|
|
64
63
|
Failed = "failed",
|
|
65
64
|
/** Stopped on purpose with work left — a budget expired, or the caller asked. Resumable. */
|
|
66
|
-
Aborted = "aborted"
|
|
67
|
-
/**
|
|
68
|
-
* Stopped on purpose, waiting for an answer to {@link PipelineRun.inquiry}.
|
|
69
|
-
*
|
|
70
|
-
* Resumable, and NOT stale: a waiting run has no process behind it and its `heartbeatAt` will not
|
|
71
|
-
* move again until somebody answers. A reconciler that reads staleness alone would take this for
|
|
72
|
-
* a crashed run and repair what is merely waiting.
|
|
73
|
-
*/
|
|
74
|
-
Waiting = "waiting"
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* What a `Waiting` run is waiting for.
|
|
78
|
-
*
|
|
79
|
-
* Written by the runner when a step asks a question nobody could answer while it ran, and read by
|
|
80
|
-
* everything that reports a run — a resume delivers the answer under {@link Inquiry.id}, which is
|
|
81
|
-
* the only thing that routes it back.
|
|
82
|
-
*/
|
|
83
|
-
export interface PipelineRunInquiry {
|
|
84
|
-
/** The step that asked. A resume re-enters exactly this one. */
|
|
85
|
-
step: string;
|
|
86
|
-
askedAt: string;
|
|
87
|
-
inquiry: Inquiry;
|
|
65
|
+
Aborted = "aborted"
|
|
88
66
|
}
|
|
89
67
|
/**
|
|
90
68
|
* The data plane of a pipeline run, and the ONE authority on where it stands.
|
|
@@ -120,13 +98,6 @@ export interface PipelineRun extends ResourceRecord {
|
|
|
120
98
|
error?: string;
|
|
121
99
|
/** The last thing a step said about itself. Progress, not state. */
|
|
122
100
|
note?: string;
|
|
123
|
-
/**
|
|
124
|
-
* The question this run stopped on.
|
|
125
|
-
*
|
|
126
|
-
* Present only while `status === Waiting`, and cleared on every entry of the run — a row that
|
|
127
|
-
* kept advertising a question it has already been given would have every reader offer it again.
|
|
128
|
-
*/
|
|
129
|
-
inquiry?: PipelineRunInquiry;
|
|
130
101
|
/** Whatever lock the run held, so a resume can re-take the same one. */
|
|
131
102
|
lockTask?: string;
|
|
132
103
|
/** How many times this run has been RESUMED. Reset only by a `Done` outcome. */
|
package/build/pipeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,O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AAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,SAAU,YAAY,KAAG,IA6DzD,CAAA;AAgCD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,SAAU,YAAY,KAAG,MAAM,EA0C7D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,SAAU,YAAY,QAAQ,MAAM,KAAG,MAAM,EAmB5E,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,YAAY,SAAU,YAAY,QAAQ,MAAM,KAAG,gBAAgB,GAAG,IAC5B,CAAA"}
|
package/build/pipeline.js
CHANGED
|
@@ -8,14 +8,6 @@ export var PipelineRunStatus;
|
|
|
8
8
|
PipelineRunStatus["Failed"] = "failed";
|
|
9
9
|
/** Stopped on purpose with work left — a budget expired, or the caller asked. Resumable. */
|
|
10
10
|
PipelineRunStatus["Aborted"] = "aborted";
|
|
11
|
-
/**
|
|
12
|
-
* Stopped on purpose, waiting for an answer to {@link PipelineRun.inquiry}.
|
|
13
|
-
*
|
|
14
|
-
* Resumable, and NOT stale: a waiting run has no process behind it and its `heartbeatAt` will not
|
|
15
|
-
* move again until somebody answers. A reconciler that reads staleness alone would take this for
|
|
16
|
-
* a crashed run and repair what is merely waiting.
|
|
17
|
-
*/
|
|
18
|
-
PipelineRunStatus["Waiting"] = "waiting";
|
|
19
11
|
})(PipelineRunStatus || (PipelineRunStatus = {}));
|
|
20
12
|
const fault = (faults, message) => {
|
|
21
13
|
faults.push(message);
|
package/build/pipeline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB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CAAC;IAED,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IACvC,IAAI,IAAI,GAAG,IAAI,CAAA;IACf,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,GAAG,KAAK,CAAA;QACZ,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAQ;YACrC,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;gBACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACvB,IAAI,GAAG,IAAI,CAAA;YACb,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;AACnE,CAAC,CAAA;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAkB,EAAE,IAAY,EAA2B,EAAE,CACxF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/agent-common",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"typescript": "^7.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/flow": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/llm-common": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
32
|
+
"@owlmeans/error": "^0.1.18-rc.11",
|
|
33
|
+
"@owlmeans/flow": "^0.1.18-rc.17",
|
|
34
|
+
"@owlmeans/llm-common": "^0.1.18-rc.15",
|
|
35
|
+
"@owlmeans/resource": "^0.1.18-rc.12"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
package/src/consts.ts
CHANGED
|
@@ -36,16 +36,6 @@ export const DEFAULT_MAX_STATE_CHARS = 256_000
|
|
|
36
36
|
export const DEFAULT_STEP_ATTEMPTS = 1
|
|
37
37
|
export const DEFAULT_STEP_TIMEOUT = 1_800_000
|
|
38
38
|
|
|
39
|
-
/**
|
|
40
|
-
* Where a pipeline's answers live in its state.
|
|
41
|
-
*
|
|
42
|
-
* One key, named here rather than per pipeline, because an answer has to survive every hop it can
|
|
43
|
-
* take: a resume merges answers into it, a composing step forwards it to its child, and a reader
|
|
44
|
-
* looks a question up by id. Scalars and keys, like everything else a state holds — the answer's
|
|
45
|
-
* decision travels here and its prose belongs wherever that pipeline keeps its documents.
|
|
46
|
-
*/
|
|
47
|
-
export const INQUIRY_ANSWERS_KEY = 'answers'
|
|
48
|
-
|
|
49
39
|
/** The lifecycle flow every agent run is driven through. */
|
|
50
40
|
export const AGENT_RUN_FLOW = 'agent-run'
|
|
51
41
|
|
package/src/errors.ts
CHANGED
|
@@ -92,22 +92,6 @@ export class PipelineStateTooLargeError extends AgentCommonError {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/**
|
|
96
|
-
* A run was asked to wait for an answer it has no way of being given.
|
|
97
|
-
*
|
|
98
|
-
* Thrown when a step asks a question, nobody is there to answer it, and the pipeline has no run
|
|
99
|
-
* store: parking would leave nothing behind to resume, so the step fails at once rather than
|
|
100
|
-
* stopping a run that could never be started again.
|
|
101
|
-
*/
|
|
102
|
-
export class PipelineNotResumableError extends AgentCommonError {
|
|
103
|
-
public static override typeName: string = `PipelineNotResumable${AgentCommonError.typeName}`
|
|
104
|
-
|
|
105
|
-
constructor(message: string = 'error') {
|
|
106
|
-
super(`pipeline-not-resumable:${message}`)
|
|
107
|
-
this.type = PipelineNotResumableError.typeName
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
95
|
ResilientError.registerErrorClass(AgentCommonError)
|
|
112
96
|
ResilientError.registerErrorClass(AgentRunStateError)
|
|
113
97
|
ResilientError.registerErrorClass(PipelineSpecError)
|
|
@@ -115,4 +99,3 @@ ResilientError.registerErrorClass(PipelineVersionError)
|
|
|
115
99
|
ResilientError.registerErrorClass(PipelineUnknownStepError)
|
|
116
100
|
ResilientError.registerErrorClass(PipelineNotIdempotentError)
|
|
117
101
|
ResilientError.registerErrorClass(PipelineStateTooLargeError)
|
|
118
|
-
ResilientError.registerErrorClass(PipelineNotResumableError)
|
package/src/pipeline.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Inquiry } from '@owlmeans/llm-common'
|
|
2
1
|
import type { ResourceRecord } from '@owlmeans/resource'
|
|
3
2
|
import { DEFAULT_STEP_ATTEMPTS } from './consts.js'
|
|
4
3
|
import { PipelineSpecError, PipelineUnknownStepError } from './errors.js'
|
|
@@ -70,28 +69,6 @@ export enum PipelineRunStatus {
|
|
|
70
69
|
Failed = 'failed',
|
|
71
70
|
/** Stopped on purpose with work left — a budget expired, or the caller asked. Resumable. */
|
|
72
71
|
Aborted = 'aborted',
|
|
73
|
-
/**
|
|
74
|
-
* Stopped on purpose, waiting for an answer to {@link PipelineRun.inquiry}.
|
|
75
|
-
*
|
|
76
|
-
* Resumable, and NOT stale: a waiting run has no process behind it and its `heartbeatAt` will not
|
|
77
|
-
* move again until somebody answers. A reconciler that reads staleness alone would take this for
|
|
78
|
-
* a crashed run and repair what is merely waiting.
|
|
79
|
-
*/
|
|
80
|
-
Waiting = 'waiting',
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* What a `Waiting` run is waiting for.
|
|
85
|
-
*
|
|
86
|
-
* Written by the runner when a step asks a question nobody could answer while it ran, and read by
|
|
87
|
-
* everything that reports a run — a resume delivers the answer under {@link Inquiry.id}, which is
|
|
88
|
-
* the only thing that routes it back.
|
|
89
|
-
*/
|
|
90
|
-
export interface PipelineRunInquiry {
|
|
91
|
-
/** The step that asked. A resume re-enters exactly this one. */
|
|
92
|
-
step: string
|
|
93
|
-
askedAt: string
|
|
94
|
-
inquiry: Inquiry
|
|
95
72
|
}
|
|
96
73
|
|
|
97
74
|
/**
|
|
@@ -128,13 +105,6 @@ export interface PipelineRun extends ResourceRecord {
|
|
|
128
105
|
error?: string
|
|
129
106
|
/** The last thing a step said about itself. Progress, not state. */
|
|
130
107
|
note?: string
|
|
131
|
-
/**
|
|
132
|
-
* The question this run stopped on.
|
|
133
|
-
*
|
|
134
|
-
* Present only while `status === Waiting`, and cleared on every entry of the run — a row that
|
|
135
|
-
* kept advertising a question it has already been given would have every reader offer it again.
|
|
136
|
-
*/
|
|
137
|
-
inquiry?: PipelineRunInquiry
|
|
138
108
|
/** Whatever lock the run held, so a resume can re-take the same one. */
|
|
139
109
|
lockTask?: string
|
|
140
110
|
/** How many times this run has been RESUMED. Reset only by a `Done` outcome. */
|
package/tests/pipeline.spec.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
|
-
import { InquiryKind } from '@owlmeans/llm-common'
|
|
3
2
|
import {
|
|
4
|
-
INQUIRY_ANSWERS_KEY, PipelineRunStatus,
|
|
5
3
|
orderPipelineSteps, pipelineDescendants, pipelineStep, validatePipelineSpec,
|
|
6
4
|
} from '../src/index.js'
|
|
7
|
-
import type {
|
|
5
|
+
import type { PipelineSpec } from '../src/index.js'
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* The spec is the one thing in this family that is checked without a model, a slot or a network, so
|
|
@@ -127,41 +125,3 @@ describe('agent-common — descendants', () => {
|
|
|
127
125
|
expect(pipelineStep(graph, 'a')?.step).toBe('a')
|
|
128
126
|
})
|
|
129
127
|
})
|
|
130
|
-
|
|
131
|
-
describe('agent-common — a run that is waiting for an answer', () => {
|
|
132
|
-
const waiting = (): PipelineRun => ({
|
|
133
|
-
runId: 'r', pipeline: 'test', version: 1, scope: 'p1',
|
|
134
|
-
status: PipelineRunStatus.Waiting,
|
|
135
|
-
completed: ['a'], pending: ['b'], state: `{"${INQUIRY_ANSWERS_KEY}":{}}`, stateChars: 15,
|
|
136
|
-
warnings: [], attempts: 0,
|
|
137
|
-
inquiry: {
|
|
138
|
-
step: 'b',
|
|
139
|
-
askedAt: '2026-01-01T00:00:00.000Z',
|
|
140
|
-
inquiry: {
|
|
141
|
-
id: 'q1', kind: InquiryKind.Choice, question: 'Which product is this?',
|
|
142
|
-
options: [{ value: 'a', label: 'A' }, { value: 'b', label: 'B' }],
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
startedAt: '2026-01-01T00:00:00.000Z',
|
|
146
|
-
heartbeatAt: '2026-01-01T00:00:00.000Z',
|
|
147
|
-
updatedAt: '2026-01-01T00:00:00.000Z',
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
test('`Waiting` is its own status, distinct from the two that mean the run stopped badly', () => {
|
|
151
|
-
// A reconciler branches on this string. Aborted means nobody asked anything and a resume may
|
|
152
|
-
// simply carry on; Waiting means a resume without an answer would park on the same question.
|
|
153
|
-
expect(PipelineRunStatus.Waiting).toBe('waiting')
|
|
154
|
-
expect(PipelineRunStatus.Waiting).not.toBe(PipelineRunStatus.Aborted)
|
|
155
|
-
expect(PipelineRunStatus.Waiting).not.toBe(PipelineRunStatus.Failed)
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
test('a row carrying its inquiry survives the wire unchanged', () => {
|
|
159
|
-
// These records cross process boundaries and storage backends; the question's id is the ONLY
|
|
160
|
-
// thing that routes an answer back, so it has to arrive spelled exactly as it was written.
|
|
161
|
-
const restored = JSON.parse(JSON.stringify(waiting())) as PipelineRun
|
|
162
|
-
|
|
163
|
-
expect(restored).toEqual(waiting())
|
|
164
|
-
expect(restored.inquiry?.inquiry.id).toBe('q1')
|
|
165
|
-
expect(restored.inquiry?.step).toBe('b')
|
|
166
|
-
})
|
|
167
|
-
})
|