narrarium-engine 0.1.12 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +69 -5
  2. package/dist/ai/deadlines.d.ts.map +1 -1
  3. package/dist/ai/deadlines.js +25 -8
  4. package/dist/ai/deadlines.js.map +1 -1
  5. package/dist/ai/fetch-client.d.ts +19 -1
  6. package/dist/ai/fetch-client.d.ts.map +1 -1
  7. package/dist/ai/fetch-client.js +289 -74
  8. package/dist/ai/fetch-client.js.map +1 -1
  9. package/dist/ai/types.d.ts +71 -0
  10. package/dist/ai/types.d.ts.map +1 -1
  11. package/dist/ai/types.js +19 -0
  12. package/dist/ai/types.js.map +1 -1
  13. package/dist/autopilot/calls/index.d.ts +8 -0
  14. package/dist/autopilot/calls/index.d.ts.map +1 -0
  15. package/dist/autopilot/calls/index.js +8 -0
  16. package/dist/autopilot/calls/index.js.map +1 -0
  17. package/dist/autopilot/calls/memory-store.d.ts +38 -0
  18. package/dist/autopilot/calls/memory-store.d.ts.map +1 -0
  19. package/dist/autopilot/calls/memory-store.js +279 -0
  20. package/dist/autopilot/calls/memory-store.js.map +1 -0
  21. package/dist/autopilot/calls/port.d.ts +76 -0
  22. package/dist/autopilot/calls/port.d.ts.map +1 -0
  23. package/dist/autopilot/calls/port.js +28 -0
  24. package/dist/autopilot/calls/port.js.map +1 -0
  25. package/dist/autopilot/calls/recorder.d.ts +120 -0
  26. package/dist/autopilot/calls/recorder.d.ts.map +1 -0
  27. package/dist/autopilot/calls/recorder.js +400 -0
  28. package/dist/autopilot/calls/recorder.js.map +1 -0
  29. package/dist/autopilot/calls/retention.d.ts +27 -0
  30. package/dist/autopilot/calls/retention.d.ts.map +1 -0
  31. package/dist/autopilot/calls/retention.js +33 -0
  32. package/dist/autopilot/calls/retention.js.map +1 -0
  33. package/dist/autopilot/calls/run-calls.d.ts +106 -0
  34. package/dist/autopilot/calls/run-calls.d.ts.map +1 -0
  35. package/dist/autopilot/calls/run-calls.js +251 -0
  36. package/dist/autopilot/calls/run-calls.js.map +1 -0
  37. package/dist/autopilot/calls/types.d.ts +232 -0
  38. package/dist/autopilot/calls/types.d.ts.map +1 -0
  39. package/dist/autopilot/calls/types.js +53 -0
  40. package/dist/autopilot/calls/types.js.map +1 -0
  41. package/dist/autopilot/calls/utf8.d.ts +19 -0
  42. package/dist/autopilot/calls/utf8.d.ts.map +1 -0
  43. package/dist/autopilot/calls/utf8.js +91 -0
  44. package/dist/autopilot/calls/utf8.js.map +1 -0
  45. package/dist/autopilot/errors.d.ts.map +1 -1
  46. package/dist/autopilot/errors.js +60 -1
  47. package/dist/autopilot/errors.js.map +1 -1
  48. package/dist/autopilot/runner.d.ts +10 -0
  49. package/dist/autopilot/runner.d.ts.map +1 -1
  50. package/dist/autopilot/runner.js +109 -7
  51. package/dist/autopilot/runner.js.map +1 -1
  52. package/dist/autopilot/session.d.ts +12 -0
  53. package/dist/autopilot/session.d.ts.map +1 -1
  54. package/dist/autopilot/session.js +4 -0
  55. package/dist/autopilot/session.js.map +1 -1
  56. package/dist/autopilot/types.d.ts +60 -3
  57. package/dist/autopilot/types.d.ts.map +1 -1
  58. package/dist/autopilot/types.js.map +1 -1
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +1 -0
  62. package/dist/index.js.map +1 -1
  63. package/dist/server/client.d.ts +42 -1
  64. package/dist/server/client.d.ts.map +1 -1
  65. package/dist/server/client.js +69 -1
  66. package/dist/server/client.js.map +1 -1
  67. package/dist/server/protocol.d.ts +44 -0
  68. package/dist/server/protocol.d.ts.map +1 -1
  69. package/dist/server/protocol.js +19 -0
  70. package/dist/server/protocol.js.map +1 -1
  71. package/dist/version.d.ts +1 -1
  72. package/dist/version.js +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1,400 @@
