@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.
- package/README.md +174 -13
- package/agent-meta/manifest.json +3 -3
- package/agent-meta/skills/agent-common/SKILL.md +69 -14
- package/build/consts.d.ts +118 -5
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +204 -4
- package/build/consts.js.map +1 -1
- package/build/consts.local.d.ts +9 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +9 -0
- package/build/consts.local.js.map +1 -0
- package/build/errors.d.ts +60 -0
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +84 -0
- package/build/errors.js.map +1 -1
- package/build/helpers/conversation.d.ts +0 -9
- package/build/helpers/conversation.d.ts.map +1 -1
- package/build/helpers/conversation.js +0 -28
- package/build/helpers/conversation.js.map +1 -1
- package/build/helpers/truncate.d.ts +10 -0
- package/build/helpers/truncate.d.ts.map +1 -0
- package/build/helpers/truncate.js +29 -0
- package/build/helpers/truncate.js.map +1 -0
- package/build/index.d.ts +6 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -1
- package/build/index.js.map +1 -1
- package/build/models/pipeline-spec/types.d.ts +57 -0
- package/build/models/pipeline-spec/types.d.ts.map +1 -0
- package/build/models/pipeline-spec/types.js +2 -0
- package/build/models/pipeline-spec/types.js.map +1 -0
- package/build/models/pipeline-spec.d.ts +4 -0
- package/build/models/pipeline-spec.d.ts.map +1 -0
- package/build/models/pipeline-spec.js +171 -0
- package/build/models/pipeline-spec.js.map +1 -0
- package/build/pipeline.d.ts +10 -0
- package/build/pipeline.d.ts.map +1 -0
- package/build/pipeline.js +10 -0
- package/build/pipeline.js.map +1 -0
- package/build/results/types.d.ts +211 -0
- package/build/results/types.d.ts.map +1 -0
- package/build/results/types.js +2 -0
- package/build/results/types.js.map +1 -0
- package/build/results.d.ts +4 -0
- package/build/results.d.ts.map +1 -0
- package/build/results.js +218 -0
- package/build/results.js.map +1 -0
- package/build/types.d.ts +146 -24
- package/build/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/consts.local.ts +15 -0
- package/src/consts.ts +218 -4
- package/src/errors.ts +96 -0
- package/src/helpers/conversation.ts +0 -32
- package/src/helpers/truncate.ts +31 -0
- package/src/index.ts +6 -1
- package/src/models/pipeline-spec/types.ts +58 -0
- package/src/models/pipeline-spec.ts +202 -0
- package/src/pipeline.ts +16 -0
- package/src/results/types.ts +221 -0
- package/src/results.ts +270 -0
- package/src/types.ts +153 -25
- package/tests/pipeline.spec.ts +164 -0
- package/tests/results.spec.ts +148 -0
- package/src/flows.ts +0 -118
package/build/consts.js
CHANGED
|
@@ -15,9 +15,50 @@ export const AGENTS_SERVICE = 'agents';
|
|
|
15
15
|
* the same way `ExecutionService.checkpoint` does with no plugin registered.
|
|
16
16
|
*/
|
|
17
17
|
export const AGENT_CONVERSATION_STORE = 'agent-conversation-store';
|
|
18
|
-
export const AGENT_RUN_STATE_STORE = 'agent-run-state-store';
|
|
19
18
|
export const AGENT_MEMORY_GRAPH_STORE = 'agent-memory-graph-store';
|
|
20
19
|
export const AGENT_MEMORY_EVENTS_STORE = 'agent-memory-events-store';
|
|
20
|
+
export const AGENT_PIPELINE_RUN_STORE = 'agent-pipeline-run-store';
|
|
21
|
+
export const AGENT_CHECKPOINT_STORE = 'agent-checkpoint-store';
|
|
22
|
+
export const AGENT_CUMULATIVE_RESULT_STORE = 'agent-cumulative-result-store';
|
|
23
|
+
/**
|
|
24
|
+
* Caps and defaults for cumulative pipeline results.
|
|
25
|
+
*
|
|
26
|
+
* Every one of them bounds what a later step is TOLD, never what a step may produce: a fact that
|
|
27
|
+
* does not fit is left out of one view, and it is still on its entry for the next view and for any
|
|
28
|
+
* code that queries it. `DEFAULT_RESULTS_WINDOW` is a distance in the step graph — a consumer that
|
|
29
|
+
* many edges or fewer after a producer gets the producer's full entry; anything further back gets
|
|
30
|
+
* its names only, unless the producer names the consumer outright.
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_RESULTS_MAX_CHARS = 12_000;
|
|
33
|
+
export const DEFAULT_RESULT_ENTRY_CHARS = 4_000;
|
|
34
|
+
export const DEFAULT_RESULT_COMPACT_CHARS = 400;
|
|
35
|
+
export const DEFAULT_RESULTS_WINDOW = 2;
|
|
36
|
+
export const DEFAULT_RESULT_SUMMARY_CHARS = 600;
|
|
37
|
+
/** The consumer wildcard: every later step of the pipeline — and of anything it is composed into. */
|
|
38
|
+
export const RESULTS_EVERY_STEP = '*';
|
|
39
|
+
/**
|
|
40
|
+
* Caps and defaults for a pipeline run.
|
|
41
|
+
*
|
|
42
|
+
* `DEFAULT_MAX_STATE_CHARS` is generous by the standard of what a state may legally hold — scalars
|
|
43
|
+
* and keys — and deliberately so: it is a TRIPWIRE, not a budget. A state approaching it is a state
|
|
44
|
+
* carrying an artifact, and the step fails so that fact is discovered on the first run rather than
|
|
45
|
+
* surviving as a row nobody can read back.
|
|
46
|
+
*
|
|
47
|
+
* `DEFAULT_STEP_ATTEMPTS` is 1 because retry budgets in this family multiply: an outer retry around
|
|
48
|
+
* a model's own inner retry is their product, not their sum.
|
|
49
|
+
*/
|
|
50
|
+
export const DEFAULT_MAX_STATE_CHARS = 256_000;
|
|
51
|
+
export const DEFAULT_STEP_ATTEMPTS = 1;
|
|
52
|
+
export const DEFAULT_STEP_TIMEOUT = 1_800_000;
|
|
53
|
+
/**
|
|
54
|
+
* Where a pipeline's answers live in its state.
|
|
55
|
+
*
|
|
56
|
+
* One key, named here rather than per pipeline, because an answer has to survive every hop it can
|
|
57
|
+
* take: a resume merges answers into it, a composing step forwards it to its child, and a reader
|
|
58
|
+
* looks a question up by id. Scalars and keys, like everything else a state holds — the answer's
|
|
59
|
+
* decision travels here and its prose belongs wherever that pipeline keeps its documents.
|
|
60
|
+
*/
|
|
61
|
+
export const INQUIRY_ANSWERS_KEY = 'answers';
|
|
21
62
|
/** The lifecycle flow every agent run is driven through. */
|
|
22
63
|
export const AGENT_RUN_FLOW = 'agent-run';
|
|
23
64
|
/**
|
|
@@ -26,8 +67,12 @@ export const AGENT_RUN_FLOW = 'agent-run';
|
|
|
26
67
|
* These are recoverable LIFECYCLE stages, not conversational turns. A ReAct loop's turn count is
|
|
27
68
|
* unbounded and its messages are not scalars, while `FlowPayload` holds flat scalars only — so the
|
|
28
69
|
* loop lives inside `Working` and only its counter travels in the payload. What the steps buy is
|
|
29
|
-
* the ability to say
|
|
30
|
-
*
|
|
70
|
+
* the ability to say how far a run got when it ended, which is what a plugin reads on `onFinish`.
|
|
71
|
+
*
|
|
72
|
+
* Nothing RESUMES one of these. A ReAct run is not a resumable unit: its state is an unbounded
|
|
73
|
+
* message list whose tool results are side effects already applied to the world, so re-entering it
|
|
74
|
+
* would re-apply them. Resumable work is a PIPELINE — see `pipeline.ts` — whose steps are named,
|
|
75
|
+
* whose state is scalars, and whose side effects are guarded per step.
|
|
31
76
|
*/
|
|
32
77
|
export var AgentRunStep;
|
|
33
78
|
(function (AgentRunStep) {
|
|
@@ -46,7 +91,6 @@ export var AgentRunTransition;
|
|
|
46
91
|
AgentRunTransition["Finalize"] = "finalize";
|
|
47
92
|
AgentRunTransition["Finish"] = "finish";
|
|
48
93
|
AgentRunTransition["Fail"] = "fail";
|
|
49
|
-
AgentRunTransition["Resume"] = "resume";
|
|
50
94
|
})(AgentRunTransition || (AgentRunTransition = {}));
|
|
51
95
|
/** How a run ended. Written on the conversation event so a reader can weigh the advice. */
|
|
52
96
|
export var AgentRunStatus;
|
|
@@ -67,4 +111,160 @@ export const DEFAULT_MEMORY_NODE_CHARS = 2000;
|
|
|
67
111
|
export const DEFAULT_MEMORY_EVENTS_LIMIT = 50;
|
|
68
112
|
/** Separator between a dedication's kind and its target — `project:<id>`. */
|
|
69
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];
|
|
70
270
|
//# sourceMappingURL=consts.js.map
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAA;AAEtC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAA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C;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
|
@@ -8,4 +8,64 @@ export declare class AgentRunStateError extends AgentCommonError {
|
|
|
8
8
|
static typeName: string;
|
|
9
9
|
constructor(message?: string);
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* A pipeline declaration is not runnable.
|
|
13
|
+
*
|
|
14
|
+
* Thrown by {@link import('./models/pipeline-spec/types.js').PipelineSpecModel.validate} and by the runner's own build
|
|
15
|
+
* step, and it always names EVERY fault it found rather than the first: a spec is authored once and
|
|
16
|
+
* fixed once, and reporting faults one per build turns a five-minute edit into five builds.
|
|
17
|
+
*/
|
|
18
|
+
export declare class PipelineSpecError extends AgentCommonError {
|
|
19
|
+
static typeName: string;
|
|
20
|
+
constructor(message?: string);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A resume was asked of a run started under a different version of its pipeline.
|
|
24
|
+
*
|
|
25
|
+
* Refused rather than adapted. `completed` names steps by string, so a spec that has since renamed,
|
|
26
|
+
* removed or reordered a step would have a resumed run skip work it never did — silently, because
|
|
27
|
+
* an unknown name in `completed` simply matches nothing.
|
|
28
|
+
*/
|
|
29
|
+
export declare class PipelineVersionError extends AgentCommonError {
|
|
30
|
+
static typeName: string;
|
|
31
|
+
constructor(message?: string);
|
|
32
|
+
}
|
|
33
|
+
/** A resume, a progress report or a skip named a step the spec does not declare. */
|
|
34
|
+
export declare class PipelineUnknownStepError extends AgentCommonError {
|
|
35
|
+
static typeName: string;
|
|
36
|
+
constructor(message?: string);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A resume was asked to re-enter a completed step whose side effect cannot be repeated.
|
|
40
|
+
*
|
|
41
|
+
* The caller may override with `force`, which is why this is an error and not a silent skip: an
|
|
42
|
+
* operator re-running a wipe, a purge or a hostname claim has to say so.
|
|
43
|
+
*/
|
|
44
|
+
export declare class PipelineNotIdempotentError extends AgentCommonError {
|
|
45
|
+
static typeName: string;
|
|
46
|
+
constructor(message?: string);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A step produced a state larger than the run row may carry.
|
|
50
|
+
*
|
|
51
|
+
* The step FAILS — the state is never truncated and the write is never skipped. A pipeline state is
|
|
52
|
+
* scalars and keys by contract; anything that overflows it is a large artifact that belongs in a
|
|
53
|
+
* store of its own, and silently dropping it would make a resume replay from a state that never
|
|
54
|
+
* existed.
|
|
55
|
+
*/
|
|
56
|
+
export declare class PipelineStateTooLargeError extends AgentCommonError {
|
|
57
|
+
static typeName: string;
|
|
58
|
+
constructor(message?: string);
|
|
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
|
+
}
|
|
11
71
|
//# 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,cAAc;IAClD,OAAuB,QAAQ,EAAE,MAAM,CAAoC;IAE3E,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,qFAAqF;AACrF,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,OAAuB,QAAQ,EAAE,MAAM,CAAyC;IAEhF,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
|
|
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,cAAc;IAClD,OAAuB,QAAQ,EAAE,MAAM,CAAoC;IAE3E,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,qFAAqF;AACrF,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,OAAuB,QAAQ,EAAE,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;AAED;;;;;;GAMG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,OAAuB,QAAQ,EAAE,MAAM,CAAqD;IAE5F,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
|
package/build/errors.js
CHANGED
|
@@ -13,6 +13,90 @@ export class AgentRunStateError extends AgentCommonError {
|
|
|
13
13
|
this.type = AgentRunStateError.typeName;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* A pipeline declaration is not runnable.
|
|
18
|
+
*
|
|
19
|
+
* Thrown by {@link import('./models/pipeline-spec/types.js').PipelineSpecModel.validate} and by the runner's own build
|
|
20
|
+
* step, and it always names EVERY fault it found rather than the first: a spec is authored once and
|
|
21
|
+
* fixed once, and reporting faults one per build turns a five-minute edit into five builds.
|
|
22
|
+
*/
|
|
23
|
+
export class PipelineSpecError extends AgentCommonError {
|
|
24
|
+
static typeName = `PipelineSpec${AgentCommonError.typeName}`;
|
|
25
|
+
constructor(message = 'error') {
|
|
26
|
+
super(`pipeline-spec:${message}`);
|
|
27
|
+
this.type = PipelineSpecError.typeName;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A resume was asked of a run started under a different version of its pipeline.
|
|
32
|
+
*
|
|
33
|
+
* Refused rather than adapted. `completed` names steps by string, so a spec that has since renamed,
|
|
34
|
+
* removed or reordered a step would have a resumed run skip work it never did — silently, because
|
|
35
|
+
* an unknown name in `completed` simply matches nothing.
|
|
36
|
+
*/
|
|
37
|
+
export class PipelineVersionError extends AgentCommonError {
|
|
38
|
+
static typeName = `PipelineVersion${AgentCommonError.typeName}`;
|
|
39
|
+
constructor(message = 'error') {
|
|
40
|
+
super(`pipeline-version:${message}`);
|
|
41
|
+
this.type = PipelineVersionError.typeName;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** A resume, a progress report or a skip named a step the spec does not declare. */
|
|
45
|
+
export class PipelineUnknownStepError extends AgentCommonError {
|
|
46
|
+
static typeName = `PipelineUnknownStep${AgentCommonError.typeName}`;
|
|
47
|
+
constructor(message = 'error') {
|
|
48
|
+
super(`pipeline-step:${message}`);
|
|
49
|
+
this.type = PipelineUnknownStepError.typeName;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A resume was asked to re-enter a completed step whose side effect cannot be repeated.
|
|
54
|
+
*
|
|
55
|
+
* The caller may override with `force`, which is why this is an error and not a silent skip: an
|
|
56
|
+
* operator re-running a wipe, a purge or a hostname claim has to say so.
|
|
57
|
+
*/
|
|
58
|
+
export class PipelineNotIdempotentError extends AgentCommonError {
|
|
59
|
+
static typeName = `PipelineNotIdempotent${AgentCommonError.typeName}`;
|
|
60
|
+
constructor(message = 'error') {
|
|
61
|
+
super(`pipeline-idempotency:${message}`);
|
|
62
|
+
this.type = PipelineNotIdempotentError.typeName;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A step produced a state larger than the run row may carry.
|
|
67
|
+
*
|
|
68
|
+
* The step FAILS — the state is never truncated and the write is never skipped. A pipeline state is
|
|
69
|
+
* scalars and keys by contract; anything that overflows it is a large artifact that belongs in a
|
|
70
|
+
* store of its own, and silently dropping it would make a resume replay from a state that never
|
|
71
|
+
* existed.
|
|
72
|
+
*/
|
|
73
|
+
export class PipelineStateTooLargeError extends AgentCommonError {
|
|
74
|
+
static typeName = `PipelineStateTooLarge${AgentCommonError.typeName}`;
|
|
75
|
+
constructor(message = 'error') {
|
|
76
|
+
super(`pipeline-state:${message}`);
|
|
77
|
+
this.type = PipelineStateTooLargeError.typeName;
|
|
78
|
+
}
|
|
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
|
+
}
|
|
16
94
|
ResilientError.registerErrorClass(AgentCommonError);
|
|
17
95
|
ResilientError.registerErrorClass(AgentRunStateError);
|
|
96
|
+
ResilientError.registerErrorClass(PipelineSpecError);
|
|
97
|
+
ResilientError.registerErrorClass(PipelineVersionError);
|
|
98
|
+
ResilientError.registerErrorClass(PipelineUnknownStepError);
|
|
99
|
+
ResilientError.registerErrorClass(PipelineNotIdempotentError);
|
|
100
|
+
ResilientError.registerErrorClass(PipelineStateTooLargeError);
|
|
101
|
+
ResilientError.registerErrorClass(PipelineNotResumableError);
|
|
18
102
|
//# sourceMappingURL=errors.js.map
|
package/build/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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AAI,GAAG,0BAA0B,CAAC,QAAQ,CAAA;IACjD,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA2B,SAAQ,gBAAgB;IACvD,MAAM,CAAU,QAAQ,GAAW,wBAAwB,gBAAgB,CAAC,QAAQ,EAAE,CAAA;IAE7F,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,QAAQ,CAAA;IACjD,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IACtD,MAAM,CAAU,QAAQ,GAAW,uBAAuB,gBAAgB,CAAC,QAAQ,EAAE,CAAA;IAE5F,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC,QAAQ,CAAA;IAChD,CAAC;CACF;AAED,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACnD,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;AACrD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACvD,cAAc,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;AAC3D,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;AAC7D,cAAc,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAA"}
|
|
@@ -14,13 +14,4 @@ import type { ConversationRef } from '../types.js';
|
|
|
14
14
|
* dedication.
|
|
15
15
|
*/
|
|
16
16
|
export declare const conversationFor: (purpose: LlmPurpose | undefined, override?: Partial<ConversationRef>) => ConversationRef;
|
|
17
|
-
/**
|
|
18
|
-
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
19
|
-
*
|
|
20
|
-
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
21
|
-
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
22
|
-
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
23
|
-
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
24
|
-
*/
|
|
25
|
-
export declare const truncateAt: (text: string, max: number) => string;
|
|
26
17
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,YACjB,UAAU,GAAG,SAAS,aACpB,OAAO,CAAC,eAAe,CAAC,KAClC,eASF,CAAA
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,YACjB,UAAU,GAAG,SAAS,aACpB,OAAO,CAAC,eAAe,CAAC,KAClC,eASF,CAAA"}
|
|
@@ -21,32 +21,4 @@ export const conversationFor = (purpose, override) => {
|
|
|
21
21
|
scope: override?.scope ?? (target !== '' ? target : 'anonymous'),
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Cut `text` to `max` characters on a boundary a reader will not trip over.
|
|
26
|
-
*
|
|
27
|
-
* Every cap in this package lands here, because a model asked for "at most N characters" answers
|
|
28
|
-
* with N plus whatever it felt was needed. Truncating mid-word reads as corruption and truncating
|
|
29
|
-
* mid-sentence reads as a bug report, so the cut prefers the last paragraph, then line, then
|
|
30
|
-
* sentence, then word break inside the last quarter of the budget, and always marks itself.
|
|
31
|
-
*/
|
|
32
|
-
export const truncateAt = (text, max) => {
|
|
33
|
-
const trimmed = text.trim();
|
|
34
|
-
if (trimmed.length <= max) {
|
|
35
|
-
return trimmed;
|
|
36
|
-
}
|
|
37
|
-
if (max <= 1) {
|
|
38
|
-
return trimmed.slice(0, Math.max(0, max));
|
|
39
|
-
}
|
|
40
|
-
const ellipsis = '…';
|
|
41
|
-
const budget = max - ellipsis.length;
|
|
42
|
-
const head = trimmed.slice(0, budget);
|
|
43
|
-
const floor = Math.floor(budget * 0.75);
|
|
44
|
-
for (const boundary of ['\n\n', '\n', '. ', ' ']) {
|
|
45
|
-
const at = head.lastIndexOf(boundary);
|
|
46
|
-
if (at >= floor) {
|
|
47
|
-
return head.slice(0, boundary === '. ' ? at + 1 : at).trimEnd() + ellipsis;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return head.trimEnd() + ellipsis;
|
|
51
|
-
};
|
|
52
24
|
//# sourceMappingURL=conversation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/helpers/conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,OAA+B,EAC/B,QAAmC,EAClB,EAAE;IACnB,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,EAAE,CAAA;IAC5C,MAAM,SAAS,GAAG,UAAU,CAAC,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
|
|
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"}
|
|
@@ -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,6 +1,11 @@
|
|
|
1
1
|
export * from './consts.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
3
|
export type * from './types.js';
|
|
4
|
-
export * from './
|
|
4
|
+
export type * from './results/types.js';
|
|
5
|
+
export type * from './models/pipeline-spec/types.js';
|
|
6
|
+
export * from './models/pipeline-spec.js';
|
|
7
|
+
export * from './pipeline.js';
|
|
8
|
+
export * from './results.js';
|
|
5
9
|
export * from './helpers/conversation.js';
|
|
10
|
+
export * from './helpers/truncate.js';
|
|
6
11
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,
|
|
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,5 +1,8 @@
|
|
|
1
1
|
export * from './consts.js';
|
|
2
2
|
export * from './errors.js';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './models/pipeline-spec.js';
|
|
4
|
+
export * from './pipeline.js';
|
|
5
|
+
export * from './results.js';
|
|
4
6
|
export * from './helpers/conversation.js';
|
|
7
|
+
export * from './helpers/truncate.js';
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAI3B,cAAc,2BAA2B,CAAA;AACzC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA"}
|