@owlmeans/agent-common 0.1.18-rc.7 → 0.1.18

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 (65) hide show
  1. package/README.md +174 -13
  2. package/agent-meta/manifest.json +3 -3
  3. package/agent-meta/skills/agent-common/SKILL.md +69 -14
  4. package/build/consts.d.ts +118 -5
  5. package/build/consts.d.ts.map +1 -1
  6. package/build/consts.js +204 -4
  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 +60 -0
  13. package/build/errors.d.ts.map +1 -1
  14. package/build/errors.js +84 -0
  15. package/build/errors.js.map +1 -1
  16. package/build/helpers/conversation.d.ts +0 -9
  17. package/build/helpers/conversation.d.ts.map +1 -1
  18. package/build/helpers/conversation.js +0 -28
  19. package/build/helpers/conversation.js.map +1 -1
  20. package/build/helpers/truncate.d.ts +10 -0
  21. package/build/helpers/truncate.d.ts.map +1 -0
  22. package/build/helpers/truncate.js +29 -0
  23. package/build/helpers/truncate.js.map +1 -0
  24. package/build/index.d.ts +6 -1
  25. package/build/index.d.ts.map +1 -1
  26. package/build/index.js +4 -1
  27. package/build/index.js.map +1 -1
  28. package/build/models/pipeline-spec/types.d.ts +57 -0
  29. package/build/models/pipeline-spec/types.d.ts.map +1 -0
  30. package/build/models/pipeline-spec/types.js +2 -0
  31. package/build/models/pipeline-spec/types.js.map +1 -0
  32. package/build/models/pipeline-spec.d.ts +4 -0
  33. package/build/models/pipeline-spec.d.ts.map +1 -0
  34. package/build/models/pipeline-spec.js +171 -0
  35. package/build/models/pipeline-spec.js.map +1 -0
  36. package/build/pipeline.d.ts +10 -0
  37. package/build/pipeline.d.ts.map +1 -0
  38. package/build/pipeline.js +10 -0
  39. package/build/pipeline.js.map +1 -0
  40. package/build/results/types.d.ts +211 -0
  41. package/build/results/types.d.ts.map +1 -0
  42. package/build/results/types.js +2 -0
  43. package/build/results/types.js.map +1 -0
  44. package/build/results.d.ts +4 -0
  45. package/build/results.d.ts.map +1 -0
  46. package/build/results.js +218 -0
  47. package/build/results.js.map +1 -0
  48. package/build/types.d.ts +146 -24
  49. package/build/types.d.ts.map +1 -1
  50. package/package.json +8 -8
  51. package/src/consts.local.ts +15 -0
  52. package/src/consts.ts +218 -4
  53. package/src/errors.ts +96 -0
  54. package/src/helpers/conversation.ts +0 -32
  55. package/src/helpers/truncate.ts +31 -0
  56. package/src/index.ts +6 -1
  57. package/src/models/pipeline-spec/types.ts +58 -0
  58. package/src/models/pipeline-spec.ts +202 -0
  59. package/src/pipeline.ts +16 -0
  60. package/src/results/types.ts +221 -0
  61. package/src/results.ts +270 -0
  62. package/src/types.ts +153 -25
  63. package/tests/pipeline.spec.ts +164 -0
  64. package/tests/results.spec.ts +148 -0
  65. package/src/flows.ts +0 -118
