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,9 @@
1
+ import { type DataType } from "apache-arrow";
2
+ /**
3
+ * Map a JS TypedArray instance to the corresponding Arrow element type and
4
+ * length. Returns undefined when the view is not a supported TypedArray.
5
+ */
6
+ export declare function typedArrayToArrowType(value: ArrayBufferView): {
7
+ elementType: DataType;
8
+ length: number;
9
+ } | undefined;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // SPDX-FileCopyrightText: Copyright The LanceDB Authors
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.typedArrayToArrowType = typedArrayToArrowType;
6
+ const apache_arrow_1 = require("apache-arrow");
7
+ /**
8
+ * Map a JS TypedArray instance to the corresponding Arrow element type and
9
+ * length. Returns undefined when the view is not a supported TypedArray.
10
+ */
11
+ function typedArrayToArrowType(value) {
12
+ if (value instanceof Float32Array)
13
+ return { elementType: new apache_arrow_1.Float32(), length: value.length };
14
+ if (value instanceof Float64Array)
15
+ return { elementType: new apache_arrow_1.Float64(), length: value.length };
16
+ if (value instanceof Uint8Array)
17
+ return { elementType: new apache_arrow_1.Uint8(), length: value.length };
18
+ if (value instanceof Uint16Array)
19
+ return { elementType: new apache_arrow_1.Uint16(), length: value.length };
20
+ if (value instanceof Uint32Array)
21
+ return { elementType: new apache_arrow_1.Uint32(), length: value.length };
22
+ if (value instanceof Int8Array)
23
+ return { elementType: new apache_arrow_1.Int8(), length: value.length };
24
+ if (value instanceof Int16Array)
25
+ return { elementType: new apache_arrow_1.Int16(), length: value.length };
26
+ if (value instanceof Int32Array)
27
+ return { elementType: new apache_arrow_1.Int32(), length: value.length };
28
+ return undefined;
29
+ }
@@ -0,0 +1,508 @@
1
+ import { Data, SchemaLike, TableLike } from "./arrow";
2
+ import { Table as ArrowTable } from "./arrow";
3
+ import { EmbeddingFunctionConfig } from "./embedding/registry";
4
+ import { MaterializedView, MaterializedViewSelect } from "./materialized_view";
5
+ import { Connection as LanceDbConnection } from "./native";
6
+ import type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, Job, JobDescription, JobInfo, ListNamespacesResponse, ListTablesResponse } from "./native";
7
+ export type { CreateNamespaceResponse, DescribeNamespaceResponse, DropNamespaceResponse, ListNamespacesResponse, ListTablesResponse, };
8
+ import { Table } from "./table";
9
+ export interface CreateTableOptions {
10
+ /**
11
+ * The mode to use when creating the table.
12
+ *
13
+ * If this is set to "create" and the table already exists then either
14
+ * an error will be thrown or, if existOk is true, then nothing will
15
+ * happen. Any provided data will be ignored.
16
+ *
17
+ * If this is set to "overwrite" then any existing table will be replaced.
18
+ */
19
+ mode: "create" | "overwrite";
20
+ /**
21
+ * If this is true and the table already exists and the mode is "create"
22
+ * then no error will be raised.
23
+ */
24
+ existOk: boolean;
25
+ /**
26
+ * Configuration for object storage.
27
+ *
28
+ * Options already set on the connection will be inherited by the table,
29
+ * but can be overridden here.
30
+ *
31
+ * The available options are described at https://docs.lancedb.com/storage/
32
+ */
33
+ storageOptions?: Record<string, string>;
34
+ /**
35
+ * The version of the data storage format to use.
36
+ *
37
+ * The default is `stable`.
38
+ * Set to "legacy" to use the old format.
39
+ *
40
+ * @deprecated Pass `new_table_data_storage_version` to storageOptions instead.
41
+ */
42
+ dataStorageVersion?: string;
43
+ /**
44
+ * Use the new V2 manifest paths. These paths provide more efficient
45
+ * opening of datasets with many versions on object stores. WARNING:
46
+ * turning this on will make the dataset unreadable for older versions
47
+ * of LanceDB (prior to 0.10.0). To migrate an existing dataset, instead
48
+ * use the {@link LocalTable#migrateManifestPathsV2} method.
49
+ *
50
+ * @deprecated Pass `new_table_enable_v2_manifest_paths` to storageOptions instead.
51
+ */
52
+ enableV2ManifestPaths?: boolean;
53
+ schema?: SchemaLike;
54
+ embeddingFunction?: EmbeddingFunctionConfig;
55
+ }
56
+ export interface OpenTableOptions {
57
+ /**
58
+ * Open the table scoped to this branch instead of the default branch.
59
+ *
60
+ * Reads and writes on the returned table operate in the branch's context.
61
+ */
62
+ branch?: string;
63
+ /**
64
+ * Open the table pinned to this version, producing a read-only view.
65
+ *
66
+ * Composes with {@link OpenTableOptions.branch}: when both are set, opens
67
+ * that branch at the version; otherwise opens `main` at the version. Call
68
+ * `checkoutLatest` to return to a writable state.
69
+ */
70
+ version?: number;
71
+ /**
72
+ * Configuration for object storage.
73
+ *
74
+ * Options already set on the connection will be inherited by the table,
75
+ * but can be overridden here.
76
+ *
77
+ * The available options are described at https://docs.lancedb.com/storage/
78
+ */
79
+ storageOptions?: Record<string, string>;
80
+ /**
81
+ * Set the size of the index cache, specified as a number of entries
82
+ *
83
+ * @deprecated Use session-level cache configuration instead.
84
+ * Create a Session with custom cache sizes and pass it to the connect() function.
85
+ *
86
+ * The exact meaning of an "entry" will depend on the type of index:
87
+ * - IVF: there is one entry for each IVF partition
88
+ * - BTREE: there is one entry for the entire index
89
+ *
90
+ * This cache applies to the entire opened table, across all indices.
91
+ * Setting this value higher will increase performance on larger datasets
92
+ * at the expense of more RAM
93
+ */
94
+ indexCacheSize?: number;
95
+ }
96
+ /**
97
+ * @deprecated Use {@link ListTablesOptions} with {@link Connection.listTables}
98
+ * instead.
99
+ */
100
+ export interface TableNamesOptions {
101
+ /**
102
+ * If present, only return names that come lexicographically after the
103
+ * supplied value.
104
+ *
105
+ * This can be combined with limit to implement pagination by setting this to
106
+ * the last table name from the previous page.
107
+ */
108
+ startAfter?: string;
109
+ /** An optional limit to the number of results to return. */
110
+ limit?: number;
111
+ }
112
+ export interface ListTablesOptions {
113
+ /**
114
+ * Token from a previous response, to resume listing where it left off.
115
+ *
116
+ * The token is opaque: it carries whatever the database needs to resume, and
117
+ * callers should not construct or interpret one.
118
+ */
119
+ pageToken?: string;
120
+ /**
121
+ * An upper bound on how many tables to return.
122
+ *
123
+ * A page may hold fewer than this and still not be the last one, so keep
124
+ * going while the response carries a page token rather than while pages are
125
+ * full.
126
+ */
127
+ limit?: number;
128
+ }
129
+ export interface ListNamespacesOptions {
130
+ /** Token from a previous response for pagination. */
131
+ pageToken?: string;
132
+ /** An optional limit to the number of results to return. */
133
+ limit?: number;
134
+ }
135
+ export interface CreateNamespaceOptions {
136
+ /** Creation mode. */
137
+ mode?: "create" | "exist_ok" | "overwrite";
138
+ /** Properties to set on the new namespace. */
139
+ properties?: Record<string, string>;
140
+ }
141
+ export interface DropNamespaceOptions {
142
+ /** Whether to skip if the namespace doesn't exist, or fail. */
143
+ mode?: "skip" | "fail";
144
+ /** Refuse to drop if non-empty (restrict) or drop recursively (cascade). */
145
+ behavior?: "restrict" | "cascade";
146
+ }
147
+ export interface RenameTableOptions {
148
+ /**
149
+ * The namespace path of the table being renamed. Defaults to the root
150
+ * namespace (`[]`) when omitted.
151
+ */
152
+ namespacePath?: string[];
153
+ /**
154
+ * The namespace path to move the table to as part of the rename. When
155
+ * omitted the table stays in `namespacePath`.
156
+ */
157
+ newNamespacePath?: string[];
158
+ }
159
+ /**
160
+ * A LanceDB Connection that allows you to open tables and create new ones.
161
+ *
162
+ * Connection could be local against filesystem or remote against a server.
163
+ *
164
+ * A Connection is intended to be a long lived object and may hold open
165
+ * resources such as HTTP connection pools. This is generally fine and
166
+ * a single connection should be shared if it is going to be used many
167
+ * times. However, if you are finished with a connection, you may call
168
+ * close to eagerly free these resources. Any call to a Connection
169
+ * method after it has been closed will result in an error.
170
+ *
171
+ * Closing a connection is optional. Connections will automatically
172
+ * be closed when they are garbage collected.
173
+ *
174
+ * Any created tables are independent and will continue to work even if
175
+ * the underlying connection has been closed.
176
+ * @hideconstructor
177
+ */
178
+ export declare abstract class Connection {
179
+ /**
180
+ * Return true if the connection has not been closed
181
+ */
182
+ abstract isOpen(): boolean;
183
+ /**
184
+ * Close the connection, releasing any underlying resources.
185
+ *
186
+ * It is safe to call this method multiple times.
187
+ *
188
+ * Any attempt to use the connection after it is closed will result in an error.
189
+ */
190
+ abstract close(): void;
191
+ /**
192
+ * Return a brief description of the connection
193
+ */
194
+ abstract display(): string;
195
+ /**
196
+ * List all the table names in this database.
197
+ *
198
+ * Tables will be returned in lexicographical order.
199
+ * @param {Partial<TableNamesOptions>} options - options to control the
200
+ * paging / start point (backwards compatibility)
201
+ *
202
+ * @deprecated Use {@link Connection.listTables} instead.
203
+ */
204
+ abstract tableNames(options?: Partial<TableNamesOptions>): Promise<string[]>;
205
+ /**
206
+ * List all the table names in this database.
207
+ *
208
+ * Tables will be returned in lexicographical order.
209
+ * @param {string[]} namespacePath - The namespace path to list tables from (defaults to root namespace)
210
+ * @param {Partial<TableNamesOptions>} options - options to control the
211
+ * paging / start point
212
+ *
213
+ * @deprecated Use {@link Connection.listTables} instead.
214
+ */
215
+ abstract tableNames(namespacePath?: string[], options?: Partial<TableNamesOptions>): Promise<string[]>;
216
+ /**
217
+ * List a page of the tables in this database.
218
+ *
219
+ * To retrieve the tables after the page, pass the `pageToken` the response
220
+ * carries back in. A page can be shorter than `limit` without being the last
221
+ * one, so walk until a response carries no page token:
222
+ *
223
+ * ```ts
224
+ * const names = [];
225
+ * let pageToken = undefined;
226
+ * do {
227
+ * const page = await conn.listTables({ pageToken, limit: 100 });
228
+ * names.push(...page.tables);
229
+ * pageToken = page.pageToken;
230
+ * } while (pageToken);
231
+ * ```
232
+ *
233
+ * @param {Partial<ListTablesOptions>} options - Pagination options
234
+ * (`pageToken`, `limit`).
235
+ * @returns {Promise<ListTablesResponse>} A page of table names and an
236
+ * optional token for the tables after it.
237
+ */
238
+ abstract listTables(options?: Partial<ListTablesOptions>): Promise<ListTablesResponse>;
239
+ /**
240
+ * List a page of the tables in this database.
241
+ *
242
+ * @param {string[]} namespacePath - The namespace path to list tables from
243
+ * (defaults to root namespace)
244
+ * @param {Partial<ListTablesOptions>} options - Pagination options
245
+ * (`pageToken`, `limit`).
246
+ * @returns {Promise<ListTablesResponse>} A page of table names and an
247
+ * optional token for the tables after it.
248
+ */
249
+ abstract listTables(namespacePath?: string[], options?: Partial<ListTablesOptions>): Promise<ListTablesResponse>;
250
+ /**
251
+ * Open a table in the database.
252
+ * @param {string} name - The name of the table
253
+ * @param {string[]} namespacePath - The namespace path of the table (defaults to root namespace)
254
+ * @param {Partial<OpenTableOptions>} options - Additional options
255
+ */
256
+ /**
257
+ * Define a materialized view named `name` over the table `source`.
258
+ *
259
+ * The view is created empty, with the query recorded in its schema
260
+ * metadata; `view.refresh()` computes the rows. The view is a normal
261
+ * table: it can be queried, indexed and searched, and it appears in
262
+ * `tableNames`. The source table must have stable row ids (create it with
263
+ * the `newTableEnableStableRowIds` storage option); they keep the view's
264
+ * provenance valid across source compactions and cannot be enabled after
265
+ * a table exists. Local databases only.
266
+ */
267
+ abstract createMaterializedView(name: string, source: string, options?: {
268
+ select?: MaterializedViewSelect;
269
+ where?: string;
270
+ limit?: number;
271
+ }): Promise<MaterializedView>;
272
+ /**
273
+ * Open the materialized view named `name`.
274
+ *
275
+ * Rejects a table that exists but is not a materialized view.
276
+ */
277
+ abstract openMaterializedView(name: string): Promise<MaterializedView>;
278
+ /**
279
+ * The names of the materialized views in this database.
280
+ *
281
+ * Found by reading every table's schema, so this costs an open per table.
282
+ */
283
+ abstract listMaterializedViews(): Promise<string[]>;
284
+ abstract openTable(name: string, namespacePath?: string[], options?: Partial<OpenTableOptions>): Promise<Table>;
285
+ /**
286
+ * Creates a new Table and initialize it with new data.
287
+ * @param {object} options - The options object.
288
+ * @param {string} options.name - The name of the table.
289
+ * @param {Data} options.data - Non-empty Array of Records to be inserted into the table
290
+ * @param {string[]} namespacePath - The namespace path to create the table in (defaults to root namespace)
291
+ *
292
+ */
293
+ abstract createTable(options: {
294
+ name: string;
295
+ data: Data;
296
+ } & Partial<CreateTableOptions>, namespacePath?: string[]): Promise<Table>;
297
+ /**
298
+ * Creates a new Table and initialize it with new data.
299
+ * @param {string} name - The name of the table.
300
+ * @param {Record<string, unknown>[] | TableLike} data - Non-empty Array of Records
301
+ * to be inserted into the table
302
+ * @param {Partial<CreateTableOptions>} options - Additional options (backwards compatibility)
303
+ */
304
+ abstract createTable(name: string, data: Record<string, unknown>[] | TableLike, options?: Partial<CreateTableOptions>): Promise<Table>;
305
+ /**
306
+ * Creates a new Table and initialize it with new data.
307
+ * @param {string} name - The name of the table.
308
+ * @param {Record<string, unknown>[] | TableLike} data - Non-empty Array of Records
309
+ * to be inserted into the table
310
+ * @param {string[]} namespacePath - The namespace path to create the table in (defaults to root namespace)
311
+ * @param {Partial<CreateTableOptions>} options - Additional options
312
+ */
313
+ abstract createTable(name: string, data: Record<string, unknown>[] | TableLike, namespacePath?: string[], options?: Partial<CreateTableOptions>): Promise<Table>;
314
+ /**
315
+ * Creates a new empty Table
316
+ * @param {string} name - The name of the table.
317
+ * @param {Schema} schema - The schema of the table
318
+ * @param {Partial<CreateTableOptions>} options - Additional options (backwards compatibility)
319
+ */
320
+ abstract createEmptyTable(name: string, schema: import("./arrow").SchemaLike, options?: Partial<CreateTableOptions>): Promise<Table>;
321
+ /**
322
+ * Creates a new empty Table
323
+ * @param {string} name - The name of the table.
324
+ * @param {Schema} schema - The schema of the table
325
+ * @param {string[]} namespacePath - The namespace path to create the table in (defaults to root namespace)
326
+ * @param {Partial<CreateTableOptions>} options - Additional options
327
+ */
328
+ abstract createEmptyTable(name: string, schema: import("./arrow").SchemaLike, namespacePath?: string[], options?: Partial<CreateTableOptions>): Promise<Table>;
329
+ /**
330
+ * Drop an existing table.
331
+ * @param {string} name The name of the table to drop.
332
+ * @param {string[]} namespacePath The namespace path of the table (defaults to root namespace).
333
+ */
334
+ abstract dropTable(name: string, namespacePath?: string[]): Promise<void>;
335
+ /**
336
+ * Start dropping a table and return its cleanup job.
337
+ *
338
+ * The table may become unavailable before its data files are removed. Wait
339
+ * on the returned job to know when cleanup has finished.
340
+ */
341
+ abstract dropTableAsync(name: string, namespacePath?: string[]): Promise<Job>;
342
+ /**
343
+ * Drop all tables in the database.
344
+ * @param {string[]} namespacePath The namespace path to drop tables from (defaults to root namespace).
345
+ */
346
+ abstract dropAllTables(namespacePath?: string[]): Promise<void>;
347
+ /**
348
+ * Describe a namespace, returning its properties.
349
+ *
350
+ * @param {string[]} namespacePath - The namespace path to describe, in
351
+ * parent → child order, e.g. `["analytics", "sales"]`.
352
+ * @returns {Promise<DescribeNamespaceResponse>} The namespace's properties
353
+ * (may be undefined if the namespace has none).
354
+ */
355
+ abstract describeNamespace(namespacePath: string[]): Promise<DescribeNamespaceResponse>;
356
+ /**
357
+ * List the immediate child namespaces under the given parent.
358
+ *
359
+ * Results may be paginated. To retrieve subsequent pages, pass the
360
+ * `pageToken` returned by a previous call.
361
+ *
362
+ * @param {string[]} namespacePath - The parent namespace path. Defaults
363
+ * to the root namespace if omitted.
364
+ * @param {Partial<ListNamespacesOptions>} options - Pagination options
365
+ * (`pageToken`, `limit`).
366
+ * @returns {Promise<ListNamespacesResponse>} Child namespace names and
367
+ * an optional token for fetching the next page.
368
+ */
369
+ abstract listNamespaces(namespacePath?: string[], options?: Partial<ListNamespacesOptions>): Promise<ListNamespacesResponse>;
370
+ /**
371
+ * Create a new namespace at the given path.
372
+ *
373
+ * @param {string[]} namespacePath - The namespace path to create.
374
+ * @param {Partial<CreateNamespaceOptions>} options - Creation `mode`
375
+ * ("create" | "exist_ok" | "overwrite") and optional `properties`
376
+ * to attach to the namespace.
377
+ * @returns {Promise<CreateNamespaceResponse>} The properties of the
378
+ * created namespace and an optional transaction id.
379
+ */
380
+ abstract createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
381
+ /**
382
+ * Drop a namespace.
383
+ *
384
+ * Use `behavior: "cascade"` to also drop everything contained in the
385
+ * namespace (sub-namespaces and tables). The default `"restrict"`
386
+ * behavior refuses to drop a non-empty namespace.
387
+ *
388
+ * @param {string[]} namespacePath - The namespace path to drop.
389
+ * @param {Partial<DropNamespaceOptions>} options - `mode` ("skip" | "fail"
390
+ * for missing-namespace handling) and `behavior` ("restrict" | "cascade").
391
+ * @returns {Promise<DropNamespaceResponse>} Any properties returned by
392
+ * the server and an optional transaction id.
393
+ */
394
+ abstract dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
395
+ /**
396
+ * Clone a table from a source table.
397
+ *
398
+ * A shallow clone creates a new table that shares the underlying data files
399
+ * with the source table but has its own independent manifest. This allows
400
+ * both the source and cloned tables to evolve independently while initially
401
+ * sharing the same data, deletion, and index files.
402
+ *
403
+ * @param {string} targetTableName - The name of the target table to create.
404
+ * @param {string} sourceUri - The URI of the source table to clone from.
405
+ * @param {object} options - Clone options.
406
+ * @param {string[]} options.targetNamespacePath - The namespace path for the target table (defaults to root namespace).
407
+ * @param {number} options.sourceVersion - The version of the source table to clone.
408
+ * @param {string} options.sourceTag - The tag of the source table to clone.
409
+ * @param {boolean} options.isShallow - Whether to perform a shallow clone (defaults to true).
410
+ */
411
+ abstract cloneTable(targetTableName: string, sourceUri: string, options?: {
412
+ targetNamespacePath?: string[];
413
+ sourceVersion?: number;
414
+ sourceTag?: string;
415
+ isShallow?: boolean;
416
+ }): Promise<Table>;
417
+ /**
418
+ * Rename a table.
419
+ *
420
+ * Currently only supported by LanceDB Cloud. Local OSS connections and
421
+ * namespace-backed connections (via {@link connectNamespace}) reject with
422
+ * a "not supported" error.
423
+ *
424
+ * @param {string} currentName - The current name of the table.
425
+ * @param {string} newName - The new name for the table.
426
+ * @param {RenameTableOptions} options - Optional namespace paths. When
427
+ * `newNamespacePath` is omitted the table stays in `namespacePath`.
428
+ */
429
+ abstract renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
430
+ /**
431
+ * A {@link Job} handle for a server-side job by id.
432
+ *
433
+ * The handle is constructed without a server round trip; an unknown id
434
+ * surfaces when the handle is used. Dropping the handle has no effect on
435
+ * the job itself.
436
+ */
437
+ abstract job(jobId: string): Job;
438
+ /** List server-side jobs across the database's tables. */
439
+ abstract listJobs(): Promise<JobInfo[]>;
440
+ /**
441
+ * Describe a single server-side job by id.
442
+ *
443
+ * Resolves to `null` when the server has no such job.
444
+ */
445
+ abstract getJob(jobId: string): Promise<JobDescription | null>;
446
+ /**
447
+ * Request cancellation of a server-side job by id.
448
+ *
449
+ * Resolves to true if the server accepted the cancellation, false if no
450
+ * such job exists. Cancelling an already-terminal job is a no-op success.
451
+ */
452
+ abstract cancelJob(jobId: string): Promise<boolean>;
453
+ /**
454
+ * The lifecycle event history of a server-side job, as an Arrow table.
455
+ *
456
+ * Lists history across all jobs when `jobId` is omitted.
457
+ */
458
+ abstract jobHistory(jobId?: string): Promise<ArrowTable>;
459
+ }
460
+ /** @hideconstructor */
461
+ export declare class LocalConnection extends Connection {
462
+ readonly inner: LanceDbConnection;
463
+ /** @hidden */
464
+ constructor(inner: LanceDbConnection);
465
+ isOpen(): boolean;
466
+ close(): void;
467
+ display(): string;
468
+ tableNames(namespacePathOrOptions?: string[] | Partial<TableNamesOptions>, options?: Partial<TableNamesOptions>): Promise<string[]>;
469
+ createMaterializedView(name: string, source: string, options?: {
470
+ select?: MaterializedViewSelect;
471
+ where?: string;
472
+ limit?: number;
473
+ }): Promise<MaterializedView>;
474
+ openMaterializedView(name: string): Promise<MaterializedView>;
475
+ listMaterializedViews(): Promise<string[]>;
476
+ listTables(namespacePathOrOptions?: string[] | Partial<ListTablesOptions>, options?: Partial<ListTablesOptions>): Promise<ListTablesResponse>;
477
+ openTable(name: string, namespacePath?: string[], options?: Partial<OpenTableOptions>): Promise<Table>;
478
+ cloneTable(targetTableName: string, sourceUri: string, options?: {
479
+ targetNamespacePath?: string[];
480
+ sourceVersion?: number;
481
+ sourceTag?: string;
482
+ isShallow?: boolean;
483
+ }): Promise<Table>;
484
+ private getStorageOptions;
485
+ createTable(nameOrOptions: string | ({
486
+ name: string;
487
+ data: Data;
488
+ } & Partial<CreateTableOptions>), dataOrNamespacePath?: Record<string, unknown>[] | TableLike | string[], namespacePathOrOptions?: string[] | Partial<CreateTableOptions>, options?: Partial<CreateTableOptions>): Promise<Table>;
489
+ private _createTableImpl;
490
+ createEmptyTable(name: string, schema: import("./arrow").SchemaLike, namespacePathOrOptions?: string[] | Partial<CreateTableOptions>, options?: Partial<CreateTableOptions>): Promise<Table>;
491
+ dropTable(name: string, namespacePath?: string[]): Promise<void>;
492
+ dropTableAsync(name: string, namespacePath?: string[]): Promise<Job>;
493
+ dropAllTables(namespacePath?: string[]): Promise<void>;
494
+ describeNamespace(namespacePath: string[]): Promise<DescribeNamespaceResponse>;
495
+ listNamespaces(namespacePath?: string[], options?: Partial<ListNamespacesOptions>): Promise<ListNamespacesResponse>;
496
+ createNamespace(namespacePath: string[], options?: Partial<CreateNamespaceOptions>): Promise<CreateNamespaceResponse>;
497
+ dropNamespace(namespacePath: string[], options?: Partial<DropNamespaceOptions>): Promise<DropNamespaceResponse>;
498
+ renameTable(currentName: string, newName: string, options?: RenameTableOptions): Promise<void>;
499
+ job(jobId: string): Job;
500
+ listJobs(): Promise<JobInfo[]>;
501
+ getJob(jobId: string): Promise<JobDescription | null>;
502
+ cancelJob(jobId: string): Promise<boolean>;
503
+ jobHistory(jobId?: string): Promise<ArrowTable>;
504
+ }
505
+ /**
506
+ * Takes storage options and makes all the keys snake case.
507
+ */
508
+ export declare function cleanseStorageOptions(options?: Record<string, string>): Record<string, string> | undefined;