@owlmeans/agent-common 0.1.18-rc.47 → 0.1.18-rc.49

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 (62) hide show
  1. package/README.md +174 -13
  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 +20 -0
  5. package/build/consts.d.ts.map +1 -1
  6. package/build/consts.js +103 -0
  7. package/build/consts.js.map +1 -1
  8. package/build/errors.d.ts +1 -1
  9. package/build/errors.js +1 -1
  10. package/build/helpers/conversation.d.ts +0 -9
  11. package/build/helpers/conversation.d.ts.map +1 -1
  12. package/build/helpers/conversation.js +0 -28
  13. package/build/helpers/conversation.js.map +1 -1
  14. package/build/helpers/truncate.d.ts +10 -0
  15. package/build/helpers/truncate.d.ts.map +1 -0
  16. package/build/helpers/truncate.js +29 -0
  17. package/build/helpers/truncate.js.map +1 -0
  18. package/build/index.d.ts +4 -1
  19. package/build/index.d.ts.map +1 -1
  20. package/build/index.js +2 -1
  21. package/build/index.js.map +1 -1
  22. package/build/models/pipeline-spec/types.d.ts +57 -0
  23. package/build/models/pipeline-spec/types.d.ts.map +1 -0
  24. package/build/models/pipeline-spec/types.js +2 -0
  25. package/build/models/pipeline-spec/types.js.map +1 -0
  26. package/build/models/pipeline-spec.d.ts +4 -0
  27. package/build/models/pipeline-spec.d.ts.map +1 -0
  28. package/build/models/pipeline-spec.js +171 -0
  29. package/build/models/pipeline-spec.js.map +1 -0
  30. package/build/pipeline.d.ts +4 -43
  31. package/build/pipeline.d.ts.map +1 -1
  32. package/build/pipeline.js +9 -205
  33. package/build/pipeline.js.map +1 -1
  34. package/build/results/types.d.ts +211 -0
  35. package/build/results/types.d.ts.map +1 -0
  36. package/build/results/types.js +2 -0
  37. package/build/results/types.js.map +1 -0
  38. package/build/results.d.ts +3 -55
  39. package/build/results.d.ts.map +1 -1
  40. package/build/results.js +202 -250
  41. package/build/results.js.map +1 -1
  42. package/build/types.d.ts +1 -137
  43. package/build/types.d.ts.map +1 -1
  44. package/package.json +5 -5
  45. package/src/consts.ts +113 -0
  46. package/src/errors.ts +1 -1
  47. package/src/helpers/conversation.ts +0 -32
  48. package/src/helpers/truncate.ts +31 -0
  49. package/src/index.ts +4 -1
  50. package/src/models/pipeline-spec/types.ts +58 -0
  51. package/src/models/pipeline-spec.ts +202 -0
  52. package/src/pipeline.ts +10 -231
  53. package/src/results/types.ts +221 -0
  54. package/src/results.ts +229 -274
  55. package/src/types.ts +2 -147
  56. package/tests/pipeline.spec.ts +26 -29
  57. package/tests/results.spec.ts +24 -26
  58. package/build/flows.d.ts +0 -21
  59. package/build/flows.d.ts.map +0 -1
  60. package/build/flows.js +0 -105
  61. package/build/flows.js.map +0 -1
  62. package/src/flows.ts +0 -113
