@elaraai/e3-api-client 1.0.104 → 1.0.105

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.
@@ -2,12 +2,43 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
- import { FunctionSignatureType, FunctionCallRequestType, ExecuteResultType, OneShotRequestType, SplitCallRequestType, SplitCallStatusType, } from './types.js';
6
- import { ArrayType } from '@elaraai/east';
5
+ import { FunctionSignatureType, FunctionCallAnswerType, FunctionCallPageType, FunctionCallRequestType, FunctionCallStatusType, FunctionCallType, ExecuteResultType, OneShotRequestType, SplitCallRequestType, SplitCallStatusType, } from './types.js';
6
+ import { ArrayType, NullType } from '@elaraai/east';
7
7
  import { PackageJobResponseType } from '@elaraai/e3-types';
8
- import { get, post, verboseQuery } from './http.js';
8
+ import { ApiError, get, post, sleep, verboseQuery } from './http.js';
9
9
  import { JOB_POLL_MAX_MS, JOB_POLL_MIN_MS } from './packages.js';
10
+ import { uuidv7 } from './uuid.js';
10
11
  const enc = encodeURIComponent;
12
+ function callsBase(repo, ws, id) {
13
+ const base = `/repos/${enc(repo)}/workspaces/${enc(ws)}/calls`;
14
+ return id !== undefined ? `${base}/${enc(id)}` : base;
15
+ }
16
+ /** A path with a query of the parameters given, in order. */
17
+ function withQuery(path, params) {
18
+ const query = new URLSearchParams();
19
+ for (const [name, value] of params) {
20
+ if (value !== undefined)
21
+ query.set(name, value);
22
+ }
23
+ const text = query.toString();
24
+ return text === '' ? path : `${path}?${text}`;
25
+ }
26
+ /** A wait as a query gives it: whole milliseconds, zero or more. */
27
+ function waitParam(ms) {
28
+ return ms === undefined ? undefined : String(Math.max(0, Math.trunc(ms)));
29
+ }
30
+ /**
31
+ * How long each poll of a call {@link workspaceFunctionCall} makes asks the
32
+ * server to wait for it to end, in milliseconds. A server holds a poll at
33
+ * most as long as it allows — the local server 20 s, a host whose held
34
+ * requests cost it less — and answers as soon as the call ends.
35
+ */
36
+ export const CALL_POLL_WAIT_MS = 20_000;
37
+ /** The least time between two polls of a call, which doubles to
38
+ * {@link CALL_POLL_MAX_MS}: a poll a server answered at once waits it out. */
39
+ const CALL_POLL_MIN_MS = 250;
40
+ /** The most time between two polls of a call. */
41
+ const CALL_POLL_MAX_MS = 2_000;
11
42
  function pkgBase(repo, pkg, version, fn) {
12
43
  const base = `/repos/${enc(repo)}/packages/${enc(pkg)}/${enc(version)}/functions`;
13
44
  return fn !== undefined ? `${base}/${enc(fn)}` : base;
@@ -93,15 +124,26 @@ export async function workspaceFunctionDescribe(url, repo, ws, fn, options) {
93
124
  return get(url, wsBase(repo, ws, fn), FunctionSignatureType, options);
94
125
  }
95
126
  /**
96
- * Call a function of the deployed package synchronously.
127
+ * Call a function of the deployed package, and wait for its result: the call
128
+ * is started, kept by the server for its lifetime, and polled to its end.
97
129
  *
98
130
  * @remarks
99
131
  * A runner the request names is held to the caller's grant, as
100
132
  * {@link functionCall} says. An argument is a value, or a dataset of the
101
133
  * workspace (`variant('dataset', path)`), pinned by its hash at launch as a
102
- * one-shot's is: the result's `inputs` names each dataset argument's path and
103
- * the hash it was pinned at, in argument order, and an unassigned one is
104
- * `invalid`.
134
+ * one-shot's is: the result's `inputs` names each input the function reads and
135
+ * each dataset argument, with the hash it was pinned at, in parameter order,
136
+ * and an unassigned one is `invalid`.
137
+ *
138
+ * A call is held to its own timeout, never to a request's, so it may run for
139
+ * as long as its limits allow: its start waits up to the server's window
140
+ * ({@link workspaceFunctionStart}), and a call still running is polled — each
141
+ * poll held by the server until the call ends or a while passes — 250 ms
142
+ * apart at first, backing off to 2 s. The client names the call, an id of its
143
+ * own ({@link FunctionCallStartOptions.id}), so an abort reaches the call
144
+ * however soon it comes. A server that keeps no calls, one that predates
145
+ * them, has no route to start one, and the call is made through
146
+ * {@link workspaceFunctionCallSync} instead.
105
147
  *
106
148
  * @param url - Base URL of the e3 API server
107
149
  * @param repo - Repository name
@@ -111,15 +153,289 @@ export async function workspaceFunctionDescribe(url, repo, ws, fn, options) {
111
153
  * @param req - The arguments (values or dataset paths), a runner to run on
112
154
  * instead of the function's own, and the limits
113
155
  * @param options - Request options including auth token
156
+ * @param call - The signal that stops the call, and who is told its id once
157
+ * it runs on past its start
114
158
  * @returns The call's terminal result
115
159
  * @throws {ApiError} `permission_denied` (`path` `runner`) when the caller may
116
- * not run the function on the runner the request names, and
117
- * `workspace_not_found` / `workspace_not_deployed`
160
+ * not run the function on the runner the request names,
161
+ * `workspace_not_found` / `workspace_not_deployed`, and `internal` for a
162
+ * call someone cancelled, or the server lost, which has no result
163
+ * @throws {AuthError} On 401 Unauthorized
164
+ * @throws The abort's reason, once `call.signal` aborts
165
+ */
166
+ export async function workspaceFunctionCall(url, repo, ws, fn, req, options, call = {}) {
167
+ return keptCall(url, repo, ws, options, call, (id) => workspaceFunctionStart(url, repo, ws, fn, req, options, {
168
+ id,
169
+ ...(call.startWaitMs !== undefined && { waitMs: call.startWaitMs }),
170
+ }), () => workspaceFunctionCallSync(url, repo, ws, fn, req, options));
171
+ }
172
+ /**
173
+ * A kept call, started and polled to its end: what {@link workspaceFunctionCall}
174
+ * and {@link oneShotCall} make, each by its own start, and its own route
175
+ * within one request for a server that keeps no such calls.
176
+ *
177
+ * @param url - Base URL of the e3 API server
178
+ * @param repo - Repository name
179
+ * @param ws - The workspace the call is made through
180
+ * @param options - Request options including auth token
181
+ * @param call - The signal that stops the call, and who is told its id
182
+ * @param start - Starts the call under the id the client named it by
183
+ * @param sync - Makes the call within one request, on a server whose start
184
+ * route is none
185
+ * @returns The call's terminal result
186
+ */
187
+ async function keptCall(url, repo, ws, options, call, start, sync) {
188
+ const { signal } = call;
189
+ signal?.throwIfAborted();
190
+ // The call is named before it is sent, so it can be stopped before its start answers
191
+ const id = uuidv7();
192
+ const starting = start(id);
193
+ let answer;
194
+ try {
195
+ answer = await untilAborted(starting, signal);
196
+ }
197
+ catch (err) {
198
+ if (err instanceof ApiError && (err.code === 'not_found' || err.code === 'method_not_allowed')) {
199
+ // A server that keeps no calls answers within one request alone
200
+ return untilAborted(sync(), signal);
201
+ }
202
+ if (signal?.aborted === true) {
203
+ // Asked to stop at once by its name; and again once the start answers,
204
+ // for a call filed after that ask reached the server, or filed under a
205
+ // name of the server's
206
+ void workspaceFunctionCallCancel(url, repo, ws, id, options).catch(() => undefined);
207
+ void starting.then((started) => cancelQuietly(url, repo, ws, started, options), () => undefined);
208
+ }
209
+ throw err;
210
+ }
211
+ let status = answer.status;
212
+ if (status.type === 'running')
213
+ call.onStarted?.(answer.id);
214
+ for (let gap = CALL_POLL_MIN_MS; status.type === 'running'; gap = Math.min(gap * 2, CALL_POLL_MAX_MS)) {
215
+ const asked = Date.now();
216
+ try {
217
+ // An abort stops the wait at once, whatever the fetch does with its
218
+ // signal: a host's own fetch, as e3 in a page answers through, may
219
+ // answer the held poll in its own time
220
+ status = await untilAborted(workspaceFunctionCallStatus(url, repo, ws, answer.id, options, {
221
+ waitMs: CALL_POLL_WAIT_MS,
222
+ ...(signal !== undefined && { signal }),
223
+ }), signal);
224
+ // A poll the server answered before the gap passed waits the rest of it
225
+ if (status.type === 'running')
226
+ await pause(gap - (Date.now() - asked), signal);
227
+ }
228
+ catch (err) {
229
+ if (signal?.aborted === true)
230
+ void cancelQuietly(url, repo, ws, answer, options);
231
+ throw err;
232
+ }
233
+ }
234
+ return callResult(answer.id, status);
235
+ }
236
+ /**
237
+ * Start a call of a function of the deployed package: the server files it,
238
+ * runs it where its calls run, and waits a while for it to end.
239
+ *
240
+ * @remarks
241
+ * The call is kept by the server from now until the lifetime its end gives
242
+ * it: an hour for a success or a cancel, a week for any other end, unless the
243
+ * server says otherwise. Its timeout is the server's ceiling unless the
244
+ * request asks for less, since it answers no request. The answer is the
245
+ * call's id and how it stood when the wait ended: `completed` with its
246
+ * result for a call that ended within it — a call found wrong among them,
247
+ * `invalid` — or `running`, which {@link workspaceFunctionCallStatus} polls.
248
+ * A start is never sent twice, so a call is never filed twice.
249
+ *
250
+ * @param url - Base URL of the e3 API server
251
+ * @param repo - Repository name
252
+ * @param ws - The workspace whose deployed package holds the function
253
+ * @param fn - Function name
254
+ * @param req - The arguments, a runner to run on instead of the function's
255
+ * own, and the limits
256
+ * @param options - Request options including auth token
257
+ * @param start - How long the start waits for the call to end, and the id to
258
+ * file it under
259
+ * @returns The call's id and status
260
+ * @throws {ApiError} As {@link workspaceFunctionCall} does; `not_found` from a
261
+ * server that keeps no calls
262
+ * @throws {AuthError} On 401 Unauthorized
263
+ */
264
+ export async function workspaceFunctionStart(url, repo, ws, fn, req, options, start = {}) {
265
+ const path = withQuery(`${wsBase(repo, ws, fn)}/calls`, [
266
+ ['wait', waitParam(start.waitMs)],
267
+ ['id', start.id],
268
+ ['verbose', options.verbose === true ? '1' : undefined],
269
+ ]);
270
+ return post(url, path, req, FunctionCallRequestType, FunctionCallAnswerType, options);
271
+ }
272
+ /**
273
+ * A call's status: `running`; its result once it ended, its value inline up
274
+ * to its `maxResultBytes`; `cancelled`, naming who asked; or `lost`, and why.
275
+ *
276
+ * @param url - Base URL of the e3 API server
277
+ * @param repo - Repository name
278
+ * @param ws - The workspace the call was made through
279
+ * @param id - The call's id
280
+ * @param options - Request options including auth token
281
+ * @param poll - How long the server waits for the call to end, and the signal
282
+ * that aborts the poll
283
+ * @returns The status
284
+ * @throws {ApiError} `internal` when the workspace keeps no such call — none
285
+ * was made, or its lifetime has ended — and `permission_denied` (`path`
286
+ * `call`) for a caller the server does not let read it
287
+ * @throws {AuthError} On 401 Unauthorized
288
+ * @throws The abort's reason, once `poll.signal` aborts
289
+ */
290
+ export async function workspaceFunctionCallStatus(url, repo, ws, id, options, poll = {}) {
291
+ return get(url, withQuery(`${callsBase(repo, ws, id)}/status`, [['wait', waitParam(poll.waitMs)]]), FunctionCallStatusType, options, poll.signal);
292
+ }
293
+ /**
294
+ * Ask a running call to stop: the server stops its runner, and the call ends
295
+ * `cancelled`, naming who asked. A call that has ended is left as it is.
296
+ *
297
+ * @remarks
298
+ * The request is sent `keepalive`, so it reaches the server though the page
299
+ * that sends it is closing: a page that stops its calls as it goes away is
300
+ * heard.
301
+ *
302
+ * @param url - Base URL of the e3 API server
303
+ * @param repo - Repository name
304
+ * @param ws - The workspace the call was made through
305
+ * @param id - The call's id
306
+ * @param options - Request options including auth token
307
+ * @returns The call's status once it stopped, or `running` while it stops
308
+ * @throws {ApiError} As {@link workspaceFunctionCallStatus} does, and
309
+ * `permission_denied` (`path` `call`) for a caller the server does not let
310
+ * cancel it
311
+ * @throws {AuthError} On 401 Unauthorized
312
+ */
313
+ export async function workspaceFunctionCallCancel(url, repo, ws, id, options) {
314
+ return post(url, `${callsBase(repo, ws, id)}/cancel`, null, NullType, FunctionCallStatusType, options, undefined, { keepalive: true });
315
+ }
316
+ /**
317
+ * A page of the calls a workspace keeps, the latest first: each by who made
318
+ * it, when, and how it stands or ended.
319
+ *
320
+ * @remarks
321
+ * A call is kept for its lifetime, an hour for a success or a cancel and a
322
+ * week for any other end unless the server says otherwise, so the list holds
323
+ * what is recent however many calls are made. A page's `next` is the next
324
+ * page's `before`, `none` on the last. A page may hold fewer calls than its
325
+ * limit, or none, and name a next all the same: a server that reads a bounded
326
+ * number of calls a request, as the cloud's does, stops where its reads
327
+ * stopped, which a list of a function's calls, or a state's, may reach first.
328
+ *
329
+ * @param url - Base URL of the e3 API server
330
+ * @param repo - Repository name
331
+ * @param ws - The workspace
332
+ * @param options - Request options including auth token
333
+ * @param query - Only a function's calls, or only those in a state, and the
334
+ * page's cursor and size
335
+ * @returns The page
336
+ * @throws {ApiError} `workspace_not_found`, and `bad_request` for a query
337
+ * given wrong
338
+ * @throws {AuthError} On 401 Unauthorized
339
+ */
340
+ export async function workspaceCallList(url, repo, ws, options, query = {}) {
341
+ const path = withQuery(callsBase(repo, ws), [
342
+ ['function', query.function],
343
+ ['state', query.state],
344
+ ['before', query.before],
345
+ ['limit', query.limit === undefined ? undefined : String(query.limit)],
346
+ ]);
347
+ return get(url, path, FunctionCallPageType, options);
348
+ }
349
+ /**
350
+ * A kept call, whole: the package it ran from, its arguments — values by the
351
+ * objects they were stored as, datasets by the hashes they were pinned at —
352
+ * the versions of the inputs it read, its limits, its value by hash once it
353
+ * succeeded, its log tails, and when it is forgotten.
354
+ *
355
+ * @param url - Base URL of the e3 API server
356
+ * @param repo - Repository name
357
+ * @param ws - The workspace the call was made through
358
+ * @param id - The call's id
359
+ * @param options - Request options including auth token
360
+ * @returns The call
361
+ * @throws {ApiError} As {@link workspaceFunctionCallStatus} does
118
362
  * @throws {AuthError} On 401 Unauthorized
119
363
  */
120
- export async function workspaceFunctionCall(url, repo, ws, fn, req, options) {
364
+ export async function workspaceCallGet(url, repo, ws, id, options) {
365
+ return get(url, callsBase(repo, ws, id), FunctionCallType, options);
366
+ }
367
+ /**
368
+ * Call a function of the deployed package within one request: the sync route,
369
+ * which a server that keeps no calls answers alone.
370
+ *
371
+ * @remarks
372
+ * The call's timeout defaults as a sync call's does, and is clamped under the
373
+ * server's sync deadline, so a call that runs past it is answered `timed_out`.
374
+ * A server that keeps calls keeps this one too. {@link workspaceFunctionCall}
375
+ * is held to no request's deadline, and is what a caller makes unless it
376
+ * wants a single request.
377
+ *
378
+ * @param url - Base URL of the e3 API server
379
+ * @param repo - Repository name
380
+ * @param ws - The workspace whose deployed package holds the function
381
+ * @param fn - Function name
382
+ * @param req - The arguments, a runner to run on instead of the function's
383
+ * own, and the limits
384
+ * @param options - Request options including auth token
385
+ * @returns The call's terminal result
386
+ * @throws {ApiError} As {@link workspaceFunctionCall} does
387
+ * @throws {AuthError} On 401 Unauthorized
388
+ */
389
+ export async function workspaceFunctionCallSync(url, repo, ws, fn, req, options) {
121
390
  return post(url, verboseQuery(wsBase(repo, ws, fn), options), req, FunctionCallRequestType, ExecuteResultType, options);
122
391
  }
392
+ /** A call's result, once it ended: what a cancelled or lost call, which has
393
+ * none, is refused as, in the sync route's words. */
394
+ function callResult(id, status) {
395
+ switch (status.type) {
396
+ case 'completed':
397
+ return status.value;
398
+ case 'cancelled': {
399
+ const by = status.value.by.type === 'some' ? ` by ${status.value.by.value}` : '';
400
+ throw new ApiError('internal', { message: `call ${id} was cancelled${by}, and has no result` });
401
+ }
402
+ case 'lost':
403
+ throw new ApiError('internal', { message: `call ${id} was lost: ${status.value.message}` });
404
+ case 'running':
405
+ throw new ApiError('internal', { message: `call ${id} is still running` });
406
+ }
407
+ }
408
+ /** Asks a call that runs on to stop, ignoring the answer: what an abort does. */
409
+ async function cancelQuietly(url, repo, ws, answer, options) {
410
+ if (answer.status.type !== 'running')
411
+ return;
412
+ await workspaceFunctionCallCancel(url, repo, ws, answer.id, options).catch(() => undefined);
413
+ }
414
+ /** What a promise settles to, or the abort's reason once `signal` aborts
415
+ * first; the promise runs on regardless. */
416
+ function untilAborted(promise, signal) {
417
+ if (signal === undefined)
418
+ return promise;
419
+ return new Promise((resolve, reject) => {
420
+ if (signal.aborted) {
421
+ reject(signal.reason);
422
+ return;
423
+ }
424
+ const onAbort = () => reject(signal.reason);
425
+ signal.addEventListener('abort', onAbort, { once: true });
426
+ promise.then((value) => {
427
+ signal.removeEventListener('abort', onAbort);
428
+ resolve(value);
429
+ }, (err) => {
430
+ signal.removeEventListener('abort', onAbort);
431
+ reject(err);
432
+ });
433
+ });
434
+ }
435
+ /** Waits `ms`, or rejects with the abort's reason once `signal` aborts. */
436
+ function pause(ms, signal) {
437
+ return untilAborted(new Promise((resolve) => setTimeout(resolve, Math.max(0, ms))), signal);
438
+ }
123
439
  // =============================================================================
124
440
  // One-shot (anonymous caller-supplied IR; the server's grant)
125
441
  // =============================================================================
@@ -135,6 +451,10 @@ export async function workspaceFunctionCall(url, repo, ws, fn, req, options) {
135
451
  * path and the hash it was pinned at, in argument order, so an answer can be
136
452
  * reproduced and a stale one noticed.
137
453
  *
454
+ * The call runs within the request, its timeout clamped under the server's
455
+ * sync deadline, so one that runs past it is answered `timed_out`, and
456
+ * nothing of it is kept. {@link oneShotCall} is held to no request's deadline.
457
+ *
138
458
  * @param url - Base URL of the e3 API server
139
459
  * @param repo - Repository name
140
460
  * @param ws - The workspace whose datasets the call reads
@@ -149,6 +469,77 @@ export async function workspaceFunctionCall(url, repo, ws, fn, req, options) {
149
469
  export async function oneShotExecute(url, repo, ws, req, options) {
150
470
  return post(url, verboseQuery(oneShotBase(repo, ws), options), req, OneShotRequestType, ExecuteResultType, options);
151
471
  }
472
+ /**
473
+ * Run an anonymous IR against a workspace, and wait for its result: the call
474
+ * is started, kept by the server for its lifetime among the workspace's calls
475
+ * — naming no function, its program being the caller's — and polled to its
476
+ * end.
477
+ *
478
+ * @remarks
479
+ * Held to the caller's grant as {@link oneShotExecute} is. A call is held to
480
+ * its own timeout, never to a request's, so it may run for as long as its
481
+ * limits allow — its timeout is the server's ceiling unless the request asks
482
+ * for less — and is started, polled and stopped as {@link workspaceFunctionCall}
483
+ * says: its start waits up to the server's window, a call still running is
484
+ * polled, and an abort asks the server to stop it, by the id the client named
485
+ * it with. The server keeps it, as it keeps a function's call — who made it,
486
+ * its arguments, the versions of the datasets it read, its value and its logs
487
+ * — which {@link workspaceCallList} and {@link workspaceCallGet} read. A
488
+ * server that keeps no one-shot calls, one that predates them, has no route
489
+ * to start one, and the call is made through {@link oneShotExecute} instead.
490
+ *
491
+ * @param url - Base URL of the e3 API server
492
+ * @param repo - Repository name
493
+ * @param ws - The workspace whose datasets the call reads
494
+ * @param req - The body IR, its arguments (values or dataset paths), its
495
+ * runner and its limits
496
+ * @param options - Request options including auth token
497
+ * @param call - The signal that stops the call, and who is told its id once
498
+ * it runs on past its start
499
+ * @returns The call's terminal result
500
+ * @throws {ApiError} As {@link oneShotExecute} does, and `internal` for a call
501
+ * someone cancelled, or the server lost, which has no result
502
+ * @throws {AuthError} On 401 Unauthorized
503
+ * @throws The abort's reason, once `call.signal` aborts
504
+ */
505
+ export async function oneShotCall(url, repo, ws, req, options, call = {}) {
506
+ return keptCall(url, repo, ws, options, call, (id) => oneShotStart(url, repo, ws, req, options, {
507
+ id,
508
+ ...(call.startWaitMs !== undefined && { waitMs: call.startWaitMs }),
509
+ }), () => oneShotExecute(url, repo, ws, req, options));
510
+ }
511
+ /**
512
+ * Start a one-shot as a call: the server files it, runs it where its calls
513
+ * run, and waits a while for it to end.
514
+ *
515
+ * @remarks
516
+ * Answered as {@link workspaceFunctionStart} answers a function's start: the
517
+ * call's id and how it stood when the wait ended, `completed` with its result
518
+ * for a call that ended within it — one found wrong among them, `invalid` — or
519
+ * `running`, which {@link workspaceFunctionCallStatus} polls and
520
+ * {@link workspaceFunctionCallCancel} stops. A start is never sent twice, so a
521
+ * call is never filed twice.
522
+ *
523
+ * @param url - Base URL of the e3 API server
524
+ * @param repo - Repository name
525
+ * @param ws - The workspace whose datasets the call reads
526
+ * @param req - The body IR, its arguments, its runner and its limits
527
+ * @param options - Request options including auth token
528
+ * @param start - How long the start waits for the call to end, and the id to
529
+ * file it under
530
+ * @returns The call's id and status
531
+ * @throws {ApiError} As {@link oneShotExecute} does; `not_found` from a server
532
+ * that keeps no one-shot calls
533
+ * @throws {AuthError} On 401 Unauthorized
534
+ */
535
+ export async function oneShotStart(url, repo, ws, req, options, start = {}) {
536
+ const path = withQuery(`${oneShotBase(repo, ws)}/calls`, [
537
+ ['wait', waitParam(start.waitMs)],
538
+ ['id', start.id],
539
+ ['verbose', options.verbose === true ? '1' : undefined],
540
+ ]);
541
+ return post(url, path, req, OneShotRequestType, FunctionCallAnswerType, options);
542
+ }
152
543
  // =============================================================================
153
544
  // Split calls (a caller's program over a dataset's pieces, as a job)
154
545
  // =============================================================================
@@ -163,6 +554,16 @@ export async function oneShotExecute(url, repo, ws, req, options) {
163
554
  * grant any other. A request found wrong is answered by the poll, as an
164
555
  * `invalid` result.
165
556
  *
557
+ * The output kinds are a task's — `array`, `set`, `dict`, `fold` — and
558
+ * `first`, an array's first `limit` elements in input order, whose pieces run
559
+ * in order and stop once they hold them (#1110). The final function, `then`,
560
+ * runs once over the assembled output and then the arguments not partitioned,
561
+ * in their order: the partitioned ones are the pieces' to read, and are never
562
+ * staged for it. One that takes any other count
563
+ * is `invalid`, naming its count and the call's. A client of this release and
564
+ * a server of an earlier one disagree on what `then` is given: keep them in
565
+ * step.
566
+ *
166
567
  * @param url - Base URL of the e3 API server
167
568
  * @param repo - Repository name
168
569
  * @param ws - The workspace whose datasets the call reads
@@ -178,8 +579,8 @@ export async function splitCallLaunch(url, repo, ws, req, options) {
178
579
  return post(url, `${oneShotBase(repo, ws)}/split`, req, SplitCallRequestType, PackageJobResponseType, options);
179
580
  }
180
581
  /**
181
- * A split call's status: how far its job has got, its result, or why the
182
- * server could not run it.
582
+ * A split call's status: how far its job has got, its result, why the server
583
+ * could not run it, or that it was cancelled.
183
584
  *
184
585
  * @param url - Base URL of the e3 API server
185
586
  * @param repo - Repository name
@@ -196,6 +597,25 @@ export async function splitCallLaunch(url, repo, ws, req, options) {
196
597
  export async function splitCallStatus(url, repo, ws, id, options) {
197
598
  return get(url, `${oneShotBase(repo, ws)}/split/${enc(id)}`, SplitCallStatusType, options);
198
599
  }
600
+ /**
601
+ * Cancel a split call: a job still running ends `cancelled`, and the server
602
+ * stops its units; one that has ended is left as it is. The units that
603
+ * finished stay cached, so a relaunch is served them.
604
+ *
605
+ * @param url - Base URL of the e3 API server
606
+ * @param repo - Repository name
607
+ * @param ws - The workspace the call was launched in
608
+ * @param id - The job's id
609
+ * @param options - Request options including auth token
610
+ * @returns The job's status after the cancel, as a poll answers it:
611
+ * `cancelled`, or the status it had already ended with
612
+ * @throws {ApiError} As {@link splitCallStatus} does: whoever may poll a job
613
+ * may cancel it
614
+ * @throws {AuthError} On 401 Unauthorized
615
+ */
616
+ export async function splitCallCancel(url, repo, ws, id, options) {
617
+ return post(url, `${oneShotBase(repo, ws)}/split/${enc(id)}/cancel`, null, NullType, SplitCallStatusType, options);
618
+ }
199
619
  /**
200
620
  * What a split call's pieces would be: launched as an explain, a job the
201
621
  * server plans them in, as the call's run would, running no unit, and polled
@@ -206,12 +626,14 @@ export async function splitCallStatus(url, repo, ws, id, options) {
206
626
  * @param ws - The workspace whose datasets the call reads
207
627
  * @param req - The call
208
628
  * @param options - Request options including auth token
209
- * @param callOptions - The signal that stops polling
629
+ * @param callOptions - The signal that gives the explain up, and cancels its
630
+ * job
210
631
  * @returns The piece count, the argument they are cut over, and what it weighs
211
632
  * @throws {ApiError} `permission_denied` as for {@link splitCallLaunch}
212
633
  * @throws {AuthError} On 401 Unauthorized
213
634
  * @throws {Error} When the call is found wrong, naming what is wrong, or the
214
635
  * server could not plan it
636
+ * @throws The signal's reason once it aborts
215
637
  */
216
638
  export async function splitCallExplain(url, repo, ws, req, options, callOptions = {}) {
217
639
  const { id } = await post(url, `${oneShotBase(repo, ws)}/split?explain=1`, req, SplitCallRequestType, PackageJobResponseType, options);
@@ -223,6 +645,8 @@ export async function splitCallExplain(url, repo, ws, req, options, callOptions
223
645
  const why = outcome.type === 'invalid' ? outcome.value.diagnostics.map((diagnostic) => diagnostic.message).join('; ') : outcome.type;
224
646
  throw new Error(`Split call explain refused: ${why}`);
225
647
  }
648
+ if (status.type === 'cancelled')
649
+ throw new Error('Split call explain cancelled');
226
650
  throw new Error(`Split call explain failed: ${status.type === 'failed' ? status.value.message : status.type}`);
227
651
  }
228
652
  /**
@@ -234,35 +658,55 @@ export async function splitCallExplain(url, repo, ws, req, options, callOptions
234
658
  * @param ws - The workspace whose datasets the call reads
235
659
  * @param req - The call
236
660
  * @param options - Request options including auth token
237
- * @param callOptions - Its progress, and the signal that stops polling
238
- * @returns The call's result, and the assembled output's hash
661
+ * @param callOptions - Its progress, and the signal that gives it up and
662
+ * cancels its job
663
+ * @returns The call's result, the assembled output's hash, and how it ran
239
664
  * @throws {ApiError} As {@link splitCallLaunch} does
240
665
  * @throws {AuthError} On 401 Unauthorized
241
- * @throws {Error} When the server could not run the call
666
+ * @throws {Error} When the server could not run the call, or it was cancelled
667
+ * @throws The signal's reason once it aborts
242
668
  */
243
669
  export async function splitCall(url, repo, ws, req, options, callOptions = {}) {
244
670
  const { id } = await splitCallLaunch(url, repo, ws, req, options);
245
671
  const status = await splitCallEnd(url, repo, ws, id, options, callOptions);
246
672
  if (status.type === 'completed') {
247
- return { result: status.value.result, output: status.value.output.type === 'some' ? status.value.output.value : null };
673
+ return {
674
+ result: status.value.result,
675
+ output: status.value.output.type === 'some' ? status.value.output.value : null,
676
+ report: status.value.report.type === 'some' ? status.value.report.value : null,
677
+ };
248
678
  }
679
+ if (status.type === 'cancelled')
680
+ throw new Error('Split call cancelled');
249
681
  throw new Error(`Split call failed: ${status.type === 'failed' ? status.value.message : status.type}`);
250
682
  }
251
683
  /**
252
684
  * Polls a split call's job until it is no longer `processing`, 100 ms apart
253
685
  * at first, backing off to a second, telling `onProgress` how far it has got.
686
+ * Once `signal` aborts, it cancels the job and rejects with the signal's
687
+ * reason.
254
688
  *
255
689
  * @returns The status it ended with
256
690
  */
257
691
  async function splitCallEnd(url, repo, ws, id, options, callOptions) {
258
- for (let wait = JOB_POLL_MIN_MS;; wait = Math.min(wait * 2, JOB_POLL_MAX_MS)) {
259
- callOptions.signal?.throwIfAborted();
260
- const status = await splitCallStatus(url, repo, ws, id, options);
261
- if (status.type !== 'processing')
262
- return status;
263
- if (status.value.type === 'some')
264
- callOptions.onProgress?.(status.value.value);
265
- await new Promise((resolve) => setTimeout(resolve, wait));
692
+ const { signal } = callOptions;
693
+ try {
694
+ for (let wait = JOB_POLL_MIN_MS;; wait = Math.min(wait * 2, JOB_POLL_MAX_MS)) {
695
+ signal?.throwIfAborted();
696
+ const status = await splitCallStatus(url, repo, ws, id, options);
697
+ if (status.type !== 'processing')
698
+ return status;
699
+ if (status.value.type === 'some')
700
+ callOptions.onProgress?.(status.value.value);
701
+ await sleep(wait, signal);
702
+ }
703
+ }
704
+ catch (err) {
705
+ // Given up: the job is cancelled, so its units stop. A cancel that fails
706
+ // leaves the job to its timeout, and the abort is still what is thrown.
707
+ if (signal?.aborted === true)
708
+ await splitCallCancel(url, repo, ws, id, options).catch(() => undefined);
709
+ throw err;
266
710
  }
267
711
  }
268
712
  //# sourceMappingURL=functions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAuB,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAE/B,SAAS,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,OAAe,EAAE,EAAW;IACtE,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;IAClF,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,EAAU,EAAE,EAAW;IACnD,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC;IACnE,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,EAAU;IAC3C,OAAO,U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MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=functions.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.spec.d.ts","sourceRoot":"","sources":["../../src/functions.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}