@@ -0,0 +1,218 @@
1
+ import { DEFAULT_RESULT_COMPACT_CHARS, DEFAULT_RESULT_ENTRY_CHARS, DEFAULT_RESULT_SUMMARY_CHARS, RESULTS_EVERY_STEP, CumulativeFactKind, CumulativeResultSource } from './consts.js';
2
+ import { truncateAt } from './helpers/truncate.js';
3
+ import { NAMES_ONLY, NOT_VERIFIED, PARTIAL_EMPTY, PARTIAL_WITH_FACTS, SEEDED, SUMMARY_ALONE, SUMMARY_LEFT_OUT, SUMMARY_WITH_FACTS } from './consts.local.js';
4
+ export const createCumulativeResultsHelper = () => {
5
+ const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
6
+ const oneLine = (text) => text.replace(/\s+/g, ' ').trim();
7
+ const factKey = (fact) => `${fact.kind}\u0000${fact.name}\u0000${fact.specifier ?? fact.path ?? ''}`;
8
+ /** File facts last — a location is the first thing a budget can spare, a shape the last. */
9
+ const kindRank = (kind) => kind === CumulativeFactKind.File ? 1 : 0;
10
+ const sortFacts = (facts) => [...facts].sort((a, b) => kindRank(a.kind) - kindRank(b.kind)
11
+ || compare(a.kind, b.kind)
12
+ || compare(a.name, b.name)
13
+ || compare(a.specifier ?? a.path ?? '', b.specifier ?? b.path ?? ''));
14
+ const renderResultFact = (fact) => {
15
+ let line = `- ${fact.kind} \`${oneLine(fact.name)}\``;
16
+ const shape = fact.signature != null && fact.signature.trim() !== ''
17
+ ? oneLine(fact.signature)
18
+ : fact.members != null && fact.members.length > 0
19
+ ? `{ ${fact.members.map(oneLine).join(', ')} }`
20
+ : '';
21
+ if (shape !== '') {
22
+ line += `: ${shape}`;
23
+ }
24
+ const attrs = Object.keys(fact.attrs ?? {}).sort(compare)
25
+ .map(key => `${key}: ${oneLine(fact.attrs[key])}`);
26
+ if (attrs.length > 0) {
27
+ line += ` (${attrs.join(', ')})`;
28
+ }
29
+ if (fact.ref != null && fact.ref !== '') {
30
+ line += ` → \`${oneLine(fact.ref)}\``;
31
+ }
32
+ if (fact.specifier != null && fact.specifier !== '') {
33
+ line += ` — import from \`${fact.specifier}\``;
34
+ }
35
+ if (fact.path != null && fact.path !== '' && fact.path !== fact.name) {
36
+ line += fact.specifier != null && fact.specifier !== ''
37
+ ? ` (file \`${fact.path}\`)`
38
+ : ` — file \`${fact.path}\``;
39
+ }
40
+ return line;
41
+ };
42
+ const moreFacts = (count) => `- … and ${count} more not listed here for space. They exist: check the files before creating anything similar.`;
43
+ const moreNames = (count) => `- … and ${count} more`;
44
+ const heading = (entry, compact) => {
45
+ const notes = [];
46
+ const hasFacts = entry.facts.length > 0;
47
+ if (entry.partial === true) {
48
+ notes.push(hasFacts ? PARTIAL_WITH_FACTS : PARTIAL_EMPTY);
49
+ }
50
+ if (entry.source === CumulativeResultSource.Seeded) {
51
+ notes.push(SEEDED);
52
+ }
53
+ if (!hasFacts && entry.summary != null) {
54
+ notes.push(NOT_VERIFIED);
55
+ }
56
+ if (compact && (hasFacts || entry.summary != null)) {
57
+ notes.push(hasFacts ? NAMES_ONLY : SUMMARY_LEFT_OUT);
58
+ }
59
+ return `### ${entry.label}${notes.length > 0 ? ` (${notes.join('; ')})` : ''}`;
60
+ };
61
+ /** Lines under `head`, as many as fit in `max`, with `more(n)` saying how many did not. */
62
+ const fit = (head, lines, tail, max, more) => {
63
+ const total = (parts) => parts.join('\n').length;
64
+ if (total([...head, ...lines, ...tail]) <= max) {
65
+ return [...head, ...lines, ...tail].join('\n');
66
+ }
67
+ // Room for the "more" line is reserved at its widest, so adding it can never break the cap.
68
+ const reserve = more(lines.length).length + 1;
69
+ const kept = [];
70
+ for (const line of lines) {
71
+ if (total([...head, ...kept, line, ...tail]) + reserve > max) {
72
+ break;
73
+ }
74
+ kept.push(line);
75
+ }
76
+ return [...head, ...kept, more(lines.length - kept.length), ...tail].join('\n');
77
+ };
78
+ const renderResultEntry = (entry, caps = {}) => {
79
+ const maxChars = caps.maxChars ?? DEFAULT_RESULT_ENTRY_CHARS;
80
+ const maxCompactChars = caps.maxCompactChars ?? DEFAULT_RESULT_COMPACT_CHARS;
81
+ const facts = sortFacts(entry.facts);
82
+ if (facts.length === 0 && entry.summary == null && entry.partial !== true) {
83
+ return { full: '', compact: '' };
84
+ }
85
+ const summary = entry.summary != null && entry.summary.trim() !== ''
86
+ ? [`${facts.length > 0 ? SUMMARY_WITH_FACTS : SUMMARY_ALONE} ${oneLine(entry.summary)}`]
87
+ : [];
88
+ const full = fit([heading(entry, false)], facts.map(renderResultFact), summary, maxChars, moreFacts);
89
+ const byKind = new Map();
90
+ for (const fact of facts) {
91
+ const names = byKind.get(fact.kind) ?? [];
92
+ if (!names.includes(fact.name)) {
93
+ names.push(fact.name);
94
+ }
95
+ byKind.set(fact.kind, names);
96
+ }
97
+ // One line per kind while the names fit; the rest are counted, never cut.
98
+ const compactHead = heading(entry, true);
99
+ const namesWithin = (reserve) => {
100
+ const lines = [];
101
+ let left = 0;
102
+ for (const [kind, names] of byKind) {
103
+ let line = `- ${kind}:`;
104
+ let taken = 0;
105
+ for (const name of names) {
106
+ const next = `${line}${taken > 0 ? ',' : ''} \`${oneLine(name)}\``;
107
+ if (left > 0 || [compactHead, ...lines, next].join('\n').length + reserve > maxCompactChars) {
108
+ left += 1;
109
+ continue;
110
+ }
111
+ line = next;
112
+ taken += 1;
113
+ }
114
+ if (taken > 0) {
115
+ lines.push(line);
116
+ }
117
+ }
118
+ return { lines, left };
119
+ };
120
+ let names = namesWithin(0);
121
+ if (names.left > 0) {
122
+ // Room for the "more" line is reserved at its widest, so adding it can never break the cap.
123
+ names = namesWithin(moreNames(facts.length).length + 1);
124
+ }
125
+ const compact = [
126
+ compactHead, ...names.lines, ...(names.left > 0 ? [moreNames(names.left)] : []),
127
+ ].join('\n');
128
+ return { full, compact };
129
+ };
130
+ const compareResultOrder = (a, b) => {
131
+ for (let i = 0; i < Math.min(a.length, b.length); ++i) {
132
+ if (a[i] !== b[i]) {
133
+ return a[i] - b[i];
134
+ }
135
+ }
136
+ return b.length - a.length;
137
+ };
138
+ const rootRunOf = (runId) => {
139
+ const at = runId.indexOf('/');
140
+ return at < 0 ? runId : runId.slice(0, at);
141
+ };
142
+ const resultLabel = (ledger, runId, step) => {
143
+ const path = runId === ledger
144
+ ? ''
145
+ : runId.startsWith(`${ledger}/`)
146
+ ? runId.slice(ledger.length + 1)
147
+ : runId.slice(rootRunOf(runId).length + 1);
148
+ return path !== '' ? `${path}/${step}` : step;
149
+ };
150
+ const flatten = (value) => {
151
+ if (value == null) {
152
+ return '';
153
+ }
154
+ if (typeof value === 'string') {
155
+ return oneLine(value);
156
+ }
157
+ if (typeof value === 'number' || typeof value === 'boolean') {
158
+ return String(value);
159
+ }
160
+ if (Array.isArray(value)) {
161
+ return value.map(flatten).filter(part => part !== '').join(', ');
162
+ }
163
+ if (typeof value === 'object') {
164
+ return Object.keys(value).sort(compare)
165
+ .map(key => [key, flatten(value[key])])
166
+ .filter(([, text]) => text !== '')
167
+ .map(([key, text]) => `${key}: ${text}`)
168
+ .join('; ');
169
+ }
170
+ return '';
171
+ };
172
+ const renderResultSummary = (answer, maxChars = DEFAULT_RESULT_SUMMARY_CHARS) => {
173
+ const single = typeof answer === 'object' && answer != null && !Array.isArray(answer)
174
+ && Object.keys(answer).length === 1
175
+ ? answer[Object.keys(answer)[0]]
176
+ : answer;
177
+ return truncateAt(flatten(single), maxChars);
178
+ };
179
+ const union = (left, right) => left == null && right == null ? undefined : [...new Set([...(left ?? []), ...(right ?? [])])];
180
+ const mergeStep = (base, patch) => {
181
+ const extractors = union(base?.extractors, patch.extractors);
182
+ const omit = union(base?.omit, patch.omit);
183
+ const full = base?.full === RESULTS_EVERY_STEP || patch.full === RESULTS_EVERY_STEP
184
+ ? RESULTS_EVERY_STEP
185
+ : union(base?.full, patch.full);
186
+ return {
187
+ ...base,
188
+ ...patch,
189
+ ...(extractors != null ? { extractors } : {}),
190
+ ...(omit != null ? { omit } : {}),
191
+ ...(full != null ? { full } : {}),
192
+ };
193
+ };
194
+ const mergeResultsSpecs = (...specs) => {
195
+ const merged = {};
196
+ for (const spec of specs) {
197
+ if (spec == null) {
198
+ continue;
199
+ }
200
+ const { steps, ...scalars } = spec;
201
+ Object.assign(merged, scalars);
202
+ if (steps != null) {
203
+ const into = { ...merged.steps };
204
+ for (const name of Object.keys(steps)) {
205
+ into[name] = mergeStep(into[name], steps[name]);
206
+ }
207
+ merged.steps = into;
208
+ }
209
+ }
210
+ return merged;
211
+ };
212
+ return {
213
+ factKey, sortFacts, renderResultFact, renderResultEntry, compareResultOrder, rootRunOf, resultLabel,
214
+ renderResultSummary, mergeResultsSpecs,
215
+ };
216
+ };
217
+ export const cumulativeResultsHelper = createCumulativeResultsHelper();
218
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpL,OAAO,EAAE,UAAU,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IAED,MAAM,iBAAiB,GAAG,CACxB,GAAG,KAAsD,EAClC,EAAE;QACzB,MAAM,MAAM,GAA0B,EAAE,CAAA;QACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;gBACjB,SAAQ;YACV,CAAC;YACD,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAA;YAClC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YAC9B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;gBAClB,MAAM,IAAI,GAAoC,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA;gBACjE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBACtC,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAE,CAAC,CAAA;gBAClD,CAAC;gBACD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAA;YACrB,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAED,OAAO;QACL,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW;QACnG,mBAAmB,EAAE,iBAAiB;KACvC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,6BAA6B,EAAE,CAAA"}
package/build/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ResourceRecord } from '@owlmeans/resource';
2
- import type { ExecutionState } from '@owlmeans/llm-common';
3
- import type { AgentRunStatus } from './consts.js';
2
+ import { type AgentRunStatus, PipelineRunStatus } from './consts.js';
3
+ import type { Inquiry } from '@owlmeans/llm-common';
4
4
  /**
5
5
  * What a conversation is, as an address.
6
6
  *
@@ -39,20 +39,6 @@ export interface ConversationEvent extends ResourceRecord {
39
39
  export interface ConversationEventInput extends Omit<ConversationEvent, 'id' | 'seq' | 'createdAt'> {
40
40
  createdAt?: string;
41
41
  }
42
- /**
43
- * The data plane of a run.
44
- *
45
- * `flow` is the serialized {@link import('@owlmeans/flow').FlowModel} state — the control plane
46
- * collapsed to a string — and `state` is the execution snapshot the LLM layer produces. Keeping
47
- * them in one record is what makes a resume a single read.
48
- */
49
- export interface AgentRunState extends ResourceRecord {
50
- id: string;
51
- conversationId: string;
52
- flow: string;
53
- state: ExecutionState;
54
- updatedAt: string;
55
- }
56
42
  /**
57
43
  * A node of the subsystem memory graph.
58
44
  *
@@ -81,17 +67,153 @@ export interface MemoryEventInput extends Omit<MemoryEvent, 'id' | 'seq' | 'crea
81
67
  createdAt?: string;
82
68
  }
83
69
  /**
84
- * What a transport carries.
70
+ * What a transport carries: a POINTER, never a payload.
85
71
  *
86
- * The execution state travels by REFERENCE (`stateRef`), not by value: a project execution's state
87
- * holds the whole project specification, and a queue whose messages carry that is a queue that
88
- * falls over on the first large project. The flow string is small enough to inline, and it is what
89
- * a consumer needs to route the message before it reads anything.
72
+ * Everything a consumer needs to route the message is here, and everything else is read from the
73
+ * run row it names. That is not an optimization — a pipeline state is scalars and keys precisely so
74
+ * that the authority stays in one place, and a message that carried a copy would be a second one,
75
+ * stale from the moment it was enqueued.
90
76
  */
