@alisio/core 0.1.0-alpha.8 → 0.1.0

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 (189) hide show
  1. package/README.md +52 -7
  2. package/dist/agents/active.d.ts +99 -0
  3. package/dist/agents/active.js +218 -0
  4. package/dist/agents/capabilities.d.ts +26 -0
  5. package/dist/agents/capabilities.js +120 -0
  6. package/dist/agents/create-agent-skill.d.ts +11 -0
  7. package/dist/agents/create-agent-skill.js +60 -0
  8. package/dist/agents/definitions.d.ts +88 -0
  9. package/dist/agents/definitions.js +404 -0
  10. package/dist/agents/draft.d.ts +41 -0
  11. package/dist/agents/draft.js +133 -0
  12. package/dist/agents/service.d.ts +57 -0
  13. package/dist/agents/service.js +86 -0
  14. package/dist/agents/templates.d.ts +8 -0
  15. package/dist/agents/templates.js +102 -0
  16. package/dist/analysis/capabilities.d.ts +48 -0
  17. package/dist/analysis/capabilities.js +90 -0
  18. package/dist/analysis/data/csv.d.ts +46 -0
  19. package/dist/analysis/data/csv.js +240 -0
  20. package/dist/analysis/data/datasets.d.ts +132 -0
  21. package/dist/analysis/data/datasets.js +441 -0
  22. package/dist/analysis/data/describe.d.ts +27 -0
  23. package/dist/analysis/data/describe.js +103 -0
  24. package/dist/analysis/data/engine-client.d.ts +58 -0
  25. package/dist/analysis/data/engine-client.js +304 -0
  26. package/dist/analysis/data/engine-entry.d.ts +1 -0
  27. package/dist/analysis/data/engine-entry.js +59 -0
  28. package/dist/analysis/data/engine-source.d.ts +4 -0
  29. package/dist/analysis/data/engine-source.js +6 -0
  30. package/dist/analysis/data/engine-types.d.ts +86 -0
  31. package/dist/analysis/data/engine-types.js +7 -0
  32. package/dist/analysis/data/infer.d.ts +42 -0
  33. package/dist/analysis/data/infer.js +118 -0
  34. package/dist/analysis/data/ingest-worker.d.ts +17 -0
  35. package/dist/analysis/data/ingest-worker.js +365 -0
  36. package/dist/analysis/data/json.d.ts +19 -0
  37. package/dist/analysis/data/json.js +44 -0
  38. package/dist/analysis/data/query-worker.d.ts +12 -0
  39. package/dist/analysis/data/query-worker.js +75 -0
  40. package/dist/analysis/data/rows.d.ts +39 -0
  41. package/dist/analysis/data/rows.js +120 -0
  42. package/dist/analysis/data/sql-guard.d.ts +20 -0
  43. package/dist/analysis/data/sql-guard.js +129 -0
  44. package/dist/analysis/data/stats.d.ts +18 -0
  45. package/dist/analysis/data/stats.js +77 -0
  46. package/dist/analysis/install-hints.d.ts +33 -0
  47. package/dist/analysis/install-hints.js +144 -0
  48. package/dist/analysis/janitor.d.ts +60 -0
  49. package/dist/analysis/janitor.js +264 -0
  50. package/dist/analysis/jobs.d.ts +94 -0
  51. package/dist/analysis/jobs.js +165 -0
  52. package/dist/analysis/oci.d.ts +129 -0
  53. package/dist/analysis/oci.js +330 -0
  54. package/dist/analysis/python/sources.d.ts +2 -0
  55. package/dist/analysis/python/sources.js +10 -0
  56. package/dist/analysis/requirements.d.ts +32 -0
  57. package/dist/analysis/requirements.js +73 -0
  58. package/dist/analysis/rerun.d.ts +40 -0
  59. package/dist/analysis/rerun.js +136 -0
  60. package/dist/analysis/runtime-manager.d.ts +146 -0
  61. package/dist/analysis/runtime-manager.js +472 -0
  62. package/dist/analysis/status.d.ts +21 -0
  63. package/dist/analysis/status.js +52 -0
  64. package/dist/application.d.ts +118 -3
  65. package/dist/application.js +510 -19
  66. package/dist/artifacts/kinds.d.ts +35 -0
  67. package/dist/artifacts/kinds.js +177 -0
  68. package/dist/artifacts/publisher.d.ts +7 -0
  69. package/dist/artifacts/publisher.js +29 -0
  70. package/dist/artifacts/store.d.ts +119 -0
  71. package/dist/artifacts/store.js +581 -0
  72. package/dist/background/janitor.d.ts +22 -0
  73. package/dist/background/janitor.js +62 -0
  74. package/dist/background/mirror.d.ts +14 -0
  75. package/dist/background/mirror.js +41 -0
  76. package/dist/background/notify.d.ts +58 -0
  77. package/dist/background/notify.js +172 -0
  78. package/dist/background/output.d.ts +46 -0
  79. package/dist/background/output.js +179 -0
  80. package/dist/background/service.d.ts +137 -0
  81. package/dist/background/service.js +410 -0
  82. package/dist/background/store.d.ts +103 -0
  83. package/dist/background/store.js +195 -0
  84. package/dist/changelog/data.d.ts +6 -0
  85. package/dist/changelog/data.js +293 -0
  86. package/dist/changelog/index.d.ts +5 -0
  87. package/dist/changelog/index.js +7 -0
  88. package/dist/changelog/parse.d.ts +53 -0
  89. package/dist/changelog/parse.js +160 -0
  90. package/dist/commands/builtins.d.ts +10 -0
  91. package/dist/commands/builtins.js +161 -0
  92. package/dist/commands/catalog.d.ts +86 -0
  93. package/dist/commands/catalog.js +304 -0
  94. package/dist/config.d.ts +252 -5
  95. package/dist/config.js +514 -13
  96. package/dist/core/compaction.js +13 -2
  97. package/dist/core/contracts.d.ts +180 -3
  98. package/dist/core/opt-in.d.ts +12 -0
  99. package/dist/core/opt-in.js +12 -0
  100. package/dist/core/output-limit.d.ts +34 -0
  101. package/dist/core/output-limit.js +39 -0
  102. package/dist/core/run-stats.d.ts +16 -0
  103. package/dist/core/run-stats.js +8 -0
  104. package/dist/core/runner.d.ts +152 -4
  105. package/dist/core/runner.js +792 -138
  106. package/dist/core/timeout.d.ts +15 -0
  107. package/dist/core/timeout.js +61 -0
  108. package/dist/core/truncation.d.ts +30 -0
  109. package/dist/core/truncation.js +83 -0
  110. package/dist/goal/blockers.d.ts +45 -0
  111. package/dist/goal/blockers.js +51 -0
  112. package/dist/goal/budget.d.ts +24 -0
  113. package/dist/goal/budget.js +53 -0
  114. package/dist/goal/command.d.ts +36 -0
  115. package/dist/goal/command.js +98 -0
  116. package/dist/goal/format.d.ts +19 -0
  117. package/dist/goal/format.js +102 -0
  118. package/dist/goal/host.d.ts +29 -0
  119. package/dist/goal/host.js +42 -0
  120. package/dist/goal/index.d.ts +9 -0
  121. package/dist/goal/index.js +9 -0
  122. package/dist/goal/machine.d.ts +186 -0
  123. package/dist/goal/machine.js +344 -0
  124. package/dist/goal/prompts.d.ts +10 -0
  125. package/dist/goal/prompts.js +75 -0
  126. package/dist/goal/service.d.ts +113 -0
  127. package/dist/goal/service.js +273 -0
  128. package/dist/goal/store.d.ts +59 -0
  129. package/dist/goal/store.js +184 -0
  130. package/dist/index.d.ts +51 -6
  131. package/dist/index.js +49 -4
  132. package/dist/mcp/connector.js +38 -6
  133. package/dist/mcp/rich.d.ts +41 -0
  134. package/dist/mcp/rich.js +362 -0
  135. package/dist/permissions/modes.d.ts +72 -0
  136. package/dist/permissions/modes.js +98 -0
  137. package/dist/plan/exit-plan.d.ts +25 -0
  138. package/dist/plan/exit-plan.js +130 -0
  139. package/dist/plan/state.d.ts +102 -0
  140. package/dist/plan/state.js +165 -0
  141. package/dist/plugins/host.d.ts +39 -1
  142. package/dist/plugins/host.js +150 -9
  143. package/dist/providers/settings.d.ts +15 -0
  144. package/dist/providers/settings.js +38 -0
  145. package/dist/reload.d.ts +75 -0
  146. package/dist/reload.js +204 -0
  147. package/dist/resources/context.d.ts +5 -0
  148. package/dist/resources/context.js +13 -1
  149. package/dist/runtime/access.d.ts +62 -0
  150. package/dist/runtime/access.js +115 -0
  151. package/dist/runtime/blobs.d.ts +51 -0
  152. package/dist/runtime/blobs.js +177 -0
  153. package/dist/runtime/diff.d.ts +23 -0
  154. package/dist/runtime/diff.js +154 -0
  155. package/dist/runtime/ids.d.ts +8 -0
  156. package/dist/runtime/ids.js +32 -0
  157. package/dist/runtime/paths.d.ts +11 -0
  158. package/dist/runtime/paths.js +17 -1
  159. package/dist/runtime/process.d.ts +22 -0
  160. package/dist/runtime/process.js +100 -15
  161. package/dist/runtime/sqlite.d.ts +2 -0
  162. package/dist/runtime/sqlite.js +18 -0
  163. package/dist/runtime/store.d.ts +91 -3
  164. package/dist/runtime/store.js +465 -11
  165. package/dist/runtime/zip.d.ts +24 -0
  166. package/dist/runtime/zip.js +126 -0
  167. package/dist/sessions/children.js +17 -1
  168. package/dist/sessions/side-questions.d.ts +57 -0
  169. package/dist/sessions/side-questions.js +161 -0
  170. package/dist/startup/screen.js +6 -5
  171. package/dist/tools/analysis.d.ts +37 -0
  172. package/dist/tools/analysis.js +573 -0
  173. package/dist/tools/artifacts.d.ts +14 -0
  174. package/dist/tools/artifacts.js +143 -0
  175. package/dist/tools/background.d.ts +7 -0
  176. package/dist/tools/background.js +165 -0
  177. package/dist/tools/data.d.ts +7 -0
  178. package/dist/tools/data.js +160 -0
  179. package/dist/tools/execute.d.ts +5 -0
  180. package/dist/tools/execute.js +15 -3
  181. package/dist/tools/goal.d.ts +19 -0
  182. package/dist/tools/goal.js +126 -0
  183. package/dist/tools/search.d.ts +17 -3
  184. package/dist/tools/search.js +153 -0
  185. package/dist/tools/standard.d.ts +4 -1
  186. package/dist/tools/standard.js +99 -18
  187. package/dist/version.d.ts +5 -3
  188. package/dist/version.js +35 -6
  189. package/package.json +2 -2
