@meshagent/meshagent 0.41.4 → 0.41.6

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 (65) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/browser/agent-client.d.ts +10 -0
  3. package/dist/browser/agent-client.js +36 -1
  4. package/dist/browser/agent.d.ts +109 -14
  5. package/dist/browser/agent.js +533 -68
  6. package/dist/browser/datasets-client.d.ts +70 -0
  7. package/dist/browser/datasets-client.js +79 -0
  8. package/dist/browser/entrypoint.d.ts +1464 -1426
  9. package/dist/browser/index.d.ts +2 -0
  10. package/dist/browser/index.js +2 -0
  11. package/dist/browser/oauth-scopes.d.ts +2 -0
  12. package/dist/browser/oauth-scopes.js +21 -0
  13. package/dist/browser/participant-token.d.ts +1 -3
  14. package/dist/browser/participant-token.js +2 -3
  15. package/dist/browser/room-client.d.ts +16 -0
  16. package/dist/browser/room-client.js +69 -0
  17. package/dist/browser/storage-client.d.ts +3 -1
  18. package/dist/browser/storage-client.js +5 -2
  19. package/dist/browser/tool-content-type.d.ts +1 -1
  20. package/dist/browser/tool-content-type.js +3 -2
  21. package/dist/browser/toolkit-config.d.ts +84 -0
  22. package/dist/browser/toolkit-config.js +415 -0
  23. package/dist/esm/agent-client.d.ts +10 -0
  24. package/dist/esm/agent-client.js +36 -1
  25. package/dist/esm/agent.d.ts +109 -14
  26. package/dist/esm/agent.js +533 -68
  27. package/dist/esm/datasets-client.d.ts +70 -0
  28. package/dist/esm/datasets-client.js +79 -0
  29. package/dist/esm/entrypoint.d.ts +1464 -1426
  30. package/dist/esm/index.d.ts +2 -0
  31. package/dist/esm/index.js +2 -0
  32. package/dist/esm/oauth-scopes.d.ts +2 -0
  33. package/dist/esm/oauth-scopes.js +21 -0
  34. package/dist/esm/participant-token.d.ts +1 -3
  35. package/dist/esm/participant-token.js +2 -3
  36. package/dist/esm/room-client.d.ts +16 -0
  37. package/dist/esm/room-client.js +69 -0
  38. package/dist/esm/storage-client.d.ts +3 -1
  39. package/dist/esm/storage-client.js +5 -2
  40. package/dist/esm/tool-content-type.d.ts +1 -1
  41. package/dist/esm/tool-content-type.js +3 -2
  42. package/dist/esm/toolkit-config.d.ts +84 -0
  43. package/dist/esm/toolkit-config.js +415 -0
  44. package/dist/node/agent-client.d.ts +10 -0
  45. package/dist/node/agent-client.js +36 -1
  46. package/dist/node/agent.d.ts +109 -14
  47. package/dist/node/agent.js +533 -68
  48. package/dist/node/datasets-client.d.ts +70 -0
  49. package/dist/node/datasets-client.js +79 -0
  50. package/dist/node/entrypoint.d.ts +1464 -1426
  51. package/dist/node/index.d.ts +2 -0
  52. package/dist/node/index.js +2 -0
  53. package/dist/node/oauth-scopes.d.ts +2 -0
  54. package/dist/node/oauth-scopes.js +21 -0
  55. package/dist/node/participant-token.d.ts +1 -3
  56. package/dist/node/participant-token.js +2 -3
  57. package/dist/node/room-client.d.ts +16 -0
  58. package/dist/node/room-client.js +69 -0
  59. package/dist/node/storage-client.d.ts +3 -1
  60. package/dist/node/storage-client.js +5 -2
  61. package/dist/node/tool-content-type.d.ts +1 -1
  62. package/dist/node/tool-content-type.js +3 -2
  63. package/dist/node/toolkit-config.d.ts +84 -0
  64. package/dist/node/toolkit-config.js +415 -0
  65. package/package.json +1 -1
@@ -206,6 +206,31 @@ export declare class DatasetsClient {
206
206
  branch?: string;
207
207
  metadata?: Record<string, unknown>;
208
208
  }): Promise<void>;