91
77
  export interface AgentRunMessage {
92
- id: string;
78
+ runId: string;
93
79
  conversationId: string;
94
- flow: string;
95
- stateRef?: string;
80
+ /** The pipeline alias, when the message is about a pipeline run rather than a conversation. */
81
+ pipeline?: string;
82
+ /** Where the run stood when the message was sent. Advisory — the row is authoritative. */
83
+ step?: string;
84
+ }
85
+ /**
86
+ * What a pipeline carries between its steps.
87
+ *
88
+ * Scalars and KEYS — ids, revisions, markers, lists of codes. Never an artifact. Everything large a
89
+ * pipeline produces belongs in a store of its own and travels here as the key that finds it again:
90
+ * the state is serialized into the run row at every step boundary, and a state that carries a
91
+ * document is a row that carries it too, once per step.
92
+ */
93
+ export type PipelineState = Record<string, unknown>;
94
+ export interface PipelineStepSpec {
95
+ step: string;
96
+ /**
97
+ * The steps that must have completed before this one may run.
98
+ *
99
+ * Absent or empty means "from the start". Several steps naming the same predecessor fan OUT;
100
+ * one step naming several predecessors JOINS them. That is the whole edge vocabulary — there is
101
+ * no conditional edge, because a branch that is expressed as an edge is invisible to a resume,
102
+ * while a branch expressed as {@link PipelineStep.skipWhen} is the same mechanism that makes a
103
+ * resume correct.
104
+ */
105
+ after?: string[];
106
+ /** Human-readable, for progress reporting and tool descriptions. */
107
+ title?: string;
108
+ /** A failure is recorded on the run's `warnings` and the successors still run. */
109
+ optional?: boolean;
110
+ /**
111
+ * Re-running repeats a side effect that cannot be undone — a wipe, a purge, a claim against a
112
+ * rate-limited authority, a model call whose output is already on disk.
113
+ *
114
+ * A resume never re-enters one of these on its own; `resume(runId, { from })` refuses without
115
+ * `force`. It is also refused `attempts > 1`, since an automatic retry is exactly the thing the
116
+ * flag says must not happen.
117
+ */
118
+ nonIdempotent?: boolean;
119
+ /**
120
+ * Attempts for ONE entry of this step. Default {@link DEFAULT_STEP_ATTEMPTS} = 1.
121
+ *
122
+ * Deliberately not a ladder: retry budgets in this family MULTIPLY (an outer 8 around a model's
123
+ * own inner 8 is 64 real calls), so a step that wants retries asks for them once, here, and the
124
+ * helpers below it keep theirs.
125
+ */
126
+ attempts?: number;
127
+ /** Wall clock for one attempt, in milliseconds. */
128
+ timeout?: number;
129
+ }
130
+ export interface PipelineSpec {
131
+ alias: string;
132
+ /**
133
+ * Bumped whenever a step is added, removed or renamed.
134
+ *
135
+ * `completed` names steps by string, so a run resumed under a changed spec would skip work it
136
+ * never did — silently, because an unknown name simply matches nothing. A version mismatch is
137
+ * refused instead.
138
+ */
139
+ version: number;
140
+ steps: PipelineStepSpec[];
141
+ }
142
+ /**
143
+ * What a `Waiting` run is waiting for.
144
+ *
145
+ * Written by the runner when a step asks a question nobody could answer while it ran, and read by
146
+ * everything that reports a run — a resume delivers the answer under {@link Inquiry.id}, which is
147
+ * the only thing that routes it back.
148
+ */
149
+ export interface PipelineRunInquiry {
150
+ /** The step that asked. A resume re-enters exactly this one. */
151
+ step: string;
152
+ askedAt: string;
153
+ inquiry: Inquiry;
154
+ }
155
+ /**
156
+ * The data plane of a pipeline run, and the ONE authority on where it stands.
157
+ *
158
+ * Not the LangGraph checkpoint: that is a replay optimization which may legitimately be absent (it
159
+ * is size-guarded and expires), and a design that trusts it has a silent hole exactly where a
160
+ * crashed run needs an answer. Everything that reads a run's position — a resume, a reconciler, an
161
+ * operator, a status endpoint — reads this row.
162
+ *
163
+ * Timestamps are ISO strings, never `Date`: these records cross process boundaries and storage
164
+ * backends. A consumer whose store prefers dates maps them at its own adapter boundary.
165
+ */
166
+ export interface PipelineRun extends ResourceRecord {
167
+ /** The business key. Chosen by the caller so a run is addressable before it exists. */
168
+ runId: string;
169
+ pipeline: string;
170
+ version: number;
171
+ /** The subject the run belongs to — for an application with projects, the project id. */
172
+ scope: string;
173
+ /** The tenant. Carried so a store can refuse a read that crosses an organization. */
174
+ entityId?: string;
175
+ status: PipelineRunStatus;
176
+ /** Steps that have finished, in the order they finished. */
177
+ completed: string[];
178
+ /** Steps that had not run when the run stopped. Empty on a `Done` run. */
179
+ pending: string[];
180
+ /** JSON TEXT of {@link PipelineState}. Text, not a subdocument — a state key is a caller's word. */
181
+ state: string;
182
+ stateChars: number;
183
+ /** What an `optional` step reported when it failed. Never empties a run. */
184
+ warnings: string[];
185
+ failedAt?: string;
186
+ error?: string;
187
+ /** The last thing a step said about itself. Progress, not state. */
188
+ note?: string;
189
+ /**
190
+ * The question this run stopped on.
191
+ *
192
+ * Present only while `status === Waiting`, and cleared on every entry of the run — a row that
193
+ * kept advertising a question it has already been given would have every reader offer it again.
194
+ */
195
+ inquiry?: PipelineRunInquiry;
196
+ /** Whatever lock the run held, so a resume can re-take the same one. */
197
+ lockTask?: string;
198
+ /** How many times this run has been RESUMED. Reset only by a `Done` outcome. */
199
+ attempts: number;
200
+ startedAt: string;
201
+ /**
202
+ * Written at every step boundary — the only signal that separates a run still working from one
203
+ * whose process died. A reconciler reads staleness here, never the status.
204
+ */
205
+ heartbeatAt: string;
206
+ updatedAt: string;
207
+ }
208
+ /** What the runner reports as it moves. Never persisted as state. */
209
+ export interface PipelineProgress {
210
+ pipeline: string;
211
+ runId: string;
212
+ step: string;
213
+ /** 1-based position in the topological order. */
214
+ index: number;
215
+ total: number;
216
+ skipped?: boolean;
217
+ note?: string;
96
218
  }