1
+ import { redactSecrets } from "../../ai/redact.js";
2
+ import { cutHead, endsWithHighSurrogate, suffixStart, utf8Length } from "./utf8.js";
3
+ import { AI_CALL_CHECKPOINT, AI_CALL_ERROR_CHARACTERS, AI_CALL_LIMITS, AI_CALLS_FORMAT_VERSION, aiCallIdOf, isSafeAiCallId, } from "./types.js";
4
+ /** The live text stops this many characters short of the newest one until the next checkpoint, so a key split across two checkpoints is never kept. */
5
+ export const AI_CALL_HOLDBACK_CHARACTERS = 256;
6
+ /** The most writes waiting for the store. A live checkpoint is dropped (its text goes with the next one) when the queue is that long; the final write is always queued. */
7
+ export const AI_CALL_QUEUE_LIMIT = 8;
8
+ export const SYSTEM_AI_CALL_CLOCK = {
9
+ now: () => Date.now(),
10
+ setTimer: (callback, ms) => globalThis.setTimeout(callback, ms),
11
+ clearTimer: (handle) => globalThis.clearTimeout(handle),
12
+ };
13
+ /** Strips the address of a URL to its origin; anything else is not an address and is dropped. */
14
+ function endpointOrigin(value) {
15
+ if (!value)
16
+ return null;
17
+ try {
18
+ const url = new URL(value);
19
+ return url.protocol === "https:" || url.protocol === "http:" ? url.origin : null;
20
+ }
21
+ catch {
22
+ return null;
23
+ }
24
+ }
25
+ const URL_PATTERN = /\bhttps?:\/\/[^\s"'<>)]+/gi;
26
+ function clip(text, characters) {
27
+ return text.length > characters ? text.slice(0, characters) : text;
28
+ }
29
+ function number(value) {
30
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
31
+ }
32
+ function flag(value) {
33
+ return typeof value === "boolean" ? value : null;
34
+ }
35
+ /**
36
+ * The records of one AI call of an autopilot task. The runner creates one per `ai()` call and passes its `onText` to the client: the text it reports
37
+ * is cumulative, and a shorter text starts a new provider attempt (after a fallback or a retry; `""` resets). The recorder turns it into writes:
38
+ * the text that arrives is appended to the store every 2 seconds or 16 KiB, whichever comes first, and the rest at the end (`finish`).
39
+ *
40
+ * It never waits for the store and never throws a store failure into its caller: writes are queued in order, a live checkpoint is dropped when the
41
+ * queue is full (the next one carries its text), the final writes always queue, and the first failure of the call is reported once through
42
+ * `onError`. Every string is redacted with `redactSecrets` and the secrets the caller gives, and URLs are cut to their origins before they are
43
+ * kept. A response longer than its limit keeps its head and its end (`AI_CALL_LIMITS`); the bytes between them are dropped and the record says so.
44
+ */
45
+ export class CallRecorder {
46
+ /** The id of the call, as the store knows it. */
47
+ callId;
48
+ store;
49
+ clock;
50
+ secrets;
51
+ onError;
52
+ startedAt;
53
+ fixedBytes;
54
+ fixedTruncated;
55
+ firstTextMs = null;
56
+ lastCheckpointMs;
57
+ timer = null;
58
+ attempt = null;
59
+ attemptCount = 0;
60
+ responseBytes = 0;
61
+ truncated = false;
62
+ infos = new Map();
63
+ inFlight = 0;
64
+ chain = Promise.resolve();
65
+ reported = false;
66
+ closed = false;
67
+ constructor(options) {
68
+ this.callId = aiCallIdOf(options.activityId, options.seq);
69
+ if (!isSafeAiCallId(this.callId))
70
+ throw new TypeError(`The activity id "${options.activityId}" cannot name a call.`);
71
+ this.store = options.store;
72
+ this.clock = options.clock ?? SYSTEM_AI_CALL_CLOCK;
73
+ this.secrets = options.secrets ?? [];
74
+ this.onError = options.onError;
75
+ this.lastCheckpointMs = this.clock.now();
76
+ this.startedAt = new Date(this.lastCheckpointMs).toISOString();
77
+ const system = this.limitText(options.system, AI_CALL_LIMITS.maxSystemBytes);
78
+ const user = this.limitText(options.user, AI_CALL_LIMITS.maxUserBytes);
79
+ this.fixedBytes = system.info.storedBytes + user.info.storedBytes;
80
+ this.fixedTruncated = system.info.truncated || user.info.truncated;
81
+ const request = options.request ?? {};
82
+ const record = {
83
+ formatVersion: AI_CALLS_FORMAT_VERSION,
84
+ callId: this.callId,
85
+ bookId: options.bookId,
86
+ accountScope: options.accountScope,
87
+ runId: this.redact(options.runId),
88
+ activityId: options.activityId,
89
+ seq: options.seq,
90
+ stepAttempt: options.stepAttempt,
91
+ task: options.task,
92
+ chapter: number(options.chapter),
93
+ scene: number(options.scene),
94
+ label: this.redact(options.label),
95
+ capability: this.redact(options.capability),
96
+ host: options.host,
97
+ request: {
98
+ system: system.info,
99
+ user: user.info,
100
+ images: request.images ?? 0,
101
+ tool: request.tool == null ? null : this.redact(request.tool),
102
+ toolSchemaHash: request.toolSchemaHash == null ? null : this.redact(request.toolSchemaHash),
103
+ structured: request.structured ?? false,
104
+ maxOutputTokens: number(request.maxOutputTokens),
105
+ temperature: number(request.temperature),
106
+ },
107
+ status: "running",
108
+ response: { text: null, partial: false },
109
+ attempts: [],
110
+ timing: { startedAt: this.startedAt, firstTextAt: null, endedAt: null },
111
+ storedBytes: this.fixedBytes,
112
+ dropped: this.fixedTruncated ? "limit" : null,
113
+ };
114
+ this.write(() => this.store.begin({ record, system: system.text, user: user.text }), true);
115
+ }
116
+ /**
117
+ * Receives the cumulative text the client reports (the `onText` of the request). Never throws, and never waits: the text is kept in the recorder
118
+ * until a checkpoint sends it.
119
+ */
120
+ onText(text) {
121
+ if (this.closed || typeof text !== "string")
122
+ return;
123
+ const current = this.attempt;
124
+ if (current && text.length < current.latest.length) {
125
+ this.finishAttempt(current, current.latest);
126
+ this.attempt = null;
127
+ }
128
+ if (text.length === 0)
129
+ return;
130
+ const attempt = this.attempt ?? this.startAttempt();
131
+ attempt.latest = text;
132
+ if (this.firstTextMs === null)
133
+ this.firstTextMs = this.clock.now();
134
+ this.scan(attempt);
135
+ if (attempt.cut || attempt.scannedBytes <= attempt.sentBytes)
136
+ return;
137
+ if (attempt.scannedBytes - attempt.sentBytes >= AI_CALL_CHECKPOINT.bytes || this.clock.now() - this.lastCheckpointMs >= AI_CALL_CHECKPOINT.intervalMs)
138
+ this.checkpoint();
139
+ else
140
+ this.arm();
141
+ }
142
+ /**
143
+ * Ends the call: the text not yet sent is written, and the call is ended with its status and its provider attempts. Never throws: the returned
144
+ * promise settles when the store has taken the final writes (it never rejects; a failure was reported through `onError`). Calling it again does nothing.
145
+ */
146
+ finish(status, attempts) {
147
+ if (this.closed)
148
+ return this.chain;
149
+ this.closed = true;
150
+ this.disarm();
151
+ if (this.attempt) {
152
+ this.finishAttempt(this.attempt, this.attempt.latest);
153
+ this.attempt = null;
154
+ }
155
+ const last = this.attemptCount > 0 ? this.infos.get(this.attemptCount) ?? null : null;
156
+ const end = {
157
+ status,
158
+ response: { text: last, partial: status !== "ok" && last !== null },
159
+ attempts: attempts.map((attempt) => this.cleanAttempt(attempt)),
160
+ timing: {
161
+ startedAt: this.startedAt,
162
+ firstTextAt: this.firstTextMs === null ? null : new Date(this.firstTextMs).toISOString(),
163
+ endedAt: new Date(this.clock.now()).toISOString(),
164
+ },
165
+ storedBytes: this.fixedBytes + this.responseBytes,
166
+ dropped: this.truncated || this.fixedTruncated ? "limit" : null,
167
+ };
168
+ const callId = this.callId;
169
+ this.write(() => this.store.end(callId, end), true);
170
+ return this.chain;
171
+ }
172
+ /** Resolves when every write queued so far has settled. Never rejects. */
173
+ idle() {
174
+ return this.chain;
175
+ }
176
+ /** The text attempts started so far: the number of the attempt the latest text belongs to (see `AiCallAttempt.textAttempt`). */
177
+ get textAttempts() {
178
+ return this.attemptCount;
179
+ }
180
+ /** The bytes kept so far by the call: its system and user, and the responses. Final after `finish`. */
181
+ get storedBytes() {
182
+ return this.fixedBytes + this.responseBytes;
183
+ }
184
+ /** The characters of the last text attempt, after `finish`; 0 when no text came. */
185
+ get responseCharacters() {
186
+ return this.attemptCount > 0 ? this.infos.get(this.attemptCount)?.characters ?? 0 : 0;
187
+ }
188
+ /** Why the call kept less than it was given, after `finish`: `limit` when a text was longer than its limit. */
189
+ get dropped() {
190
+ return this.truncated || this.fixedTruncated ? "limit" : null;
191
+ }
192
+ startAttempt() {
193
+ this.attemptCount += 1;
194
+ const cap = Math.max(0, Math.min(AI_CALL_LIMITS.maxResponseBytes, AI_CALL_LIMITS.maxCallBytes - this.fixedBytes - this.responseBytes));
195
+ const tailBytes = Math.min(AI_CALL_LIMITS.responseTailBytes, Math.floor(cap / 8));
196
+ const attempt = { number: this.attemptCount, latest: "", scannedJs: 0, scannedBytes: 0, sentJs: 0, sentBytes: 0, storedOffset: 0, cap, headBytes: cap - tailBytes, tailBytes, cut: false };
197
+ this.attempt = attempt;
198
+ return attempt;
199
+ }
200
+ /** Counts the bytes of the text that is whole: a trailing high surrogate waits for the low one that completes it. */
201
+ scan(attempt) {
202
+ const text = attempt.latest;
203
+ const end = endsWithHighSurrogate(text) ? text.length - 1 : text.length;
204
+ if (end > attempt.scannedJs) {
205
+ attempt.scannedBytes += utf8Length(text, attempt.scannedJs, end);
206
+ attempt.scannedJs = end;
207
+ }
208
+ }
209
+ /**
210
+ * Sends the text of the attempt that is not yet sent, redacted, up to its head limit. A live send keeps its holdback and is refused (returns false)
211
+ * when the queue is full; the final send takes everything and always queues.
212
+ */
213
+ send(attempt, final) {
214
+ if (attempt.cut)
215
+ return true;
216
+ if (!final && this.inFlight >= AI_CALL_QUEUE_LIMIT)
217
+ return false;
218
+ const text = attempt.latest;
219
+ let end = text.length;
220
+ if (!final) {
221
+ end = Math.max(attempt.sentJs, text.length - AI_CALL_HOLDBACK_CHARACTERS);
222
+ if (end > attempt.sentJs && endsWithHighSurrogate(text, end))
223
+ end -= 1;
224
+ }
225
+ if (end <= attempt.sentJs)
226
+ return true;
227
+ const remaining = attempt.headBytes - attempt.sentBytes;
228
+ if (utf8Length(text, attempt.sentJs, end) > remaining) {
229
+ end = cutHead(text, attempt.sentJs, remaining);
230
+ attempt.cut = true;
231
+ }
232
+ if (end > attempt.sentJs)
233
+ this.appendText(attempt, attempt.sentJs, end);
234
+ return true;
235
+ }
236
+ /** Writes text[from, to) of the attempt, redacted, at the next stored offset. */
237
+ appendText(attempt, from, to) {
238
+ const bytes = utf8Length(attempt.latest, from, to);
239
+ attempt.sentBytes += bytes;
240
+ attempt.sentJs = to;
241
+ this.writeResponse(attempt, this.redact(attempt.latest.slice(from, to)));
242
+ }
243
+ writeResponse(attempt, stored) {
244
+ if (!stored)
245
+ return;
246
+ const offset = attempt.storedOffset;
247
+ attempt.storedOffset += utf8Length(stored);
248
+ const callId = this.callId;
249
+ const number = attempt.number;
250
+ this.write(() => this.store.append(callId, number, offset, stored), true);
251
+ }
252
+ /** Sends the rest of the attempt and settles its size: its head, then its end when the text was longer than its head. */
253
+ finishAttempt(attempt, text) {
254
+ attempt.latest = text;
255
+ this.scan(attempt);
256
+ const total = attempt.scannedBytes + utf8Length(text, attempt.scannedJs);
257
+ attempt.scannedJs = text.length;
258
+ attempt.scannedBytes = total;
259
+ this.send(attempt, true);
260
+ let truncated = false;
261
+ if (total > attempt.headBytes) {
262
+ if (total > attempt.cap) {
263
+ truncated = true;
264
+ const start = Math.max(suffixStart(text, attempt.tailBytes), attempt.sentJs);
265
+ if (start < text.length)
266
+ this.writeResponse(attempt, this.redact(text.slice(start)));
267
+ }
268
+ else if (attempt.sentJs < text.length) {
269
+ this.appendText(attempt, attempt.sentJs, text.length);
270
+ }
271
+ }
272
+ if (truncated)
273
+ this.truncated = true;
274
+ this.responseBytes += attempt.storedOffset;
275
+ this.infos.set(attempt.number, { characters: text.length, bytes: total, storedBytes: attempt.storedOffset, truncated });
276
+ }
277
+ checkpoint() {
278
+ this.disarm();
279
+ const attempt = this.attempt;
280
+ if (!attempt)
281
+ return;
282
+ if (this.send(attempt, false))
283
+ this.lastCheckpointMs = this.clock.now();
284
+ else
285
+ this.arm();
286
+ }
287
+ arm() {
288
+ if (this.timer !== null)
289
+ return;
290
+ this.timer = this.clock.setTimer(() => {
291
+ this.timer = null;
292
+ if (!this.closed)
293
+ this.checkpoint();
294
+ }, AI_CALL_CHECKPOINT.intervalMs);
295
+ }
296
+ disarm() {
297
+ if (this.timer === null)
298
+ return;
299
+ this.clock.clearTimer(this.timer);
300
+ this.timer = null;
301
+ }
302
+ /** Queues a store operation behind the ones before it. Live writes are refused when the queue is full; the others always queue. */
303
+ write(operation, critical) {
304
+ if (!critical && this.inFlight >= AI_CALL_QUEUE_LIMIT)
305
+ return;
306
+ this.inFlight += 1;
307
+ this.chain = this.chain
308
+ .then(operation)
309
+ .catch((error) => this.report(error))
310
+ .then(() => {
311
+ this.inFlight -= 1;
312
+ });
313
+ }
314
+ report(error) {
315
+ if (this.reported)
316
+ return;
317
+ this.reported = true;
318
+ try {
319
+ this.onError?.(error);
320
+ }
321
+ catch {
322
+ // A listener that throws is not the call's failure.
323
+ }
324
+ }
325
+ limitText(text, maxBytes) {
326
+ const bytes = utf8Length(text);
327
+ const kept = bytes > maxBytes ? text.slice(0, cutHead(text, 0, maxBytes)) : text;
328
+ const stored = this.redact(kept);
329
+ return { text: stored, info: { characters: text.length, bytes, storedBytes: utf8Length(stored), truncated: bytes > maxBytes } };
330
+ }
331
+ /** Every string a record keeps goes through here: the known secrets and the keys that look like keys, then URLs cut to their origins. */
332
+ redact(text) {
333
+ return redactSecrets(text, this.secrets).replace(URL_PATTERN, (url) => endpointOrigin(url) ?? "[address]");
334
+ }
335
+ short(value) {
336
+ return value == null ? null : clip(this.redact(String(value)), 200);
337
+ }
338
+ cleanAttempt(attempt) {
339
+ const text = attempt.textAttempt === null ? null : this.infos.get(attempt.textAttempt) ?? null;
340
+ const usage = attempt.usage
341
+ ? { inputTokens: number(attempt.usage.inputTokens) ?? 0, outputTokens: number(attempt.usage.outputTokens) ?? 0, cachedInputTokens: number(attempt.usage.cachedInputTokens) ?? 0 }
342
+ : null;
343
+ return {
344
+ index: attempt.index,
345
+ textAttempt: attempt.textAttempt ?? null,
346
+ text,
347
+ provider: this.short(attempt.provider),
348
+ model: this.short(attempt.model),
349
+ integrationId: this.short(attempt.integrationId),
350
+ endpoint: endpointOrigin(attempt.endpoint),
351
+ stream: attempt.stream === true,
352
+ tools: attempt.tools === true,
353
+ firstByteMs: number(attempt.firstByteMs),
354
+ durationMs: number(attempt.durationMs),
355
+ outcome: attempt.outcome,
356
+ finishReason: this.short(attempt.finishReason),
357
+ reasoningCharacters: number(attempt.reasoningCharacters),
358
+ usage,
359
+ usageKnown: flag(attempt.usageKnown),
360
+ cost: number(attempt.cost),
361
+ costKnown: flag(attempt.costKnown),
362
+ currency: this.short(attempt.currency),
363
+ transport: this.cleanTransport(attempt.transport),
364
+ error: attempt.error
365
+ ? {
366
+ name: this.short(attempt.error.name) ?? "Error",
367
+ message: clip(this.redact(attempt.error.message ?? ""), AI_CALL_ERROR_CHARACTERS),
368
+ status: number(attempt.error.status),
369
+ transient: attempt.error.transient === true,
370
+ timedOut: attempt.error.timedOut === true,
371
+ }
372
+ : null,
373
+ partialCharacters: number(attempt.partialCharacters),
374
+ };
375
+ }
376
+ cleanTransport(transport) {
377
+ if (!transport)
378
+ return null;
379
+ const out = {};
380
+ for (const key of ["status", "bytes", "chunks", "events", "lastChunkAfterMs", "silentMs", "partialCharacters"]) {
381
+ const value = number(transport[key]);
382
+ if (value !== null)
383
+ out[key] = value;
384
+ }
385
+ for (const key of ["usageReceived", "usageRequested"]) {
386
+ const value = flag(transport[key]);
387
+ if (value !== null)
388
+ out[key] = value;
389
+ }
390
+ for (const key of ["end", "finishReason", "requestId"]) {
391
+ const value = this.short(transport[key]);
392
+ if (value !== null)
393
+ out[key] = value;
394
+ }
395
+ if (transport.tail !== undefined)
396
+ out.tail = clip(this.redact(transport.tail), 300);
397
+ return out;
398
+ }
399
+ }
400
+ //# sourceMappingURL=recorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../../src/autopilot/calls/recorder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EACvB,UAAU,EACV,cAAc,GASf,MAAM,YAAY,CAAC;AAEpB,uJAAuJ;AACvJ,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,2KAA2K;AAC3K,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AASrC,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,GAAG,EAAE,GAAG,EAAE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OAAO,IAAI,CAAC;QAC5B,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,KAAK,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,mBAAmB,CAAU,EAAE,CAAC;YACxH,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YACrC,IAAI,KAAK,KAAK,IAAI;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAU,EAAE,CAAC;YAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YACnC,IAAI,KAAK,KAAK,IAAI;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CAAU,EAAE,CAAC;YAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;YACzC,IAAI,KAAK,KAAK,IAAI;gBAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;QACD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACpF,OAAO,GAA+B,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ /** What the retention policy needs of a task: its size, its pin, whether it runs, and when it started. Never its texts. */
2
+ export interface RetentionTask {
3
+ activityId: string;
4
+ bytes: number;
5
+ pinned: boolean;
6
+ running: boolean;
7
+ /** ISO time: the order of the tasks (oldest first). */
8
+ startedAt: string;
9
+ }
10
+ /** What the policy decided: the tasks to drop, oldest first, and what is kept. */
11
+ export interface RetentionPlan {
12
+ drop: string[];
13
+ bytes: number;
14
+ droppedBytes: number;
15
+ pinnedTasks: number;
16
+ pinnedBytes: number;
17
+ /** The pinned and running tasks alone exceed the budget: nothing else can be dropped. */
18
+ overBudget: boolean;
19
+ }
20
+ /**
21
+ * The retention of a book's calls, as a pure function: when the tasks keep more than `budget` bytes, the oldest unpinned tasks that are not running
22
+ * are dropped, whole, until they keep no more than the budget. Pinned tasks count against the budget but are never dropped. The sort is by
23
+ * `startedAt` then `activityId`, so the same tasks always give the same plan. The cost is O(n log n) in the number of tasks, and no text is read or
24
+ * copied: the input is only headers.
25
+ */
26
+ export declare function planRetention(tasks: readonly RetentionTask[], budget: number): RetentionPlan;
27
+ //# sourceMappingURL=retention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.d.ts","sourceRoot":"","sources":["../../../src/autopilot/calls/retention.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAwB5F"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The retention of a book's calls, as a pure function: when the tasks keep more than `budget` bytes, the oldest unpinned tasks that are not running
3
+ * are dropped, whole, until they keep no more than the budget. Pinned tasks count against the budget but are never dropped. The sort is by
4
+ * `startedAt` then `activityId`, so the same tasks always give the same plan. The cost is O(n log n) in the number of tasks, and no text is read or
5
+ * copied: the input is only headers.
6
+ */
7
+ export function planRetention(tasks, budget) {
8
+ let bytes = 0;
9
+ let pinnedTasks = 0;
10
+ let pinnedBytes = 0;
11
+ for (const task of tasks) {
12
+ bytes += task.bytes;
13
+ if (task.pinned) {
14
+ pinnedTasks += 1;
15
+ pinnedBytes += task.bytes;
16
+ }
17
+ }
18
+ const plan = { drop: [], bytes, droppedBytes: 0, pinnedTasks, pinnedBytes, overBudget: false };
19
+ if (bytes > budget) {
20
+ const candidates = tasks.filter((task) => !task.pinned && !task.running);
21
+ candidates.sort((left, right) => (left.startedAt < right.startedAt ? -1 : left.startedAt > right.startedAt ? 1 : left.activityId < right.activityId ? -1 : left.activityId > right.activityId ? 1 : 0));
22
+ for (const task of candidates) {
23
+ if (plan.bytes <= budget)
24
+ break;
25
+ plan.drop.push(task.activityId);
26
+ plan.bytes -= task.bytes;
27
+ plan.droppedBytes += task.bytes;
28
+ }
29
+ }
30
+ plan.overBudget = plan.bytes > budget;
31
+ return plan;
32
+ }
33
+ //# sourceMappingURL=retention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retention.js","sourceRoot":"","sources":["../../../src/autopilot/calls/retention.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAA+B,EAAE,MAAc;IAC3E,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;QACpB,IAAI,IAAI,CAAC,MAAM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AI,CAAC,KAAK,GAAG,MAAM,CAAC;IACtC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { type AiResponse } from "../../ai/types.js";
2
+ import type { FetchAiAttempt, FetchAiAttemptEnd } from "../../ai/fetch-client.js";
3
+ import type { AutopilotTaskKind } from "../types.js";
4
+ import { CallRecorder } from "./recorder.js";
5
+ import type { AiCallStore } from "./port.js";
6
+ import { type AiCallDropReason, type AiCallHost, type AiCallStatus, type AiCallTaskDraft } from "./types.js";
7
+ export interface RunCallsOptions {
8
+ store: AiCallStore;
9
+ bookId: string;
10
+ accountScope: string | null;
11
+ host: AiCallHost;
12
+ /** The budget of the book's records: after each task the oldest finished tasks are dropped until the book keeps this many bytes. */
13
+ budgetBytes?: number;
14
+ /** The known secret values of the host, redacted from every record. */
15
+ secrets: () => readonly string[];
16
+ /** Called once per run with the first failure of the store: the run says it, and keeps going without records. */
17
+ onFailure: (error: unknown) => void;
18
+ now: () => Date;
19
+ }
20
+ /** What a call is, as the runner knows it when the call starts. */
21
+ export interface CallStart {
22
+ runId: string;
23
+ activityId: string;
24
+ seq: number;
25
+ stepAttempt: number;
26
+ task: AutopilotTaskKind;
27
+ chapter: number | null;
28
+ scene: number | null;
29
+ label: string;
30
+ capability: string;
31
+ system: string;
32
+ user: string;
33
+ structured: boolean;
34
+ tool: string | null;
35
+ toolSchemaHash: string | null;
36
+ maxOutputTokens: number | null;
37
+ temperature: number | null;
38
+ }
39
+ /** What a call kept, once it ended: what the runner tells its listeners (never the text). */
40
+ export interface CallEndInfo {
41
+ callId: string;
42
+ status: AiCallStatus;
43
+ attempts: number;
44
+ characters: number;
45
+ storedBytes: number;
46
+ partial: boolean;
47
+ dropped: AiCallDropReason | null;
48
+ durationMs: number;
49
+ }
50
+ /**
51
+ * The records of one autopilot run: one recorder per AI call, the task headers, and the budget. A store failure stops the records for the rest of the
52
+ * run (reported once through `onFailure`); it never fails a step, and nothing waits for the store.
53
+ */
54
+ export declare class RunCalls {
55
+ private readonly options;
56
+ private stopped;
57
+ constructor(options: RunCallsOptions);
58
+ get active(): boolean;
59
+ saveTask(draft: AiCallTaskDraft): void;
60
+ prune(): void;
61
+ start(input: CallStart): CallRecording | null;
62
+ private fail;
63
+ private settle;
64
+ }
65
+ /**
66
+ * One AI call of a step: the recorder, and the provider attempts of the call. Its `onAttempt` and `onAttemptEnd` are the client's per-request hooks.
67
+ *
68
+ * Attempts and texts: the recorder numbers the texts it receives (a text attempt starts at a text that is not longer than the one before it, and
69
+ * at the first text). A provider attempt has the text attempt of the text it started, when it produced one (`textAttempt`), and no text otherwise.
70
+ * An attempt that fails after the model answered keeps its text as the text attempt it started; the next attempt starts a new one, because the
71
+ * client resets the text when a candidate fails.
72
+ */
73
+ export declare class CallRecording {
74
+ private readonly recorder;
75
+ private readonly input;
76
+ private readonly now;
77
+ readonly callId: string;
78
+ readonly seq: number;
79
+ readonly systemBytes: number;
80
+ readonly userBytes: number;
81
+ private readonly startedMs;
82
+ private readonly open;
83
+ private readonly reports;
84
+ private hooked;
85
+ private index;
86
+ private result;
87
+ constructor(recorder: CallRecorder, input: CallStart, systemBytes: number, userBytes: number, now: () => Date);
88
+ /** The cumulative text of the reply (`onText`), or of the arguments of a structured reply (`onStructuredText`). */
89
+ onText(text: string): void;
90
+ readonly onAttempt: (attempt: FetchAiAttempt) => void;
91
+ readonly onAttemptEnd: (end: FetchAiAttemptEnd) => void;
92
+ /**
93
+ * Ends the call: `status` is what happened (`statusOf`), and `response` or `error` is what the call gave. Idempotent. Returns what the call kept.
94
+ * Without the client's attempt hooks (a host that does not forward them) the attempt is taken from the response or the error.
95
+ */
96
+ end(status: Exclude<AiCallStatus, "running">, outcome?: {
97
+ response?: AiResponse;
98
+ error?: unknown;
99
+ }): CallEndInfo;
100
+ private synthesize;
101
+ }
102
+ /** The status of a call that ended with `error` (or none). An abort is `aborted`: the run stopped while the call was running. */
103
+ export declare function statusOf(error: unknown, aborted?: boolean): Exclude<AiCallStatus, "running">;
104
+ /** A stable hash of a schema (FNV-1a, 8 hex digits): what a record keeps of a structured reply's schema, never the schema itself. */
105
+ export declare function schemaHashOf(value: unknown): string;
106
+ //# sourceMappingURL=run-calls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-calls.d.ts","sourceRoot":"","sources":["../../../src/autopilot/calls/run-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,KAAK,UAAU,EAA+B,MAAM,mBAAmB,CAAC;AAC5H,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAkE,KAAK,gBAAgB,EAAoB,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAM/L,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,oIAAoI;IACpI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,OAAO,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IACjC,iHAAiH;IACjH,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,GAAG,EAAE,MAAM,IAAI,CAAC;CACjB;AAED,mEAAmE;AACnE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAA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