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,296 @@
1
+ import { Table as ArrowTable, Binary, BufferType, DataType, Field, FixedSizeBinary, FixedSizeList, Float, Int, LargeBinary, List, Null, RecordBatch, Schema, Struct, Utf8 } from "apache-arrow";
2
+ import { Buffers } from "apache-arrow/data";
3
+ import { type EmbeddingFunction } from "./embedding/embedding_function";
4
+ import { EmbeddingFunctionConfig } from "./embedding/registry";
5
+ export * from "apache-arrow";
6
+ export type SchemaLike = Schema | {
7
+ fields: FieldLike[];
8
+ metadata: Map<string, string>;
9
+ get names(): unknown[];
10
+ };
11
+ export type FieldLike = Field | {
12
+ type: string;
13
+ name: string;
14
+ nullable: boolean;
15
+ metadata?: Map<string, string>;
16
+ };
17
+ export type DataLike = import("apache-arrow").Data | {
18
+ type: any;
19
+ length: number;
20
+ offset: number;
21
+ stride: number;
22
+ nullable: boolean;
23
+ children: DataLike[];
24
+ dictionary?: {
25
+ data: readonly DataLike[];
26
+ };
27
+ get nullCount(): number;
28
+ values: Buffers<any>[BufferType.DATA];
29
+ typeIds: Buffers<any>[BufferType.TYPE];
30
+ nullBitmap: Buffers<any>[BufferType.VALIDITY];
31
+ valueOffsets: Buffers<any>[BufferType.OFFSET];
32
+ };
33
+ export type RecordBatchLike = RecordBatch | {
34
+ schema: SchemaLike;
35
+ data: DataLike;
36
+ };
37
+ export type TableLike = ArrowTable | {
38
+ schema: SchemaLike;
39
+ batches: RecordBatchLike[];
40
+ };
41
+ export type IntoVector = Float32Array | Float64Array | Uint8Array | number[] | Promise<Float32Array | Float64Array | Uint8Array | number[]>;
42
+ export type MultiVector = IntoVector[];
43
+ export declare function isMultiVector(value: unknown): value is MultiVector;
44
+ export declare function isIntoVector(value: unknown): value is IntoVector;
45
+ /**
46
+ * Extract the underlying byte buffer and data type from a typed array
47
+ * for passing to the Rust NAPI layer without precision loss.
48
+ */
49
+ export declare function extractVectorBuffer(vector: Float32Array | Float64Array | Uint8Array): {
50
+ data: Uint8Array;
51
+ dtype: string;
52
+ } | null;
53
+ export declare function isArrowTable(value: object): value is TableLike;
54
+ export declare function isNull(value: unknown): value is Null;
55
+ export declare function isInt(value: unknown): value is Int;
56
+ export declare function isFloat(value: unknown): value is Float;
57
+ export declare function isBinary(value: unknown): value is Binary;
58
+ export declare function isLargeBinary(value: unknown): value is LargeBinary;
59
+ export declare function isUtf8(value: unknown): value is Utf8;
60
+ export declare function isLargeUtf8(value: unknown): value is Utf8;
61
+ export declare function isBool(value: unknown): value is Utf8;
62
+ export declare function isDecimal(value: unknown): value is Utf8;
63
+ export declare function isDate(value: unknown): value is Utf8;
64
+ export declare function isTime(value: unknown): value is Utf8;
65
+ export declare function isTimestamp(value: unknown): value is Utf8;
66
+ export declare function isInterval(value: unknown): value is Utf8;
67
+ export declare function isDuration(value: unknown): value is Utf8;
68
+ export declare function isList(value: unknown): value is List;
69
+ export declare function isStruct(value: unknown): value is Struct;
70
+ export declare function isUnion(value: unknown): value is Struct;
71
+ export declare function isFixedSizeBinary(value: unknown): value is FixedSizeBinary;
72
+ export declare function isFixedSizeList(value: unknown): value is FixedSizeList;
73
+ /** Data type accepted by NodeJS SDK */
74
+ export type Data = Record<string, unknown>[] | TableLike;
75
+ export declare class VectorColumnOptions {
76
+ /** Vector column type. */
77
+ type: Float;
78
+ constructor(values?: Partial<VectorColumnOptions>);
79
+ }
80
+ /** Options to control the makeArrowTable call. */
81
+ export declare class MakeArrowTableOptions {
82
+ schema?: SchemaLike;
83
+ vectorColumns: Record<string, VectorColumnOptions>;
84
+ embeddings?: EmbeddingFunction<unknown>;
85
+ embeddingFunction?: EmbeddingFunctionConfig;
86
+ /**
87
+ * If true then string columns will be encoded with dictionary encoding
88
+ *
89
+ * Set this to true if your string columns tend to repeat the same values
90
+ * often. For more precise control use the `schema` property to specify the
91
+ * data type for individual columns.
92
+ *
93
+ * If `schema` is provided then this property is ignored.
94
+ */
95
+ dictionaryEncodeStrings: boolean;
96
+ constructor(values?: Partial<MakeArrowTableOptions>);
97
+ }
98
+ /**
99
+ * An enhanced version of the apache-arrow makeTable function from Apache Arrow
100
+ * that supports nested fields and embeddings columns.
101
+ *
102
+ * (typically you do not need to call this function. It will be called automatically
103
+ * when creating a table or adding data to it)
104
+ *
105
+ * This function converts an array of Record<String, any> (row-major JS objects)
106
+ * to an Arrow Table (a columnar structure)
107
+ *
108
+ * If a schema is provided then it will be used to determine the resulting array
109
+ * types. Fields will also be reordered to fit the order defined by the schema.
110
+ *
111
+ * If a schema is not provided then the types will be inferred and the field order
112
+ * will be controlled by the order of properties in the first record. If a type
113
+ * is inferred it will always be nullable.
114
+ *
115
+ * If not all fields are found in the data, then a subset of the schema will be
116
+ * returned.
117
+ *
118
+ * If the input is empty then a schema must be provided to create an empty table.
119
+ *
120
+ * When a schema is not specified then data types will be inferred. The inference
121
+ * rules are as follows:
122
+ *
123
+ * - boolean => Bool
124
+ * - number => Float64
125
+ * - bigint => Int64
126
+ * - String => Utf8
127
+ * - Buffer => Binary
128
+ * - Record<String, any> => Struct
129
+ * - Array<any> => List
130
+ * @example
131
+ * ```ts
132
+ * import { fromTableToBuffer, makeArrowTable } from "../arrow";
133
+ * import { Field, FixedSizeList, Float16, Float32, Int32, Schema } from "apache-arrow";
134
+ *
135
+ * const schema = new Schema([
136
+ * new Field("a", new Int32()),
137
+ * new Field("b", new Float32()),
138
+ * new Field("c", new FixedSizeList(3, new Field("item", new Float16()))),
139
+ * ]);
140
+ * const table = makeArrowTable([
141
+ * { a: 1, b: 2, c: [1, 2, 3] },
142
+ * { a: 4, b: 5, c: [4, 5, 6] },
143
+ * { a: 7, b: 8, c: [7, 8, 9] },
144
+ * ], { schema });
145
+ * ```
146
+ *
147
+ * By default it assumes that the column named `vector` is a vector column
148
+ * and it will be converted into a fixed size list array of type float32.
149
+ * The `vectorColumns` option can be used to support other vector column
150
+ * names and data types.
151
+ *
152
+ * ```ts
153
+ * const schema = new Schema([
154
+ * new Field("a", new Float64()),
155
+ * new Field("b", new Float64()),
156
+ * new Field(
157
+ * "vector",
158
+ * new FixedSizeList(3, new Field("item", new Float32()))
159
+ * ),
160
+ * ]);
161
+ * const table = makeArrowTable([
162
+ * { a: 1, b: 2, vector: [1, 2, 3] },
163
+ * { a: 4, b: 5, vector: [4, 5, 6] },
164
+ * { a: 7, b: 8, vector: [7, 8, 9] },
165
+ * ]);
166
+ * assert.deepEqual(table.schema, schema);
167
+ * ```
168
+ *
169
+ * You can specify the vector column types and names using the options as well
170
+ *
171
+ * ```ts
172
+ * const schema = new Schema([
173
+ * new Field('a', new Float64()),
174
+ * new Field('b', new Float64()),
175
+ * new Field('vec1', new FixedSizeList(3, new Field('item', new Float16()))),
176
+ * new Field('vec2', new FixedSizeList(3, new Field('item', new Float16())))
177
+ * ]);
178
+ * const table = makeArrowTable([
179
+ * { a: 1, b: 2, vec1: [1, 2, 3], vec2: [2, 4, 6] },
180
+ * { a: 4, b: 5, vec1: [4, 5, 6], vec2: [8, 10, 12] },
181
+ * { a: 7, b: 8, vec1: [7, 8, 9], vec2: [14, 16, 18] }
182
+ * ], {
183
+ * vectorColumns: {
184
+ * vec1: { type: new Float16() },
185
+ * vec2: { type: new Float16() }
186
+ * }
187
+ * }
188
+ * assert.deepEqual(table.schema, schema)
189
+ * ```
190
+ */
191
+ export declare function makeArrowTable(data: Array<Record<string, unknown>>, options?: Partial<MakeArrowTableOptions>, metadata?: Map<string, string>): ArrowTable;
192
+ /**
193
+ * Create an empty Arrow table with the provided schema
194
+ */
195
+ export declare function makeEmptyTable(schema: SchemaLike, metadata?: Map<string, string>): ArrowTable;
196
+ /**
197
+ * Convert an Array of records into an Arrow Table, optionally applying an
198
+ * embeddings function to it.
199
+ *
200
+ * This function calls `makeArrowTable` first to create the Arrow Table.
201
+ * Any provided `makeTableOptions` (e.g. a schema) will be passed on to
202
+ * that call.
203
+ *
204
+ * The embedding function will be passed a column of values (based on the
205
+ * `sourceColumn` of the embedding function) and expects to receive back
206
+ * number[][] which will be converted into a fixed size list column. By
207
+ * default this will be a fixed size list of Float32 but that can be
208
+ * customized by the `embeddingDataType` property of the embedding function.
209
+ *
210
+ * If a schema is provided in `makeTableOptions` then it should include the
211
+ * embedding columns. If no schema is provded then embedding columns will
212
+ * be placed at the end of the table, after all of the input columns.
213
+ */
214
+ export declare function convertToTable(data: Array<Record<string, unknown>>, embeddings?: EmbeddingFunctionConfig, makeTableOptions?: Partial<MakeArrowTableOptions>): Promise<ArrowTable>;
215
+ /** Creates the Arrow Type for a Vector column with dimension `dim` */
216
+ export declare function newVectorType<T extends Float>(dim: number, innerType: unknown): FixedSizeList<T>;
217
+ /**
218
+ * Serialize an Array of records into a buffer using the Arrow IPC File serialization
219
+ *
220
+ * This function will call `convertToTable` and pass on `embeddings` and `schema`
221
+ *
222
+ * `schema` is required if data is empty
223
+ */
224
+ export declare function fromRecordsToBuffer(data: Array<Record<string, unknown>>, embeddings?: EmbeddingFunctionConfig, schema?: Schema): Promise<Buffer>;
225
+ /**
226
+ * Serialize an Array of records into a buffer using the Arrow IPC Stream serialization
227
+ *
228
+ * This function will call `convertToTable` and pass on `embeddings` and `schema`
229
+ *
230
+ * `schema` is required if data is empty
231
+ */
232
+ export declare function fromRecordsToStreamBuffer(data: Array<Record<string, unknown>>, embeddings?: EmbeddingFunctionConfig, schema?: Schema): Promise<Buffer>;
233
+ /**
234
+ * Serialize an Arrow Table into a buffer using the Arrow IPC File serialization
235
+ *
236
+ * This function will apply `embeddings` to the table in a manner similar to
237
+ * `convertToTable`.
238
+ *
239
+ * `schema` is required if the table is empty
240
+ */
241
+ export declare function fromTableToBuffer(table: ArrowTable, embeddings?: EmbeddingFunctionConfig, schema?: SchemaLike): Promise<Buffer>;
242
+ /**
243
+ * Serialize an Arrow Table into a buffer using the Arrow IPC File serialization
244
+ *
245
+ * This function will apply `embeddings` to the table in a manner similar to
246
+ * `convertToTable`.
247
+ *
248
+ * `schema` is required if the table is empty
249
+ */
250
+ export declare function fromDataToBuffer(data: Data, embeddings?: EmbeddingFunctionConfig, schema?: Schema): Promise<Buffer>;
251
+ /**
252
+ * Read a single record batch from a buffer.
253
+ *
254
+ * Returns null if the buffer does not contain a record batch
255
+ */
256
+ export declare function fromBufferToRecordBatch(data: Buffer): Promise<RecordBatch | null>;
257
+ /**
258
+ * Create a buffer containing a single record batch
259
+ */
260
+ export declare function fromRecordBatchToBuffer(batch: RecordBatch): Promise<Buffer>;
261
+ /**
262
+ * Create a buffer containing a single record batch using the Arrow IPC Stream
263
+ * serialization. Each call produces a self-contained Stream message (schema +
264
+ * batch + EOS) suitable for incremental decode by `arrow_ipc::reader::StreamReader`.
265
+ */
266
+ export declare function fromRecordBatchToStreamBuffer(batch: RecordBatch): Promise<Buffer>;
267
+ /**
268
+ * Serialize an Arrow Table into a buffer using the Arrow IPC Stream serialization
269
+ *
270
+ * This function will apply `embeddings` to the table in a manner similar to
271
+ * `convertToTable`.
272
+ *
273
+ * `schema` is required if the table is empty
274
+ */
275
+ export declare function fromTableToStreamBuffer(table: ArrowTable, embeddings?: EmbeddingFunctionConfig, schema?: SchemaLike): Promise<Buffer>;
276
+ /**
277
+ * Create an empty table with the given schema
278
+ */
279
+ export declare function createEmptyTable(schema: Schema): ArrowTable;
280
+ /**
281
+ * Ensures that all nested fields defined in the schema exist in the data,
282
+ * filling missing fields with null values.
283
+ */
284
+ export declare function ensureNestedFieldsExist(data: Array<Record<string, unknown>>, schema: Schema): Array<Record<string, unknown>>;
285
+ interface JsonDataType {
286
+ type: string;
287
+ fields?: JsonField[];
288
+ length?: number;
289
+ }
290
+ interface JsonField {
291
+ name: string;
292
+ type: JsonDataType;
293
+ nullable: boolean;
294
+ metadata: Map<string, string>;
295
+ }
296
+ export declare function dataTypeToJson(dataType: DataType): JsonDataType;