97
219
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,cAAc,CAAA;CACvB;AAED,mFAAmF;AACnF,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,KAAK,GAAG,WAAW,CAAC;IACjG,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;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M,EAAE,CAAA;IACnB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,oGAAoG;IACpG,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/agent-common",
3
- "version": "0.1.18-rc.7",
3
+ "version": "0.1.18",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,17 +22,17 @@
22
22
  }
23
23
  },
24
24
  "devDependencies": {
25
- "@owlmeans/dep-config": "workspace:*",
26
- "@types/bun": "^1.3.14",
27
- "@types/node": "^26.1.0",
25
+ "@owlmeans/dep-config": "^0.1.18",
26
+ "@types/bun": "^1.4.2",
27
+ "@types/node": "^26.6.4",
28
28
  "nodemon": "^3.1.14",
29
29
  "typescript": "^7.0.2"
30
30
  },
31
31
  "dependencies": {
32
- "@owlmeans/error": "^0.1.18-rc.6",
33
- "@owlmeans/flow": "^0.1.18-rc.6",
34
- "@owlmeans/llm-common": "^0.1.18-rc.6",
35
- "@owlmeans/resource": "^0.1.18-rc.6"
32
+ "@owlmeans/error": "^0.1.18",
33
+ "@owlmeans/flow": "^0.1.18",
34
+ "@owlmeans/llm-common": "^0.1.18",
35
+ "@owlmeans/resource": "^0.1.18"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
@@ -0,0 +1,15 @@
1
+ export const PARTIAL_WITH_FACTS = 'partial: the step failed part-way; only what it left in the files is listed'
2
+
3
+ export const PARTIAL_EMPTY = 'partial: the step failed part-way and left nothing that could be read'
4
+
5
+ export const SEEDED = 'known before this run'
6
+
7
+ export const NOT_VERIFIED = 'not verified'
8
+
9
+ export const NAMES_ONLY = 'names only'
10
+
11
+ export const SUMMARY_LEFT_OUT = 'summary left out for space'
12
+
13
+ export const SUMMARY_WITH_FACTS = 'Summary (not verified — written by a model, never checked against the files):'
14
+
15
+ export const SUMMARY_ALONE = 'Summary written by a model, never checked against the files:'