presubmit 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 (220) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +51 -0
  3. package/THIRD_PARTY_NOTICES.md +24 -0
  4. package/apps/web/dist/assets/FileCode-CZZH52o7.js +5 -0
  5. package/apps/web/dist/assets/FileCode-DovDO7Jh.css +1 -0
  6. package/apps/web/dist/assets/SettingsPage-CRvOwdjt.js +4 -0
  7. package/apps/web/dist/assets/SettingsPage-UbYSCwJj.css +1 -0
  8. package/apps/web/dist/assets/TerminalPanel-0sw-J6YS.css +1 -0
  9. package/apps/web/dist/assets/TerminalPanel-BqUjPWav.js +16 -0
  10. package/apps/web/dist/assets/index-BhqNNFja.js +54 -0
  11. package/apps/web/dist/assets/index-DD8VXy8H.css +1 -0
  12. package/apps/web/dist/assets/presubmit-mark-BBQ19Fmr.svg +7 -0
  13. package/apps/web/dist/assets/presubmit-mark-busy-CwBC-7on.svg +8 -0
  14. package/apps/web/dist/assets/react-vendor-wiHys0m2.js +9 -0
  15. package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +1 -0
  16. package/apps/web/dist/index.html +6 -0
  17. package/apps/web/dist/service-worker.js +11 -0
  18. package/dist/apps/server/src/agent-builder.js +204 -0
  19. package/dist/apps/server/src/attach.js +163 -0
  20. package/dist/apps/server/src/attachments.js +86 -0
  21. package/dist/apps/server/src/browser-access.js +131 -0
  22. package/dist/apps/server/src/check-provenance.js +95 -0
  23. package/dist/apps/server/src/check-supervisor.js +112 -0
  24. package/dist/apps/server/src/checks.js +402 -0
  25. package/dist/apps/server/src/child-collaboration-guidance.js +2 -0
  26. package/dist/apps/server/src/child-sessions.js +191 -0
  27. package/dist/apps/server/src/cli.js +162 -0
  28. package/dist/apps/server/src/conversation-search.js +12 -0
  29. package/dist/apps/server/src/coordinator-messages.js +72 -0
  30. package/dist/apps/server/src/dev-auth.js +54 -0
  31. package/dist/apps/server/src/dev-server.js +201 -0
  32. package/dist/apps/server/src/dev-worker.js +48 -0
  33. package/dist/apps/server/src/diagnostics.js +105 -0
  34. package/dist/apps/server/src/fast-mode.js +8 -0
  35. package/dist/apps/server/src/folder-picker.js +54 -0
  36. package/dist/apps/server/src/git-blobs.js +62 -0
  37. package/dist/apps/server/src/git-handoff.js +127 -0
  38. package/dist/apps/server/src/history-sources.js +59 -0
  39. package/dist/apps/server/src/hub.js +159 -0
  40. package/dist/apps/server/src/internal-transport.js +38 -0
  41. package/dist/apps/server/src/local-embeddings.js +70 -0
  42. package/dist/apps/server/src/ollama-setup.js +56 -0
  43. package/dist/apps/server/src/planning.js +30 -0
  44. package/dist/apps/server/src/project-agents.js +276 -0
  45. package/dist/apps/server/src/project-memory.js +94 -0
  46. package/dist/apps/server/src/projects.js +106 -0
  47. package/dist/apps/server/src/queued-launch.js +13 -0
  48. package/dist/apps/server/src/reply-search.js +172 -0
  49. package/dist/apps/server/src/review-context.js +60 -0
  50. package/dist/apps/server/src/review-refresh.js +14 -0
  51. package/dist/apps/server/src/reviewers.js +75 -0
  52. package/dist/apps/server/src/search-settings.js +22 -0
  53. package/dist/apps/server/src/semantic-history.js +186 -0
  54. package/dist/apps/server/src/server.js +4338 -0
  55. package/dist/apps/server/src/session-changes.js +181 -0
  56. package/dist/apps/server/src/session-router-settings.js +198 -0
  57. package/dist/apps/server/src/session-workspaces.js +135 -0
  58. package/dist/apps/server/src/sessions.js +579 -0
  59. package/dist/apps/server/src/shared-auth.js +70 -0
  60. package/dist/apps/server/src/shell-evaluator-settings.js +53 -0
  61. package/dist/apps/server/src/store.js +203 -0
  62. package/dist/apps/server/src/tailscale-process.js +115 -0
  63. package/dist/apps/server/src/tailscale-serve-worker.js +33 -0
  64. package/dist/apps/server/src/tailscale-serve.js +276 -0
  65. package/dist/apps/server/src/task-capacity.js +92 -0
  66. package/dist/apps/server/src/task-graph.js +190 -0
  67. package/dist/apps/server/src/task-logs.js +74 -0
  68. package/dist/apps/server/src/task-numbers.js +25 -0
  69. package/dist/apps/server/src/task-orchestrator.js +1088 -0
  70. package/dist/apps/server/src/terminal.js +182 -0
  71. package/dist/apps/server/src/terminals.js +80 -0
  72. package/dist/apps/server/src/tool-safety.js +2 -0
  73. package/dist/apps/server/src/workspace-lock.js +140 -0
  74. package/dist/apps/server/src/workspace-watcher.js +65 -0
  75. package/dist/apps/server/src/workspace.js +517 -0
  76. package/dist/packages/agent-pi/src/agent-builder-tool.js +32 -0
  77. package/dist/packages/agent-pi/src/agent-capabilities.js +44 -0
  78. package/dist/packages/agent-pi/src/ask-user.js +86 -0
  79. package/dist/packages/agent-pi/src/auth.js +510 -0
  80. package/dist/packages/agent-pi/src/check-tools.js +72 -0
  81. package/dist/packages/agent-pi/src/command-policy.js +246 -0
  82. package/dist/packages/agent-pi/src/coordinator-tools.js +122 -0
  83. package/dist/packages/agent-pi/src/fast-mode.js +67 -0
  84. package/dist/packages/agent-pi/src/file-tools.js +163 -0
  85. package/dist/packages/agent-pi/src/history-tool.js +40 -0
  86. package/dist/packages/agent-pi/src/history.js +34 -0
  87. package/dist/packages/agent-pi/src/index.js +177 -0
  88. package/dist/packages/agent-pi/src/ipc.js +314 -0
  89. package/dist/packages/agent-pi/src/jev-session-router.js +408 -0
  90. package/dist/packages/agent-pi/src/jev-tools.js +71 -0
  91. package/dist/packages/agent-pi/src/local-model.js +277 -0
  92. package/dist/packages/agent-pi/src/memory-tools.js +119 -0
  93. package/dist/packages/agent-pi/src/model.js +25 -0
  94. package/dist/packages/agent-pi/src/planning.js +206 -0
  95. package/dist/packages/agent-pi/src/resource-loader.js +23 -0
  96. package/dist/packages/agent-pi/src/review-tools.js +158 -0
  97. package/dist/packages/agent-pi/src/review-transition.js +73 -0
  98. package/dist/packages/agent-pi/src/review.js +40 -0
  99. package/dist/packages/agent-pi/src/routing.js +27 -0
  100. package/dist/packages/agent-pi/src/session-setup.js +118 -0
  101. package/dist/packages/agent-pi/src/shell-context.js +51 -0
  102. package/dist/packages/agent-pi/src/shell-policy.js +281 -0
  103. package/dist/packages/agent-pi/src/shell-safety.js +205 -0
  104. package/dist/packages/agent-pi/src/shell.js +121 -0
  105. package/dist/packages/agent-pi/src/snapshot-permissions.js +12 -0
  106. package/dist/packages/agent-pi/src/spike.js +41 -0
  107. package/dist/packages/agent-pi/src/task-tools.js +53 -0
  108. package/dist/packages/agent-pi/src/types.js +1 -0
  109. package/dist/packages/agent-pi/src/usage.js +30 -0
  110. package/dist/packages/agent-pi/src/worker.js +602 -0
  111. package/dist/packages/protocol/src/activity-summary.js +77 -0
  112. package/dist/packages/protocol/src/agents.js +301 -0
  113. package/dist/packages/protocol/src/browser-access.js +1 -0
  114. package/dist/packages/protocol/src/checks.js +40 -0
  115. package/dist/packages/protocol/src/child-sessions.js +28 -0
  116. package/dist/packages/protocol/src/command-policy.js +3 -0
  117. package/dist/packages/protocol/src/coordinator.js +135 -0
  118. package/dist/packages/protocol/src/delegation.js +40 -0
  119. package/dist/packages/protocol/src/git-diff.js +71 -0
  120. package/dist/packages/protocol/src/git-handoff.js +1 -0
  121. package/dist/packages/protocol/src/index.js +1 -0
  122. package/dist/packages/protocol/src/memory.js +46 -0
  123. package/dist/packages/protocol/src/metrics.js +70 -0
  124. package/dist/packages/protocol/src/planning.js +138 -0
  125. package/dist/packages/protocol/src/retrieval.js +36 -0
  126. package/dist/packages/protocol/src/reviewers.js +17 -0
  127. package/dist/packages/protocol/src/search.js +16 -0
  128. package/dist/packages/protocol/src/session-changes.js +29 -0
  129. package/dist/packages/protocol/src/session-router.js +123 -0
  130. package/dist/packages/protocol/src/shell-evaluator.js +43 -0
  131. package/dist/packages/protocol/src/task-graph.js +1 -0
  132. package/dist/packages/protocol/src/token-usage.js +17 -0
  133. package/dist/packages/protocol/src/user-questions.js +106 -0
  134. package/package.json +71 -0
  135. package/vendor/lancedb/NODEJS_THIRD_PARTY_LICENSES.md +668 -0
  136. package/vendor/lancedb/RUST_THIRD_PARTY_LICENSES.html +14607 -0
  137. package/vendor/lancedb/dist/arrow.d.ts +296 -0
  138. package/vendor/lancedb/dist/arrow.js +1145 -0
  139. package/vendor/lancedb/dist/arrow_type.d.ts +9 -0
  140. package/vendor/lancedb/dist/arrow_type.js +29 -0
  141. package/vendor/lancedb/dist/connection.d.ts +508 -0
  142. package/vendor/lancedb/dist/connection.js +298 -0
  143. package/vendor/lancedb/dist/embedding/embedding_function.d.ts +103 -0
  144. package/vendor/lancedb/dist/embedding/embedding_function.js +192 -0
  145. package/vendor/lancedb/dist/embedding/index.d.ts +37 -0
  146. package/vendor/lancedb/dist/embedding/index.js +108 -0
  147. package/vendor/lancedb/dist/embedding/openai.d.ts +16 -0
  148. package/vendor/lancedb/dist/embedding/openai.js +81 -0
  149. package/vendor/lancedb/dist/embedding/registry.d.ts +94 -0
  150. package/vendor/lancedb/dist/embedding/registry.js +221 -0
  151. package/vendor/lancedb/dist/embedding/transformers.d.ts +36 -0
  152. package/vendor/lancedb/dist/embedding/transformers.js +110 -0
  153. package/vendor/lancedb/dist/header.d.ts +162 -0
  154. package/vendor/lancedb/dist/header.js +217 -0
  155. package/vendor/lancedb/dist/index.d.ts +246 -0
  156. package/vendor/lancedb/dist/index.js +176 -0
  157. package/vendor/lancedb/dist/indices.d.ts +721 -0
  158. package/vendor/lancedb/dist/indices.js +166 -0
  159. package/vendor/lancedb/dist/materialized_view.d.ts +69 -0
  160. package/vendor/lancedb/dist/materialized_view.js +112 -0
  161. package/vendor/lancedb/dist/merge.d.ts +104 -0
  162. package/vendor/lancedb/dist/merge.js +120 -0
  163. package/vendor/lancedb/dist/native.d.ts +1193 -0
  164. package/vendor/lancedb/dist/native.js +688 -0
  165. package/vendor/lancedb/dist/oauth.d.ts +66 -0
  166. package/vendor/lancedb/dist/oauth.js +15 -0
  167. package/vendor/lancedb/dist/otel.d.ts +26 -0
  168. package/vendor/lancedb/dist/otel.js +114 -0
  169. package/vendor/lancedb/dist/permutation.d.ts +143 -0
  170. package/vendor/lancedb/dist/permutation.js +184 -0
  171. package/vendor/lancedb/dist/query.d.ts +663 -0
  172. package/vendor/lancedb/dist/query.js +966 -0
  173. package/vendor/lancedb/dist/rerankers/index.d.ts +5 -0
  174. package/vendor/lancedb/dist/rerankers/index.js +19 -0
  175. package/vendor/lancedb/dist/rerankers/rrf.d.ts +14 -0
  176. package/vendor/lancedb/dist/rerankers/rrf.js +28 -0
  177. package/vendor/lancedb/dist/sanitize.d.ts +32 -0
  178. package/vendor/lancedb/dist/sanitize.js +544 -0
  179. package/vendor/lancedb/dist/scannable.d.ts +92 -0
  180. package/vendor/lancedb/dist/scannable.js +200 -0
  181. package/vendor/lancedb/dist/schema.d.ts +16 -0
  182. package/vendor/lancedb/dist/schema.js +387 -0
  183. package/vendor/lancedb/dist/table.d.ts +1069 -0
  184. package/vendor/lancedb/dist/table.js +498 -0
  185. package/vendor/lancedb/dist/util.d.ts +14 -0
  186. package/vendor/lancedb/dist/util.js +77 -0
  187. package/vendor/lancedb/license_header.txt +2 -0
  188. package/vendor/lancedb/package.json +56 -0
  189. package/vendor/transformers/LICENSE +202 -0
  190. package/vendor/transformers/dist/transformers.cjs +30844 -0
  191. package/vendor/transformers/dist/transformers.mjs +31404 -0
  192. package/vendor/transformers/package.json +55 -0
  193. package/vendor/transformers/types/backends/onnx.d.ts +30 -0
  194. package/vendor/transformers/types/configs.d.ts +85 -0
  195. package/vendor/transformers/types/env.d.ts +110 -0
  196. package/vendor/transformers/types/generation/configuration_utils.d.ts +320 -0
  197. package/vendor/transformers/types/generation/logits_process.d.ts +354 -0
  198. package/vendor/transformers/types/generation/logits_sampler.d.ts +51 -0
  199. package/vendor/transformers/types/generation/parameters.d.ts +47 -0
  200. package/vendor/transformers/types/generation/stopping_criteria.d.ts +81 -0
  201. package/vendor/transformers/types/generation/streamers.d.ts +81 -0
  202. package/vendor/transformers/types/models/whisper/common_whisper.d.ts +8 -0
  203. package/vendor/transformers/types/models/whisper/generation_whisper.d.ts +76 -0
  204. package/vendor/transformers/types/models.d.ts +3684 -0
  205. package/vendor/transformers/types/ops/registry.d.ts +11 -0
  206. package/vendor/transformers/types/pipelines.d.ts +2402 -0
  207. package/vendor/transformers/types/processors.d.ts +924 -0
  208. package/vendor/transformers/types/tokenizers.d.ts +990 -0
  209. package/vendor/transformers/types/transformers.d.ts +13 -0
  210. package/vendor/transformers/types/utils/audio.d.ts +130 -0
  211. package/vendor/transformers/types/utils/constants.d.ts +2 -0
  212. package/vendor/transformers/types/utils/core.d.ts +98 -0
  213. package/vendor/transformers/types/utils/data-structures.d.ts +236 -0
  214. package/vendor/transformers/types/utils/devices.d.ts +18 -0
  215. package/vendor/transformers/types/utils/dtypes.d.ts +19 -0
  216. package/vendor/transformers/types/utils/generic.d.ts +11 -0
  217. package/vendor/transformers/types/utils/hub.d.ts +152 -0
  218. package/vendor/transformers/types/utils/image.d.ts +119 -0
  219. package/vendor/transformers/types/utils/maths.d.ts +280 -0
  220. package/vendor/transformers/types/utils/tensor.d.ts +418 -0
