@ai-matrx/desktop-protocol 0.21.57 → 0.21.59

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/dist/frame.js CHANGED
@@ -1,124 +1,19 @@
1
- // src/error.ts
2
- var DesktopProtocolError = class _DesktopProtocolError extends Error {
3
- code;
4
- retryable;
5
- data;
6
- constructor(code, message, options = {}) {
7
- super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
8
- this.name = "DesktopProtocolError";
9
- this.code = code;
10
- this.retryable = options.retryable ?? false;
11
- this.data = options.data;
12
- }
13
- /**
14
- * Any thrown value as a DesktopProtocolError, keeping its code, message and data. Each built entry
15
- * (`.`, `./client`, `./react`) carries its own copy of this class, so `instanceof` alone misses an
16
- * error thrown by a sibling entry and reports a real NOT_FOUND as INTERNAL; this checks the shape.
17
- */
18
- static from(caught) {
19
- if (caught instanceof _DesktopProtocolError) return caught;
20
- const e = caught;
21
- if (e && typeof e === "object" && e.name === "DesktopProtocolError" && typeof e.code === "string") {
22
- return new _DesktopProtocolError(e.code, typeof e.message === "string" ? e.message : String(e.code), {
23
- retryable: e.retryable === true,
24
- ...e.data && typeof e.data === "object" ? { data: e.data } : {},
25
- cause: caught
26
- });
27
- }
28
- return new _DesktopProtocolError("INTERNAL", caught instanceof Error ? caught.message : String(caught), { cause: caught });
29
- }
30
- /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */
31
- toBody() {
32
- return this.data === void 0 ? { code: this.code, message: this.message, retryable: this.retryable } : { code: this.code, message: this.message, retryable: this.retryable, data: this.data };
33
- }
34
- };
35
-
36
- // src/frame.ts
37
- var FRAME_HEADER_BYTES = 16;
38
- var FRAME_VERSION = 1;
39
- var FRAME_STRUCT_FORMAT = ">BBBBIII";
40
- var FrameFlag = { FIN: 1, REPLAY: 2 };
41
- var FrameChannel = {
42
- /** core→client: pty output, fs.read_stream bytes */
43
- DATA: 0,
44
- /** core→client: stderr of a non-pty process (reserved for exec.spawn in v1.1) */
45
- STDERR: 1,
46
- /** client→core: keystrokes / stdin to sid */
47
- STDIN: 2,
48
- /** core→client: serialized terminal screen (attach when since_seq is outside the ring) */
49
- SNAPSHOT: 3,
50
- /** relay↔device hop only: a JSON envelope carried inside a binary frame so the relay can route
51
- * by cid without parsing JSON. Never seen by clients. */
52
- ENVELOPE: 255
53
- };
54
- var U32_MAX = 4294967295;
55
- var CHANNELS = new Set(Object.values(FrameChannel));
56
- function frameError(message) {
57
- return new DesktopProtocolError("PROTOCOL_ERROR", message);
58
- }
59
- function checkU32(name, value) {
60
- if (!Number.isInteger(value) || value < 0 || value > U32_MAX) throw frameError(`frame ${name} is not a u32: ${value}`);
61
- }
62
- function assertFrameHeader(h) {
63
- if (h.version !== FRAME_VERSION) throw frameError(`unsupported frame version ${String(h.version)}`);
64
- if (!Number.isInteger(h.flags) || h.flags < 0 || h.flags > 3) throw frameError(`reserved frame flag bits set: ${h.flags}`);
65
- if (!CHANNELS.has(h.channel)) throw frameError(`unknown frame channel ${String(h.channel)}`);
66
- checkU32("cid", h.cid);
67
- checkU32("sid", h.sid);
68
- checkU32("seq", h.seq);
69
- }
70
- function encodeFrame(h, payload) {
71
- assertFrameHeader(h);
72
- const out = new Uint8Array(FRAME_HEADER_BYTES + payload.byteLength);
73
- const v = new DataView(out.buffer);
74
- v.setUint8(0, h.version);
75
- v.setUint8(1, h.flags);
76
- v.setUint8(2, h.channel);
77
- v.setUint8(3, 0);
78
- v.setUint32(4, h.cid);
79
- v.setUint32(8, h.sid);
80
- v.setUint32(12, h.seq);
81
- out.set(payload, FRAME_HEADER_BYTES);
82
- return out;
83
- }
84
- function decodeFrame(buf) {
85
- const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
86
- if (bytes.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${bytes.byteLength} bytes`);
87
- const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
88
- if (v.getUint8(3) !== 0) throw frameError("reserved frame byte 3 is not 0");
89
- const header = {
90
- version: v.getUint8(0),
91
- flags: v.getUint8(1),
92
- channel: v.getUint8(2),
93
- cid: v.getUint32(4),
94
- sid: v.getUint32(8),
95
- seq: v.getUint32(12)
96
- };
97
- assertFrameHeader(header);
98
- return { header, payload: bytes.subarray(FRAME_HEADER_BYTES) };
99
- }
100
- function readCid(frame) {
101
- if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
102
- return new DataView(frame.buffer, frame.byteOffset, frame.byteLength).getUint32(4);
103
- }
104
- function stampCid(frame, cid) {
105
- if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
106
- checkU32("cid", cid);
107
- new DataView(frame.buffer, frame.byteOffset, frame.byteLength).setUint32(4, cid);
108
- return frame;
109
- }
110
- function hasFlag(header, flag) {
111
- return (header.flags & flag) !== 0;
112
- }
113
- var BROADCAST_CID = 0;
114
- function connectionEndFrame(cid) {
115
- if (cid === BROADCAST_CID) throw frameError("a connection end needs a client cid, not the broadcast cid 0");
116
- return encodeFrame({ version: FRAME_VERSION, flags: FrameFlag.FIN, channel: FrameChannel.ENVELOPE, cid, sid: 0, seq: 0 }, new Uint8Array(0));
117
- }
118
- function isConnectionEnd(frame) {
119
- const h = frame.header;
120
- return h.channel === FrameChannel.ENVELOPE && hasFlag(h, FrameFlag.FIN) && frame.payload.byteLength === 0 && h.cid !== BROADCAST_CID;
121
- }
1
+ import {
2
+ BROADCAST_CID,
3
+ FRAME_HEADER_BYTES,
4
+ FRAME_STRUCT_FORMAT,
5
+ FRAME_VERSION,
6
+ FrameChannel,
7
+ FrameFlag,
8
+ assertFrameHeader,
9
+ connectionEndFrame,
10
+ decodeFrame,
11
+ encodeFrame,
12
+ hasFlag,
13
+ isConnectionEnd,
14
+ readCid,
15
+ stampCid
16
+ } from "./chunk-server-OVLU5III.js";
122
17
  export {
123
18
  BROADCAST_CID,
124
19
  FRAME_HEADER_BYTES,
package/dist/frame.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/error.ts","../src/frame.ts"],"sourcesContent":["/**\n * The one error type every package entry throws. It carries the wire ErrorCode (SPEC §5), so a\n * caller branches on `code`/`retryable`/`data.reason` and never parses a message. Zod-free on\n * purpose: `./frame` (the relay hot path) throws it without pulling the schema graph.\n */\nimport type { ErrorCodeName, ErrorData } from \"./types\";\n\nexport class DesktopProtocolError extends Error {\n readonly code: ErrorCodeName;\n readonly retryable: boolean;\n readonly data: ErrorData | undefined;\n\n constructor(code: ErrorCodeName, message: string, options: { retryable?: boolean; data?: ErrorData; cause?: unknown } = {}) {\n super(message, options.cause === undefined ? undefined : { cause: options.cause });\n this.name = \"DesktopProtocolError\";\n this.code = code;\n this.retryable = options.retryable ?? false;\n this.data = options.data;\n }\n\n /**\n * Any thrown value as a DesktopProtocolError, keeping its code, message and data. Each built entry\n * (`.`, `./client`, `./react`) carries its own copy of this class, so `instanceof` alone misses an\n * error thrown by a sibling entry and reports a real NOT_FOUND as INTERNAL; this checks the shape.\n */\n static from(caught: unknown): DesktopProtocolError {\n if (caught instanceof DesktopProtocolError) return caught;\n const e = caught as { name?: unknown; code?: unknown; message?: unknown; retryable?: unknown; data?: unknown } | null;\n if (e && typeof e === \"object\" && e.name === \"DesktopProtocolError\" && typeof e.code === \"string\") {\n return new DesktopProtocolError(e.code as ErrorCodeName, typeof e.message === \"string\" ? e.message : String(e.code), {\n retryable: e.retryable === true,\n ...(e.data && typeof e.data === \"object\" ? { data: e.data as ErrorData } : {}),\n cause: caught,\n });\n }\n return new DesktopProtocolError(\"INTERNAL\", caught instanceof Error ? caught.message : String(caught), { cause: caught });\n }\n\n /** The wire body (ProtocolErrorBody) — what a core or relay sends for this error. */\n toBody(): { code: ErrorCodeName; message: string; retryable: boolean; data?: ErrorData } {\n return this.data === undefined\n ? { code: this.code, message: this.message, retryable: this.retryable }\n : { code: this.code, message: this.message, retryable: this.retryable, data: this.data };\n }\n}\n\nexport function isDesktopProtocolError(value: unknown): value is DesktopProtocolError {\n return value instanceof DesktopProtocolError || (value instanceof Error && value.name === \"DesktopProtocolError\" && \"code\" in value);\n}\n","/**\n * `@ai-matrx/desktop-protocol/frame` — the 16-byte binary frame codec. ZOD-FREE by design: the\n * relay Worker's hot path imports only this entry and must stay tiny.\n *\n * off size field notes\n * 0 u8 version = 1\n * 1 u8 flags bit0 FIN (last frame of this stream), bit1 REPLAY (from ring buffer),\n * bits2-7 reserved = 0\n * 2 u8 channel see FrameChannel\n * 3 u8 reserved = 0\n * 4 u32 cid relay connection id. 0 on every client↔relay hop; the relay stamps it on\n * the relay→device hop and strips it on the way back (rewrites 4 bytes in\n * place — the relay never parses payloads).\n * 8 u32 sid stream id, announced by the core in stream{meta:{kind:\"open\",sid}}\n * 12 u32 seq per-stream frame sequence, starts at 1, strictly +1\n *\n * Big-endian. Payload length = message length − 16 (one frame = one WS binary message).\n * Python struct format: \">BBBBIII\". The zod twin (FrameHeader in the root entry, and so the JSON\n * Schema and Pydantic model) is checked against this file by src/frame.test.ts.\n */\nimport { DesktopProtocolError } from \"./error\";\n\nexport const FRAME_HEADER_BYTES = 16 as const;\nexport const FRAME_VERSION = 1 as const;\nexport const FRAME_STRUCT_FORMAT = \">BBBBIII\" as const;\nexport const FrameFlag = { FIN: 0b01, REPLAY: 0b10 } as const;\nexport const FrameChannel = {\n /** core→client: pty output, fs.read_stream bytes */\n DATA: 0,\n /** core→client: stderr of a non-pty process (reserved for exec.spawn in v1.1) */\n STDERR: 1,\n /** client→core: keystrokes / stdin to sid */\n STDIN: 2,\n /** core→client: serialized terminal screen (attach when since_seq is outside the ring) */\n SNAPSHOT: 3,\n /** relay↔device hop only: a JSON envelope carried inside a binary frame so the relay can route\n * by cid without parsing JSON. Never seen by clients. */\n ENVELOPE: 255,\n} as const;\n\nexport type FrameChannelValue = (typeof FrameChannel)[keyof typeof FrameChannel];\n\nexport interface FrameHeader {\n version: typeof FRAME_VERSION;\n /** 0..3 — FrameFlag bits. */\n flags: number;\n channel: FrameChannelValue;\n cid: number;\n sid: number;\n seq: number;\n}\n\nexport interface DecodedFrame {\n header: FrameHeader;\n /** A VIEW into the input buffer (no copy). Copy it if you keep it past the input's lifetime. */\n payload: Uint8Array;\n}\n\nconst U32_MAX = 4_294_967_295;\nconst CHANNELS: ReadonlySet<number> = new Set(Object.values(FrameChannel));\n\nfunction frameError(message: string): DesktopProtocolError {\n return new DesktopProtocolError(\"PROTOCOL_ERROR\", message);\n}\n\nfunction checkU32(name: string, value: number): void {\n if (!Number.isInteger(value) || value < 0 || value > U32_MAX) throw frameError(`frame ${name} is not a u32: ${value}`);\n}\n\n/** Validate a header without zod. Throws DesktopProtocolError(PROTOCOL_ERROR). */\nexport function assertFrameHeader(h: FrameHeader): void {\n if (h.version !== FRAME_VERSION) throw frameError(`unsupported frame version ${String(h.version)}`);\n if (!Number.isInteger(h.flags) || h.flags < 0 || h.flags > 3) throw frameError(`reserved frame flag bits set: ${h.flags}`);\n if (!CHANNELS.has(h.channel)) throw frameError(`unknown frame channel ${String(h.channel)}`);\n checkU32(\"cid\", h.cid);\n checkU32(\"sid\", h.sid);\n checkU32(\"seq\", h.seq);\n}\n\nexport function encodeFrame(h: FrameHeader, payload: Uint8Array): Uint8Array {\n assertFrameHeader(h);\n const out = new Uint8Array(FRAME_HEADER_BYTES + payload.byteLength);\n const v = new DataView(out.buffer);\n v.setUint8(0, h.version);\n v.setUint8(1, h.flags);\n v.setUint8(2, h.channel);\n v.setUint8(3, 0);\n v.setUint32(4, h.cid);\n v.setUint32(8, h.sid);\n v.setUint32(12, h.seq);\n out.set(payload, FRAME_HEADER_BYTES);\n return out;\n}\n\nexport function decodeFrame(buf: ArrayBuffer | Uint8Array): DecodedFrame {\n const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);\n if (bytes.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${bytes.byteLength} bytes`);\n const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n if (v.getUint8(3) !== 0) throw frameError(\"reserved frame byte 3 is not 0\");\n const header = {\n version: v.getUint8(0),\n flags: v.getUint8(1),\n channel: v.getUint8(2),\n cid: v.getUint32(4),\n sid: v.getUint32(8),\n seq: v.getUint32(12),\n } as FrameHeader;\n assertFrameHeader(header);\n return { header, payload: bytes.subarray(FRAME_HEADER_BYTES) };\n}\n\n/** Read only the 4-byte cid (relay routing) without decoding the rest. */\nexport function readCid(frame: Uint8Array): number {\n if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);\n return new DataView(frame.buffer, frame.byteOffset, frame.byteLength).getUint32(4);\n}\n\n/** Relay hot path: rewrite only the cid IN PLACE, never touch the payload. Returns the same array. */\nexport function stampCid(frame: Uint8Array, cid: number): Uint8Array {\n if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);\n checkU32(\"cid\", cid);\n new DataView(frame.buffer, frame.byteOffset, frame.byteLength).setUint32(4, cid);\n return frame;\n}\n\nexport function hasFlag(header: FrameHeader, flag: (typeof FrameFlag)[keyof typeof FrameFlag]): boolean {\n return (header.flags & flag) !== 0;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Relay ↔ device hop (never seen by clients). Every JSON envelope rides an ENVELOPE frame with\n// flags 0, sid 0, seq 0 and the client's cid; byte frames carry that cid too.\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** cid 0 on an ENVELOPE frame from the device: the relay delivers it to every client. */\nexport const BROADCAST_CID = 0 as const;\n\n/**\n * Connection end: an ENVELOPE frame with FIN, sid 0, seq 0 and NO payload, for connection `cid`.\n * Relay → device: client `cid` is gone — cancel its streams, detach its sessions (idempotent; it\n * may arrive more than once). Device → relay: close client `cid`.\n */\nexport function connectionEndFrame(cid: number): Uint8Array {\n if (cid === BROADCAST_CID) throw frameError(\"a connection end needs a client cid, not the broadcast cid 0\");\n return encodeFrame({ version: FRAME_VERSION, flags: FrameFlag.FIN, channel: FrameChannel.ENVELOPE, cid, sid: 0, seq: 0 }, new Uint8Array(0));\n}\n\n/** True for a decoded connection-end frame (see connectionEndFrame). */\nexport function isConnectionEnd(frame: DecodedFrame): boolean {\n const h = frame.header;\n return h.channel === FrameChannel.ENVELOPE && hasFlag(h, FrameFlag.FIN) && frame.payload.byteLength === 0 && h.cid !== BROADCAST_CID;\n}\n"],"mappings":";AAOO,IAAM,uBAAN,MAAM,8BAA6B,MAAM;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAqB,SAAiB,UAAsE,CAAC,GAAG;AAC1H,UAAM,SAAS,QAAQ,UAAU,SAAY,SAAY,EAAE,OAAO,QAAQ,MAAM,CAAC;AACjF,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,YAAY,QAAQ,aAAa;AACtC,SAAK,OAAO,QAAQ;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,KAAK,QAAuC;AACjD,QAAI,kBAAkB,sBAAsB,QAAO;AACnD,UAAM,IAAI;AACV,QAAI,KAAK,OAAO,MAAM,YAAY,EAAE,SAAS,0BAA0B,OAAO,EAAE,SAAS,UAAU;AACjG,aAAO,IAAI,sBAAqB,EAAE,MAAuB,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,OAAO,EAAE,IAAI,GAAG;AAAA,QACnH,WAAW,EAAE,cAAc;AAAA,QAC3B,GAAI,EAAE,QAAQ,OAAO,EAAE,SAAS,WAAW,EAAE,MAAM,EAAE,KAAkB,IAAI,CAAC;AAAA,QAC5E,OAAO;AAAA,MACT,CAAC;AAAA,IACH;AACA,WAAO,IAAI,sBAAqB,YAAY,kBAAkB,QAAQ,OAAO,UAAU,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;AAAA,EAC1H;AAAA;AAAA,EAGA,SAAyF;AACvF,WAAO,KAAK,SAAS,SACjB,EAAE,MAAM,KAAK,MAAM,SAAS,KAAK,SAAS,WAAW,KAAK,UAAU,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GAAG;AACnB,MAAI,SAAS,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU,EAAE,UAAU,GAAG,GAAG;AAC/E,SAAO;AACT;AAEO,SAAS,QAAQ,QAAqB,MAA2D;AACtG,UAAQ,OAAO,QAAQ,UAAU;AACnC;AAQO,IAAM,gBAAgB;AAOtB,SAAS,mBAAmB,KAAyB;AAC1D,MAAI,QAAQ,cAAe,OAAM,WAAW,8DAA8D;AAC1G,SAAO,YAAY,EAAE,SAAS,eAAe,OAAO,UAAU,KAAK,SAAS,aAAa,UAAU,KAAK,KAAK,GAAG,KAAK,EAAE,GAAG,IAAI,WAAW,CAAC,CAAC;AAC7I;AAGO,SAAS,gBAAgB,OAA8B;AAC5D,QAAM,IAAI,MAAM;AAChB,SAAO,EAAE,YAAY,aAAa,YAAY,QAAQ,GAAG,UAAU,GAAG,KAAK,MAAM,QAAQ,eAAe,KAAK,EAAE,QAAQ;AACzH;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs CHANGED
@@ -1401,7 +1401,7 @@ var FsListParams = import_zod6.z.strictObject({
1401
1401
  // glob on name
1402
1402
  limit: import_zod6.z.int().min(1).max(5e3).default(1e3),
1403
1403
  page_token: import_zod6.z.string().max(256).optional(),
1404
- // Desktop additions; their defaults ARE the daemon's behaviour: dotfiles listed, siblings in
1404
+ // Desktop additions; their defaults ARE the daemon's behavior: dotfiles listed, siblings in
1405
1405
  // binary (byte) order of name, depth-first.
1406
1406
  show_hidden: import_zod6.z.boolean().default(true),
1407
1407
  sort: import_zod6.z.enum(["name", "mtime", "size", "kind"]).default("name")
@@ -1775,7 +1775,7 @@ var MlProgress = import_zod10.z.strictObject({
1775
1775
  /** 0–1 when known (transcribe: audio covered so far; install: bytes so far). */
1776
1776
  fraction: import_zod10.z.number().min(0).max(1).nullable(),
1777
1777
  install: MlInstallProgress.nullable(),
1778
- /** The segment just transcribed (transcribe only): text appears as it is recognised. */
1778
+ /** The segment just transcribed (transcribe only): text appears as it is recognized. */
1779
1779
  segment: TranscriptSegment.nullable()
1780
1780
  });
1781
1781
  var TextModelId = ModelKey;
@@ -1943,7 +1943,7 @@ var AccountAgent = import_zod11.z.strictObject({
1943
1943
  // 1.39: the catalogue's own row (agx_get_list_full, read whole through @ai-matrx/agents/catalog).
1944
1944
  /** The agent's tags (the library's search and its inspector). */
1945
1945
  tags: import_zod11.z.array(import_zod11.z.string().max(120)).max(50).optional(),
1946
- /** The model it runs (a model catalogue id); absent when it names none. */
1946
+ /** The model it runs (a model catalog id); absent when it names none. */
1947
1947
  model_id: AccountRowId.optional(),
1948
1948
  /** The person's access: owner, admin, editor, viewer or system (the database's own words); absent when unknown. */
1949
1949
  access_level: import_zod11.z.string().min(1).max(40).optional(),
@@ -1979,7 +1979,7 @@ var AccountAgentDetail = import_zod11.z.strictObject({
1979
1979
  custom_tool_count: import_zod11.z.int().min(0),
1980
1980
  skill_count: import_zod11.z.int().min(0),
1981
1981
  connection_count: import_zod11.z.int().min(0),
1982
- /** The model's display name when the catalogue knows it. */
1982
+ /** The model's display name when the catalog knows it. */
1983
1983
  model_name: import_zod11.z.string().max(200).nullable()
1984
1984
  });
1985
1985
  var AccountAgentsGetParams = import_zod11.z.strictObject({ agent_id: AccountRowId });
@@ -3978,7 +3978,7 @@ var StackLogsParams = import_zod29.z.strictObject({
3978
3978
  wait_ms: import_zod29.z.int().min(0).max(25e3).default(0)
3979
3979
  });
3980
3980
  var StackLogsResult = import_zod29.z.strictObject({
3981
- /** Complete lines, colour codes removed. */
3981
+ /** Complete lines, color codes removed. */
3982
3982
  lines: import_zod29.z.array(import_zod29.z.string().max(65536)).max(2e5),
3983
3983
  /** Where these lines end: pass it back as `offset` to follow. */
3984
3984
  offset: nonNegInt,
@@ -5225,7 +5225,7 @@ var ScheduleCreateParams = import_zod39.z.strictObject({
5225
5225
  /** The op's params, exactly as the op takes them; checked when the task is created. */
5226
5226
  params: import_zod39.z.record(import_zod39.z.string(), import_zod39.z.unknown()).default({}),
5227
5227
  interval_s: import_zod39.z.int().min(10).max(2592e3),
5228
- /** Stop after this many runs; absent: until cancelled. */
5228
+ /** Stop after this many runs; absent: until canceled. */
5229
5229
  max_runs: import_zod39.z.int().min(1).max(1e5).optional(),
5230
5230
  /** Run once now, before the first interval. */
5231
5231
  run_now: import_zod39.z.boolean().default(false)
@@ -5249,7 +5249,7 @@ var ScheduledTask = import_zod39.z.strictObject({
5249
5249
  runs: nonNegInt,
5250
5250
  created_at_ms: epochMs,
5251
5251
  next_run_at_ms: epochMs.nullable(),
5252
- /** active, done (ran max_runs), cancelled. */
5252
+ /** active, done (ran max_runs), canceled. */
5253
5253
  state: import_zod39.z.enum(["active", "done", "cancelled"]),
5254
5254
  /** The newest runs, newest first (at most 10). */
5255
5255
  recent: import_zod39.z.array(ScheduleRun)