@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.
@@ -0,0 +1,144 @@
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
+ function isDesktopProtocolError(value) {
36
+ return value instanceof DesktopProtocolError || value instanceof Error && value.name === "DesktopProtocolError" && "code" in value;
37
+ }
38
+
39
+ // src/frame.ts
40
+ var FRAME_HEADER_BYTES = 16;
41
+ var FRAME_VERSION = 1;
42
+ var FRAME_STRUCT_FORMAT = ">BBBBIII";
43
+ var FrameFlag = { FIN: 1, REPLAY: 2 };
44
+ var FrameChannel = {
45
+ /** core→client: pty output, fs.read_stream bytes */
46
+ DATA: 0,
47
+ /** core→client: stderr of a non-pty process (reserved for exec.spawn in v1.1) */
48
+ STDERR: 1,
49
+ /** client→core: keystrokes / stdin to sid */
50
+ STDIN: 2,
51
+ /** core→client: serialized terminal screen (attach when since_seq is outside the ring) */
52
+ SNAPSHOT: 3,
53
+ /** relay↔device hop only: a JSON envelope carried inside a binary frame so the relay can route
54
+ * by cid without parsing JSON. Never seen by clients. */
55
+ ENVELOPE: 255
56
+ };
57
+ var U32_MAX = 4294967295;
58
+ var CHANNELS = new Set(Object.values(FrameChannel));
59
+ function frameError(message) {
60
+ return new DesktopProtocolError("PROTOCOL_ERROR", message);
61
+ }
62
+ function checkU32(name, value) {
63
+ if (!Number.isInteger(value) || value < 0 || value > U32_MAX) throw frameError(`frame ${name} is not a u32: ${value}`);
64
+ }
65
+ function assertFrameHeader(h) {
66
+ if (h.version !== FRAME_VERSION) throw frameError(`unsupported frame version ${String(h.version)}`);
67
+ if (!Number.isInteger(h.flags) || h.flags < 0 || h.flags > 3) throw frameError(`reserved frame flag bits set: ${h.flags}`);
68
+ if (!CHANNELS.has(h.channel)) throw frameError(`unknown frame channel ${String(h.channel)}`);
69
+ checkU32("cid", h.cid);
70
+ checkU32("sid", h.sid);
71
+ checkU32("seq", h.seq);
72
+ }
73
+ function encodeFrame(h, payload) {
74
+ assertFrameHeader(h);
75
+ const out = new Uint8Array(FRAME_HEADER_BYTES + payload.byteLength);
76
+ const v = new DataView(out.buffer);
77
+ v.setUint8(0, h.version);
78
+ v.setUint8(1, h.flags);
79
+ v.setUint8(2, h.channel);
80
+ v.setUint8(3, 0);
81
+ v.setUint32(4, h.cid);
82
+ v.setUint32(8, h.sid);
83
+ v.setUint32(12, h.seq);
84
+ out.set(payload, FRAME_HEADER_BYTES);
85
+ return out;
86
+ }
87
+ function decodeFrame(buf) {
88
+ const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
89
+ if (bytes.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${bytes.byteLength} bytes`);
90
+ const v = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
91
+ if (v.getUint8(3) !== 0) throw frameError("reserved frame byte 3 is not 0");
92
+ const header = {
93
+ version: v.getUint8(0),
94
+ flags: v.getUint8(1),
95
+ channel: v.getUint8(2),
96
+ cid: v.getUint32(4),
97
+ sid: v.getUint32(8),
98
+ seq: v.getUint32(12)
99
+ };
100
+ assertFrameHeader(header);
101
+ return { header, payload: bytes.subarray(FRAME_HEADER_BYTES) };
102
+ }
103
+ function readCid(frame) {
104
+ if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
105
+ return new DataView(frame.buffer, frame.byteOffset, frame.byteLength).getUint32(4);
106
+ }
107
+ function stampCid(frame, cid) {
108
+ if (frame.byteLength < FRAME_HEADER_BYTES) throw frameError(`short frame: ${frame.byteLength} bytes`);
109
+ checkU32("cid", cid);
110
+ new DataView(frame.buffer, frame.byteOffset, frame.byteLength).setUint32(4, cid);
111
+ return frame;
112
+ }
113
+ function hasFlag(header, flag) {
114
+ return (header.flags & flag) !== 0;
115
+ }
116
+ var BROADCAST_CID = 0;
117
+ function connectionEndFrame(cid) {
118
+ if (cid === BROADCAST_CID) throw frameError("a connection end needs a client cid, not the broadcast cid 0");
119
+ return encodeFrame({ version: FRAME_VERSION, flags: FrameFlag.FIN, channel: FrameChannel.ENVELOPE, cid, sid: 0, seq: 0 }, new Uint8Array(0));
120
+ }
121
+ function isConnectionEnd(frame) {
122
+ const h = frame.header;
123
+ return h.channel === FrameChannel.ENVELOPE && hasFlag(h, FrameFlag.FIN) && frame.payload.byteLength === 0 && h.cid !== BROADCAST_CID;
124
+ }
125
+
126
+ export {
127
+ DesktopProtocolError,
128
+ isDesktopProtocolError,
129
+ FRAME_HEADER_BYTES,
130
+ FRAME_VERSION,
131
+ FRAME_STRUCT_FORMAT,
132
+ FrameFlag,
133
+ FrameChannel,
134
+ assertFrameHeader,
135
+ encodeFrame,
136
+ decodeFrame,
137
+ readCid,
138
+ stampCid,
139
+ hasFlag,
140
+ BROADCAST_CID,
141
+ connectionEndFrame,
142
+ isConnectionEnd
143
+ };
144
+ //# sourceMappingURL=chunk-server-OVLU5III.js.map
@@ -0,0 +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,sBAAq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/D;AAGO,SAAS,QAAQ,OAA2B;AACjD,MAAI,MAAM,aAAa,mBAAoB,OAAM,WAAW,gBAAgB,MAAM,UAAU,QAAQ;AACpG,SAAO,IAAI,SAAS,MAAM,QAAQ,MAAM,YAAY,MAAM,UAAU,EAAE,UAAU,CAAC;AACnF;AAGO,SAAS,SAAS,OAAmB,KAAyB;AACnE,MAAI,MAAM,aAAa,mBAAoB,OAAM,WAAW,gBAAgB,MAAM,UAAU,QAAQ;AACpG,WAAS,OAAO,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":[]}
package/dist/client.cjs CHANGED
@@ -532,7 +532,7 @@ var FsListParams = import_zod6.z.strictObject({
532
532
  // glob on name
533
533
  limit: import_zod6.z.int().min(1).max(5e3).default(1e3),
534
534
  page_token: import_zod6.z.string().max(256).optional(),
535
- // Desktop additions; their defaults ARE the daemon's behaviour: dotfiles listed, siblings in
535
+ // Desktop additions; their defaults ARE the daemon's behavior: dotfiles listed, siblings in
536
536
  // binary (byte) order of name, depth-first.
537
537
  show_hidden: import_zod6.z.boolean().default(true),
538
538
  sort: import_zod6.z.enum(["name", "mtime", "size", "kind"]).default("name")
@@ -854,7 +854,7 @@ var MlProgress = import_zod9.z.strictObject({
854
854
  /** 0–1 when known (transcribe: audio covered so far; install: bytes so far). */
855
855
  fraction: import_zod9.z.number().min(0).max(1).nullable(),
856
856
  install: MlInstallProgress.nullable(),
857
- /** The segment just transcribed (transcribe only): text appears as it is recognised. */
857
+ /** The segment just transcribed (transcribe only): text appears as it is recognized. */
858
858
  segment: TranscriptSegment.nullable()
859
859
  });
860
860
  var TextModelId = ModelKey;
@@ -1412,7 +1412,7 @@ var AccountAgent = import_zod14.z.strictObject({
1412
1412
  // 1.39: the catalogue's own row (agx_get_list_full, read whole through @ai-matrx/agents/catalog).
1413
1413
  /** The agent's tags (the library's search and its inspector). */
1414
1414
  tags: import_zod14.z.array(import_zod14.z.string().max(120)).max(50).optional(),
1415
- /** The model it runs (a model catalogue id); absent when it names none. */
1415
+ /** The model it runs (a model catalog id); absent when it names none. */
1416
1416
  model_id: AccountRowId.optional(),
1417
1417
  /** The person's access: owner, admin, editor, viewer or system (the database's own words); absent when unknown. */
1418
1418
  access_level: import_zod14.z.string().min(1).max(40).optional(),
@@ -1448,7 +1448,7 @@ var AccountAgentDetail = import_zod14.z.strictObject({
1448
1448
  custom_tool_count: import_zod14.z.int().min(0),
1449
1449
  skill_count: import_zod14.z.int().min(0),
1450
1450
  connection_count: import_zod14.z.int().min(0),
1451
- /** The model's display name when the catalogue knows it. */
1451
+ /** The model's display name when the catalog knows it. */
1452
1452
  model_name: import_zod14.z.string().max(200).nullable()
1453
1453
  });
1454
1454
  var AccountAgentsGetParams = import_zod14.z.strictObject({ agent_id: AccountRowId });
@@ -2254,7 +2254,7 @@ var StackLogsParams = import_zod24.z.strictObject({
2254
2254
  wait_ms: import_zod24.z.int().min(0).max(25e3).default(0)
2255
2255
  });
2256
2256
  var StackLogsResult = import_zod24.z.strictObject({
2257
- /** Complete lines, colour codes removed. */
2257
+ /** Complete lines, color codes removed. */
2258
2258
  lines: import_zod24.z.array(import_zod24.z.string().max(65536)).max(2e5),
2259
2259
  /** Where these lines end: pass it back as `offset` to follow. */
2260
2260
  offset: nonNegInt,
@@ -4268,7 +4268,7 @@ var ScheduleCreateParams = import_zod37.z.strictObject({
4268
4268
  /** The op's params, exactly as the op takes them; checked when the task is created. */
4269
4269
  params: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.unknown()).default({}),
4270
4270
  interval_s: import_zod37.z.int().min(10).max(2592e3),
4271
- /** Stop after this many runs; absent: until cancelled. */
4271
+ /** Stop after this many runs; absent: until canceled. */
4272
4272
  max_runs: import_zod37.z.int().min(1).max(1e5).optional(),
4273
4273
  /** Run once now, before the first interval. */
4274
4274
  run_now: import_zod37.z.boolean().default(false)
@@ -4292,7 +4292,7 @@ var ScheduledTask = import_zod37.z.strictObject({
4292
4292
  runs: nonNegInt,
4293
4293
  created_at_ms: epochMs,
4294
4294
  next_run_at_ms: epochMs.nullable(),
4295
- /** active, done (ran max_runs), cancelled. */
4295
+ /** active, done (ran max_runs), canceled. */
4296
4296
  state: import_zod37.z.enum(["active", "done", "cancelled"]),
4297
4297
  /** The newest runs, newest first (at most 10). */
4298
4298
  recent: import_zod37.z.array(ScheduleRun)