@@ -0,0 +1,240 @@
1
+ /**
2
+ * Streaming CSV/TSV parser (RFC 4180, spec §17.2): quoted fields, doubled quotes, line breaks
3
+ * inside quotes, CRLF/LF/CR rows. No dependencies and no I/O: callers push decoded text chunks
4
+ * (any split, even inside a quote or between CR and LF) and receive rows through a callback.
5
+ * Blank lines are skipped. Lenient on purpose: a stray quote inside an unquoted field is literal
6
+ * and text after a closing quote is appended.
7
+ */
8
+ const QUOTE = 34;
9
+ const CR = 13;
10
+ const LF = 10;
11
+ var State;
12
+ (function (State) {
13
+ /** Before the first character of a field. */
14
+ State[State["Start"] = 0] = "Start";
15
+ State[State["Unquoted"] = 1] = "Unquoted";
16
+ State[State["Quoted"] = 2] = "Quoted";
17
+ /** Right after a `"` inside a quoted field: either an escaped quote or the closing one. */
18
+ State[State["QuoteInQuoted"] = 3] = "QuoteInQuoted";
19
+ })(State || (State = {}));
20
+ export class CsvError extends Error {
21
+ code;
22
+ constructor(message, code) {
23
+ super(message);
24
+ this.code = code;
25
+ }
26
+ }
27
+ export class CsvParser {
28
+ onRow;
29
+ maxCellChars;
30
+ state = State.Start;
31
+ field = "";
32
+ fields = [];
33
+ skipLineFeed = false;
34
+ /** The current field was opened with a quote (so `""` is a value, not a blank line). */
35
+ quotedField = false;
36
+ delimiter;
37
+ /** Rows delivered so far (blank lines excluded). */
38
+ rows = 0;
39
+ constructor(delimiter, onRow, maxCellChars = 1024 * 1024) {
40
+ this.onRow = onRow;
41
+ this.maxCellChars = maxCellChars;
42
+ if (delimiter.length !== 1)
43
+ throw new Error("The CSV delimiter must be one character");
44
+ this.delimiter = delimiter.charCodeAt(0);
45
+ }
46
+ add(text) {
47
+ this.field += text;
48
+ if (this.field.length > this.maxCellChars)
49
+ throw new CsvError(`A cell in row ${this.rows + 1} exceeds ${this.maxCellChars} characters`, "cell_too_large");
50
+ }
51
+ endField() {
52
+ this.fields.push(this.field);
53
+ this.field = "";
54
+ this.quotedField = false;
55
+ }
56
+ endRow() {
57
+ const blank = this.fields.length === 0 && this.field === "" && !this.quotedField;
58
+ if (!blank) {
59
+ this.endField();
60
+ this.rows++;
61
+ const row = this.fields;
62
+ this.fields = [];
63
+ this.state = State.Start;
64
+ this.onRow(row);
65
+ return;
66
+ }
67
+ this.state = State.Start;
68
+ this.quotedField = false;
69
+ }
70
+ write(chunk) {
71
+ const n = chunk.length;
72
+ let i = 0;
73
+ if (this.skipLineFeed && n > 0) {
74
+ if (chunk.charCodeAt(0) === LF)
75
+ i = 1;
76
+ this.skipLineFeed = false;
77
+ }
78
+ while (i < n) {
79
+ switch (this.state) {
80
+ case State.Start: {
81
+ if (chunk.charCodeAt(i) === QUOTE) {
82
+ this.state = State.Quoted;
83
+ this.quotedField = true;
84
+ i++;
85
+ }
86
+ else
87
+ this.state = State.Unquoted;
88
+ break;
89
+ }
90
+ case State.Unquoted: {
91
+ let j = i;
92
+ let c = 0;
93
+ while (j < n) {
94
+ c = chunk.charCodeAt(j);
95
+ if (c === this.delimiter || c === LF || c === CR)
96
+ break;
97
+ j++;
98
+ }
99
+ if (j > i)
100
+ this.add(chunk.slice(i, j));
101
+ i = j;
102
+ if (j >= n)
103
+ break;
104
+ if (c === this.delimiter) {
105
+ this.endField();
106
+ this.state = State.Start;
107
+ i++;
108
+ }
109
+ else {
110
+ i++;
111
+ if (c === CR) {
112
+ if (i < n && chunk.charCodeAt(i) === LF)
113
+ i++;
114
+ else if (i >= n)
115
+ this.skipLineFeed = true;
116
+ }
117
+ this.endRow();
118
+ }
119
+ break;
120
+ }
121
+ case State.Quoted: {
122
+ const quote = chunk.indexOf('"', i);
123
+ if (quote < 0) {
124
+ this.add(chunk.slice(i));
125
+ i = n;
126
+ }
127
+ else {
128
+ if (quote > i)
129
+ this.add(chunk.slice(i, quote));
130
+ i = quote + 1;
131
+ this.state = State.QuoteInQuoted;
132
+ }
133
+ break;
134
+ }
135
+ case State.QuoteInQuoted: {
136
+ const c = chunk.charCodeAt(i);
137
+ if (c === QUOTE) {
138
+ this.add('"');
139
+ this.state = State.Quoted;
140
+ i++;
141
+ }
142
+ else if (c === this.delimiter) {
143
+ this.endField();
144
+ this.state = State.Start;
145
+ i++;
146
+ }
147
+ else if (c === LF || c === CR) {
148
+ i++;
149
+ if (c === CR) {
150
+ if (i < n && chunk.charCodeAt(i) === LF)
151
+ i++;
152
+ else if (i >= n)
153
+ this.skipLineFeed = true;
154
+ }
155
+ // A quoted-empty field ("") is a real, empty value: the row is not blank.
156
+ this.state = State.Unquoted;
157
+ this.endRow();
158
+ }
159
+ else {
160
+ // Text after the closing quote: keep it (lenient).
161
+ this.state = State.Unquoted;
162
+ }
163
+ break;
164
+ }
165
+ }
166
+ }
167
+ }
168
+ /** Flushes the last row when the input has no final line break. */
169
+ end() {
170
+ if (this.fields.length === 0 && this.field === "" && !this.quotedField)
171
+ return;
172
+ this.endRow();
173
+ }
174
+ }
175
+ /** Parses a whole string (tests and small inputs). */
176
+ export function parseCsv(text, delimiter = ",") {
177
+ const rows = [];
178
+ const parser = new CsvParser(delimiter, (row) => rows.push(row));
179
+ parser.write(text);
180
+ parser.end();
181
+ return rows;
182
+ }
183
+ const CANDIDATES = [",", ";", "\t", "|"];
184
+ /**
185
+ * Detects the delimiter from a text sample (the first 64 KiB): the candidate that splits most
186
+ * rows into the same number (> 1) of fields wins; ties keep the order `,` `;` TAB `|`.
187
+ */
188
+ export function detectDelimiter(sample) {
189
+ let best = ",";
190
+ let bestScore = 0;
191
+ for (const candidate of CANDIDATES) {
192
+ const counts = new Map();
193
+ let rows = 0;
194
+ const parser = new CsvParser(candidate, (row) => {
195
+ rows++;
196
+ counts.set(row.length, (counts.get(row.length) ?? 0) + 1);
197
+ });
198
+ try {
199
+ parser.write(sample);
200
+ }
201
+ catch {
202
+ continue;
203
+ }
204
+ // The last row may be cut by the sample boundary: it is never flushed (no end()).
205
+ if (rows < 1)
206
+ continue;
207
+ let width = 0;
208
+ let frequency = 0;
209
+ for (const [w, count] of counts)
210
+ if (w > 1 && (count > frequency || (count === frequency && w > width))) {
211
+ width = w;
212
+ frequency = count;
213
+ }
214
+ const score = frequency * 1000 + width;
215
+ if (score > bestScore) {
216
+ best = candidate;
217
+ bestScore = score;
218
+ }
219
+ }
220
+ return best;
221
+ }
222
+ /**
223
+ * Decodes a byte sample as the ingestion does: UTF-8 (BOM removed), UTF-16 by BOM, or
224
+ * windows-1252 when the bytes are not valid UTF-8. A sample cut inside a character is tolerated.
225
+ */
226
+ export function decodeTextBytes(bytes, truncated = false) {
227
+ if (bytes[0] === 0xff && bytes[1] === 0xfe)
228
+ return { text: new TextDecoder("utf-16le").decode(bytes), encoding: "utf-16le" };
229
+ if (bytes[0] === 0xfe && bytes[1] === 0xff)
230
+ return { text: new TextDecoder("utf-16be").decode(bytes), encoding: "utf-16be" };
231
+ try {
232
+ return {
233
+ text: new TextDecoder("utf-8", { fatal: true }).decode(bytes, { stream: truncated }),
234
+ encoding: "utf-8",
235
+ };
236
+ }
237
+ catch {
238
+ return { text: new TextDecoder("windows-1252").decode(bytes), encoding: "windows-1252" };
239
+ }
240
+ }
@@ -0,0 +1,132 @@
1
+ import type { DatasetDetailWire, DatasetFormat, DatasetRef, DatasetRowsPage, SqlDatabase } from "@alisio/sdk";
2
+ import type { PythonResolution } from "../runtime-manager.ts";
3
+ import { type SampleRows } from "./describe.ts";
4
+ import { DataEngine, DataError } from "./engine-client.ts";
5
+ import type { SheetSummary } from "./engine-types.ts";
6
+ import { PageParamError } from "./rows.ts";
7
+ export { DataError, PageParamError };
8
+ export interface DatasetLimits {
9
+ maxUploadBytes: number;
10
+ maxRows: number;
11
+ queryTimeoutMs: number;
12
+ maxInteractiveRows: number;
13
+ }
14
+ export declare const DEFAULT_DATASET_LIMITS: DatasetLimits;
15
+ export declare const XLSX_REMEDY = "Export the sheet as CSV, or install Python 3.10+.";
16
+ /** The format of a file name, or undefined when it is not a supported dataset. */
17
+ export declare function datasetFormat(name: string): DatasetFormat | undefined;
18
+ export interface DatasetRecord {
19
+ id: string;
20
+ /** The session that created it. */
21
+ sessionId: string;
22
+ rootSessionId: string;
23
+ name: string;
24
+ format: DatasetFormat;
25
+ sha256: string;
26
+ bytes: number;
27
+ blobHash?: string;
28
+ sourcePath?: string;
29
+ dbRelPath: string;
30
+ ingestVersion: number;
31
+ sheets: SheetSummary[];
32
+ createdAt: number;
33
+ }
34
+ export declare const toDatasetRef: (record: DatasetRecord) => DatasetRef;
35
+ export interface IngestInput {
36
+ rootSessionId: string;
37
+ sessionId: string;
38
+ workspace: string;
39
+ /** Absolute path of the file to read (resolved and authorised by the caller). */
40
+ path: string;
41
+ /** Display name; defaults to the file name. */
42
+ name?: string;
43
+ blobHash?: string;
44
+ /** Recorded as `source_path` (a workspace or artifact file); never sent to clients. */
45
+ sourcePath?: string;
46
+ signal?: AbortSignal;
47
+ onProgress?: (rows: number) => void;
48
+ }
49
+ export interface DatasetServiceOptions {
50
+ /** State folder (`stateHome()` or the folder of `--db`). */
51
+ root: string;
52
+ db: SqlDatabase;
53
+ limits?: Partial<DatasetLimits>;
54
+ /** The Python interpreter (XLSX only); absent means XLSX is unsupported. */
55
+ python?: {
56
+ interpreter(signal: AbortSignal): Promise<PythonResolution>;
57
+ };
58
+ engine?: DataEngine;
59
+ now?: () => number;
60
+ }
61
+ export declare class DatasetService {
62
+ private readonly options;
63
+ readonly limits: DatasetLimits;
64
+ readonly engine: DataEngine;
65
+ private inflight;
66
+ constructor(options: DatasetServiceOptions);
67
+ private now;
68
+ /** Absolute path of a dataset file. */
69
+ file(record: DatasetRecord): string;
70
+ get(id: string): DatasetRecord | undefined;
71
+ private touched;
72
+ /**
73
+ * Records that a dataset was used, for the retention sweep ("unused for `jobsDays`"): the
74
+ * modification time of its SQLite file (nothing else changes it after the ingestion), at most
75
+ * once every ten minutes per dataset. Best effort: a failure never affects the caller.
76
+ */
77
+ private touch;
78
+ /** Every dataset (all sessions), for the retention sweep; does not count as a use. */
79
+ all(): DatasetRecord[];
80
+ /** A dataset of this root session; another session's id is `not_found`. */
81
+ getFor(id: string, rootSessionId: string): DatasetRecord;
82
+ list(rootSessionId: string): DatasetRecord[];
83
+ private bySha;
84
+ /**
85
+ * Ingests a file into a dataset, or returns the session's existing dataset with the same
86
+ * content (`reused`). Concurrent calls for the same content share one ingestion. A failure
87
+ * leaves no row and no file.
88
+ */
89
+ ingest(input: IngestInput): Promise<{
90
+ record: DatasetRecord;
91
+ reused: boolean;
92
+ }>;
93
+ private build;
94
+ /** The XLSX route (spec §17.6, option B): the Python standard-library helper, then statistics. */
95
+ private ingestXlsx;
96
+ /** The `alisio_runtime` package on disk for `python -m` (content-addressed, written once). */
97
+ private helperDir;
98
+ /** Schema and statistics of every sheet (`GET /api/datasets/:did`). */
99
+ detail(record: DatasetRecord): DatasetDetailWire;
100
+ /** First rows of a table, for `data_inspect` and the prompt summary. */
101
+ sample(record: DatasetRecord, table: string, rows: number, signal?: AbortSignal): Promise<SampleRows>;
102
+ /** The description for the model: `data_inspect` text. */
103
+ describe(record: DatasetRecord, sampleRows: number, maxChars: number, signal?: AbortSignal): Promise<{
104
+ detail: DatasetDetailWire;
105
+ samples: Map<string, SampleRows>;
106
+ text: string;
107
+ }>;
108
+ /** The ≤ 4 KB summary appended to a prompt that attaches the dataset. */
109
+ summary(record: DatasetRecord, signal?: AbortSignal): Promise<string>;
110
+ /**
111
+ * Runs a model-written read-only query (`data_query`): lexical guard, then a read-only
112
+ * connection in the engine process, with a row limit and a time limit.
113
+ */
114
+ query(record: DatasetRecord, sql: string, options?: {
115
+ maxRows?: number;
116
+ signal?: AbortSignal;
117
+ }): Promise<import("./engine-types.ts").QueryResult>;
118
+ /** One page of a sheet for `SpreadsheetView` (spec §17.4). */
119
+ page(record: DatasetRecord, request: {
120
+ sheet?: string;
121
+ after?: string;
122
+ offset?: number;
123
+ limit?: number;
124
+ sort?: string;
125
+ dir?: "asc" | "desc";
126
+ filter?: string;
127
+ column?: string;
128
+ }, signal?: AbortSignal): Promise<DatasetRowsPage>;
129
+ /** Deletes a dataset file and row (connections are closed first, for Windows). */
130
+ remove(record: DatasetRecord): Promise<void>;
131
+ close(): void;
132
+ }