@@ -0,0 +1,211 @@
1
+ import type { ResourceRecord } from '@owlmeans/resource';
2
+ import { RESULTS_EVERY_STEP, CumulativeResultSource } from '../consts.js';
3
+ /**
4
+ * ONE authoritative fact about what a step produced, small enough to be one line of a prompt.
5
+ *
6
+ * Every field is optional past `kind` and `name`, because facts differ in what matters about them:
7
+ * a type has a shape and an import specifier, an endpoint an alias, a method, a path and a guard, a
8
+ * resource a table and an accessor, a file only its path. Put scalars that have no field of their
9
+ * own into `attrs`.
10
+ */
11
+ export interface CumulativeResultFact {
12
+ /** What the fact is about — see {@link CumulativeFactKind}. */
13
+ kind: string;
14
+ /** The name to use VERBATIM. */
15
+ name: string;
16
+ /** The file it lives in, relative to the project root. */
17
+ path?: string;
18
+ /** The module specifier it is imported from. */
19
+ specifier?: string;
20
+ /** Its shape or signature, on one line. */
21
+ signature?: string;
22
+ /** Fields, parameters or columns, when there is no signature to say it. */
23
+ members?: string[];
24
+ /** Another fact's name this one points at — a returned type, a mapped table. */
25
+ ref?: string;
26
+ /** Scalars without a field of their own — `method`, `path`, `guard`, `table`. */
27
+ attrs?: Record<string, string>;
28
+ }
29
+ /**
30
+ * One step's contribution to a ledger.
31
+ *
32
+ * Keyed by `(ledger, runId, step)`. `order` places it in the ledger: the topological index of the
33
+ * step in its own pipeline, preceded by the index path of every step it was composed under, so a
34
+ * run composed as a step of another sorts inside that step, ahead of the composing step's own
35
+ * entry. A single number cannot say that: two pipelines' indexes are not comparable.
36
+ *
37
+ * `full` and `compact` are rendered once, when the entry is written, and never contain a timestamp,
38
+ * a run id or anything else a model would copy without meaning to.
39
+ */
40
+ export interface CumulativeResultEntry extends ResourceRecord {
41
+ /** What entries can see each other — by default the root run of the composition. */
42
+ ledger: string;
43
+ pipeline: string;
44
+ runId: string;
45
+ step: string;
46
+ /** How the entry is headed in a prompt: the step, behind the path of the steps it runs under. */
47
+ label: string;
48
+ order: number[];
49
+ /** Bumped every time the entry is re-extracted after a later step rewrote one of its files. */
50
+ revision: number;
51
+ source: CumulativeResultSource;
52
+ /** An `optional` step that failed: whatever it left behind, and a heading that says so. */
53
+ partial?: boolean;
54
+ facts: CumulativeResultFact[];
55
+ /** The files the facts were read from — what a later rewrite is matched against. */
56
+ files: string[];
57
+ /** A model's summary, rendered and capped. NOT verified, and always labelled so. */
58
+ summary?: string;
59
+ full: string;
60
+ compact: string;
61
+ /** Consumers that always get the full entry, by step name, or every later step. */
62
+ fullFor?: string[] | typeof RESULTS_EVERY_STEP;
63
+ /** Consumers that never see the entry in their prompt. */
64
+ omitFor?: string[];
65
+ /** How many edges back the entry is still rendered in full by default. */
66
+ window?: number;
67
+ updatedAt: string;
68
+ }
69
+ /**
70
+ * The optional model-written summary of a step. OFF unless a step declares one.
71
+ *
72
+ * Facts are the product; a summary is for what code cannot extract — an intent, a decision taken.
73
+ * It is bounded by `maxChars` in code after the model answers, rendered deterministically from the
74
+ * schema-shaped answer, and always labelled as unverified wherever it is shown.
75
+ */
76
+ export interface ResultSummarySpec {
77
+ /** Which model — interpreted by the caller's summarize callback (a model role, typically). */
78
+ role?: string;
79
+ instructions: string;
80
+ /** JSON schema of the answer. Absent means `{ summary: string }`. */
81
+ schema?: Record<string, unknown>;
82
+ /** Defaults to `DEFAULT_RESULT_SUMMARY_CHARS`. */
83
+ maxChars?: number;
84
+ }
85
+ /**
86
+ * What one step contributes, and to whom. JSON-safe, so a declaration can live in data.
87
+ *
88
+ * Extractors are named, never inlined: a declaration names what runs, and the runtime holds the
89
+ * code. A consumer not named in `full` or `omit` gets the full entry within `window` edges and the
90
+ * names only beyond it.
91
+ */
92
+ export interface StepResultsSpec {
93
+ /** Named deterministic extractors, run in this order. */
94
+ extractors?: string[];
95
+ /** Later steps that get the FULL entry wherever they sit, or `'*'` for all of them. */
96
+ full?: string[] | typeof RESULTS_EVERY_STEP;
97
+ /** Later steps that are never shown the entry. */
98
+ omit?: string[];
99
+ /** Overrides {@link CumulativeResultsSpec.window} for this entry. */
100
+ window?: number;
101
+ /** Cap on the full rendering; facts are dropped whole, never cut. */
102
+ maxChars?: number;
103
+ /** Cap on the names-only rendering. */
104
+ maxCompactChars?: number;
105
+ /** Re-extract this entry when a later step rewrites one of its files. Defaults to the spec's. */
106
+ refresh?: boolean;
107
+ summary?: ResultSummarySpec;
108
+ }
109
+ /** The pipeline-level declaration — merged from a pipeline's own and any overlay with {@link CumulativeResultsHelper.mergeResultsSpecs}. */
110
+ export interface CumulativeResultsSpec {
111
+ /** Per step, by step name. A step with no entry contributes only what it records itself. */
112
+ steps?: Record<string, StepResultsSpec>;
113
+ /** Default {@link DEFAULT_RESULTS_WINDOW}. */
114
+ window?: number;
115
+ /** Total characters of one view. Default `DEFAULT_RESULTS_MAX_CHARS`. */
116
+ maxChars?: number;
117
+ /** Default cap of one full entry. Default {@link DEFAULT_RESULT_ENTRY_CHARS}. */
118
+ maxEntryChars?: number;
119
+ /** Default cap of one names-only entry. Default {@link DEFAULT_RESULT_COMPACT_CHARS}. */
120
+ maxCompactChars?: number;
121
+ /** Default for {@link StepResultsSpec.refresh}. Defaults to `true`. */
122
+ refresh?: boolean;
123
+ }
124
+ /** What a facts query may narrow by. Every field is an exact match. */
125
+ export interface ResultFactQuery {
126
+ kind?: string;
127
+ name?: string;
128
+ /** A producing step, by its name or by its label. */
129
+ step?: string;
130
+ }
131
+ /** What {@link CumulativeResultsHelper.renderResultEntry} needs of an entry. */
132
+ export interface RenderableResultEntry extends Pick<CumulativeResultEntry, 'label' | 'source' | 'partial' | 'facts' | 'summary'> {
133
+ }
134
+ export interface ResultRenderCaps {
135
+ /** Cap on the full rendering. Default {@link DEFAULT_RESULT_ENTRY_CHARS}. */
136
+ maxChars?: number;
137
+ /** Cap on the names-only rendering. Default {@link DEFAULT_RESULT_COMPACT_CHARS}. */
138
+ maxCompactChars?: number;
139
+ }
140
+ /** An entry's two renderings. */
141
+ export interface RenderedResultEntry {
142
+ full: string;
143
+ compact: string;
144
+ }
145
+ /**
146
+ * CUMULATIVE PIPELINE RESULTS — the contracts.
147
+ *
148
+ * After a step of a pipeline finishes, code reads what it produced — a type's shape, a file, an
149
+ * endpoint's method, path and parameters, a resource's table — into a small list of FACTS, and the
150
+ * later steps are told those facts instead of re-deriving them from the files. A later step that is
151
+ * handed the authoritative names does not invent a second spelling of them, and that is the whole
152
+ * point: it removes the class of errors that live BETWEEN steps.
153
+ *
154
+ * Everything here is data and pure functions. The runtime that extracts, stores and cuts the views
155
+ * is `@owlmeans/agent`'s `cumulativeResultsPlugin`; the prompt block it lands in is
156
+ * `@owlmeans/llm`'s. A backend or a browser bundle reads an entry without either.
157
+ */
158
+ export interface CumulativeResultsHelper {
159
+ /**
160
+ * The identity of a fact inside a ledger: what it is, what it is called and where it comes from.
161
+ * Two facts with one key are one fact, owned by whichever entry produced it first.
162
+ */
163
+ factKey: (fact: CumulativeResultFact) => string;
164
+ /**
165
+ * Facts in the one order they are ever rendered in: by kind (file facts last), name and location,
166
+ * with a code-unit comparison so every host sorts them alike.
167
+ */
168
+ sortFacts: (facts: readonly CumulativeResultFact[]) => CumulativeResultFact[];
169
+ /** One fact as one prompt line: kind and name, shape, scalars, pointer, and where it comes from. */
170
+ renderResultFact: (fact: CumulativeResultFact) => string;
171
+ /**
172
+ * An entry's two renderings — in full, and as names only — or two empty strings when it has
173
+ * nothing to say.
174
+ *
175
+ * Deterministic and free of anything that varies between two renderings of the same facts: no
176
+ * timestamp, no run id, no revision. Over its cap an entry DROPS whole facts, in render order, and
177
+ * says how many it dropped; it never cuts one fact's line, because half a signature is a wrong
178
+ * signature. An empty entry that is not partial renders to nothing, so it costs a view nothing.
179
+ */
180
+ renderResultEntry: (entry: RenderableResultEntry, caps?: ResultRenderCaps) => RenderedResultEntry;
181
+ /**
182
+ * Ledger order: element by element, and where one key is a prefix of the other, the LONGER one
183
+ * first — an entry of a run composed under a step sorts ahead of that step's own entry, which is
184
+ * written only once the composed run has finished.
185
+ */
186
+ compareResultOrder: (a: readonly number[], b: readonly number[]) => number;
187
+ /** The root run of a composition — what a composed run's id (`<parent>/<step>`) starts with. */
188
+ rootRunOf: (runId: string) => string;
189
+ /**
190
+ * How an entry is headed: the step, behind the path of composing steps between the ledger's root
191
+ * run and the run that produced it. A root-run step is headed by its bare name.
192
+ */
193
+ resultLabel: (ledger: string, runId: string, step: string) => string;
194
+ /**
195
+ * A model's schema-shaped summary as one capped line, the same bytes for the same answer.
196
+ *
197
+ * An object renders as `key: value` pairs in key order; one with a single key renders as that
198
+ * value alone, so the default `{ summary }` answer reads as prose. The cap is applied here, after
199
+ * the model answered — a cap in a prompt is a request.
200
+ */
201
+ renderResultSummary: (answer: unknown, maxChars?: number) => string;
202
+ /**
203
+ * Several declarations as one — a pipeline's own, then any overlay (a variant, a deployment).
204
+ *
205
+ * Later declarations win field by field, except the lists: extractors, `full` consumers and `omit`
206
+ * consumers ACCUMULATE, the way skills do down an execution chain, because an overlay that adds an
207
+ * extractor is not asking to lose the ones the pipeline declared. `'*'` in `full` absorbs names.
208
+ */
209
+ mergeResultsSpecs: (...specs: Array<CumulativeResultsSpec | null | undefined>) => CumulativeResultsSpec;
210
+ }
211
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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K,MAAM,CAAA;IAC1E,gGAAgG;IAChG,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACpC;;;OAGG;IACH,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACpE;;;;;;OAMG;IACH,mBAAmB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACnE;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,KAAK,qBAAqB,CAAA;CACxG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/results/types.ts"],"names":[],"mappings":""}
@@ -1,56 +1,4 @@
1
- import type { CumulativeResultFact, CumulativeResultsSpec, RenderableResultEntry, ResultRenderCaps } from './types.js';
2
- /**
3
- * The identity of a fact inside a ledger: what it is, what it is called and where it comes from.
4
- * Two facts with one key are one fact, owned by whichever entry produced it first.
5
- */
6
- export declare const factKey: (fact: CumulativeResultFact) => string;
7
- /**
8
- * Facts in the one order they are ever rendered in: by kind (file facts last), name and location,
9
- * with a code-unit comparison so every host sorts them alike.
10
- */
11
- export declare const sortFacts: (facts: readonly CumulativeResultFact[]) => CumulativeResultFact[];
12
- /** One fact as one prompt line: kind and name, shape, scalars, pointer, and where it comes from. */
13
- export declare const renderResultFact: (fact: CumulativeResultFact) => string;
14
- /**
15
- * An entry's two renderings — in full, and as names only — or two empty strings when it has
16
- * nothing to say.
17
- *
18
- * Deterministic and free of anything that varies between two renderings of the same facts: no
19
- * timestamp, no run id, no revision. Over its cap an entry DROPS whole facts, in render order, and
20
- * says how many it dropped; it never cuts one fact's line, because half a signature is a wrong
21
- * signature. An empty entry that is not partial renders to nothing, so it costs a view nothing.
22
- */
23
- export declare const renderResultEntry: (entry: RenderableResultEntry, caps?: ResultRenderCaps) => {
24
- full: string;
25
- compact: string;
26
- };
27
- /**
28
- * Ledger order: element by element, and where one key is a prefix of the other, the LONGER one
29
- * first — an entry of a run composed under a step sorts ahead of that step's own entry, which is
30
- * written only once the composed run has finished.
31
- */
32
- export declare const compareResultOrder: (a: readonly number[], b: readonly number[]) => number;
33
- /** The root run of a composition — what a composed run's id (`<parent>/<step>`) starts with. */
34
- export declare const rootRunOf: (runId: string) => string;
35
- /**
36
- * How an entry is headed: the step, behind the path of composing steps between the ledger's root
37
- * run and the run that produced it. A root-run step is headed by its bare name.
38
- */
39
- export declare const resultLabel: (ledger: string, runId: string, step: string) => string;
40
- /**
41
- * A model's schema-shaped summary as one capped line, the same bytes for the same answer.
42
- *
43
- * An object renders as `key: value` pairs in key order; one with a single key renders as that
44
- * value alone, so the default `{ summary }` answer reads as prose. The cap is applied here, after
45
- * the model answered — a cap in a prompt is a request.
46
- */
47
- export declare const renderResultSummary: (answer: unknown, maxChars?: number) => string;
48
- /**
49
- * Several declarations as one — a pipeline's own, then any overlay (a variant, a deployment).
50
- *
51
- * Later declarations win field by field, except the lists: extractors, `full` consumers and `omit`
52
- * consumers ACCUMULATE, the way skills do down an execution chain, because an overlay that adds an
53
- * extractor is not asking to lose the ones the pipeline declared. `'*'` in `full` absorbs names.
54
- */
55
- export declare const mergeResultsSpecs: (...specs: Array<CumulativeResultsSpec | null | undefined>) => CumulativeResultsSpec;
1
+ import type { CumulativeResultsHelper } from './results/types.js';
2
+ export declare const createCumulativeResultsHelper: () => CumulativeResultsHelper;
3
+ export declare const cumulativeResultsHelper: CumulativeResultsHelper;
56
4
  //# sourceMappingURL=results.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAA;AAoBvI;;;GAGG;AACH,eAAO,MAAM,OAAO,SAAU,oBAAoB,KAAG,MACuB,CAAA;AAK5E;;;GAGG;AACH,eAAO,MAAM,SAAS,UAAW,SAAS,oBAAoB,EAAE,KAAG,oBAAoB,EAKd,CAAA;AAEzE,oGAAoG;AACpG,eAAO,MAAM,gBAAgB,SAAU,oBAAoB,KAAG,MA4B7D,CAAA;AAiDD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,UACrB,qBAAqB,SAAQ,gBAAgB,KACnD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAuDjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,MAAO,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,EAAE,KAAG,MAQ/E,CAAA;AAED,gGAAgG;AAChG,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,MAIzC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,SAAS,MAAM,QAAQ,MAAM,KAAG,MAQzE,CAAA;AA0BD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WACtB,OAAO,aAAY,MAAM,KAChC,MAOF,CAAA;AAqBD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,aAClB,KAAK,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,KACxD,qBAkBF,CAAA"}
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACY,uBAAuB,EAE9C,MAAM,oBAAoB,CAAA;AAE3B,eAAO,MAAM,6BAA6B,QAAO,uBAmQhD,CAAA;AAED,eAAO,MAAM,uBAAuB,yBAAkC,CAAA"}