@zaly/agent 0.0.3

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 (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/agent-BaD2kax9.mjs +68 -0
  4. package/dist/agent-BaD2kax9.mjs.map +1 -0
  5. package/dist/agent-GDLdDc2w.mjs +902 -0
  6. package/dist/agent-GDLdDc2w.mjs.map +1 -0
  7. package/dist/bash-QNMTQ1PD.mjs +142 -0
  8. package/dist/bash-QNMTQ1PD.mjs.map +1 -0
  9. package/dist/compactions-3AjPqjeZ.mjs +190 -0
  10. package/dist/compactions-3AjPqjeZ.mjs.map +1 -0
  11. package/dist/edit-Qxl4w1C2.mjs +170 -0
  12. package/dist/edit-Qxl4w1C2.mjs.map +1 -0
  13. package/dist/env-UUFv5Mye.mjs +30 -0
  14. package/dist/env-UUFv5Mye.mjs.map +1 -0
  15. package/dist/fetch-D8cmmA3E.mjs +111 -0
  16. package/dist/fetch-D8cmmA3E.mjs.map +1 -0
  17. package/dist/find-Bah9SKWX.mjs +87 -0
  18. package/dist/find-Bah9SKWX.mjs.map +1 -0
  19. package/dist/grep-B2Ax7ewy.mjs +244 -0
  20. package/dist/grep-B2Ax7ewy.mjs.map +1 -0
  21. package/dist/index-node-esm-D6YQRKEz.mjs +1537 -0
  22. package/dist/index-node-esm-D6YQRKEz.mjs.map +1 -0
  23. package/dist/index.d.mts +1605 -0
  24. package/dist/index.d.mts.map +1 -0
  25. package/dist/index.mjs +948 -0
  26. package/dist/index.mjs.map +1 -0
  27. package/dist/jsonl-Dw_VBp46.mjs +134 -0
  28. package/dist/jsonl-Dw_VBp46.mjs.map +1 -0
  29. package/dist/manager-D-lWBTHG.mjs +271 -0
  30. package/dist/manager-D-lWBTHG.mjs.map +1 -0
  31. package/dist/markdown-Bv4J8cg3.mjs +53 -0
  32. package/dist/markdown-Bv4J8cg3.mjs.map +1 -0
  33. package/dist/masker-Bv9KjkDF.mjs +396 -0
  34. package/dist/masker-Bv9KjkDF.mjs.map +1 -0
  35. package/dist/model-_3ZA2xqm.mjs +27 -0
  36. package/dist/model-_3ZA2xqm.mjs.map +1 -0
  37. package/dist/notify-DpG_m9iP.mjs +96 -0
  38. package/dist/notify-DpG_m9iP.mjs.map +1 -0
  39. package/dist/read-Djsx2NZl.mjs +205 -0
  40. package/dist/read-Djsx2NZl.mjs.map +1 -0
  41. package/dist/registry-CFmR5G3J.mjs +564 -0
  42. package/dist/registry-CFmR5G3J.mjs.map +1 -0
  43. package/dist/search-CRw247ES.mjs +121 -0
  44. package/dist/search-CRw247ES.mjs.map +1 -0
  45. package/dist/session/claude.d.mts +59 -0
  46. package/dist/session/claude.d.mts.map +1 -0
  47. package/dist/session/claude.mjs +455 -0
  48. package/dist/session/claude.mjs.map +1 -0
  49. package/dist/session-CUUdWFC5.mjs +450 -0
  50. package/dist/session-CUUdWFC5.mjs.map +1 -0
  51. package/dist/session-Ds5nJz5A.d.mts +346 -0
  52. package/dist/session-Ds5nJz5A.d.mts.map +1 -0
  53. package/dist/session.d.mts +37 -0
  54. package/dist/session.d.mts.map +1 -0
  55. package/dist/session.mjs +106 -0
  56. package/dist/session.mjs.map +1 -0
  57. package/dist/subagent-baqzjRMc.mjs +136 -0
  58. package/dist/subagent-baqzjRMc.mjs.map +1 -0
  59. package/dist/swarm-BJ3gQA1Z.mjs +194 -0
  60. package/dist/swarm-BJ3gQA1Z.mjs.map +1 -0
  61. package/dist/swarm-BuFx_xeY.mjs +109 -0
  62. package/dist/swarm-BuFx_xeY.mjs.map +1 -0
  63. package/dist/tasks-D8rARHZ1.mjs +65 -0
  64. package/dist/tasks-D8rARHZ1.mjs.map +1 -0
  65. package/dist/tasks-WmC270X2.mjs +615 -0
  66. package/dist/tasks-WmC270X2.mjs.map +1 -0
  67. package/dist/tools-DW1dbcCz.mjs +695 -0
  68. package/dist/tools-DW1dbcCz.mjs.map +1 -0
  69. package/dist/truncate-BSMXgiXj.mjs +102 -0
  70. package/dist/truncate-BSMXgiXj.mjs.map +1 -0
  71. package/dist/uuid-ByXP5SO5.mjs +59 -0
  72. package/dist/uuid-ByXP5SO5.mjs.map +1 -0
  73. package/dist/wakeup-BYqTnfSp.mjs +29 -0
  74. package/dist/wakeup-BYqTnfSp.mjs.map +1 -0
  75. package/dist/write-D3L-92vj.mjs +89 -0
  76. package/dist/write-D3L-92vj.mjs.map +1 -0
  77. package/package.json +63 -0
@@ -0,0 +1,205 @@
1
+ import { normPath, safeStat } from "@zaly/shared";
2
+ import { AiError, defineTool, extractToolResults, toAttachment } from "@zaly/ai";
3
+ import { stat } from "node:fs/promises";
4
+ import { Type } from "typebox";
5
+ import { normalizeEol } from "@zaly/shared/text";
6
+ import { fileDetect } from "@zaly/shared/detect";
7
+ //#region src/tools/read.ts
8
+ /**
9
+ * Read a file from disk.
10
+ *
11
+ * Output shape:
12
+ * - Text files → numbered lines, `cat -n` style (6-char padded number,
13
+ * tab, content). Line numbers reflect the absolute line in the file
14
+ * even when reading a slice via `offset`/`limit`.
15
+ * - Image files (png, jpeg, webp, gif, avif, …) → `ImagePart` attachment.
16
+ * The model sees the image natively if its modality supports it.
17
+ * - Other binary files → `BINARY_FILE` error with a hint.
18
+ *
19
+ * Path resolution: relative paths resolve against the agent's session
20
+ * cwd via `process.cwd()` for now. When the permission system gates this
21
+ * via a tool-side hook, the cwd from `PermissionContext` will be used
22
+ * instead so resolution stays consistent across the loop.
23
+ */
24
+ const DEFAULT_LIMIT = 2e3;
25
+ const MAX_LINE_LENGTH = 2e3;
26
+ function isFileMeta(meta) {
27
+ const m = meta;
28
+ return m !== void 0 && m !== null && typeof m === "object" && typeof m.path === "string" && typeof m.mtime === "number" && (m.kind === "read" || m.kind === "write" || m.kind === "edit");
29
+ }
30
+ /** Build the `read` tool with model-aware schema description. The
31
+ * attachment-shape blurb is included only when the loaded model
32
+ * actually accepts the relevant modality — text-only models see a
33
+ * description that promises only text output, so they don't reach
34
+ * for the tool expecting images they can't process. */
35
+ const readTool = defineTool({
36
+ name: "read",
37
+ desc: `Read a file. Text files return numbered lines (\`cat -n\` style). Image & PDF files are sent as attachments. Use \`offset\`/\`limit\` to slice large files.`,
38
+ parallel: true,
39
+ params: Type.Object({
40
+ path: Type.String({ description: "Path to the file. Absolute or cwd-relative." }),
41
+ offset: Type.Optional(Type.Integer({
42
+ default: 1,
43
+ description: "1-based line number to start at. Negative values count from the end: -50 starts 50 lines before EOF (so `offset: -50` with the default limit returns the last 50 lines, like `tail -n 50`). `offset: -50, limit: 20` reads 20 lines starting 50 from the end."
44
+ })),
45
+ limit: Type.Optional(Type.Integer({
46
+ default: DEFAULT_LIMIT,
47
+ description: "Maximum number of lines to return.",
48
+ minimum: 1
49
+ }))
50
+ }),
51
+ async preflight(args, ctx) {
52
+ const path = normPath(ctx.cwd, args.path);
53
+ await ctx.need?.("read", path);
54
+ },
55
+ async call(args, ctx) {
56
+ const path = normPath(ctx.cwd, args.path);
57
+ const fileStat = await stat(path).catch((error) => {
58
+ throw new AiError({
59
+ cause: error,
60
+ code: "NOT_FOUND",
61
+ message: `cannot read ${path}: file not found`
62
+ });
63
+ });
64
+ if (!fileStat.isFile()) throw new AiError({
65
+ code: "NOT_A_FILE",
66
+ message: `${path} is not a regular file`
67
+ });
68
+ if (isUnchanged(path, ctx)) {
69
+ ctx.meta = {
70
+ full: false,
71
+ kind: "read",
72
+ limit: 0,
73
+ mtime: fileStat.mtimeMs,
74
+ offset: 0,
75
+ path,
76
+ unchanged: true
77
+ };
78
+ return [{
79
+ content: `file unchanged since last read: ${path}`,
80
+ tag: "unchanged",
81
+ type: "meta"
82
+ }];
83
+ }
84
+ const file = await fileDetect(path);
85
+ if (!file) throw new AiError({
86
+ code: "READ_ERROR",
87
+ message: `${path}: could not read file`
88
+ });
89
+ if (file.type === "binary") throw new AiError({
90
+ code: "BINARY_FILE",
91
+ data: {
92
+ bytes: file.data.length,
93
+ path
94
+ },
95
+ message: `${path}: binary file (${file.data.length} bytes); not displayable as text`
96
+ });
97
+ const att = await toAttachment(file);
98
+ if (att) return [att];
99
+ if (file.type !== "text") throw new AiError({
100
+ code: "UNSUPPORTED_FILE",
101
+ data: {
102
+ path,
103
+ type: file.type
104
+ },
105
+ message: `${path}: unsupported file type ${file.type}`
106
+ });
107
+ const slice = formatTextSlice(new TextDecoder().decode(file.data), {
108
+ limit: args.limit ?? DEFAULT_LIMIT,
109
+ offset: args.offset ?? 1
110
+ });
111
+ ctx.meta = {
112
+ full: slice.full,
113
+ kind: "read",
114
+ limit: slice.limit,
115
+ mtime: fileStat.mtimeMs,
116
+ offset: slice.offset,
117
+ path
118
+ };
119
+ return slice.content;
120
+ }
121
+ });
122
+ function assertFresh(path, ctx) {
123
+ const err = checkFresh(path, ctx);
124
+ if (err !== true) throw err;
125
+ }
126
+ function isUnchanged(path, ctx) {
127
+ return checkFresh(path, ctx, { full: true }) === true;
128
+ }
129
+ function checkFresh(path, ctx, opts = {}) {
130
+ path = normPath(ctx.cwd, path);
131
+ const mtime = safeStat(path)?.mtimeMs;
132
+ if (mtime === void 0) return new AiError({
133
+ code: "NOT_FOUND",
134
+ message: `${path}: file not found`
135
+ });
136
+ const messages = ctx.messages ?? [];
137
+ let ret = freshnessError(path, "NOT_READ");
138
+ for (const { m, $p, p } of extractToolResults(messages)) {
139
+ const id = m.id;
140
+ if (!id || !isFileMeta(p.meta) || ctx.isMasked?.(id, $p)) continue;
141
+ if (opts.full && !p.meta.full) continue;
142
+ if (p.meta.mtime === mtime) return true;
143
+ ret = freshnessError(path, "STALE");
144
+ }
145
+ return ret;
146
+ }
147
+ /** Build the canonical "you need to read this first" error. Used by
148
+ * `write` (existing files only) and `edit` (always). The `code` is
149
+ * stable so the model can branch on it; the message tells the model
150
+ * what to do next; `data.reason` distinguishes never-read vs
151
+ * changed-since-read for downstream renderers. */
152
+ function freshnessError(path, reason) {
153
+ return new AiError({
154
+ code: "FILE_NOT_FRESH",
155
+ data: {
156
+ path,
157
+ reason
158
+ },
159
+ message: reason === "NOT_READ" ? `${path}: read this file before mutating it.` : `${path}: file changed since last read. Re-read before mutating.`
160
+ });
161
+ }
162
+ /** Format a slice of file content as numbered lines plus, when the
163
+ * slice doesn't cover the whole file, a `<slice>` MetaPart with
164
+ * "showing X-Y of Z" info is included, Full reads return a plain
165
+ * string for the cleanest model surface. */
166
+ function formatTextSlice(content, { offset, limit }) {
167
+ content = normalizeEol(content);
168
+ const lines = content.split("\n");
169
+ if (lines.at(-1) === "") lines.pop();
170
+ let start = offset < 0 ? Math.max(0, lines.length + offset) : Math.max(0, offset - 1);
171
+ if (start >= lines.length) start = lines.length;
172
+ const end = Math.min(lines.length, start + limit);
173
+ const out = [];
174
+ for (let i = start; i < end; i++) {
175
+ const lineNo = (i + 1).toString().padStart(6, " ");
176
+ let line = lines[i];
177
+ if (line.length > MAX_LINE_LENGTH) line = `${line.slice(0, MAX_LINE_LENGTH)}… [line truncated, ${line.length} chars]`;
178
+ out.push(`${lineNo}\t${line}`);
179
+ }
180
+ const text = out.join("\n");
181
+ const full = start === 0 && end === lines.length;
182
+ if (full) return {
183
+ content: text,
184
+ full,
185
+ limit: lines.length,
186
+ offset: 1
187
+ };
188
+ return {
189
+ content: [{
190
+ content: start === end ? `offset ${offset} past end of file (${lines.length} lines)` : `showing ${start + 1}-${end} of ${lines.length}`,
191
+ tag: "slice",
192
+ type: "meta"
193
+ }, {
194
+ text,
195
+ type: "text"
196
+ }],
197
+ full,
198
+ limit: end - start,
199
+ offset: start + 1
200
+ };
201
+ }
202
+ //#endregion
203
+ export { assertFresh, readTool };
204
+
205
+ //# sourceMappingURL=read-Djsx2NZl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-Djsx2NZl.mjs","names":[],"sources":["../src/tools/read.ts"],"sourcesContent":["import type { Content, ToolContext } from \"@zaly/ai\"\n\nimport { AiError, defineTool, extractToolResults, toAttachment } from \"@zaly/ai\"\nimport { normPath, safeStat } from \"@zaly/shared\"\nimport { fileDetect } from \"@zaly/shared/detect\"\nimport { normalizeEol } from \"@zaly/shared/text\"\nimport { stat } from \"node:fs/promises\"\nimport { Type } from \"typebox\"\n\n/**\n * Read a file from disk.\n *\n * Output shape:\n * - Text files → numbered lines, `cat -n` style (6-char padded number,\n * tab, content). Line numbers reflect the absolute line in the file\n * even when reading a slice via `offset`/`limit`.\n * - Image files (png, jpeg, webp, gif, avif, …) → `ImagePart` attachment.\n * The model sees the image natively if its modality supports it.\n * - Other binary files → `BINARY_FILE` error with a hint.\n *\n * Path resolution: relative paths resolve against the agent's session\n * cwd via `process.cwd()` for now. When the permission system gates this\n * via a tool-side hook, the cwd from `PermissionContext` will be used\n * instead so resolution stays consistent across the loop.\n */\nconst DEFAULT_LIMIT = 2000\nconst MAX_LINE_LENGTH = 2000\n\nexport type ReadTool = typeof readTool\n\nexport type FileMeta = {\n path: string\n mtime: number\n kind: \"read\" | \"write\" | \"edit\"\n /** True when the result reflects the whole-file content — set by\n * un-sliced `read` and by `write` (which always replaces the\n * full file). Used by the masker to know whether this result\n * subsumes earlier reads of the same path. `edit` never sets it\n * because the result is patch-relative. */\n full?: boolean\n unchanged?: boolean\n}\n\nfunction isFileMeta(meta: unknown): meta is FileMeta {\n const m = meta as Partial<Record<string, unknown>> | undefined | null\n return (\n m !== undefined &&\n m !== null &&\n typeof m === \"object\" &&\n typeof m.path === \"string\" &&\n typeof m.mtime === \"number\" &&\n (m.kind === \"read\" || m.kind === \"write\" || m.kind === \"edit\")\n )\n}\n\nexport type ReadToolMeta = FileMeta & {\n offset: number\n limit: number\n}\n\n/** Build the `read` tool with model-aware schema description. The\n * attachment-shape blurb is included only when the loaded model\n * actually accepts the relevant modality — text-only models see a\n * description that promises only text output, so they don't reach\n * for the tool expecting images they can't process. */\n// oxlint-disable-next-line sort-keys -- semantic field order: name, desc, params, call\nexport const readTool = defineTool({\n name: \"read\",\n desc: `Read a file. Text files return numbered lines (\\`cat -n\\` style). Image & PDF files are sent as attachments. Use \\`offset\\`/\\`limit\\` to slice large files.`,\n parallel: true,\n // oxlint-disable-next-line sort-keys -- semantic param order\n params: Type.Object({\n path: Type.String({ description: \"Path to the file. Absolute or cwd-relative.\" }),\n offset: Type.Optional(\n Type.Integer({\n default: 1,\n description:\n \"1-based line number to start at. Negative values count from \" +\n \"the end: -50 starts 50 lines before EOF (so `offset: -50` \" +\n \"with the default limit returns the last 50 lines, like \" +\n \"`tail -n 50`). `offset: -50, limit: 20` reads 20 lines \" +\n \"starting 50 from the end.\",\n })\n ),\n limit: Type.Optional(\n Type.Integer({\n default: DEFAULT_LIMIT,\n description: \"Maximum number of lines to return.\",\n minimum: 1,\n })\n ),\n }),\n\n async preflight(args, ctx: ToolContext<ReadToolMeta>) {\n const path = normPath(ctx.cwd, args.path)\n await ctx.need?.(\"read\", path)\n },\n\n async call(args, ctx: ToolContext<ReadToolMeta>): Promise<Content> {\n const path = normPath(ctx.cwd, args.path)\n\n const fileStat = await stat(path).catch((error: unknown) => {\n throw new AiError({\n cause: error,\n code: \"NOT_FOUND\",\n message: `cannot read ${path}: file not found`,\n })\n })\n if (!fileStat.isFile()) {\n throw new AiError({ code: \"NOT_A_FILE\", message: `${path} is not a regular file` })\n }\n\n if (isUnchanged(path, ctx)) {\n // Fresh! We've seen this file's current bytes, so we can skip\n // returning the content again.\n ctx.meta = {\n full: false,\n kind: \"read\",\n limit: 0,\n mtime: fileStat.mtimeMs,\n offset: 0,\n path,\n unchanged: true,\n }\n return [\n { content: `file unchanged since last read: ${path}`, tag: \"unchanged\", type: \"meta\" },\n ]\n }\n\n const file = await fileDetect(path)\n if (!file) {\n throw new AiError({\n code: \"READ_ERROR\",\n message: `${path}: could not read file`,\n })\n }\n\n // Threshold-based binary check — files with sporadic control bytes\n // (logs with ANSI styling, source with form feeds) still read as\n // text; only when binary content dominates the sample do we bail.\n if (file.type === \"binary\") {\n throw new AiError({\n code: \"BINARY_FILE\",\n data: { bytes: file.data.length, path },\n message: `${path}: binary file (${file.data.length} bytes); not displayable as text`,\n })\n }\n\n const att = await toAttachment(file)\n if (att) return [att]\n\n if (file.type !== \"text\") {\n throw new AiError({\n code: \"UNSUPPORTED_FILE\",\n data: { path, type: file.type },\n message: `${path}: unsupported file type ${file.type}`,\n })\n }\n\n const text = new TextDecoder().decode(file.data)\n const slice = formatTextSlice(text, {\n limit: args.limit ?? DEFAULT_LIMIT,\n offset: args.offset ?? 1,\n })\n\n // Record the read so the freshness tracker knows we've seen this\n // file's current bytes. write/edit consult this before mutating;\n // the masker uses `full` to know whether this read subsumes\n // earlier reads of the same path.\n ctx.meta = {\n full: slice.full,\n kind: \"read\",\n limit: slice.limit,\n mtime: fileStat.mtimeMs,\n offset: slice.offset,\n path,\n }\n\n return slice.content\n },\n})\n\nexport function assertFresh(path: string, ctx: ToolContext) {\n const err = checkFresh(path, ctx)\n if (err !== true) throw err\n}\n\nexport function isUnchanged(path: string, ctx: ToolContext) {\n return checkFresh(path, ctx, { full: true }) === true\n}\n\nexport function checkFresh(\n path: string,\n ctx: ToolContext,\n opts: { full?: boolean } = {}\n): AiError | true {\n path = normPath(ctx.cwd, path)\n const mtime = safeStat(path)?.mtimeMs\n if (mtime === undefined)\n return new AiError({ code: \"NOT_FOUND\", message: `${path}: file not found` })\n const messages = ctx.messages ?? []\n let ret: AiError = freshnessError(path, \"NOT_READ\")\n\n for (const { m, $p, p } of extractToolResults<FileMeta>(messages)) {\n const id = m.id\n if (!id || !isFileMeta(p.meta) || ctx.isMasked?.(id, $p)) continue\n if (opts.full && !p.meta.full) continue\n if (p.meta.mtime === mtime) return true // Fresh! The file's mtime matches what we saw at read time.\n ret = freshnessError(path, \"STALE\")\n }\n return ret\n}\n\n/** Build the canonical \"you need to read this first\" error. Used by\n * `write` (existing files only) and `edit` (always). The `code` is\n * stable so the model can branch on it; the message tells the model\n * what to do next; `data.reason` distinguishes never-read vs\n * changed-since-read for downstream renderers. */\nexport function freshnessError(path: string, reason: \"NOT_READ\" | \"STALE\"): AiError {\n return new AiError({\n code: \"FILE_NOT_FRESH\",\n data: { path, reason },\n message:\n reason === \"NOT_READ\"\n ? `${path}: read this file before mutating it.`\n : `${path}: file changed since last read. Re-read before mutating.`,\n })\n}\n\n/** Format a slice of file content as numbered lines plus, when the\n * slice doesn't cover the whole file, a `<slice>` MetaPart with\n * \"showing X-Y of Z\" info is included, Full reads return a plain\n * string for the cleanest model surface. */\nfunction formatTextSlice(\n content: string,\n { offset, limit }: { offset: number; limit: number }\n): { content: Content; full?: boolean; offset: number; limit: number } {\n // Normalize line endings to LF for display. The model always sees LF;\n // edit/write detect the file's actual style and re-apply it on disk.\n content = normalizeEol(content)\n const lines = content.split(\"\\n\")\n // `split` on a final newline produces a trailing empty string — drop\n // it so a 3-line file with trailing LF reads as 3 lines, not 4.\n if (lines.at(-1) === \"\") lines.pop()\n\n // Negative offset = \"from the end\" — Python-slice / `tail -n` semantic.\n // `-1000` on a 30-line file clamps to 0 (read whole file) rather than\n // erroring; `0` is treated as `1` (head, off-by-one tolerance).\n let start = offset < 0 ? Math.max(0, lines.length + offset) : Math.max(0, offset - 1)\n // Overshoot clamps to `lines.length` so the slice loop emits nothing.\n // The agent gets an empty text + a `<slice>` meta that reports the\n // real file size, then can re-issue with a sensible offset.\n if (start >= lines.length) start = lines.length\n const end = Math.min(lines.length, start + limit)\n\n const out: string[] = []\n for (let i = start; i < end; i++) {\n const lineNo = (i + 1).toString().padStart(6, \" \")\n let line = lines[i]\n if (line.length > MAX_LINE_LENGTH) {\n line = `${line.slice(0, MAX_LINE_LENGTH)}… [line truncated, ${line.length} chars]`\n }\n out.push(`${lineNo}\\t${line}`)\n }\n\n const text = out.join(\"\\n\")\n const full = start === 0 && end === lines.length\n if (full) return { content: text, full, limit: lines.length, offset: 1 }\n\n // Empty slice (overshot offset): tell the agent the offset they asked\n // for and the real file size, rather than emitting a nonsensical\n // \"showing 6-5 of 5\"-style range.\n const sliceMsg =\n start === end\n ? `offset ${offset} past end of file (${lines.length} lines)`\n : `showing ${start + 1}-${end} of ${lines.length}`\n\n return {\n content: [\n { content: sliceMsg, tag: \"slice\", type: \"meta\" },\n { text, type: \"text\" },\n ],\n full,\n limit: end - start,\n offset: start + 1,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,gBAAgB;AACtB,MAAM,kBAAkB;AAiBxB,SAAS,WAAW,MAAiC;CACnD,MAAM,IAAI;CACV,OACE,MAAM,KAAA,KACN,MAAM,QACN,OAAO,MAAM,YACb,OAAO,EAAE,SAAS,YAClB,OAAO,EAAE,UAAU,aAClB,EAAE,SAAS,UAAU,EAAE,SAAS,WAAW,EAAE,SAAS;AAE3D;;;;;;AAaA,MAAa,WAAW,WAAW;CACjC,MAAM;CACN,MAAM;CACN,UAAU;CAEV,QAAQ,KAAK,OAAO;EAClB,MAAM,KAAK,OAAO,EAAE,aAAa,8CAA8C,CAAC;EAChF,QAAQ,KAAK,SACX,KAAK,QAAQ;GACX,SAAS;GACT,aACE;EAKJ,CAAC,CACH;EACA,OAAO,KAAK,SACV,KAAK,QAAQ;GACX,SAAS;GACT,aAAa;GACb,SAAS;EACX,CAAC,CACH;CACF,CAAC;CAED,MAAM,UAAU,MAAM,KAAgC;EACpD,MAAM,OAAO,SAAS,IAAI,KAAK,KAAK,IAAI;EACxC,MAAM,IAAI,OAAO,QAAQ,IAAI;CAC/B;CAEA,MAAM,KAAK,MAAM,KAAkD;EACjE,MAAM,OAAO,SAAS,IAAI,KAAK,KAAK,IAAI;EAExC,MAAM,WAAW,MAAM,KAAK,IAAI,CAAC,CAAC,OAAO,UAAmB;GAC1D,MAAM,IAAI,QAAQ;IAChB,OAAO;IACP,MAAM;IACN,SAAS,eAAe,KAAK;GAC/B,CAAC;EACH,CAAC;EACD,IAAI,CAAC,SAAS,OAAO,GACnB,MAAM,IAAI,QAAQ;GAAE,MAAM;GAAc,SAAS,GAAG,KAAK;EAAwB,CAAC;EAGpF,IAAI,YAAY,MAAM,GAAG,GAAG;GAG1B,IAAI,OAAO;IACT,MAAM;IACN,MAAM;IAC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