@wardby/cli 0.8.0 → 0.9.0
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/deploy/local/docker-compose.quickstart-coding.yml +5 -0
- package/dist/claude-plugin/command.d.ts +4 -1
- package/dist/claude-plugin/command.js +7 -4
- package/dist/cli.js +24 -0
- package/dist/coding/transcript/recorder.js +2 -8
- package/dist/core/dispatch.js +3 -0
- package/dist/core/engine-native.d.ts +2 -0
- package/dist/core/engine-native.js +13 -0
- package/dist/core/error-code.js +1 -0
- package/dist/core/listen-address.d.ts +10 -0
- package/dist/core/listen-address.js +14 -0
- package/dist/core/power-idle.d.ts +8 -2
- package/dist/core/power-idle.js +17 -3
- package/dist/core/power.d.ts +5 -0
- package/dist/core/power.js +5 -0
- package/dist/core/retention-days.d.ts +5 -0
- package/dist/core/retention-days.js +14 -0
- package/dist/core/run-steps/config.d.ts +25 -0
- package/dist/core/run-steps/config.js +40 -0
- package/dist/core/run-steps/control-chars.d.ts +16 -0
- package/dist/core/run-steps/control-chars.js +26 -0
- package/dist/core/run-steps/detail.d.ts +32 -0
- package/dist/core/run-steps/detail.js +240 -0
- package/dist/core/run-steps/extract.d.ts +52 -0
- package/dist/core/run-steps/extract.js +467 -0
- package/dist/core/run-steps/ingress.d.ts +51 -0
- package/dist/core/run-steps/ingress.js +160 -0
- package/dist/core/run-steps/last-step.d.ts +15 -0
- package/dist/core/run-steps/last-step.js +35 -0
- package/dist/core/run-steps/native.d.ts +48 -0
- package/dist/core/run-steps/native.js +164 -0
- package/dist/core/run-steps/seen.d.ts +16 -0
- package/dist/core/run-steps/seen.js +35 -0
- package/dist/core/run-steps/summarize.d.ts +57 -0
- package/dist/core/run-steps/summarize.js +304 -0
- package/dist/core/run-steps/sweep.d.ts +21 -0
- package/dist/core/run-steps/sweep.js +41 -0
- package/dist/core/run-steps/types.d.ts +89 -0
- package/dist/core/run-steps/types.js +39 -0
- package/dist/core/run-steps/wire.d.ts +35 -0
- package/dist/core/run-steps/wire.js +47 -0
- package/dist/core/run-steps/writer.d.ts +49 -0
- package/dist/core/run-steps/writer.js +279 -0
- package/dist/core/runner.d.ts +4 -0
- package/dist/core/runner.js +15 -1
- package/dist/generated/prisma/browser.d.ts +8 -0
- package/dist/generated/prisma/client.d.ts +8 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +30 -0
- package/dist/generated/prisma/enums.d.ts +6 -0
- package/dist/generated/prisma/enums.js +5 -0
- package/dist/generated/prisma/internal/class.d.ts +11 -0
- package/dist/generated/prisma/internal/class.js +4 -4
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +103 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +19 -1
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +19 -0
- package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +19 -1
- package/dist/generated/prisma/models/Agent.d.ts +101 -1
- package/dist/generated/prisma/models/CodingProxySession.d.ts +41 -1
- package/dist/generated/prisma/models/Run.d.ts +503 -1
- package/dist/generated/prisma/models/RunStep.d.ts +1453 -0
- package/dist/generated/prisma/models/RunStep.js +1 -0
- package/dist/generated/prisma/models.d.ts +1 -0
- package/dist/help-index.json +102 -14
- package/dist/mcp/auth/access.d.ts +1 -0
- package/dist/mcp/context.d.ts +3 -0
- package/dist/mcp/index.js +10 -0
- package/dist/mcp/tools/agents.js +37 -7
- package/dist/mcp/tools/power.js +2 -2
- package/dist/mcp/tools/run-access.d.ts +7 -0
- package/dist/mcp/tools/run-access.js +14 -0
- package/dist/mcp/tools/run-steps.d.ts +16 -0
- package/dist/mcp/tools/run-steps.js +85 -0
- package/dist/mcp/tools/runs.js +10 -2
- package/dist/native-worker/gateway-server.d.ts +4 -1
- package/dist/native-worker/gateway-server.js +10 -2
- package/dist/native-worker/gateway.d.ts +3 -0
- package/dist/native-worker/gateway.js +8 -0
- package/dist/native-worker/http-server.d.ts +2 -4
- package/dist/native-worker/http-server.js +2 -8
- package/dist/providers/coding-proxy/memory-ledger.js +1 -0
- package/dist/providers/coding-proxy/prisma-ledger.js +9 -3
- package/dist/providers/coding-proxy/proxy.d.ts +26 -0
- package/dist/providers/coding-proxy/proxy.js +133 -42
- package/dist/providers/coding-proxy/run-step-forwarder.d.ts +42 -0
- package/dist/providers/coding-proxy/run-step-forwarder.js +206 -0
- package/dist/providers/coding-proxy/runtime.d.ts +7 -0
- package/dist/providers/coding-proxy/runtime.js +55 -3
- package/dist/providers/coding-proxy/types.d.ts +5 -0
- package/dist/providers/engine/types.d.ts +26 -0
- package/dist/providers/executor/container.d.ts +14 -0
- package/dist/providers/executor/container.js +8 -1
- package/dist/providers/jobs/kubernetes.d.ts +8 -0
- package/dist/providers/jobs/kubernetes.js +22 -4
- package/dist/quickstart-images.json +1 -1
- package/dist/serve.js +26 -18
- package/dist/viewer/api-schema.d.ts +66 -0
- package/dist/viewer/api-schema.js +31 -0
- package/dist/viewer/openapi.js +2 -1
- package/dist/viewer/run-detail.d.ts +2 -0
- package/dist/viewer/run-detail.js +26 -1
- package/docs/claude-code-plugin.md +57 -13
- package/docs/coding-agent-setup.md +17 -0
- package/docs/coding-worker-isolation.md +16 -0
- package/docs/debugging-agent-runs.md +112 -0
- package/docs/getting-started-gke.md +28 -7
- package/docs/mcp-servers.md +9 -0
- package/docs/native-sandbox.md +6 -0
- package/docs/security-deployment.md +51 -0
- package/docs/viewer-api.md +21 -12
- package/docs/viewer-api.openapi.yml +78 -2
- package/help/admin-viewer.md +1 -0
- package/help/claude-code-run-pane.md +27 -4
- package/help/deploy-gke.md +5 -0
- package/help/errors/coding-mcp-gateway-unavailable.md +46 -0
- package/help/low-power-mode.md +19 -8
- package/help/mcp.md +2 -0
- package/help/resume-runs-locally.md +4 -0
- package/help/run-steps.md +140 -0
- package/package.json +1 -1
- package/prisma/migrations/20261110000000_run_steps/migration.sql +26 -0
- package/prisma/migrations/20261111000000_run_steps_viewer_notify/migration.sql +59 -0
- package/prisma/migrations/20261112000000_run_steps_detail/migration.sql +9 -0
- package/prisma/schema.prisma +52 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The detail level's text (RunStep.detail): a tool's input, the end of its output, a model
|
|
3
|
+
* message. Redacted on the control plane, on the raw text, before any cut, against the same values
|
|
4
|
+
* and forms as summaries (stepSummarizer): every form of every secret value (secretForms), matched
|
|
5
|
+
* both in the text as written and in its whitespace-collapsed form (mapped back, so a secret the
|
|
6
|
+
* model wrote with other spacing is masked while the text keeps its lines), the longest secret
|
|
7
|
+
* start the text ends in (and, for an output whose head was cut, the longest secret end it starts
|
|
8
|
+
* with), the same two checks at every line break and ellipsis inside it (an agent may elide an
|
|
9
|
+
* output's middle, splitting a secret around its marker), then token shapes (redactSecrets). Only
|
|
10
|
+
* then is it cut.
|
|
11
|
+
*/
|
|
12
|
+
import { REDACTED, redactSecrets } from "../../coding/redact.js";
|
|
13
|
+
import { MIN_REDACTABLE_SECRET_LENGTH, maskSpans, mergeSpans, secretSpans } from "../secret-spans.js";
|
|
14
|
+
import { secretForms, secretTail } from "./summarize.js";
|
|
15
|
+
import { DETAIL_INPUT_CHARS, DETAIL_OUTPUT_CHARS, DETAIL_OUTPUT_HEADING, DETAIL_SAID_CHARS, MAX_STEP_DETAIL_CHARS, MAX_STEP_TEXT_CHARS, tailOf, } from "./types.js";
|
|
16
|
+
const WS = /\s/;
|
|
17
|
+
// A PEM private key's lone edges: complete pairs are masked by redactSecrets first, so what
|
|
18
|
+
// matches here is a BEGIN whose END is not in the text, or an END whose BEGIN was cut away.
|
|
19
|
+
const PEM_BEGIN_TO_END = /-----BEGIN (?:[A-Z ]{1,32} )?PRIVATE KEY-----[\s\S]*$/;
|
|
20
|
+
const PEM_START_TO_END = /^[\s\S]*?-----END (?:[A-Z ]{1,32} )?PRIVATE KEY-----/;
|
|
21
|
+
const reverse = (text) => text.split("").reverse().join("");
|
|
22
|
+
/** A line break, or a run of "…" or of three or more ".": where a text may have been elided. */
|
|
23
|
+
const EDGE_BOUNDARY = /\n|…+|\.{3,}/g;
|
|
24
|
+
const SPACE_OR_TAB = /[ \t]/;
|
|
25
|
+
/**
|
|
26
|
+
* The [start, end) of each elision boundary in `text`: EDGE_BOUNDARY, widened over an opening
|
|
27
|
+
* bracket just before an ellipsis or a closing one just after it ("[... omitted ...]"), and over
|
|
28
|
+
* any spaces or tabs around it. Widened by hand, never past the previous boundary, so the scan is
|
|
29
|
+
* linear (a regex with leading `[ \t]*` backtracks quadratically on a long run of spaces).
|
|
30
|
+
*/
|
|
31
|
+
function edgeBoundaries(text) {
|
|
32
|
+
const found = [];
|
|
33
|
+
let floor = 0;
|
|
34
|
+
for (const match of text.matchAll(EDGE_BOUNDARY)) {
|
|
35
|
+
let start = match.index;
|
|
36
|
+
let end = start + match[0].length;
|
|
37
|
+
if (match[0] !== "\n") {
|
|
38
|
+
if (start > floor && "[(<".includes(text[start - 1]))
|
|
39
|
+
start--;
|
|
40
|
+
while (start > floor && SPACE_OR_TAB.test(text[start - 1]))
|
|
41
|
+
start--;
|
|
42
|
+
if (end < text.length && "])>".includes(text[end]))
|
|
43
|
+
end++;
|
|
44
|
+
while (end < text.length && SPACE_OR_TAB.test(text[end]))
|
|
45
|
+
end++;
|
|
46
|
+
}
|
|
47
|
+
// A widened end may run into the next match; that match then starts at or after it.
|
|
48
|
+
if (start < floor)
|
|
49
|
+
start = floor;
|
|
50
|
+
if (end <= floor)
|
|
51
|
+
continue;
|
|
52
|
+
found.push([start, end]);
|
|
53
|
+
floor = end;
|
|
54
|
+
}
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* `text` collapsed as summaries are (collapseWhitespace: runs of whitespace become one space,
|
|
59
|
+
* trimmed), with each collapsed character's [from, to) span in `text`.
|
|
60
|
+
*/
|
|
61
|
+
export function collapseWithMap(text) {
|
|
62
|
+
let start = 0;
|
|
63
|
+
let end = text.length;
|
|
64
|
+
while (start < end && WS.test(text[start]))
|
|
65
|
+
start++;
|
|
66
|
+
while (end > start && WS.test(text[end - 1]))
|
|
67
|
+
end--;
|
|
68
|
+
const parts = [];
|
|
69
|
+
const from = [];
|
|
70
|
+
const to = [];
|
|
71
|
+
for (let i = start; i < end;) {
|
|
72
|
+
if (WS.test(text[i])) {
|
|
73
|
+
const run = i;
|
|
74
|
+
while (i < end && WS.test(text[i]))
|
|
75
|
+
i++;
|
|
76
|
+
parts.push(" ");
|
|
77
|
+
from.push(run);
|
|
78
|
+
to.push(i);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
parts.push(text[i]);
|
|
82
|
+
from.push(i);
|
|
83
|
+
to.push(i + 1);
|
|
84
|
+
i++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return { collapsed: parts.join(""), from, to };
|
|
88
|
+
}
|
|
89
|
+
/** Forms long enough for an edge check (a proper prefix of at least the minimum), by their first characters. */
|
|
90
|
+
function byStart(forms) {
|
|
91
|
+
const index = new Map();
|
|
92
|
+
for (const form of forms) {
|
|
93
|
+
if (form.length <= MIN_REDACTABLE_SECRET_LENGTH)
|
|
94
|
+
continue;
|
|
95
|
+
const start = form.slice(0, MIN_REDACTABLE_SECRET_LENGTH);
|
|
96
|
+
const same = index.get(start);
|
|
97
|
+
if (same)
|
|
98
|
+
same.push(form);
|
|
99
|
+
else
|
|
100
|
+
index.set(start, [form]);
|
|
101
|
+
}
|
|
102
|
+
return index;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The forms `subject` could end in a proper prefix of (secretTail's matches are at least the minimum
|
|
106
|
+
* long, so the subject holds the form's first MIN_REDACTABLE_SECRET_LENGTH characters): only these
|
|
107
|
+
* are scanned, so a line costs about its own length, however many secret values a run has.
|
|
108
|
+
* Longest first, as secretForms orders them.
|
|
109
|
+
*/
|
|
110
|
+
function candidates(subject, index) {
|
|
111
|
+
const starts = new Set();
|
|
112
|
+
for (let i = 0; i + MIN_REDACTABLE_SECRET_LENGTH <= subject.length; i++) {
|
|
113
|
+
starts.add(subject.slice(i, i + MIN_REDACTABLE_SECRET_LENGTH));
|
|
114
|
+
}
|
|
115
|
+
const found = [];
|
|
116
|
+
for (const start of starts)
|
|
117
|
+
found.push(...(index.get(start) ?? []));
|
|
118
|
+
return found.sort((a, b) => b.length - a.length);
|
|
119
|
+
}
|
|
120
|
+
/** The most a cut head's partial first line drop takes (afterCutHead). */
|
|
121
|
+
export const CUT_HEAD_DROP_CHARS = 256;
|
|
122
|
+
/**
|
|
123
|
+
* A text cut at its head, without its partial first line: up to and including the first line
|
|
124
|
+
* break when one falls within CUT_HEAD_DROP_CHARS of the cut, else exactly that many characters
|
|
125
|
+
* (a single-line output, such as a JSON result, keeps the rest of its end).
|
|
126
|
+
*/
|
|
127
|
+
const afterCutHead = (text) => {
|
|
128
|
+
const at = text.indexOf("\n");
|
|
129
|
+
return at >= 0 && at < CUT_HEAD_DROP_CHARS ? text.slice(at + 1) : text.slice(CUT_HEAD_DROP_CHARS);
|
|
130
|
+
};
|
|
131
|
+
const headCut = (text, max) => (text.length > max ? `${text.slice(0, max - 1)}…` : text);
|
|
132
|
+
/** A tool step's stored detail with its output appended, within MAX_STEP_DETAIL_CHARS. */
|
|
133
|
+
export function joinDetail(existing, suffix) {
|
|
134
|
+
return `${existing ?? ""}${suffix}`.slice(0, MAX_STEP_DETAIL_CHARS);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Detail texts for one batch, against every secret value delivered to the run (the agent's and the
|
|
138
|
+
* run's own). The forms, and each form's KMP table for the edge checks, are built once per batch.
|
|
139
|
+
*/
|
|
140
|
+
export function stepDetailer(secretValues) {
|
|
141
|
+
const forms = secretForms(secretValues);
|
|
142
|
+
const reversedForms = forms.map(reverse);
|
|
143
|
+
const tails = new Map();
|
|
144
|
+
const heads = new Map();
|
|
145
|
+
const formsByStart = byStart(forms);
|
|
146
|
+
const reversedByStart = byStart(reversedForms);
|
|
147
|
+
/**
|
|
148
|
+
* The same edge checks at every boundary inside `text`: each line break, each run of "…", and
|
|
149
|
+
* each run of three or more "." (every known truncation marker holds one: "…N tokens
|
|
150
|
+
* truncated…", "[... omitted N of M lines ...]"). The longest secret start each piece ends in
|
|
151
|
+
* before a boundary, and the longest secret end each piece starts with after one (at least
|
|
152
|
+
* MIN_REDACTABLE_SECRET_LENGTH, as at the text's own edges). A coding agent may elide the middle
|
|
153
|
+
* of a long output (or input) before the model sees it, on its own line or mid-line, leaving a
|
|
154
|
+
* delivered secret's start before the marker and its end after it, neither an exact-value match.
|
|
155
|
+
* Each match is masked only where it was found, at that boundary. A piece is scanned only for
|
|
156
|
+
* the forms whose first characters it holds (candidates), and no further back than its own start,
|
|
157
|
+
* so the cost stays near linear in the text however many secret values the run has.
|
|
158
|
+
*/
|
|
159
|
+
const boundaryEdgeSpans = (text) => {
|
|
160
|
+
const spans = [];
|
|
161
|
+
const pieces = [];
|
|
162
|
+
let start = 0;
|
|
163
|
+
for (const [from, to] of edgeBoundaries(text)) {
|
|
164
|
+
pieces.push([start, from]);
|
|
165
|
+
start = to;
|
|
166
|
+
}
|
|
167
|
+
pieces.push([start, text.length]);
|
|
168
|
+
for (const [from, to] of pieces) {
|
|
169
|
+
if (to <= from)
|
|
170
|
+
continue;
|
|
171
|
+
const piece = text.slice(from, to);
|
|
172
|
+
if (from > 0) {
|
|
173
|
+
const reversed = reverse(piece);
|
|
174
|
+
const head = secretTail(reversed, candidates(reversed, reversedByStart), heads).length;
|
|
175
|
+
if (head > 0)
|
|
176
|
+
spans.push([from, from + head]);
|
|
177
|
+
}
|
|
178
|
+
if (to < text.length) {
|
|
179
|
+
const tail = secretTail(piece, candidates(piece, formsByStart), tails).length;
|
|
180
|
+
if (tail > 0)
|
|
181
|
+
spans.push([to - tail, to]);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return spans;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* `raw` with every occurrence of every form masked, as written and in its collapsed form, plus
|
|
188
|
+
* the longest secret start it ends in (every text: a stream can stop mid-secret without saying
|
|
189
|
+
* so) and, when its head was cut, the longest secret end it starts with; then token shapes.
|
|
190
|
+
*/
|
|
191
|
+
const edges = (subject, headWasCut) => {
|
|
192
|
+
const found = [secretTail(subject, forms, tails)];
|
|
193
|
+
if (headWasCut)
|
|
194
|
+
found.push(reverse(secretTail(reverse(subject), reversedForms, heads)));
|
|
195
|
+
return found.filter(Boolean);
|
|
196
|
+
};
|
|
197
|
+
/** The spans of `text` as written: every form, the text's edges, and every boundary's edges. */
|
|
198
|
+
const asWrittenSpans = (text, headWasCut) => [
|
|
199
|
+
...secretSpans(text, [...forms, ...edges(text, headWasCut)], 1),
|
|
200
|
+
...boundaryEdgeSpans(text),
|
|
201
|
+
];
|
|
202
|
+
const redact = (raw, headWasCut) => {
|
|
203
|
+
const text = raw.slice(0, MAX_STEP_TEXT_CHARS);
|
|
204
|
+
const { collapsed, from, to } = collapseWithMap(text);
|
|
205
|
+
const asWritten = asWrittenSpans(text, headWasCut);
|
|
206
|
+
const viaCollapsed = secretSpans(collapsed, [...forms, ...edges(collapsed, headWasCut)], 1).map(([start, end]) => [from[start], to[end - 1]]);
|
|
207
|
+
const masked = maskSpans(text, mergeSpans([...asWritten, ...viaCollapsed]), REDACTED);
|
|
208
|
+
// Token shapes (and Bearer values) after the exact values, as redactSecrets does for summaries.
|
|
209
|
+
const shaped = redactSecrets(masked);
|
|
210
|
+
const open = shaped.replace(PEM_BEGIN_TO_END, REDACTED);
|
|
211
|
+
return headWasCut ? open.replace(PEM_START_TO_END, REDACTED) : open;
|
|
212
|
+
};
|
|
213
|
+
return {
|
|
214
|
+
premask(raw, headWasCut, marker) {
|
|
215
|
+
return maskSpans(raw, mergeSpans(asWrittenSpans(raw, headWasCut)), marker);
|
|
216
|
+
},
|
|
217
|
+
step(step) {
|
|
218
|
+
if (step.kind === "said")
|
|
219
|
+
return headCut(redact(step.text, false), DETAIL_SAID_CHARS);
|
|
220
|
+
return headCut(redact(step.input ?? step.text, false), DETAIL_INPUT_CHARS);
|
|
221
|
+
},
|
|
222
|
+
output(result) {
|
|
223
|
+
const source = tailOf(result.output);
|
|
224
|
+
const headWasCut = result.outputCut === true || source.cut;
|
|
225
|
+
// Redacted on everything available first. A text cut at its head then starts mid-line, where
|
|
226
|
+
// a token shape's anchor (a label, a scheme, a BEGIN line) may be gone, so the partial first
|
|
227
|
+
// line (at most CUT_HEAD_DROP_CHARS of it) is dropped, after the 2 KiB cut as well as after
|
|
228
|
+
// the source's.
|
|
229
|
+
let text = redact(source.text, headWasCut);
|
|
230
|
+
let cut = headWasCut;
|
|
231
|
+
if (cut)
|
|
232
|
+
text = afterCutHead(text);
|
|
233
|
+
if (text.length > DETAIL_OUTPUT_CHARS - 1) {
|
|
234
|
+
text = afterCutHead(text.slice(text.length - (DETAIL_OUTPUT_CHARS - 1)));
|
|
235
|
+
cut = true;
|
|
236
|
+
}
|
|
237
|
+
return `${DETAIL_OUTPUT_HEADING}${cut ? "…" : ""}${text}`;
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ExtractedResult, ExtractedStep, StepStatus } from "./types.js";
|
|
2
|
+
/** What an extractor keeps beyond the summary: the detail level's raw input and output tails. Off by default. */
|
|
3
|
+
export interface StepCaptureOptions {
|
|
4
|
+
detail?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type StepWireProtocol = "openai-responses" | "anthropic-messages";
|
|
7
|
+
export interface StreamStepExtractor {
|
|
8
|
+
/** Reads one SSE frame (the text between blank lines). Never throws. */
|
|
9
|
+
consume(frame: string): void;
|
|
10
|
+
/** The steps completed since the last call. */
|
|
11
|
+
take(): ExtractedStep[];
|
|
12
|
+
/**
|
|
13
|
+
* The steps left when the reply has ended. When it was cut (it ended without its terminal event,
|
|
14
|
+
* or stopped at the output limit), its open text is kept and the last text is marked truncated; a
|
|
15
|
+
* tool call still open never ran, so it is no step. Never throws.
|
|
16
|
+
*/
|
|
17
|
+
finish(): ExtractedStep[];
|
|
18
|
+
}
|
|
19
|
+
export declare const MAX_RESULTS_PER_REQUEST = 64;
|
|
20
|
+
/** Anthropic Messages streams: input_json_delta assembled per block index, emitted on content_block_stop. */
|
|
21
|
+
export declare class AnthropicStreamSteps implements StreamStepExtractor {
|
|
22
|
+
private readonly options?;
|
|
23
|
+
private messageId;
|
|
24
|
+
private readonly blocks;
|
|
25
|
+
private done;
|
|
26
|
+
private stopped;
|
|
27
|
+
private cutStop;
|
|
28
|
+
constructor(options?: StepCaptureOptions | undefined);
|
|
29
|
+
consume(frame: string): void;
|
|
30
|
+
take(): ExtractedStep[];
|
|
31
|
+
finish(): ExtractedStep[];
|
|
32
|
+
private read;
|
|
33
|
+
}
|
|
34
|
+
/** One Responses output item as a step: function_call, custom_tool_call, or an assistant message. */
|
|
35
|
+
export declare function openAiItemStep(value: unknown, options?: StepCaptureOptions): ExtractedStep | undefined;
|
|
36
|
+
/** OpenAI Responses streams: one step per response.output_item.done. */
|
|
37
|
+
export declare class OpenAiStreamSteps implements StreamStepExtractor {
|
|
38
|
+
private readonly options?;
|
|
39
|
+
private done;
|
|
40
|
+
private completed;
|
|
41
|
+
constructor(options?: StepCaptureOptions | undefined);
|
|
42
|
+
consume(frame: string): void;
|
|
43
|
+
take(): ExtractedStep[];
|
|
44
|
+
finish(): ExtractedStep[];
|
|
45
|
+
}
|
|
46
|
+
export declare function streamStepExtractor(protocol: StepWireProtocol, options?: StepCaptureOptions): StreamStepExtractor;
|
|
47
|
+
/** A whole (non-stream) reply's steps. */
|
|
48
|
+
export declare function stepsFromJson(protocol: StepWireProtocol, value: unknown, options?: StepCaptureOptions): ExtractedStep[];
|
|
49
|
+
/** A result's status from its first lines: an exit line wins, else the error flag. */
|
|
50
|
+
export declare function statusFromOutput(head: string, isError: boolean): StepStatus;
|
|
51
|
+
/** The results a request carries for the turn before it: the newest part of the history only. */
|
|
52
|
+
export declare function resultsFromRequest(protocol: StepWireProtocol, value: unknown, options?: StepCaptureOptions): ExtractedResult[];
|