@@ -0,0 +1,1069 @@
1
+ import { Table as ArrowTable, Data, DataType, Field, IntoVector, MultiVector, Schema } from "./arrow";
2
+ import { IndexOptions } from "./indices";
3
+ import { MergeInsertBuilder } from "./merge";
4
+ import { AddColumnsResult, AddColumnsSql, AddResult, AlterColumnsResult, BranchContents, DeleteResult, DropColumnsResult, IndexConfig, IndexStatistics, Job, LsmStats, Branches as NativeBranches, OptimizeStats, RefreshColumnResult, RefreshMaterializedViewResult, TableStatistics, Tags, UpdateFieldMetadataResult, UpdateResult, Table as _NativeTable } from "./native";
5
+ import { AutoQuery, FullTextQuery, Query, TakeQuery, VectorQuery } from "./query";
6
+ import { IntoSql } from "./util";
7
+ export { IndexConfig } from "./native";
8
+ export { BucketStats, GenerationStats, LsmStats, MemtableStats, } from "./native";
9
+ /**
10
+ * Progress snapshot for a write operation, delivered to the `progress`
11
+ * callback passed to {@link Table.add}.
12
+ */
13
+ export interface WriteProgress {
14
+ /** Number of rows written so far. */
15
+ outputRows: number;
16
+ /** Number of bytes written so far. */
17
+ outputBytes: number;
18
+ /**
19
+ * Total rows expected, when the input source reports it.
20
+ *
21
+ * Always set on the final callback (the one with `done: true`), falling
22
+ * back to the actual number of rows written when the source could not
23
+ * report a row count up front.
24
+ */
25
+ totalRows?: number;
26
+ /** Wall-clock seconds since the write started. */
27
+ elapsedSeconds: number;
28
+ /** Number of parallel write tasks currently in flight. */
29
+ activeTasks: number;
30
+ /** Total number of parallel write tasks (the write parallelism). */
31
+ totalTasks: number;
32
+ /** `true` for the final callback; `false` otherwise. */
33
+ done: boolean;
34
+ }
35
+ /**
36
+ * Options for adding data to a table.
37
+ */
38
+ export interface AddDataOptions {
39
+ /**
40
+ * If "append" (the default) then the new data will be added to the table
41
+ *
42
+ * If "overwrite" then the new data will replace the existing data in the table.
43
+ */
44
+ mode: "append" | "overwrite";
45
+ /**
46
+ * Optional callback invoked periodically with write progress.
47
+ *
48
+ * The callback is fired once per batch written and once more with
49
+ * `done: true` when the write completes. Calls are dispatched
50
+ * asynchronously to the JS event loop and never block the write — a slow
51
+ * callback will queue events rather than back-pressure the writer.
52
+ *
53
+ * Errors thrown from the callback are logged with `console.warn` and
54
+ * swallowed — they do not abort the write.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * await table.add(data, {
59
+ * progress: (p) => {
60
+ * console.log(`${p.outputRows}/${p.totalRows ?? "?"} rows`);
61
+ * },
62
+ * });
63
+ * ```
64
+ */
65
+ progress: (progress: WriteProgress) => void;
66
+ }
67
+ export interface UpdateOptions {
68
+ /**
69
+ * A filter that limits the scope of the update.
70
+ *
71
+ * This should be an SQL filter expression.
72
+ *
73
+ * Only rows that satisfy the expression will be updated.
74
+ *
75
+ * For example, this could be 'my_col == 0' to replace all instances
76
+ * of 0 in a column with some other default value.
77
+ */
78
+ where: string;
79
+ }
80
+ export interface OptimizeOptions {
81
+ /**
82
+ * If set then all versions older than the given date
83
+ * be removed. The current version will never be removed.
84
+ * The default is 7 days
85
+ * @example
86
+ * // Delete all versions older than 1 day
87
+ * const olderThan = new Date();
88
+ * olderThan.setDate(olderThan.getDate() - 1));
89
+ * tbl.optimize({cleanupOlderThan: olderThan});
90
+ *
91
+ * // Delete all versions except the current version
92
+ * tbl.optimize({cleanupOlderThan: new Date()});
93
+ */
94
+ cleanupOlderThan: Date;
95
+ /**
96
+ * Because they may be part of an in-progress transaction, files newer than
97
+ * 7 days old are not deleted by default. If you are sure that there are no
98
+ * in-progress transactions, then you can set this to true to delete all
99
+ * files older than `cleanupOlderThan`.
100
+ *
101
+ * **WARNING**: This should only be set to true if you can guarantee that
102
+ * no other process is currently working on this dataset. Otherwise the
103
+ * dataset could be put into a corrupted state.
104
+ */
105
+ deleteUnverified: boolean;
106
+ }
107
+ export interface Version {
108
+ version: number;
109
+ timestamp: Date;
110
+ metadata: Record<string, string>;
111
+ }
112
+ /** Token produced by the tokenizer configured on a full-text search index. */
113
+ export interface FtsToken {
114
+ /** Token text after tokenizer filters have been applied. */
115
+ text: string;
116
+ /** Token position used by full-text query matching. */
117
+ position: number;
118
+ }
119
+ export type TokenizeTableOptions = {
120
+ /** FTS-indexed column whose tokenizer should be used. */
121
+ column: string;
122
+ indexName?: never;
123
+ } | {
124
+ /** Name of the FTS index whose tokenizer should be used. */
125
+ indexName: string;
126
+ column?: never;
127
+ };
128
+ /**
129
+ * Specification selecting Lance's MemWAL LSM-style write path for
130
+ * `mergeInsert`.
131
+ *
132
+ * `specType` is `"bucket"`, `"identity"`, or `"unsharded"`. For `"bucket"`,
133
+ * `column` and `numBuckets` are required; for `"identity"`, `column` is
134
+ * required and must be a deterministic function of the unenforced primary
135
+ * key (every row with a given primary key must always produce the same
136
+ * `column` value, or upserts of that key can land in different shards and a
137
+ * stale version can win).
138
+ */
139
+ export interface LsmWriteSpec {
140
+ /** One of `"bucket"`, `"identity"`, or `"unsharded"`. */
141
+ specType: "bucket" | "identity" | "unsharded";
142
+ /** Bucket and identity variants: the sharding column. */
143
+ column?: string;
144
+ /** Bucket variant: the number of buckets, in `[1, 1024]`. */
145
+ numBuckets?: number;
146
+ /**
147
+ * Indexes the MemWAL keeps up to date. Omit to maintain every supported
148
+ * index, resolved on install — a snapshot, so indexes created later are not
149
+ * maintained. Pass `[]` for none.
150
+ */
151
+ maintainedIndexes?: string[];
152
+ /** Default `ShardWriter` configuration recorded in the MemWAL index. */
153
+ writerConfigDefaults?: Record<string, string>;
154
+ }
155
+ /**
156
+ * A Table is a collection of Records in a LanceDB Database.
157
+ *
158
+ * A Table object is expected to be long lived and reused for multiple operations.
159
+ * Table objects will cache a certain amount of index data in memory. This cache
160
+ * will be freed when the Table is garbage collected. To eagerly free the cache you
161
+ * can call the `close` method. Once the Table is closed, it cannot be used for any
162
+ * further operations.
163
+ *
164
+ * Tables are created using the methods {@link Connection#createTable}
165
+ * and {@link Connection#createEmptyTable}. Existing tables are opened
166
+ * using {@link Connection#openTable}.
167
+ *
168
+ * Closing a table is optional. It not closed, it will be closed when it is garbage
169
+ * collected.
170
+ *
171
+ * @hideconstructor
172
+ */
173
+ export declare abstract class Table {
174
+ /** Returns the name of the table */
175
+ abstract get name(): string;
176
+ /** Return true if the table has not been closed */
177
+ abstract isOpen(): boolean;
178
+ /**
179
+ * Close the table, releasing any underlying resources.
180
+ *
181
+ * It is safe to call this method multiple times.
182
+ *
183
+ * Any attempt to use the table after it is closed will result in an error.
184
+ */
185
+ abstract close(): void;
186
+ /** Return a brief description of the table */
187
+ abstract display(): string;
188
+ /** Get the schema of the table. */
189
+ abstract schema(): Promise<Schema>;
190
+ /**
191
+ * Insert records into this Table.
192
+ * @param {Data} data Records to be inserted into the Table
193
+ * @returns {Promise<AddResult>} A promise that resolves to an object
194
+ * containing the new version number of the table
195
+ */
196
+ abstract add(data: Data, options?: Partial<AddDataOptions>): Promise<AddResult>;
197
+ /**
198
+ * Update existing records in the Table
199
+ * @param opts.values The values to update. The keys are the column names and the values
200
+ * are the values to set.
201
+ * @returns {Promise<UpdateResult>} A promise that resolves to an object containing
202
+ * the number of rows updated and the new version number
203
+ * @example
204
+ * ```ts
205
+ * table.update({where:"x = 2", values:{"vector": [10, 10]}})
206
+ * ```
207
+ */
208
+ abstract update(opts: {
209
+ values: Map<string, IntoSql> | Record<string, IntoSql>;
210
+ } & Partial<UpdateOptions>): Promise<UpdateResult>;
211
+ /**
212
+ * Update existing records in the Table
213
+ * @param opts.valuesSql The values to update. The keys are the column names and the values
214
+ * are the values to set. The values are SQL expressions.
215
+ * @returns {Promise<UpdateResult>} A promise that resolves to an object containing
216
+ * the number of rows updated and the new version number
217
+ * @example
218
+ * ```ts
219
+ * table.update({where:"x = 2", valuesSql:{"x": "x + 1"}})
220
+ * ```
221
+ */
222
+ abstract update(opts: {
223
+ valuesSql: Map<string, string> | Record<string, string>;
224
+ } & Partial<UpdateOptions>): Promise<UpdateResult>;
225
+ /**
226
+ * Update existing records in the Table
227
+ *
228
+ * An update operation can be used to adjust existing values. Use the
229
+ * returned builder to specify which columns to update. The new value
230
+ * can be a literal value (e.g. replacing nulls with some default value)
231
+ * or an expression applied to the old value (e.g. incrementing a value)
232
+ *
233
+ * An optional condition can be specified (e.g. "only update if the old
234
+ * value is 0")
235
+ *
236
+ * Note: if your condition is something like "some_id_column == 7" and
237
+ * you are updating many rows (with different ids) then you will get
238
+ * better performance with a single [`merge_insert`] call instead of
239
+ * repeatedly calilng this method.
240
+ * @param {Map<string, string> | Record<string, string>} updates - the
241
+ * columns to update
242
+ * @returns {Promise<UpdateResult>} A promise that resolves to an object
243
+ * containing the number of rows updated and the new version number
244
+ *
245
+ * Keys in the map should specify the name of the column to update.
246
+ * Values in the map provide the new value of the column. These can
247
+ * be SQL literal strings (e.g. "7" or "'foo'") or they can be expressions
248
+ * based on the row being updated (e.g. "my_col + 1")
249
+ * @param {Partial<UpdateOptions>} options - additional options to control
250
+ * the update behavior
251
+ */
252
+ abstract update(updates: Map<string, string> | Record<string, string>, options?: Partial<UpdateOptions>): Promise<UpdateResult>;
253
+ /** Count the total number of rows in the dataset. */
254
+ abstract countRows(filter?: string): Promise<number>;
255
+ /**
256
+ * Delete the rows that satisfy the predicate.
257
+ * @returns {Promise<DeleteResult>} A promise that resolves to an object
258
+ * containing the new version number of the table
259
+ */
260
+ abstract delete(predicate: string): Promise<DeleteResult>;
261
+ /**
262
+ * Create an index to speed up queries.
263
+ *
264
+ * Indices can be created on vector columns or scalar columns.
265
+ * Indices on vector columns will speed up vector searches.
266
+ * Indices on scalar columns will speed up filtering (in both
267
+ * vector and non-vector searches)
268
+ *
269
+ * We currently don't support custom named indexes.
270
+ * The index name will always be `${column}_idx`.
271
+ *
272
+ * @example
273
+ * // If the column has a vector (fixed size list) data type then
274
+ * // an IvfPq vector index will be created.
275
+ * const table = await conn.openTable("my_table");
276
+ * await table.createIndex("vector");
277
+ * @example
278
+ * // For advanced control over vector index creation you can specify
279
+ * // the index type and options.
280
+ * const table = await conn.openTable("my_table");
281
+ * await table.createIndex("vector", {
282
+ * config: lancedb.Index.ivfPq({
283
+ * numPartitions: 128,
284
+ * numSubVectors: 16,
285
+ * }),
286
+ * });
287
+ * @example
288
+ * // Or create a Scalar index
289
+ * await table.createIndex("my_float_col");
290
+ */
291
+ abstract createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
292
+ /**
293
+ * Create an index, returning a handle to the indexing job.
294
+ *
295
+ * The job may already be complete when returned; callers must not assume
296
+ * the index exists until {@link Job.wait} resolves.
297
+ */
298
+ abstract createIndexAsync(column: string, options?: Partial<IndexOptions>): Promise<Job>;
299
+ /**
300
+ * Drop an index from the table.
301
+ *
302
+ * @param name The name of the index.
303
+ *
304
+ * This does not delete the index from disk, it just removes it from the table.
305
+ * To delete the index, run {@link Table#optimize} after dropping the index.
306
+ *
307
+ * Use {@link Table.listIndices} to find the names of the indices.
308
+ */
309
+ abstract dropIndex(name: string): Promise<void>;
310
+ /**
311
+ * Prewarm an index in the table.
312
+ *
313
+ * @param name The name of the index.
314
+ *
315
+ * This will load the index into memory. This may reduce the cold-start time for
316
+ * future queries. If the index does not fit in the cache then this call may be
317
+ * wasteful.
318
+ */
319
+ abstract prewarmIndex(name: string): Promise<void>;
320
+ /**
321
+ * Prewarm one or more columns of data in the table.
322
+ *
323
+ * @param columns The columns to prewarm. If undefined, all columns are prewarmed.
324
+ *
325
+ * This will load the column data into the page cache so that future queries that
326
+ * read those columns avoid the initial cold-start latency. This call initiates
327
+ * prewarming and returns once the request is accepted; the warming itself may
328
+ * continue in the background. Calling it on already-prewarmed columns is a
329
+ * no-op on the server.
330
+ *
331
+ * Prewarming is generally useful for columns used in filters or projections.
332
+ * Large columns (e.g. high-dimensional vectors or binary data) may not be
333
+ * practical to prewarm.
334
+ *
335
+ * This feature is currently only supported on remote tables.
336
+ */
337
+ abstract prewarmData(columns?: string[]): Promise<void>;
338
+ /**
339
+ * Waits for asynchronous indexing to complete on the table.
340
+ *
341
+ * @param indexNames The name of the indices to wait for
342
+ * @param timeoutSeconds The number of seconds to wait before timing out
343
+ *
344
+ * This will raise an error if the indices are not created and fully indexed within the timeout.
345
+ */
346
+ abstract waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
347
+ /**
348
+ * Create a {@link Query} Builder.
349
+ *
350
+ * Queries allow you to search your existing data. By default the query will
351
+ * return all the data in the table in no particular order. The builder
352
+ * returned by this method can be used to control the query using filtering,
353
+ * vector similarity, sorting, and more.
354
+ *
355
+ * Note: By default, all columns are returned. For best performance, you should
356
+ * only fetch the columns you need.
357
+ *
358
+ * When appropriate, various indices and statistics based pruning will be used to
359
+ * accelerate the query.
360
+ * @example
361
+ * // SQL-style filtering
362
+ * //
363
+ * // This query will return up to 1000 rows whose value in the `id` column
364
+ * // is greater than 5. LanceDb supports a broad set of filtering functions.
365
+ * for await (const batch of table
366
+ * .query()
367
+ * .where("id > 1")
368
+ * .select(["id"])
369
+ * .limit(20)) {
370
+ * console.log(batch);
371
+ * }
372
+ * @example
373
+ * // Vector Similarity Search
374
+ * //
375
+ * // This example will find the 10 rows whose value in the "vector" column are
376
+ * // closest to the query vector [1.0, 2.0, 3.0]. If an index has been created
377
+ * // on the "vector" column then this will perform an ANN search.
378
+ * //
379
+ * // The `refineFactor` and `nprobes` methods are used to control the recall /
380
+ * // latency tradeoff of the search.
381
+ * for await (const batch of table
382
+ * .query()
383
+ * .where("id > 1")
384
+ * .select(["id"])
385
+ * .limit(20)) {
386
+ * console.log(batch);
387
+ * }
388
+ * @example
389
+ * // Scan the full dataset
390
+ * //
391
+ * // This query will return everything in the table in no particular order.
392
+ * for await (const batch of table.query()) {
393
+ * console.log(batch);
394
+ * }
395
+ * @returns {Query} A builder that can be used to parameterize the query
396
+ */
397
+ abstract query(): Query;
398
+ /**
399
+ * Create a query that returns a subset of the rows in the table.
400
+ * @param offsets The offsets of the rows to return.
401
+ * @returns A builder that can be used to parameterize the query.
402
+ */
403
+ abstract takeOffsets(offsets: number[]): TakeQuery;
404
+ /**
405
+ * Create a query that returns a subset of the rows in the table.
406
+ * @param rowIds The row ids of the rows to return.
407
+ *
408
+ * Row ids returned by `withRowId()` are `bigint`, so `bigint[]` is supported.
409
+ * For convenience / backwards compatibility, `number[]` is also accepted (for
410
+ * small row ids that fit in a safe integer).
411
+ * @returns A builder that can be used to parameterize the query.
412
+ */
413
+ abstract takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
414
+ /**
415
+ * Create a search query to find the nearest neighbors
416
+ * of the given query
417
+ * @param {string | IntoVector} query - the query, a vector or string
418
+ * @param {string} queryType - the type of the query, "vector", "fts", or "auto"
419
+ * @param {string | string[]} ftsColumns - the columns to search in for full text search
420
+ * for now, only one column can be searched at a time.
421
+ *
422
+ * when "auto" is used, if the query is a string and an embedding function is defined, it will be treated as a vector query
423
+ * if the query is a string and no embedding function is defined, it will be treated as a full text search query
424
+ */
425
+ abstract search(query: string | IntoVector | MultiVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query | AutoQuery;
426
+ /**
427
+ * Search the table with a given query vector.
428
+ *
429
+ * This is a convenience method for preparing a vector query and
430
+ * is the same thing as calling `nearestTo` on the builder returned
431
+ * by `query`. @see {@link Query#nearestTo} for more details.
432
+ */
433
+ abstract vectorSearch(vector: IntoVector | MultiVector): VectorQuery;
434
+ /**
435
+ * Add new columns with defined values.
436
+ *
437
+ * The `{ computed }` form stores the expression rather than evaluating it
438
+ * now: the column is committed with no values, and rows get them from
439
+ * {@link Table#refreshColumn}. Declaring one therefore costs the same on a
440
+ * large table as on an empty one.
441
+ *
442
+ * A refresh does not revisit rows it has already filled, so mutating an
443
+ * input leaves the value computed at fill time; recomputing means dropping
444
+ * the column and declaring it again. While a declaration reads a column,
445
+ * that column cannot be renamed, retyped or dropped.
446
+ *
447
+ * On LanceDB Cloud and Enterprise the expression is planned by the
448
+ * server, and the refresh runs as a server job -- see
449
+ * {@link Table#refreshColumnAsync}.
450
+ * @param {AddColumnsSql[] | Field | Field[] | Schema} newColumnTransforms Either:
451
+ * - An array of objects with column names and SQL expressions to calculate values
452
+ * - A single Arrow Field defining one column with its data type (column will be initialized with null values)
453
+ * - An array of Arrow Fields defining columns with their data types (columns will be initialized with null values)
454
+ * - An Arrow Schema defining columns with their data types (columns will be initialized with null values)
455
+ * - `{ computed }`, declaring columns defined by a SQL expression whose type and inputs are derived from it
456
+ * @returns {Promise<AddColumnsResult>} A promise that resolves to an object
457
+ * containing the new version number of the table after adding the columns.
458
+ * @example
459
+ * ```ts
460
+ * await table.addColumns({ computed: [{ name: "doubled", valueSql: "x * 2" }] });
461
+ * const { rowsFilled } = await table.refreshColumn("doubled");
462
+ * ```
463
+ */
464
+ abstract addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema | {
465
+ computed: AddColumnsSql[];
466
+ }): Promise<AddColumnsResult>;
467
+ /**
468
+ * Fill the rows of a computed column that hold no value yet.
469
+ *
470
+ * Rows appended since the last refresh are filled by the next one; rows
471
+ * already filled are left as they are, so the call is idempotent and does
472
+ * not observe a mutated input. Local tables only: a remote refresh runs
473
+ * as a server job, through {@link Table#refreshColumnAsync}.
474
+ * @param {string} column The name of the computed column to fill.
475
+ * @returns {Promise<RefreshColumnResult>} A promise that resolves to the
476
+ * number of rows filled and the new version number of the table.
477
+ */
478
+ abstract refreshColumn(column: string): Promise<RefreshColumnResult>;
479
+ /**
480
+ * Like {@link Table#refreshColumn}, but returns a handle to the refresh
481
+ * job instead of blocking until it completes.
482
+ *
483
+ * The job may already be complete when returned; callers must not assume
484
+ * the column is filled until {@link Job.wait} resolves. Invalid input --
485
+ * an unknown column, or one that is not computed -- rejects here rather
486
+ * than failing the job. On local tables the job runs in-process; on
487
+ * LanceDB Cloud and Enterprise it is the server's backfill job.
488
+ * @param {string} column The name of the computed column to fill.
489
+ * @example
490
+ * ```ts
491
+ * const job = await table.refreshColumnAsync("doubled");
492
+ * await job.wait();
493
+ * console.log(await job.status()); // "finished"
494
+ * ```
495
+ */
496
+ abstract refreshColumnAsync(column: string): Promise<Job>;
497
+ /**
498
+ * Recompute this table's contents from its materialized-view definition.
499
+ *
500
+ * Plumbing for {@link MaterializedView.refresh}, which is the way to call
501
+ * it: rejects tables that carry no view definition. Local tables only.
502
+ * @ignore
503
+ */
504
+ abstract refreshMaterializedView(full?: boolean, sourceVersion?: number): Promise<RefreshMaterializedViewResult>;
505
+ /**
506
+ * Alter the name or nullability of columns.
507
+ * @param {ColumnAlteration[]} columnAlterations One or more alterations to
508
+ * apply to columns.
509
+ * @returns {Promise<AlterColumnsResult>} A promise that resolves to an object
510
+ * containing the new version number of the table after altering the columns.
511
+ */
512
+ abstract alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
513
+ /**
514
+ * Update per-field (column) metadata.
515
+ *
516
+ * The following keys are treated specially, by convention, and should be
517
+ * used when appropriate:
518
+ *
519
+ * - `lancedb:description`: for a human-readable description of a field.
520
+ * - `lancedb:tag:<name>`: for a user-defined key-value tag, where the suffix
521
+ * names the tag category; e.g. `lancedb:tag:model: "clip"`.
522
+ * - `lancedb:logical-column`: for a column grouping; e.g. `feature_v1` and
523
+ * `feature_v2` might be in the same logical column.
524
+ * - `lancedb:status`: for status options (`production`, `candidate`,
525
+ * `deprecated`, `archived`) to designate the current life cycle state of
526
+ * this column.
527
+ * @param {FieldMetadataUpdate[]} updates One or more per-field updates. Each
528
+ * update's metadata is merged into the field's existing metadata by default;
529
+ * a value of `null` deletes that key, and `replace: true` swaps the whole map.
530
+ * @returns {Promise<UpdateFieldMetadataResult>} resolves to the new table version.
531
+ */
532
+ abstract updateFieldMetadata(updates: FieldMetadataUpdate[]): Promise<UpdateFieldMetadataResult>;
533
+ /**
534
+ * Drop one or more columns from the dataset
535
+ *
536
+ * This is a metadata-only operation and does not remove the data from the
537
+ * underlying storage. In order to remove the data, you must subsequently
538
+ * call ``compact_files`` to rewrite the data without the removed columns and
539
+ * then call ``cleanup_files`` to remove the old files.
540
+ * @param {string[]} columnNames The names of the columns to drop. These can
541
+ * be nested column references (e.g. "a.b.c") or top-level column names
542
+ * (e.g. "a").
543
+ * @returns {Promise<DropColumnsResult>} A promise that resolves to an object
544
+ * containing the new version number of the table after dropping the columns.
545
+ */
546
+ abstract dropColumns(columnNames: string[]): Promise<DropColumnsResult>;
547
+ /**
548
+ * Set the unenforced primary key for this table to a single column.
549
+ *
550
+ * "Unenforced" means LanceDB does not check uniqueness on writes; the
551
+ * column is recorded in the schema as the primary key for use by features
552
+ * such as `merge_insert`. Only single-column primary keys are supported,
553
+ * and the key cannot be changed once set.
554
+ * @param {string | string[]} columns The primary key column. A one-element
555
+ * array is also accepted; passing more than one column is rejected.
556
+ * @returns {Promise<void>}
557
+ */
558
+ abstract setUnenforcedPrimaryKey(columns: string | string[]): Promise<void>;
559
+ /**
560
+ * Install an {@link LsmWriteSpec} on this table, selecting Lance's MemWAL
561
+ * LSM-style write path for future `mergeInsert` calls.
562
+ *
563
+ * `LsmWriteSpec` chooses one of three sharding strategies via `specType`:
564
+ *
565
+ * - `"bucket"` — hash-bucket writes by the single-column unenforced primary
566
+ * key (`column` and `numBuckets` required).
567
+ * - `"identity"` — shard by the raw value of a scalar `column`.
568
+ * - `"unsharded"` — route every write to a single shard.
569
+ *
570
+ * All variants require the table to have an unenforced primary key
571
+ * ({@link Table#setUnenforcedPrimaryKey}); bucket sharding additionally
572
+ * requires it to be the single column being bucketed.
573
+ *
574
+ * Omitting `maintainedIndexes` maintains every index on the table, resolved
575
+ * here, failing if one cannot be maintained — name them to install anyway.
576
+ * Naming them pins an exact set, and a still-building index is rejected
577
+ * rather than quietly omitted.
578
+ * @param {LsmWriteSpec} spec The sharding spec to install.
579
+ * @returns {Promise<void>}
580
+ * @example
581
+ * ```ts
582
+ * await table.setUnenforcedPrimaryKey("id");
583
+ * await table.setLsmWriteSpec({
584
+ * specType: "bucket",
585
+ * column: "id",
586
+ * numBuckets: 16,
587
+ * maintainedIndexes: ["id_idx"],
588
+ * });
589
+ * ```
590
+ */
591
+ abstract setLsmWriteSpec(spec: LsmWriteSpec): Promise<void>;
592
+ /**
593
+ * Remove the {@link LsmWriteSpec} from this table, reverting to the standard
594
+ * `mergeInsert` write path.
595
+ *
596
+ * Errors if no spec is currently set.
597
+ * @returns {Promise<void>}
598
+ */
599
+ abstract unsetLsmWriteSpec(): Promise<void>;
600
+ /**
601
+ * Read the {@link LsmWriteSpec} currently installed on this table.
602
+ *
603
+ * Resolves to `undefined` when the MemWAL LSM write path is not enabled (no
604
+ * spec has been set, or it was removed with {@link Table#unsetLsmWriteSpec}).
605
+ * The returned spec mirrors what was passed to
606
+ * {@link Table#setLsmWriteSpec}, except that `maintainedIndexes` always
607
+ * reports the concrete list resolved when the spec was set — `undefined`
608
+ * never round-trips.
609
+ * @returns {Promise<LsmWriteSpec | undefined>}
610
+ */
611
+ abstract getLsmWriteSpec(): Promise<LsmWriteSpec | undefined>;
612
+ /**
613
+ * Drain and close any cached MemWAL shard writers held for this table.
614
+ *
615
+ * When an {@link LsmWriteSpec} is installed, `mergeInsert` opens MemWAL
616
+ * shard writers and caches them for reuse across calls. This closes them,
617
+ * flushing pending data; writers reopen lazily on the next `mergeInsert`.
618
+ * It is a no-op when no writers are cached.
619
+ * @returns {Promise<void>}
620
+ */
621
+ abstract closeLsmWriters(): Promise<void>;
622
+ /**
623
+ * Seal every bucket's active memtable into a new L0 generation.
624
+ *
625
+ * Returns once the seal is committed. Sealing an empty memtable is a no-op,
626
+ * so this is safe to call repeatedly.
627
+ * @returns {Promise<void>}
628
+ */
629
+ abstract flushLsm(): Promise<void>;
630
+ /**
631
+ * Trigger a background L0 → base compaction pass per bucket.
632
+ *
633
+ * Returns once the passes are *dispatched*, not once they finish — watch
634
+ * {@link Table#getLsmStats} for progress, or use
635
+ * {@link Table#checkpointLsm} to wait for convergence.
636
+ * @returns {Promise<void>}
637
+ */
638
+ abstract compactLsm(): Promise<void>;
639
+ /**
640
+ * Converge this table's LSM write path into its base table.
641
+ *
642
+ * Seals once, then triggers compaction and polls until the L0 that existed
643
+ * at the start is gone. The target set is fixed at the start, so
644
+ * generations created *during* the checkpoint are ignored — that is what
645
+ * lets it terminate under write load, and what makes it best-effort: it
646
+ * converges the fresh tier as of some instant. Idempotent, abandonable at
647
+ * any point, and safe to run on a cadence.
648
+ *
649
+ * There is no liveness bound — the compactor pool is shared across tables,
650
+ * so a checkpoint queued behind unrelated work looks exactly like one that
651
+ * is merging. The caller owns the deadline.
652
+ * @returns {Promise<void>}
653
+ * @example
654
+ * ```ts
655
+ * const before = await table.getLsmStats();
656
+ * await table.checkpointLsm();
657
+ * const after = await table.getLsmStats();
658
+ * ```
659
+ */
660
+ abstract checkpointLsm(): Promise<void>;
661
+ /**
662
+ * Read live per-bucket LSM state.
663
+ *
664
+ * Answers "how far behind is my fresh tier", "which bucket is hot", and
665
+ * "why is my fresh-tier vector search brute-force". Mutates no table state.
666
+ *
667
+ * Resolves to `undefined` only when the LSM write path is not enabled.
668
+ * @param {boolean} includeGenerationRows Also count rows per L0 generation.
669
+ * Off by default because each count opens an uncached Lance dataset.
670
+ * @returns {Promise<LsmStats | undefined>}
671
+ */
672
+ abstract getLsmStats(includeGenerationRows?: boolean): Promise<LsmStats | undefined>;
673
+ /** Retrieve the version of the table */
674
+ abstract version(): Promise<number>;
675
+ /**
676
+ * Checks out a specific version of the table _This is an in-place operation._
677
+ *
678
+ * This allows viewing previous versions of the table. If you wish to
679
+ * keep writing to the dataset starting from an old version, then use
680
+ * the `restore` function.
681
+ *
682
+ * Calling this method will set the table into time-travel mode. If you
683
+ * wish to return to standard mode, call `checkoutLatest`.
684
+ * @param {number | string} version The version to checkout, could be version number or tag
685
+ * @example
686
+ * ```typescript
687
+ * import * as lancedb from "@lancedb/lancedb"
688
+ * const db = await lancedb.connect("./.lancedb");
689
+ * const table = await db.createTable("my_table", [
690
+ * { vector: [1.1, 0.9], type: "vector" },
691
+ * ]);
692
+ *
693
+ * console.log(await table.version()); // 1
694
+ * console.log(table.display());
695
+ * await table.add([{ vector: [0.5, 0.2], type: "vector" }]);
696
+ * await table.checkout(1);
697
+ * console.log(await table.version()); // 2
698
+ * ```
699
+ */
700
+ abstract checkout(version: number | string): Promise<void>;
701
+ /**
702
+ * Checkout the latest version of the table. _This is an in-place operation._
703
+ *
704
+ * The table will be set back into standard mode, and will track the latest
705
+ * version of the table.
706
+ */
707
+ abstract checkoutLatest(): Promise<void>;
708
+ /**
709
+ * List all the versions of the table
710
+ */
711
+ abstract listVersions(): Promise<Version[]>;
712
+ /**
713
+ * Get a tags manager for this table.
714
+ *
715
+ * Tags allow you to label specific versions of a table with a human-readable name.
716
+ * The returned tags manager can be used to list, create, update, or delete tags.
717
+ *
718
+ * @returns {Tags} A tags manager for this table
719
+ * @example
720
+ * ```typescript
721
+ * const tagsManager = await table.tags();
722
+ * await tagsManager.create("v1", 1);
723
+ * const tags = await tagsManager.list();
724
+ * console.log(tags); // { "v1": { version: 1, manifestSize: ... } }
725
+ * ```
726
+ */
727
+ abstract tags(): Promise<Tags>;
728
+ /**
729
+ * Get the branch manager for this table.
730
+ *
731
+ * Branches are isolated, writable lines of history forked from another
732
+ * branch (or version). Writes on a branch do not affect `main`.
733
+ */
734
+ abstract branches(): Promise<Branches>;
735
+ /**
736
+ * The branch this table handle is scoped to, or `null` for the main branch.
737
+ *
738
+ * A handle returned by {@link Branches.create} or {@link Branches.checkout}
739
+ * reports the branch it targets; a handle opened normally reports `null`.
740
+ */
741
+ abstract currentBranch(): string | null;
742
+ /**
743
+ * Restore the table to the currently checked out version
744
+ *
745
+ * This operation will fail if checkout has not been called previously
746
+ *
747
+ * This operation will overwrite the latest version of the table with a
748
+ * previous version. Any changes made since the checked out version will
749
+ * no longer be visible.
750
+ *
751
+ * Once the operation concludes the table will no longer be in a checked
752
+ * out state and the read_consistency_interval, if any, will apply.
753
+ */
754
+ abstract restore(): Promise<void>;
755
+ /**
756
+ * Optimize the on-disk data and indices for better performance.
757
+ *
758
+ * Modeled after ``VACUUM`` in PostgreSQL.
759
+ *
760
+ * Optimization covers three operations:
761
+ *
762
+ * - Compaction: Merges small files into larger ones
763
+ * - Prune: Removes old versions of the dataset
764
+ * - Index: Optimizes the indices, adding new data to existing indices
765
+ *
766
+ *
767
+ * The frequency an application should call optimize is based on the frequency of
768
+ * data modifications. If data is frequently added, deleted, or updated then
769
+ * optimize should be run frequently. A good rule of thumb is to run optimize if
770
+ * you have added or modified 100,000 or more records or run more than 20 data
771
+ * modification operations.
772
+ */
773
+ abstract optimize(options?: Partial<OptimizeOptions>): Promise<OptimizeStats>;
774
+ /** List all indices that have been created with {@link Table.createIndex} */
775
+ abstract listIndices(): Promise<IndexConfig[]>;
776
+ /**
777
+ * Tokenize a full-text search query using the tokenizer configured on an FTS index.
778
+ *
779
+ * Specify exactly one of `column` or `indexName`.
780
+ *
781
+ * Model-backed tokenizers such as `jieba/*` and `lindera/*` are rebuilt in
782
+ * the client process from index metadata. For remote tables, this means the
783
+ * same tokenizer model files must also exist locally.
784
+ */
785
+ abstract tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
786
+ /** Return the table as an arrow table */
787
+ abstract toArrow(): Promise<ArrowTable>;
788
+ abstract mergeInsert(on: string | string[]): MergeInsertBuilder;
789
+ /** List all the stats of a specified index
790
+ *
791
+ * @param {string} name The name of the index.
792
+ * @returns {IndexStatistics | undefined} The stats of the index. If the index does not exist, it will return undefined
793
+ *
794
+ * Use {@link Table.listIndices} to find the names of the indices.
795
+ */
796
+ abstract indexStats(name: string): Promise<IndexStatistics | undefined>;
797
+ /** Returns table and fragment statistics
798
+ *
799
+ * @returns {TableStatistics} The table and fragment statistics
800
+ *
801
+ */
802
+ abstract stats(): Promise<TableStatistics>;
803
+ /**
804
+ * Get the initial storage options that were passed in when opening this table.
805
+ *
806
+ * For dynamically refreshed options (e.g., credential vending), use
807
+ * {@link Table.latestStorageOptions}.
808
+ *
809
+ * Warning: This is an internal API and the return value is subject to change.
810
+ *
811
+ * @returns The storage options, or undefined if no storage options were configured.
812
+ */
813
+ abstract initialStorageOptions(): Promise<Record<string, string> | null | undefined>;
814
+ /**
815
+ * Get the latest storage options, refreshing from provider if configured.
816
+ *
817
+ * This method is useful for credential vending scenarios where storage options
818
+ * may be refreshed dynamically. If no dynamic provider is configured, this
819
+ * returns the initial static options.
820
+ *
821
+ * Warning: This is an internal API and the return value is subject to change.
822
+ *
823
+ * @returns The storage options, or undefined if no storage options were configured.
824
+ */
825
+ abstract latestStorageOptions(): Promise<Record<string, string> | null | undefined>;
826
+ }
827
+ export declare class LocalTable extends Table {
828
+ private readonly inner;
829
+ constructor(inner: _NativeTable);
830
+ get name(): string;
831
+ isOpen(): boolean;
832
+ close(): void;
833
+ display(): string;
834
+ private getEmbeddingFunctions;
835
+ /** Get the schema of the table. */
836
+ schema(): Promise<Schema>;
837
+ add(data: Data, options?: Partial<AddDataOptions>): Promise<AddResult>;
838
+ update(optsOrUpdates: (Map<string, string> | Record<string, string>) | ({
839
+ values: Map<string, IntoSql> | Record<string, IntoSql>;
840
+ } & Partial<UpdateOptions>) | ({
841
+ valuesSql: Map<string, string> | Record<string, string>;
842
+ } & Partial<UpdateOptions>), options?: Partial<UpdateOptions>): Promise<UpdateResult>;
843
+ countRows(filter?: string): Promise<number>;
844
+ delete(predicate: string): Promise<DeleteResult>;
845
+ createIndex(column: string, options?: Partial<IndexOptions>): Promise<void>;
846
+ createIndexAsync(column: string, options?: Partial<IndexOptions>): Promise<Job>;
847
+ dropIndex(name: string): Promise<void>;
848
+ prewarmIndex(name: string): Promise<void>;
849
+ prewarmData(columns?: string[]): Promise<void>;
850
+ waitForIndex(indexNames: string[], timeoutSeconds: number): Promise<void>;
851
+ takeOffsets(offsets: number[]): TakeQuery;
852
+ takeRowIds(rowIds: readonly (bigint | number)[]): TakeQuery;
853
+ query(): Query;
854
+ search(query: string | IntoVector | MultiVector | FullTextQuery, queryType?: string, ftsColumns?: string | string[]): VectorQuery | Query | AutoQuery;
855
+ vectorSearch(vector: IntoVector | MultiVector): VectorQuery;
856
+ addColumns(newColumnTransforms: AddColumnsSql[] | Field | Field[] | Schema | {
857
+ computed: AddColumnsSql[];
858
+ }): Promise<AddColumnsResult>;
859
+ refreshColumn(column: string): Promise<RefreshColumnResult>;
860
+ refreshColumnAsync(column: string): Promise<Job>;
861
+ refreshMaterializedView(full?: boolean, sourceVersion?: number): Promise<RefreshMaterializedViewResult>;
862
+ alterColumns(columnAlterations: ColumnAlteration[]): Promise<AlterColumnsResult>;
863
+ updateFieldMetadata(updates: FieldMetadataUpdate[]): Promise<UpdateFieldMetadataResult>;
864
+ dropColumns(columnNames: string[]): Promise<DropColumnsResult>;
865
+ setUnenforcedPrimaryKey(columns: string | string[]): Promise<void>;
866
+ setLsmWriteSpec(spec: LsmWriteSpec): Promise<void>;
867
+ unsetLsmWriteSpec(): Promise<void>;
868
+ getLsmWriteSpec(): Promise<LsmWriteSpec | undefined>;
869
+ closeLsmWriters(): Promise<void>;
870
+ flushLsm(): Promise<void>;
871
+ compactLsm(): Promise<void>;
872
+ checkpointLsm(): Promise<void>;
873
+ getLsmStats(includeGenerationRows?: boolean): Promise<LsmStats | undefined>;
874
+ version(): Promise<number>;
875
+ checkout(version: number | string): Promise<void>;
876
+ checkoutLatest(): Promise<void>;
877
+ listVersions(): Promise<Version[]>;
878
+ restore(): Promise<void>;
879
+ tags(): Promise<Tags>;
880
+ branches(): Promise<Branches>;
881
+ currentBranch(): string | null;
882
+ optimize(options?: Partial<OptimizeOptions>): Promise<OptimizeStats>;
883
+ listIndices(): Promise<IndexConfig[]>;
884
+ tokenize(query: string, options: TokenizeTableOptions): Promise<FtsToken[]>;
885
+ toArrow(): Promise<ArrowTable>;
886
+ indexStats(name: string): Promise<IndexStatistics | undefined>;
887
+ stats(): Promise<TableStatistics>;
888
+ initialStorageOptions(): Promise<Record<string, string> | null | undefined>;
889
+ latestStorageOptions(): Promise<Record<string, string> | null | undefined>;
890
+ mergeInsert(on: string | string[]): MergeInsertBuilder;
891
+ /**
892
+ * Check if the table uses the new manifest path scheme.
893
+ *
894
+ * This function will return true if the table uses the V2 manifest
895
+ * path scheme.
896
+ */
897
+ usesV2ManifestPaths(): Promise<boolean>;
898
+ /**
899
+ * Migrate the table to use the new manifest path scheme.
900
+ *
901
+ * This function will rename all V1 manifests to V2 manifest paths.
902
+ * These paths provide more efficient opening of datasets with many versions
903
+ * on object stores.
904
+ *
905
+ * This function is idempotent, and can be run multiple times without
906
+ * changing the state of the object store.
907
+ *
908
+ * However, it should not be run while other concurrent operations are happening.
909
+ * And it should also run until completion before resuming other operations.
910
+ */
911
+ migrateManifestPathsV2(): Promise<void>;
912
+ }
913
+ /**
914
+ * A definition of a column alteration. The alteration changes the column at
915
+ * `path` to have the new name `name`, to be nullable if `nullable` is true,
916
+ * and to have the data type `data_type`. At least one of `rename` or `nullable`
917
+ * must be provided.
918
+ */
919
+ export interface ColumnAlteration {
920
+ /**
921
+ * The path to the column to alter. This is a dot-separated path to the column.
922
+ * If it is a top-level column then it is just the name of the column. If it is
923
+ * a nested column then it is the path to the column, e.g. "a.b.c" for a column
924
+ * `c` nested inside a column `b` nested inside a column `a`.
925
+ */
926
+ path: string;
927
+ /**
928
+ * The new name of the column. If not provided then the name will not be changed.
929
+ * This must be distinct from the names of all other columns in the table.
930
+ */
931
+ rename?: string;
932
+ /**
933
+ * A new data type for the column. If not provided then the data type will not be changed.
934
+ * Changing data types is limited to casting to the same general type. For example, these
935
+ * changes are valid:
936
+ * * `int32` -> `int64` (integers)
937
+ * * `double` -> `float` (floats)
938
+ * * `string` -> `large_string` (strings)
939
+ * But these changes are not:
940
+ * * `int32` -> `double` (mix integers and floats)
941
+ * * `string` -> `int32` (mix strings and integers)
942
+ */
943
+ dataType?: string | DataType;
944
+ /** Set the new nullability. Note that a nullable column cannot be made non-nullable. */
945
+ nullable?: boolean;
946
+ }
947
+ /** A per-field metadata update, addressed by dot-path. */
948
+ export interface FieldMetadataUpdate {
949
+ /**
950
+ * Dot-separated path to the field. For a top-level column this is just its
951
+ * name; for a nested field it's the path, e.g. "a.b.c".
952
+ */
953
+ path: string;
954
+ /**
955
+ * Metadata key/value pairs. Merged into the field's existing metadata by
956
+ * default; a value of `null` deletes that key. See
957
+ * {@link Table.updateFieldMetadata} for the conventional `lancedb:*` keys.
958
+ */
959
+ metadata: Record<string, string | null>;
960
+ /** If true, replace the field's entire metadata map instead of merging. */
961
+ replace?: boolean;
962
+ }
963
+ /** Summary of a column in a branch diff. */
964
+ export interface BranchColumnSummary {
965
+ name: string;
966
+ dataType: string;
967
+ nullable: boolean;
968
+ }
969
+ /** A column whose definition differs between main and the branch. */
970
+ export interface BranchColumnChange {
971
+ name: string;
972
+ main: BranchColumnSummary;
973
+ branch: BranchColumnSummary;
974
+ }
975
+ /** Summary of an index in a branch diff. */
976
+ export interface BranchIndexSummary {
977
+ indexName: string;
978
+ columns: string[];
979
+ indexType?: string;
980
+ status: string;
981
+ }
982
+ /** Row-level comparison between main and the branch. */
983
+ export interface BranchRowCountSummary {
984
+ unchanged: number;
985
+ newOnBase: number;
986
+ newOnBranch: number;
987
+ staleRecompute: number;
988
+ inputsChanged: number;
989
+ deltaAvailable: boolean;
990
+ }
991
+ /** A reason why a cherry-pick cannot currently land. */
992
+ export interface CherryPickError {
993
+ code: string;
994
+ message: string;
995
+ }
996
+ /** Read-only comparison of a branch against main. */
997
+ export interface BranchDiff {
998
+ fromBranch: string;
999
+ parentVersion: number;
1000
+ mainVersion: number;
1001
+ branchVersion: number;
1002
+ baseMoved: boolean;
1003
+ rowCountMain: number;
1004
+ rowCountBranch: number;
1005
+ rowSummary: BranchRowCountSummary;
1006
+ addedColumns: BranchColumnSummary[];
1007
+ removedColumns: BranchColumnSummary[];
1008
+ changedColumns: BranchColumnChange[];
1009
+ addedIndexes: BranchIndexSummary[];
1010
+ removedIndexes: BranchIndexSummary[];
1011
+ errors: CherryPickError[];
1012
+ }
1013
+ /** Changes that would be, or were, promoted by a cherry-pick. */
1014
+ export interface CherryPickPreview {
1015
+ promotedColumns: string[];
1016
+ }
1017
+ /** Result of previewing or attempting a cherry-pick. */
1018
+ export interface CherryPickResult {
1019
+ status: "ready" | "failed" | "notImplemented" | "cherryPicked" | "unknown";
1020
+ diff: BranchDiff;
1021
+ preview: CherryPickPreview;
1022
+ mainVersionAfter?: number;
1023
+ }
1024
+ /**
1025
+ * Branch manager for a {@link Table}.
1026
+ *
1027
+ * Unlike tags, `create` and `checkout` return a new {@link Table} handle scoped
1028
+ * to the branch; writes on it do not affect `main`.
1029
+ */
1030
+ export declare class Branches {
1031
+ #private;
1032
+ /**
1033
+ * Construct a Branches manager. Internal use only.
1034
+ * @hidden
1035
+ */
1036
+ constructor(inner: NativeBranches);
1037
+ /** List all branches, mapping name to branch metadata. */
1038
+ list(): Promise<Record<string, BranchContents>>;
1039
+ /**
1040
+ * Create a branch and return a handle scoped to it.
1041
+ *
1042
+ * @param name Name of the new branch.
1043
+ * @param fromRef Source branch to fork from. Defaults to `main`.
1044
+ * @param fromVersion A specific version on `fromRef`. Defaults to latest.
1045
+ */
1046
+ create(name: string, fromRef?: string, fromVersion?: number): Promise<Table>;
1047
+ /**
1048
+ * Check out an existing branch and return a handle scoped to it.
1049
+ *
1050
+ * With `version` set, the returned handle is pinned to that version of the
1051
+ * branch (a read-only, detached view); otherwise it tracks the branch's
1052
+ * latest and stays writable.
1053
+ */
1054
+ checkout(name: string, version?: number): Promise<Table>;
1055
+ /** Delete a branch. */
1056
+ delete(name: string): Promise<void>;
1057
+ /** Compare a branch against main without modifying either branch. */
1058
+ diff(fromBranch: string): Promise<BranchDiff>;
1059
+ /**
1060
+ * Cherry-pick a branch onto main.
1061
+ *
1062
+ * Set `dryRun` to `true` to preview. A failed cherry-pick resolves
1063
+ * with `status: "failed"` instead of throwing.
1064
+ *
1065
+ * @param fromBranch Branch to cherry-pick from.
1066
+ * @param dryRun When true, only preview. Defaults to false.
1067
+ */
1068
+ cherryPick(fromBranch: string, dryRun?: boolean): Promise<CherryPickResult>;
1069
+ }