akribes 0.21.17
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/CHANGELOG.md +30 -0
- package/LICENSE +21 -0
- package/README.md +160 -0
- package/dist/client.d.ts +240 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +272 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +196 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +274 -0
- package/dist/errors.js.map +1 -0
- package/dist/execution/index.d.ts +3 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +3 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/replay.d.ts +37 -0
- package/dist/execution/replay.d.ts.map +1 -0
- package/dist/execution/replay.js +59 -0
- package/dist/execution/replay.js.map +1 -0
- package/dist/execution/steps.d.ts +327 -0
- package/dist/execution/steps.d.ts.map +1 -0
- package/dist/execution/steps.js +1068 -0
- package/dist/execution/steps.js.map +1 -0
- package/dist/http.d.ts +53 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +141 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/runStream.d.ts +176 -0
- package/dist/runStream.d.ts.map +1 -0
- package/dist/runStream.js +408 -0
- package/dist/runStream.js.map +1 -0
- package/dist/sse.d.ts +46 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +218 -0
- package/dist/sse.js.map +1 -0
- package/dist/sub/bench.d.ts +182 -0
- package/dist/sub/bench.d.ts.map +1 -0
- package/dist/sub/bench.js +420 -0
- package/dist/sub/bench.js.map +1 -0
- package/dist/sub/channels.d.ts +22 -0
- package/dist/sub/channels.d.ts.map +1 -0
- package/dist/sub/channels.js +32 -0
- package/dist/sub/channels.js.map +1 -0
- package/dist/sub/clients.d.ts +79 -0
- package/dist/sub/clients.d.ts.map +1 -0
- package/dist/sub/clients.js +190 -0
- package/dist/sub/clients.js.map +1 -0
- package/dist/sub/documents.d.ts +113 -0
- package/dist/sub/documents.d.ts.map +1 -0
- package/dist/sub/documents.js +329 -0
- package/dist/sub/documents.js.map +1 -0
- package/dist/sub/evals.d.ts +71 -0
- package/dist/sub/evals.d.ts.map +1 -0
- package/dist/sub/evals.js +86 -0
- package/dist/sub/evals.js.map +1 -0
- package/dist/sub/events.d.ts +65 -0
- package/dist/sub/events.d.ts.map +1 -0
- package/dist/sub/events.js +154 -0
- package/dist/sub/events.js.map +1 -0
- package/dist/sub/executions.d.ts +255 -0
- package/dist/sub/executions.d.ts.map +1 -0
- package/dist/sub/executions.js +322 -0
- package/dist/sub/executions.js.map +1 -0
- package/dist/sub/mcp.d.ts +51 -0
- package/dist/sub/mcp.d.ts.map +1 -0
- package/dist/sub/mcp.js +42 -0
- package/dist/sub/mcp.js.map +1 -0
- package/dist/sub/projects.d.ts +73 -0
- package/dist/sub/projects.d.ts.map +1 -0
- package/dist/sub/projects.js +101 -0
- package/dist/sub/projects.js.map +1 -0
- package/dist/sub/scripts.d.ts +58 -0
- package/dist/sub/scripts.d.ts.map +1 -0
- package/dist/sub/scripts.js +82 -0
- package/dist/sub/scripts.js.map +1 -0
- package/dist/sub/tokens.d.ts +126 -0
- package/dist/sub/tokens.d.ts.map +1 -0
- package/dist/sub/tokens.js +105 -0
- package/dist/sub/tokens.js.map +1 -0
- package/dist/sub/versions.d.ts +29 -0
- package/dist/sub/versions.d.ts.map +1 -0
- package/dist/sub/versions.js +52 -0
- package/dist/sub/versions.js.map +1 -0
- package/dist/tokenSafety.d.ts +15 -0
- package/dist/tokenSafety.d.ts.map +1 -0
- package/dist/tokenSafety.js +24 -0
- package/dist/tokenSafety.js.map +1 -0
- package/dist/types.d.ts +1147 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +132 -0
- package/dist/types.js.map +1 -0
- package/dist/workflowEvents.d.ts +297 -0
- package/dist/workflowEvents.d.ts.map +1 -0
- package/dist/workflowEvents.js +612 -0
- package/dist/workflowEvents.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-client for the akribes-server bench substrate.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `crates/akribes-sdk-rust/src/sub/bench.rs`. Two surfaces glued onto
|
|
5
|
+
* one TypeScript class for ergonomic Studio consumption:
|
|
6
|
+
*
|
|
7
|
+
* - Project-scoped operations live under
|
|
8
|
+
* `/projects/{id}/scripts/{name}/bench/...`. The `projectId` is captured
|
|
9
|
+
* at construction (`new AkribesClient({ projectId })`) and the script
|
|
10
|
+
* name is the first argument to each method.
|
|
11
|
+
* - Run-scoped + case-id-keyed operations live under `/bench-runs/{id}/...`
|
|
12
|
+
* and `/cases/{id}` and aren't tied to a project (the server resolves
|
|
13
|
+
* the owning project from the row). These are exposed on the same class
|
|
14
|
+
* so studios don't juggle two client instances.
|
|
15
|
+
*
|
|
16
|
+
* Typed errors:
|
|
17
|
+
* - 404 with a `{"error": ...}` body → `AkribesNotFoundError`.
|
|
18
|
+
* - 400 `{"error": "case_type_mismatch", "field_errors": [...]}` →
|
|
19
|
+
* `CaseTypeMismatchError`.
|
|
20
|
+
* - 400 with a `Judge contract mismatch: ...` prefix → `JudgeContractError`
|
|
21
|
+
* (with the trailing `breaks` list parsed when present).
|
|
22
|
+
* - 409 with `error_type: "..._already_exists"` → `AkribesAlreadyExistsError`
|
|
23
|
+
* (handled by the shared `fetchOk`).
|
|
24
|
+
* - All other 4xx/5xx → `AkribesHttpError`.
|
|
25
|
+
*/
|
|
26
|
+
import { connectSse } from '../sse';
|
|
27
|
+
import { AkribesHttpError, AkribesNotFoundError, CaseTypeMismatchError, JudgeContractError, } from '../errors';
|
|
28
|
+
/** Translate a server response into the typed bench-specific error
|
|
29
|
+
* taxonomy. Returns the error to throw, or `null` to let the caller
|
|
30
|
+
* fall through to the default `fetchOk` handling.
|
|
31
|
+
*
|
|
32
|
+
* Decoding rules — same shape as the Rust SDK's `error::AkribesError`
|
|
33
|
+
* classification:
|
|
34
|
+
* - 404 + `{ "error": "..." }` body → `AkribesNotFoundError`. We attach
|
|
35
|
+
* the body string so consumers can recover the original message.
|
|
36
|
+
* - 400 + `{ "error": "case_type_mismatch", "field_errors": [...] }`
|
|
37
|
+
* → `CaseTypeMismatchError`.
|
|
38
|
+
* - 400 with a `"Judge contract mismatch: ..."` message → `JudgeContractError`.
|
|
39
|
+
* The server emits the breaks as a `; `-separated trailer; we split
|
|
40
|
+
* on `; ` after the `"N field(s) incompatible: "` prefix when present
|
|
41
|
+
* and pass the empty array otherwise (it's still useful to typed-catch
|
|
42
|
+
* this case for routing).
|
|
43
|
+
*/
|
|
44
|
+
async function classifyBenchError(res) {
|
|
45
|
+
if (res.ok)
|
|
46
|
+
return null;
|
|
47
|
+
const body = await res.text();
|
|
48
|
+
let serverMessage;
|
|
49
|
+
let fieldErrors;
|
|
50
|
+
try {
|
|
51
|
+
const json = JSON.parse(body);
|
|
52
|
+
if (json && typeof json === 'object') {
|
|
53
|
+
const obj = json;
|
|
54
|
+
if (typeof obj.error === 'string')
|
|
55
|
+
serverMessage = obj.error;
|
|
56
|
+
if (Array.isArray(obj.field_errors)) {
|
|
57
|
+
fieldErrors = obj.field_errors.filter((e) => !!e && typeof e === 'object'
|
|
58
|
+
&& typeof e.path === 'string'
|
|
59
|
+
&& typeof e.message === 'string');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* body wasn't JSON; serverMessage stays undefined */
|
|
65
|
+
}
|
|
66
|
+
if (res.status === 404) {
|
|
67
|
+
return new AkribesNotFoundError(body, serverMessage);
|
|
68
|
+
}
|
|
69
|
+
if (res.status === 400) {
|
|
70
|
+
if (serverMessage === 'case_type_mismatch' && fieldErrors) {
|
|
71
|
+
return new CaseTypeMismatchError(body, serverMessage, fieldErrors);
|
|
72
|
+
}
|
|
73
|
+
if (serverMessage && serverMessage.startsWith('Judge contract mismatch')) {
|
|
74
|
+
return new JudgeContractError(body, serverMessage, parseJudgeBreaks(serverMessage));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return new AkribesHttpError(res.status, body, serverMessage ?? (body || res.statusText));
|
|
78
|
+
}
|
|
79
|
+
/** Extract the trailing `field(s) incompatible: ...` list from a
|
|
80
|
+
* "Judge contract mismatch" message. Returns an empty array when the
|
|
81
|
+
* format doesn't match — the typed error is still useful as a routing
|
|
82
|
+
* signal even without the list. */
|
|
83
|
+
function parseJudgeBreaks(message) {
|
|
84
|
+
const marker = 'field(s) incompatible: ';
|
|
85
|
+
const idx = message.indexOf(marker);
|
|
86
|
+
if (idx === -1)
|
|
87
|
+
return [];
|
|
88
|
+
const tail = message.slice(idx + marker.length).trim();
|
|
89
|
+
if (!tail)
|
|
90
|
+
return [];
|
|
91
|
+
return tail.split('; ').map((s) => s.trim()).filter(Boolean);
|
|
92
|
+
}
|
|
93
|
+
/** Run the request through the bench-specific error classifier. On 2xx
|
|
94
|
+
* returns the response; otherwise throws the appropriate typed error. */
|
|
95
|
+
async function benchFetch(http, url, init) {
|
|
96
|
+
const res = await http.authFetch(url, init);
|
|
97
|
+
const err = await classifyBenchError(res);
|
|
98
|
+
if (err)
|
|
99
|
+
throw err;
|
|
100
|
+
return res;
|
|
101
|
+
}
|
|
102
|
+
/** Shorthand for `benchFetch(...).then(r => r.json() as Promise<T>)`. */
|
|
103
|
+
async function benchFetchJson(http, url, init) {
|
|
104
|
+
const res = await benchFetch(http, url, init);
|
|
105
|
+
return res.json();
|
|
106
|
+
}
|
|
107
|
+
/** Append `?k=v&...` query params, skipping `undefined` / `null` entries. */
|
|
108
|
+
function withQuery(url, params) {
|
|
109
|
+
const qs = new URLSearchParams();
|
|
110
|
+
for (const [k, v] of Object.entries(params)) {
|
|
111
|
+
if (v === undefined || v === null)
|
|
112
|
+
continue;
|
|
113
|
+
qs.set(k, String(v));
|
|
114
|
+
}
|
|
115
|
+
const tail = qs.toString();
|
|
116
|
+
return tail ? `${url}?${tail}` : url;
|
|
117
|
+
}
|
|
118
|
+
export class BenchClient {
|
|
119
|
+
http;
|
|
120
|
+
projectId;
|
|
121
|
+
constructor(http, projectId) {
|
|
122
|
+
this.http = http;
|
|
123
|
+
this.projectId = projectId;
|
|
124
|
+
}
|
|
125
|
+
// ── URL helpers ─────────────────────────────────────────────────────────
|
|
126
|
+
benchPath(scriptName, ...segments) {
|
|
127
|
+
return this.http.scriptPath(this.projectId, scriptName, 'bench', ...segments);
|
|
128
|
+
}
|
|
129
|
+
scriptOnlyPath(scriptName, ...segments) {
|
|
130
|
+
return this.http.scriptPath(this.projectId, scriptName, ...segments);
|
|
131
|
+
}
|
|
132
|
+
runUrl(runId, ...segments) {
|
|
133
|
+
const tail = segments.length ? `/${segments.map(encodeURIComponent).join('/')}` : '';
|
|
134
|
+
return `${this.http.getBaseUrl()}/bench-runs/${runId}${tail}`;
|
|
135
|
+
}
|
|
136
|
+
caseUrl(caseId) {
|
|
137
|
+
return `${this.http.getBaseUrl()}/cases/${encodeURIComponent(caseId)}`;
|
|
138
|
+
}
|
|
139
|
+
// ── Bench config CRUD ───────────────────────────────────────────────────
|
|
140
|
+
/** `GET /projects/{id}/scripts/{name}/bench` — 404 → `null`. Other 4xx/5xx
|
|
141
|
+
* surface via {@link AkribesHttpError}. */
|
|
142
|
+
async get(scriptName, opts) {
|
|
143
|
+
try {
|
|
144
|
+
return await benchFetchJson(this.http, this.benchPath(scriptName), opts);
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
if (e instanceof AkribesNotFoundError)
|
|
148
|
+
return null;
|
|
149
|
+
throw e;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** `POST /projects/{id}/scripts/{name}/bench` — create or update. The
|
|
153
|
+
* server upserts on `(script_id)`, so this is idempotent w.r.t. an
|
|
154
|
+
* existing bench config. */
|
|
155
|
+
async save(scriptName, req, opts) {
|
|
156
|
+
return benchFetchJson(this.http, this.benchPath(scriptName), {
|
|
157
|
+
method: 'POST',
|
|
158
|
+
headers: { 'Content-Type': 'application/json' },
|
|
159
|
+
body: JSON.stringify(req),
|
|
160
|
+
signal: opts?.signal,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** `DELETE /projects/{id}/scripts/{name}/bench`. The server emits a
|
|
164
|
+
* `{"deleted": true}` body either way; we discard it. */
|
|
165
|
+
async delete(scriptName, opts) {
|
|
166
|
+
await benchFetch(this.http, this.benchPath(scriptName), {
|
|
167
|
+
method: 'DELETE',
|
|
168
|
+
signal: opts?.signal,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** `GET /projects/{id}/benches` — one row per script with a bench
|
|
172
|
+
* configured, joined with the latest run's summary. Backs the project-
|
|
173
|
+
* level evals landing page. */
|
|
174
|
+
async listProjectSummaries(opts) {
|
|
175
|
+
return benchFetchJson(this.http, `${this.http.getBaseUrl()}/projects/${this.projectId}/benches`, opts);
|
|
176
|
+
}
|
|
177
|
+
// ── Signature + contract preview ────────────────────────────────────────
|
|
178
|
+
/** `GET /projects/{id}/scripts/{name}/signature` — parsed script inputs +
|
|
179
|
+
* outputs + named type defs. Used by the case-builder modal. */
|
|
180
|
+
async getSignature(scriptName, opts) {
|
|
181
|
+
return benchFetchJson(this.http, this.scriptOnlyPath(scriptName, 'signature'), opts);
|
|
182
|
+
}
|
|
183
|
+
/** `GET /projects/{id}/scripts/{name}/bench/contract-preview` — workflow
|
|
184
|
+
* + judge signature pair plus the structured `breaks` list. Used by the
|
|
185
|
+
* judge-picker UI to surface incompatibilities before a save. */
|
|
186
|
+
async contractPreview(scriptName, args, opts) {
|
|
187
|
+
const url = withQuery(this.benchPath(scriptName, 'contract-preview'), {
|
|
188
|
+
judge: args.judgeScriptId,
|
|
189
|
+
channel: args.channel,
|
|
190
|
+
});
|
|
191
|
+
return benchFetchJson(this.http, url, opts);
|
|
192
|
+
}
|
|
193
|
+
// ── Cases ───────────────────────────────────────────────────────────────
|
|
194
|
+
/** `GET /projects/{id}/scripts/{name}/bench/cases`. 404 (no bench
|
|
195
|
+
* configured) → empty list. */
|
|
196
|
+
async listCases(scriptName, opts) {
|
|
197
|
+
try {
|
|
198
|
+
return await benchFetchJson(this.http, this.benchPath(scriptName, 'cases'), opts);
|
|
199
|
+
}
|
|
200
|
+
catch (e) {
|
|
201
|
+
if (e instanceof AkribesNotFoundError)
|
|
202
|
+
return [];
|
|
203
|
+
throw e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/** `POST /projects/{id}/scripts/{name}/bench/cases` — form-builder create.
|
|
207
|
+
* Throws {@link CaseTypeMismatchError} on a 400 `case_type_mismatch`
|
|
208
|
+
* envelope so form layers can surface per-field violations. */
|
|
209
|
+
async createCase(scriptName, req, opts) {
|
|
210
|
+
return benchFetchJson(this.http, this.benchPath(scriptName, 'cases'), {
|
|
211
|
+
method: 'POST',
|
|
212
|
+
headers: { 'Content-Type': 'application/json' },
|
|
213
|
+
body: JSON.stringify(req),
|
|
214
|
+
signal: opts?.signal,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/** `GET /projects/{id}/scripts/{name}/bench/cases/contract-drift`. Returns
|
|
218
|
+
* an empty drift report when the endpoint 404s (script never published). */
|
|
219
|
+
async caseContractDrift(scriptName, opts) {
|
|
220
|
+
try {
|
|
221
|
+
return await benchFetchJson(this.http, this.benchPath(scriptName, 'cases', 'contract-drift'), opts);
|
|
222
|
+
}
|
|
223
|
+
catch (e) {
|
|
224
|
+
if (e instanceof AkribesNotFoundError) {
|
|
225
|
+
return {
|
|
226
|
+
drifted: [],
|
|
227
|
+
script_version_id: null,
|
|
228
|
+
published_at: null,
|
|
229
|
+
published_by: null,
|
|
230
|
+
summary: '',
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
throw e;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/** `PATCH /cases/{id}` — sparse update. */
|
|
237
|
+
async patchCase(caseId, req, opts) {
|
|
238
|
+
return benchFetchJson(this.http, this.caseUrl(caseId), {
|
|
239
|
+
method: 'PATCH',
|
|
240
|
+
headers: { 'Content-Type': 'application/json' },
|
|
241
|
+
body: JSON.stringify(req),
|
|
242
|
+
signal: opts?.signal,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/** `DELETE /cases/{id}`. The server emits `{"deleted": true}`; we discard
|
|
246
|
+
* it for an idiomatic `void` return. */
|
|
247
|
+
async deleteCase(caseId, opts) {
|
|
248
|
+
await benchFetch(this.http, this.caseUrl(caseId), {
|
|
249
|
+
method: 'DELETE',
|
|
250
|
+
signal: opts?.signal,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/** `POST /executions/{exec_id}/promote-to-case` — promote a completed
|
|
254
|
+
* execution into a bench case, with an optional `edits` overlay. Lives
|
|
255
|
+
* on `/executions` rather than `/bench-runs` but is the natural
|
|
256
|
+
* counterpart to the case-builder flow, so it lives on this client. */
|
|
257
|
+
async promoteExecution(executionId, req = {}, opts) {
|
|
258
|
+
const url = `${this.http.getBaseUrl()}/executions/${encodeURIComponent(executionId)}/promote-to-case`;
|
|
259
|
+
return benchFetchJson(this.http, url, {
|
|
260
|
+
method: 'POST',
|
|
261
|
+
headers: { 'Content-Type': 'application/json' },
|
|
262
|
+
body: JSON.stringify(req),
|
|
263
|
+
signal: opts?.signal,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
// ── Runs (project-scoped surface) ───────────────────────────────────────
|
|
267
|
+
/** `GET /projects/{id}/scripts/{name}/bench/runs` — paginated via
|
|
268
|
+
* `limit` / `offset`. 404 → empty list. */
|
|
269
|
+
async listRuns(scriptName, params, opts) {
|
|
270
|
+
const url = withQuery(this.benchPath(scriptName, 'runs'), {
|
|
271
|
+
limit: params?.limit,
|
|
272
|
+
offset: params?.offset,
|
|
273
|
+
});
|
|
274
|
+
try {
|
|
275
|
+
return await benchFetchJson(this.http, url, opts);
|
|
276
|
+
}
|
|
277
|
+
catch (e) {
|
|
278
|
+
if (e instanceof AkribesNotFoundError)
|
|
279
|
+
return [];
|
|
280
|
+
throw e;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/** `POST /projects/{id}/scripts/{name}/bench/runs` — trigger a run.
|
|
284
|
+
* `case_ids` constrains the fan-out to a subset. Throws
|
|
285
|
+
* {@link JudgeContractError} on the contract pre-flight 400. */
|
|
286
|
+
async triggerRun(scriptName, req, opts) {
|
|
287
|
+
return benchFetchJson(this.http, this.benchPath(scriptName, 'runs'), {
|
|
288
|
+
method: 'POST',
|
|
289
|
+
headers: { 'Content-Type': 'application/json' },
|
|
290
|
+
body: JSON.stringify(req),
|
|
291
|
+
signal: opts?.signal,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
// ── Runs (run-id keyed, global surface) ─────────────────────────────────
|
|
295
|
+
/** `GET /bench-runs/{id}` — 404 → `null`. */
|
|
296
|
+
async getRun(runId, opts) {
|
|
297
|
+
try {
|
|
298
|
+
return await benchFetchJson(this.http, this.runUrl(runId), opts);
|
|
299
|
+
}
|
|
300
|
+
catch (e) {
|
|
301
|
+
if (e instanceof AkribesNotFoundError)
|
|
302
|
+
return null;
|
|
303
|
+
throw e;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/** `DELETE /bench-runs/{id}`. Cancels first (best-effort) before
|
|
307
|
+
* dropping. The server emits a JSON receipt; we discard it. */
|
|
308
|
+
async deleteRun(runId, opts) {
|
|
309
|
+
await benchFetch(this.http, this.runUrl(runId), {
|
|
310
|
+
method: 'DELETE',
|
|
311
|
+
signal: opts?.signal,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/** `GET /bench-runs/{id}/results`. 404 → empty list. */
|
|
315
|
+
async listResults(runId, opts) {
|
|
316
|
+
try {
|
|
317
|
+
return await benchFetchJson(this.http, this.runUrl(runId, 'results'), opts);
|
|
318
|
+
}
|
|
319
|
+
catch (e) {
|
|
320
|
+
if (e instanceof AkribesNotFoundError)
|
|
321
|
+
return [];
|
|
322
|
+
throw e;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/** `POST /bench-runs/{id}/cancel`. Flips the cancel token; in-flight cases
|
|
326
|
+
* complete naturally. Returns the run row as it stands. */
|
|
327
|
+
async cancelRun(runId, opts) {
|
|
328
|
+
return benchFetchJson(this.http, this.runUrl(runId, 'cancel'), {
|
|
329
|
+
method: 'POST',
|
|
330
|
+
headers: { 'Content-Type': 'application/json' },
|
|
331
|
+
body: '{}',
|
|
332
|
+
signal: opts?.signal,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
/** `GET /bench-runs/{a}/compare/{b}` — diff two runs of the same bench. */
|
|
336
|
+
async compareRuns(runA, runB, opts) {
|
|
337
|
+
const url = `${this.http.getBaseUrl()}/bench-runs/${runA}/compare/${runB}`;
|
|
338
|
+
return benchFetchJson(this.http, url, opts);
|
|
339
|
+
}
|
|
340
|
+
/** `GET /bench-runs/{id}/events?after_id=N` — JSON-page form of the
|
|
341
|
+
* bench-run event stream. Use for MCP-style polling; for live UI prefer
|
|
342
|
+
* {@link BenchClient.subscribeRunEvents}. */
|
|
343
|
+
async runEvents(runId, params, opts) {
|
|
344
|
+
const url = withQuery(this.runUrl(runId, 'events'), {
|
|
345
|
+
after_id: params?.afterId,
|
|
346
|
+
});
|
|
347
|
+
try {
|
|
348
|
+
return await benchFetchJson(this.http, url, opts);
|
|
349
|
+
}
|
|
350
|
+
catch (e) {
|
|
351
|
+
if (e instanceof AkribesNotFoundError)
|
|
352
|
+
return { events: [] };
|
|
353
|
+
throw e;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/** `PATCH /bench-runs/{id}/tag-session` — attribute the run to an MCP
|
|
357
|
+
* session id so the coordinator's finalize step writes the cost into
|
|
358
|
+
* `mcp_session_cost`. */
|
|
359
|
+
async tagSession(runId, mcpSessionId, opts) {
|
|
360
|
+
return benchFetchJson(this.http, this.runUrl(runId, 'tag-session'), {
|
|
361
|
+
method: 'PATCH',
|
|
362
|
+
headers: { 'Content-Type': 'application/json' },
|
|
363
|
+
body: JSON.stringify({ mcp_session_id: mcpSessionId }),
|
|
364
|
+
signal: opts?.signal,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
// ── Live run-event stream (SSE) ─────────────────────────────────────────
|
|
368
|
+
/**
|
|
369
|
+
* Subscribe to a bench run's live result stream via SSE.
|
|
370
|
+
*
|
|
371
|
+
* The server emits two event types on `/bench-runs/{id}/events`:
|
|
372
|
+
* - `result` — a new {@link BenchResult} row.
|
|
373
|
+
* - `lagged` — broadcast-stream lag report (`{ dropped: N }`).
|
|
374
|
+
*
|
|
375
|
+
* Built on the shared {@link connectSse} helper, which uses
|
|
376
|
+
* {@link EventSource} in browsers and a fetch-based reader in Node / Bun.
|
|
377
|
+
* Auth rides on the Authorization header from the SDK's `HttpClient`.
|
|
378
|
+
* Older revisions also appended `opts.token` to the URL as a `?token=`
|
|
379
|
+
* fallback so EventSource (which can't set headers) would authenticate;
|
|
380
|
+
* that leaked long-lived service-token secrets into reverse-proxy
|
|
381
|
+
* access logs. `sse.ts` now skips EventSource whenever an Authorization
|
|
382
|
+
* header is present and uses the fetch-fallback path instead — so the
|
|
383
|
+
* `opts.token` URL fallback is no longer needed. `opts.token` is kept
|
|
384
|
+
* on the API for now (a no-op) to avoid breaking compiled callers.
|
|
385
|
+
* Returns an unsubscribe function.
|
|
386
|
+
*/
|
|
387
|
+
subscribeRunEvents(runId, handlers, opts) {
|
|
388
|
+
void opts?.token;
|
|
389
|
+
const buildUrl = () => {
|
|
390
|
+
const url = new URL(`${this.http.getBaseUrl()}/bench-runs/${runId}/events`);
|
|
391
|
+
return url.toString();
|
|
392
|
+
};
|
|
393
|
+
return connectSse({
|
|
394
|
+
url: buildUrl,
|
|
395
|
+
headers: { ...this.http.authHeaders(), ...this.http.traceHeaders() },
|
|
396
|
+
signal: opts?.signal,
|
|
397
|
+
onMessage: (msg) => {
|
|
398
|
+
if (msg.event === 'result') {
|
|
399
|
+
try {
|
|
400
|
+
handlers.onResult?.(JSON.parse(msg.data));
|
|
401
|
+
}
|
|
402
|
+
catch {
|
|
403
|
+
/* malformed payload, swallow */
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else if (msg.event === 'lagged') {
|
|
407
|
+
try {
|
|
408
|
+
const parsed = JSON.parse(msg.data);
|
|
409
|
+
handlers.onLagged?.(parsed.dropped);
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
/* malformed payload, swallow */
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
onError: (err) => handlers.onError?.(err),
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
//# sourceMappingURL=bench.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bench.js","sourceRoot":"","sources":["../../src/sub/bench.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,WAAW,CAAC;AAoBnB;;;;;;;;;;;;;;;GAeG;AACH,KAAK,UAAU,kBAAkB,CAAC,GAAa;IAC7C,IAAI,GAAG,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,aAAiC,CAAC;IACtC,IAAI,WAAyC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,IAAI,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,IAA+B,CAAC;YAC5C,IAAI,OAAO,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AC,OAAO,EAAE,CAAC,GAAG,CAAC;SAC1C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HttpClient } from '../http';
|
|
2
|
+
import type { ScriptChannel } from '../types';
|
|
3
|
+
export declare class ChannelsClient {
|
|
4
|
+
private http;
|
|
5
|
+
private projectId;
|
|
6
|
+
constructor(http: HttpClient, projectId: number);
|
|
7
|
+
private path;
|
|
8
|
+
list(scriptName: string, opts?: {
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}): Promise<ScriptChannel[]>;
|
|
11
|
+
create(scriptName: string, channelName: string, opts?: {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
}): Promise<ScriptChannel>;
|
|
14
|
+
delete(scriptName: string, channelName: string, opts?: {
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
move(scriptName: string, channelName: string, versionId: number, opts?: {
|
|
18
|
+
force?: boolean;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=channels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/sub/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,qBAAa,cAAc;IAEvB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,SAAS;gBADT,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM;IAG3B,OAAO,CAAC,IAAI;IAIN,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAInF,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAOxG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/F,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMxI"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class ChannelsClient {
|
|
2
|
+
http;
|
|
3
|
+
projectId;
|
|
4
|
+
constructor(http, projectId) {
|
|
5
|
+
this.http = http;
|
|
6
|
+
this.projectId = projectId;
|
|
7
|
+
}
|
|
8
|
+
path(scriptName, ...segments) {
|
|
9
|
+
return this.http.scriptPath(this.projectId, scriptName, ...segments);
|
|
10
|
+
}
|
|
11
|
+
async list(scriptName, opts) {
|
|
12
|
+
return (await this.http.fetchOk(this.path(scriptName, 'channels'), opts)).json();
|
|
13
|
+
}
|
|
14
|
+
async create(scriptName, channelName, opts) {
|
|
15
|
+
return (await this.http.fetchOk(this.path(scriptName, 'channels'), {
|
|
16
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
17
|
+
body: JSON.stringify({ name: channelName }), signal: opts?.signal,
|
|
18
|
+
})).json();
|
|
19
|
+
}
|
|
20
|
+
async delete(scriptName, channelName, opts) {
|
|
21
|
+
await this.http.fetchOk(this.path(scriptName, 'channels', channelName), {
|
|
22
|
+
method: 'DELETE', signal: opts?.signal,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
async move(scriptName, channelName, versionId, opts) {
|
|
26
|
+
await this.http.fetchOk(this.path(scriptName, 'channels', channelName), {
|
|
27
|
+
method: 'PATCH', headers: { 'Content-Type': 'application/json' },
|
|
28
|
+
body: JSON.stringify({ version_id: versionId, ...(opts?.force != null && { force: opts.force }) }), signal: opts?.signal,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=channels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/sub/channels.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,cAAc;IAEf;IACA;IAFV,YACU,IAAgB,EAChB,SAAiB;QADjB,SAAI,GAAJ,IAAI,CAAY;QAChB,cAAS,GAAT,SAAS,CAAQ;IACxB,CAAC;IAEI,IAAI,CAAC,UAAkB,EAAE,GAAG,QAAkB;QACpD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAkB,EAAE,IAA+B;QAC5D,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,WAAmB,EAAE,IAA+B;QACnF,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;YACjE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/D,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;SAClE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAAkB,EAAE,WAAmB,EAAE,IAA+B;QACnF,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE;YACtE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;SACvC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAkB,EAAE,WAAmB,EAAE,SAAiB,EAAE,IAAgD;QACrH,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE;YACtE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAChE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;SACzH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { HttpClient } from '../http';
|
|
2
|
+
import type { ClientInterest, ClientInfo, RegisterClientResponse, ContractLockInfo } from '../types';
|
|
3
|
+
export type ContractState = {
|
|
4
|
+
/** Cached input schemas per script (from init response). */
|
|
5
|
+
schemas: Map<string, [string, string][]>;
|
|
6
|
+
/** Scripts whose schema has changed since init (from SSE events). */
|
|
7
|
+
brokenScripts: Set<string>;
|
|
8
|
+
};
|
|
9
|
+
/** Reason for a heartbeat status change. */
|
|
10
|
+
export type HeartbeatStatus = 'ok' | 'auth_failed' | 'unreachable';
|
|
11
|
+
export type ClientsClientOptions = {
|
|
12
|
+
/** Invoked whenever the heartbeat result changes category. Useful for
|
|
13
|
+
* surfacing a revoked-token state to a UI that needs to prompt for
|
|
14
|
+
* re-auth. Fired once per state transition (no 30s-stutter). */
|
|
15
|
+
onHeartbeatStatus?: (status: HeartbeatStatus) => void;
|
|
16
|
+
};
|
|
17
|
+
/** Heartbeat backoff curve — SDK-wide canonical (#1182).
|
|
18
|
+
* Exponential with full jitter, base 1s, cap 30s. The first failure waits
|
|
19
|
+
* ~1s before retrying, the second ~2s, ..., capped at ~30s. Jitter spreads
|
|
20
|
+
* reconnect attempts when many clients lose their token at once.
|
|
21
|
+
*
|
|
22
|
+
* Exported for reuse in the SSE reconnect path and for tests. */
|
|
23
|
+
export declare function heartbeatBackoffMs(consecutiveFailures: number): number;
|
|
24
|
+
export declare class ClientsClient {
|
|
25
|
+
private http;
|
|
26
|
+
private projectId;
|
|
27
|
+
private clientId;
|
|
28
|
+
private clientName;
|
|
29
|
+
private options;
|
|
30
|
+
private heartbeatTimer;
|
|
31
|
+
private inflightHeartbeat;
|
|
32
|
+
private consecutiveFailures;
|
|
33
|
+
private lastStatus;
|
|
34
|
+
private paused;
|
|
35
|
+
readonly contractState: ContractState;
|
|
36
|
+
constructor(http: HttpClient, projectId: number, clientId: string | undefined, clientName: string | undefined, options?: ClientsClientOptions);
|
|
37
|
+
init(interests: ClientInterest[], opts?: {
|
|
38
|
+
signal?: AbortSignal;
|
|
39
|
+
}): Promise<RegisterClientResponse>;
|
|
40
|
+
/** Resume a heartbeat that was paused after an auth failure. Call this
|
|
41
|
+
* after rotating the underlying token via {@link AkribesClient.setToken}. */
|
|
42
|
+
resumeHeartbeat(): void;
|
|
43
|
+
private fireStatus;
|
|
44
|
+
private startHeartbeat;
|
|
45
|
+
list(opts?: {
|
|
46
|
+
signal?: AbortSignal;
|
|
47
|
+
}): Promise<ClientInfo[]>;
|
|
48
|
+
delete(id: string, opts?: {
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
listLocks(scriptName: string, opts?: {
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}): Promise<ContractLockInfo[]>;
|
|
54
|
+
revokeLock(scriptName: string, lockId: number, opts?: {
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
rebindLock(scriptName: string, lockId: number, versionId?: number, opts?: {
|
|
58
|
+
signal?: AbortSignal;
|
|
59
|
+
}): Promise<ContractLockInfo>;
|
|
60
|
+
/** List contract locks for `scriptName` in `projectId`. Cross-project
|
|
61
|
+
* variant of {@link listLocks}; the implicit project_id on this client
|
|
62
|
+
* is ignored. */
|
|
63
|
+
listLocksFor(projectId: number, scriptName: string, opts?: {
|
|
64
|
+
signal?: AbortSignal;
|
|
65
|
+
}): Promise<ContractLockInfo[]>;
|
|
66
|
+
/** Delete (revoke) a single lock in `projectId`. Cross-project variant
|
|
67
|
+
* of {@link revokeLock}. */
|
|
68
|
+
deleteLock(projectId: number, scriptName: string, lockId: number, opts?: {
|
|
69
|
+
signal?: AbortSignal;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
/** Update (rebind) a single lock to a new version in `projectId`.
|
|
72
|
+
* Cross-project variant of {@link rebindLock}. Pass `versionId =
|
|
73
|
+
* undefined` to rebind the lock to the channel's current version. */
|
|
74
|
+
updateLock(projectId: number, scriptName: string, lockId: number, versionId?: number, opts?: {
|
|
75
|
+
signal?: AbortSignal;
|
|
76
|
+
}): Promise<ContractLockInfo>;
|
|
77
|
+
destroy(): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../src/sub/clients.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,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