209
+ createTableWithArrowSchema({ name, schema, batches, mode, namespace, branch, metadata }: {
210
+ name: string;
211
+ schema: Schema;
212
+ batches?: ArrowTableChunks;
213
+ mode?: CreateMode;
214
+ namespace?: string[];
215
+ branch?: string;
216
+ metadata?: Record<string, unknown>;
217
+ }): Promise<void>;
218
+ createTableFromArrowBatches({ name, batches, mode, namespace, branch, metadata }: {
219
+ name: string;
220
+ batches: ArrowTableChunks;
221
+ mode?: CreateMode;
222
+ namespace?: string[];
223
+ branch?: string;
224
+ metadata?: Record<string, unknown>;
225
+ }): Promise<void>;
226
+ createTableFromArrowTable({ name, table, mode, namespace, branch, metadata }: {
227
+ name: string;
228
+ table: Table;
229
+ mode?: CreateMode;
230
+ namespace?: string[];
231
+ branch?: string;
232
+ metadata?: Record<string, unknown>;
233
+ }): Promise<void>;
209
234
  createTableFromData({ name, data, mode, namespace, branch, metadata }: {
210
235
  name: string;
211
236
  data?: Iterable<Table> | Table;
@@ -237,6 +262,12 @@ export declare class DatasetsClient {
237
262
  namespace?: string[];
238
263
  branch?: string;
239
264
  }): Promise<void>;
265
+ renameTable({ name, newName, namespace, branch }: {
266
+ name: string;
267
+ newName: string;
268
+ namespace?: string[];
269
+ branch?: string;
270
+ }): Promise<void>;
240
271
  importFromStorage({ table, path, mode, format, on, sheet, batchSize, namespace, branch }: {
241
272
  table: string;
242
273
  path: string;
@@ -256,6 +287,13 @@ export declare class DatasetsClient {
256
287
  branch?: string;
257
288
  version?: number;
258
289
  }): Promise<void>;
290
+ updateColumnMetadata({ table, column, metadata, namespace, branch }: {
291
+ table: string;
292
+ column: string;
293
+ metadata: Record<string, string>;
294
+ namespace?: string[];
295
+ branch?: string;
296
+ }): Promise<void>;
259
297
  dropIndex({ table, name, namespace, branch }: {
260
298
  table: string;
261
299
  name: string;
@@ -280,6 +318,12 @@ export declare class DatasetsClient {
280
318
  namespace?: string[];
281
319
  branch?: string;
282
320
  }): Promise<void>;
321
+ insertTable({ table, records, namespace, branch }: {
322
+ table: string;
323
+ records: Table;
324
+ namespace?: string[];
325
+ branch?: string;
326
+ }): Promise<void>;
283
327
  insertStream({ table, chunks, namespace, branch }: {
284
328
  table: string;
285
329
  chunks: ArrowTableChunks;
@@ -306,6 +350,13 @@ export declare class DatasetsClient {
306
350
  namespace?: string[];
307
351
  branch?: string;
308
352
  }): Promise<void>;
353
+ mergeTable({ table, on, records, namespace, branch }: {
354
+ table: string;
355
+ on: string;
356
+ records: Table;
357
+ namespace?: string[];
358
+ branch?: string;
359
+ }): Promise<void>;
309
360
  mergeStream({ table, on, chunks, namespace, branch }: {
310
361
  table: string;
311
362
  on: string;
@@ -320,6 +371,13 @@ export declare class DatasetsClient {
320
371
  namespace?: string[];
321
372
  branch?: string;
322
373
  }): Promise<Table[]>;
374
+ sqlTable({ query, tables, params, namespace, branch }: {
375
+ query: string;
376
+ tables?: Array<TableRef | string>;
377
+ params?: Table;
378
+ namespace?: string[];
379
+ branch?: string;
380
+ }): Promise<Table>;
323
381
  openSqlQuery({ query, tables, params, namespace, branch }: {
324
382
  query: string;
325
383
  tables?: Array<TableRef | string>;
@@ -369,6 +427,18 @@ export declare class DatasetsClient {
369
427
  branch?: string;
370
428
  version?: number;
371
429
  }): Promise<Table[]>;
430
+ searchTable({ table, text, vector, where, offset, limit, select, namespace, branch, version }: {
431
+ table: string;
432
+ text?: string;
433
+ vector?: number[];
434
+ where?: DatasetWhere;
435
+ offset?: number;
436
+ limit?: number;
437
+ select?: string[];
438
+ namespace?: string[];
439
+ branch?: string;
440
+ version?: number;
441
+ }): Promise<Table>;
372
442
  searchStream({ table, text, vector, where, offset, limit, select, namespace, branch, version }: {
373
443
  table: string;
374
444
  text?: string;
@@ -537,6 +537,13 @@ function tableFromIPCBytes(data) {
537
537
  }
538
538
  return table;
539
539
  }
540
+ function tableFromChunks(chunks) {
541
+ if (chunks.length === 0) {
542
+ return new apache_arrow_1.Table(new apache_arrow_1.Schema([]), []);
543
+ }
544
+ const [first, ...rest] = chunks;
545
+ return first.concat(...rest);
546
+ }
540
547
  function schemaFromIPCBytes(data) {
541
548
  return tableFromIPCBytes(data).schema;
542
549
  }
@@ -846,6 +853,38 @@ class DatasetsClient {
846
853
  metadata,
847
854
  });
848
855
  }
856
+ async createTableWithArrowSchema({ name, schema, batches, mode = "create", namespace, branch, metadata }) {
857
+ return this.createTable({
858
+ name,
859
+ schema,
860
+ data: batches,
861
+ mode,
862
+ namespace,
863
+ branch,
864
+ metadata,
865
+ });
866
+ }
867
+ async createTableFromArrowBatches({ name, batches, mode = "create", namespace, branch, metadata }) {
868
+ return this.createTable({
869
+ name,
870
+ data: batches,
871
+ mode,
872
+ namespace,
873
+ branch,
874
+ metadata,
875
+ });
876
+ }
877
+ async createTableFromArrowTable({ name, table, mode = "create", namespace, branch, metadata }) {
878
+ return this.createTableWithArrowSchema({
879
+ name,
880
+ schema: table.schema,
881
+ batches: [table],
882
+ mode,
883
+ namespace,
884
+ branch,
885
+ metadata,
886
+ });
887
+ }
849
888
  async createTableFromData({ name, data, mode = "create", namespace, branch, metadata }) {
850
889
  return this.createTable({
851
890
  name,
@@ -882,6 +921,14 @@ class DatasetsClient {
882
921
  },
883
922
  });
884
923
  }
924
+ async renameTable({ name, newName, namespace, branch }) {
925
+ await this.invoke("rename_table", {
926
+ name,
927
+ new_name: newName,
928
+ namespace: namespace ?? null,
929
+ branch: branch ?? null,
930
+ });
931
+ }
885
932
  async importFromStorage({ table, path, mode = "create", format = "auto", on, sheet, batchSize, namespace, branch }) {
886
933
  const input = {
887
934
  table,
@@ -908,6 +955,15 @@ class DatasetsClient {
908
955
  version: version ?? null,
909
956
  });
910
957
  }
958
+ async updateColumnMetadata({ table, column, metadata, namespace, branch }) {
959
+ await this.invoke("update_column_metadata", {
960
+ table,
961
+ column,
962
+ metadata: metadataEntries(metadata),
963
+ namespace: namespace ?? null,
964
+ branch: branch ?? null,
965
+ });
966
+ }
911
967
  async dropIndex({ table, name, namespace, branch }) {
912
968
  await this.room.invoke({
913
969
  toolkit: "dataset",
@@ -949,6 +1005,9 @@ class DatasetsClient {
949
1005
  async insert({ table, records, namespace, branch }) {
950
1006
  await this.insertStream({ table, chunks: [records], namespace, branch });
951
1007
  }
1008
+ async insertTable({ table, records, namespace, branch }) {
1009
+ await this.insertStream({ table, chunks: [records], namespace, branch });
1010
+ }
952
1011
  async insertStream({ table, chunks, namespace, branch }) {
953
1012
  const input = new DatasetArrowWriteInputStream({
954
1013
  kind: "start",
@@ -981,6 +1040,9 @@ class DatasetsClient {
981
1040
  async merge({ table, on, records, namespace, branch }) {
982
1041
  await this.mergeStream({ table, on, chunks: [records], namespace, branch });
983
1042
  }
1043
+ async mergeTable({ table, on, records, namespace, branch }) {
1044
+ await this.mergeStream({ table, on, chunks: [records], namespace, branch });
1045
+ }
984
1046
  async mergeStream({ table, on, chunks, namespace, branch }) {
985
1047
  const input = new DatasetArrowWriteInputStream({
986
1048
  kind: "start",
@@ -998,6 +1060,9 @@ class DatasetsClient {
998
1060
  }
999
1061
  return results;
1000
1062
  }
1063
+ async sqlTable({ query, tables, params, namespace, branch }) {
1064
+ return tableFromChunks(await this.sql({ query, tables, params, namespace, branch }));
1065
+ }
1001
1066
  async openSqlQuery({ query, tables, params, namespace, branch }) {
1002
1067
  const response = await this.invokeContent("open_sql_query", new response_1.BinaryContent({
1003
1068
  data: params == null ? new Uint8Array() : (0, apache_arrow_1.tableToIPC)(params, "stream"),
@@ -1126,6 +1191,20 @@ class DatasetsClient {
1126
1191
  }
1127
1192
  return results;
1128
1193
  }
1194
+ async searchTable({ table, text, vector, where, offset, limit, select, namespace, branch, version }) {
1195
+ return tableFromChunks(await this.search({
1196
+ table,
1197
+ text,
1198
+ vector,
1199
+ where,
1200
+ offset,
1201
+ limit,
1202
+ select,
1203
+ namespace,
1204
+ branch,
1205
+ version,
1206
+ }));
1207
+ }
1129
1208
  async *searchStream({ table, text, vector, where, offset, limit, select, namespace, branch, version }) {
1130
1209
  yield* this.streamArrow("search", {
1131
1210
  kind: "start",