@dreamlake/dreamlake-cli 0.105.1 → 0.106.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.
- package/dist/api/index.d.ts +220 -14
- package/dist/api/native-experiments.d.ts +218 -7
- package/dist/api/native-experiments.js +154 -9
- package/dist/cli/auth/commands.d.ts +11 -1
- package/dist/cli/auth/commands.js +34 -10
- package/dist/cli/experiments/native-commands.d.ts +3 -1
- package/dist/cli/experiments/native-commands.js +21 -14
- package/dist/cli/experiments/native-run-data.d.ts +51 -0
- package/dist/cli/experiments/native-run-data.js +826 -0
- package/dist/cli/help-examples.generated.js +42 -31
- package/dist/cli/index.js +4 -3
- package/dist/cli/memos/move-command.js +2 -2
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/package.json +9 -9
package/dist/api/index.d.ts
CHANGED
|
@@ -167,13 +167,50 @@ export declare function createApi(transport: Transport): {
|
|
|
167
167
|
apiUrl: string;
|
|
168
168
|
provider: string;
|
|
169
169
|
}>;
|
|
170
|
-
create: (key: string) => Promise<{
|
|
170
|
+
create: (key: string, body?: import("./native-experiments.js").NativeRunCreate) => Promise<{
|
|
171
171
|
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
172
172
|
}>;
|
|
173
|
+
createAt: (segments: string[], body?: import("./native-experiments.js").NativeRunCreate) => Promise<{
|
|
174
|
+
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
175
|
+
}>;
|
|
176
|
+
purge: (id: string) => Promise<{
|
|
177
|
+
id: string;
|
|
178
|
+
deleted: boolean;
|
|
179
|
+
purged: boolean;
|
|
180
|
+
}>;
|
|
181
|
+
folders: {
|
|
182
|
+
create: (body: {
|
|
183
|
+
path: string;
|
|
184
|
+
} | {
|
|
185
|
+
parentId?: string | null;
|
|
186
|
+
name: string;
|
|
187
|
+
}) => Promise<unknown>;
|
|
188
|
+
list: (query?: {
|
|
189
|
+
parentId?: string;
|
|
190
|
+
limit?: number;
|
|
191
|
+
cursor?: string;
|
|
192
|
+
}) => Promise<unknown>;
|
|
193
|
+
get: (id: string) => Promise<unknown>;
|
|
194
|
+
update: (id: string, patch: {
|
|
195
|
+
name?: string;
|
|
196
|
+
parentId?: string | null;
|
|
197
|
+
}) => Promise<unknown>;
|
|
198
|
+
byPath: (segments: string[]) => Promise<unknown>;
|
|
199
|
+
operate: (id: string, kind: import("./native-experiments.js").NativeFolderOperation) => Promise<{
|
|
200
|
+
operationId: string;
|
|
201
|
+
state: string;
|
|
202
|
+
}>;
|
|
203
|
+
operation: (operationId: string) => Promise<unknown>;
|
|
204
|
+
};
|
|
205
|
+
batch: (action: "trash" | "purge", items: Array<{
|
|
206
|
+
type: "run" | "folder";
|
|
207
|
+
id: string;
|
|
208
|
+
}>) => Promise<unknown>;
|
|
173
209
|
list: (query?: {
|
|
174
210
|
limit?: number;
|
|
175
211
|
cursor?: string;
|
|
176
212
|
includeArchived?: boolean;
|
|
213
|
+
folderId?: string;
|
|
177
214
|
}) => Promise<{
|
|
178
215
|
runs: import("./native-experiments.js").NativeExperimentRun[];
|
|
179
216
|
hasMore: boolean;
|
|
@@ -199,15 +236,23 @@ export declare function createApi(transport: Transport): {
|
|
|
199
236
|
archive: (id: string, archived: boolean) => Promise<{
|
|
200
237
|
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
201
238
|
}>;
|
|
239
|
+
update: (id: string, patch: {
|
|
240
|
+
description?: string | null;
|
|
241
|
+
tags?: string[];
|
|
242
|
+
metadata?: Record<string, unknown> | null;
|
|
243
|
+
name?: string;
|
|
244
|
+
folderPath?: string;
|
|
245
|
+
writeProtected?: boolean;
|
|
246
|
+
}) => Promise<{
|
|
247
|
+
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
248
|
+
}>;
|
|
202
249
|
parameters: {
|
|
203
250
|
get: (id: string) => Promise<unknown>;
|
|
204
251
|
set: (id: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
252
|
+
delete: (id: string) => Promise<unknown>;
|
|
205
253
|
};
|
|
206
254
|
logs: {
|
|
207
|
-
list: (id: string, query?:
|
|
208
|
-
limit?: number;
|
|
209
|
-
cursor?: string;
|
|
210
|
-
}) => Promise<unknown>;
|
|
255
|
+
list: (id: string, query?: import("./native-experiments.js").NativeLogQuery) => Promise<unknown>;
|
|
211
256
|
append: (id: string, entries: Array<{
|
|
212
257
|
timestamp: string;
|
|
213
258
|
level: string;
|
|
@@ -221,9 +266,67 @@ export declare function createApi(transport: Transport): {
|
|
|
221
266
|
limit?: number;
|
|
222
267
|
cursor?: string;
|
|
223
268
|
}) => Promise<unknown>;
|
|
224
|
-
append: (id: string, name: string, dataPoints: Record<string, unknown>[]) => Promise<unknown>;
|
|
269
|
+
append: (id: string, name: string, dataPoints: Record<string, unknown>[], descriptor?: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
270
|
+
stats: (id: string, name: string) => Promise<unknown>;
|
|
271
|
+
updateMetadata: (id: string, name: string, patch: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
272
|
+
};
|
|
273
|
+
files: {
|
|
274
|
+
list: (id: string, query?: {
|
|
275
|
+
prefix?: string;
|
|
276
|
+
tags?: string[];
|
|
277
|
+
}) => Promise<unknown>;
|
|
278
|
+
get: (id: string, fileId: string) => Promise<unknown>;
|
|
279
|
+
upload: (id: string, upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
280
|
+
download: (id: string, fileId: string, options?: {
|
|
281
|
+
signal?: AbortSignal;
|
|
282
|
+
}) => Promise<Response>;
|
|
283
|
+
update: (id: string, fileId: string, patch: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
284
|
+
delete: (id: string, fileId: string) => Promise<unknown>;
|
|
285
|
+
media: (id: string, fileId: string) => Promise<unknown>;
|
|
286
|
+
};
|
|
287
|
+
projectFiles: {
|
|
288
|
+
list: (query?: {
|
|
289
|
+
folderId?: string;
|
|
290
|
+
}) => Promise<unknown>;
|
|
291
|
+
upload: (upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
292
|
+
get: (fileId: string) => Promise<unknown>;
|
|
293
|
+
text: (fileId: string) => Promise<unknown>;
|
|
294
|
+
download: (fileId: string, options?: {
|
|
295
|
+
signal?: AbortSignal;
|
|
296
|
+
}) => Promise<Response>;
|
|
297
|
+
media: (fileId: string) => Promise<unknown>;
|
|
298
|
+
replace: (fileId: string, upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
299
|
+
update: (fileId: string, patch: import("./native-experiments.js").NativeItemMetadataPatch & {
|
|
300
|
+
filename?: string;
|
|
301
|
+
folderId?: string | null;
|
|
302
|
+
}) => Promise<unknown>;
|
|
303
|
+
delete: (fileId: string) => Promise<unknown>;
|
|
304
|
+
};
|
|
305
|
+
dashboard: {
|
|
306
|
+
section: (id: string, field: "header" | "metrics" | "charts" | "metadata") => Promise<unknown>;
|
|
307
|
+
charts: (id: string, type: "image" | "line" | "video") => Promise<unknown>;
|
|
308
|
+
};
|
|
309
|
+
bindrs: {
|
|
310
|
+
list: (id: string, item?: import("./native-experiments.js").NativeRunItem) => Promise<unknown>;
|
|
311
|
+
attach: (id: string, ref: import("./native-experiments.js").NativeBindrRef) => Promise<unknown>;
|
|
312
|
+
detach: (id: string, ref: import("./native-experiments.js").NativeBindrRef) => Promise<unknown>;
|
|
313
|
+
};
|
|
314
|
+
tracks: {
|
|
315
|
+
list: (id: string, query?: {
|
|
316
|
+
topic?: string;
|
|
317
|
+
}) => Promise<unknown>;
|
|
318
|
+
create: (id: string, topic: string, descriptor?: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
319
|
+
append: (id: string, topic: string, entries: Array<Record<string, unknown> & {
|
|
320
|
+
timestamp: number;
|
|
321
|
+
}>) => Promise<unknown>;
|
|
322
|
+
read: (id: string, topic: string, query?: import("./native-experiments.js").NativeTrackQuery) => Promise<unknown>;
|
|
323
|
+
export: (id: string, topic: string, query: import("./native-experiments.js").NativeTrackQuery & {
|
|
324
|
+
format: "json" | "jsonl" | "parquet" | "mcap";
|
|
325
|
+
}, options?: {
|
|
326
|
+
signal?: AbortSignal;
|
|
327
|
+
}) => Promise<Response>;
|
|
225
328
|
};
|
|
226
|
-
setStatus: (id: string, status: "
|
|
329
|
+
setStatus: (id: string, status: import("./native-experiments.js").NativeRunStatus) => Promise<unknown>;
|
|
227
330
|
};
|
|
228
331
|
machine: {
|
|
229
332
|
self: () => Promise<unknown>;
|
|
@@ -1260,13 +1363,50 @@ export declare function createClient(options: ClientOptions): {
|
|
|
1260
1363
|
apiUrl: string;
|
|
1261
1364
|
provider: string;
|
|
1262
1365
|
}>;
|
|
1263
|
-
create: (key: string) => Promise<{
|
|
1366
|
+
create: (key: string, body?: import("./native-experiments.js").NativeRunCreate) => Promise<{
|
|
1264
1367
|
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
1265
1368
|
}>;
|
|
1369
|
+
createAt: (segments: string[], body?: import("./native-experiments.js").NativeRunCreate) => Promise<{
|
|
1370
|
+
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
1371
|
+
}>;
|
|
1372
|
+
purge: (id: string) => Promise<{
|
|
1373
|
+
id: string;
|
|
1374
|
+
deleted: boolean;
|
|
1375
|
+
purged: boolean;
|
|
1376
|
+
}>;
|
|
1377
|
+
folders: {
|
|
1378
|
+
create: (body: {
|
|
1379
|
+
path: string;
|
|
1380
|
+
} | {
|
|
1381
|
+
parentId?: string | null;
|
|
1382
|
+
name: string;
|
|
1383
|
+
}) => Promise<unknown>;
|
|
1384
|
+
list: (query?: {
|
|
1385
|
+
parentId?: string;
|
|
1386
|
+
limit?: number;
|
|
1387
|
+
cursor?: string;
|
|
1388
|
+
}) => Promise<unknown>;
|
|
1389
|
+
get: (id: string) => Promise<unknown>;
|
|
1390
|
+
update: (id: string, patch: {
|
|
1391
|
+
name?: string;
|
|
1392
|
+
parentId?: string | null;
|
|
1393
|
+
}) => Promise<unknown>;
|
|
1394
|
+
byPath: (segments: string[]) => Promise<unknown>;
|
|
1395
|
+
operate: (id: string, kind: import("./native-experiments.js").NativeFolderOperation) => Promise<{
|
|
1396
|
+
operationId: string;
|
|
1397
|
+
state: string;
|
|
1398
|
+
}>;
|
|
1399
|
+
operation: (operationId: string) => Promise<unknown>;
|
|
1400
|
+
};
|
|
1401
|
+
batch: (action: "trash" | "purge", items: Array<{
|
|
1402
|
+
type: "run" | "folder";
|
|
1403
|
+
id: string;
|
|
1404
|
+
}>) => Promise<unknown>;
|
|
1266
1405
|
list: (query?: {
|
|
1267
1406
|
limit?: number;
|
|
1268
1407
|
cursor?: string;
|
|
1269
1408
|
includeArchived?: boolean;
|
|
1409
|
+
folderId?: string;
|
|
1270
1410
|
}) => Promise<{
|
|
1271
1411
|
runs: import("./native-experiments.js").NativeExperimentRun[];
|
|
1272
1412
|
hasMore: boolean;
|
|
@@ -1292,15 +1432,23 @@ export declare function createClient(options: ClientOptions): {
|
|
|
1292
1432
|
archive: (id: string, archived: boolean) => Promise<{
|
|
1293
1433
|
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
1294
1434
|
}>;
|
|
1435
|
+
update: (id: string, patch: {
|
|
1436
|
+
description?: string | null;
|
|
1437
|
+
tags?: string[];
|
|
1438
|
+
metadata?: Record<string, unknown> | null;
|
|
1439
|
+
name?: string;
|
|
1440
|
+
folderPath?: string;
|
|
1441
|
+
writeProtected?: boolean;
|
|
1442
|
+
}) => Promise<{
|
|
1443
|
+
experiment: import("./native-experiments.js").NativeExperimentRun;
|
|
1444
|
+
}>;
|
|
1295
1445
|
parameters: {
|
|
1296
1446
|
get: (id: string) => Promise<unknown>;
|
|
1297
1447
|
set: (id: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
1448
|
+
delete: (id: string) => Promise<unknown>;
|
|
1298
1449
|
};
|
|
1299
1450
|
logs: {
|
|
1300
|
-
list: (id: string, query?:
|
|
1301
|
-
limit?: number;
|
|
1302
|
-
cursor?: string;
|
|
1303
|
-
}) => Promise<unknown>;
|
|
1451
|
+
list: (id: string, query?: import("./native-experiments.js").NativeLogQuery) => Promise<unknown>;
|
|
1304
1452
|
append: (id: string, entries: Array<{
|
|
1305
1453
|
timestamp: string;
|
|
1306
1454
|
level: string;
|
|
@@ -1314,9 +1462,67 @@ export declare function createClient(options: ClientOptions): {
|
|
|
1314
1462
|
limit?: number;
|
|
1315
1463
|
cursor?: string;
|
|
1316
1464
|
}) => Promise<unknown>;
|
|
1317
|
-
append: (id: string, name: string, dataPoints: Record<string, unknown>[]) => Promise<unknown>;
|
|
1465
|
+
append: (id: string, name: string, dataPoints: Record<string, unknown>[], descriptor?: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
1466
|
+
stats: (id: string, name: string) => Promise<unknown>;
|
|
1467
|
+
updateMetadata: (id: string, name: string, patch: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
1468
|
+
};
|
|
1469
|
+
files: {
|
|
1470
|
+
list: (id: string, query?: {
|
|
1471
|
+
prefix?: string;
|
|
1472
|
+
tags?: string[];
|
|
1473
|
+
}) => Promise<unknown>;
|
|
1474
|
+
get: (id: string, fileId: string) => Promise<unknown>;
|
|
1475
|
+
upload: (id: string, upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
1476
|
+
download: (id: string, fileId: string, options?: {
|
|
1477
|
+
signal?: AbortSignal;
|
|
1478
|
+
}) => Promise<Response>;
|
|
1479
|
+
update: (id: string, fileId: string, patch: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
1480
|
+
delete: (id: string, fileId: string) => Promise<unknown>;
|
|
1481
|
+
media: (id: string, fileId: string) => Promise<unknown>;
|
|
1482
|
+
};
|
|
1483
|
+
projectFiles: {
|
|
1484
|
+
list: (query?: {
|
|
1485
|
+
folderId?: string;
|
|
1486
|
+
}) => Promise<unknown>;
|
|
1487
|
+
upload: (upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
1488
|
+
get: (fileId: string) => Promise<unknown>;
|
|
1489
|
+
text: (fileId: string) => Promise<unknown>;
|
|
1490
|
+
download: (fileId: string, options?: {
|
|
1491
|
+
signal?: AbortSignal;
|
|
1492
|
+
}) => Promise<Response>;
|
|
1493
|
+
media: (fileId: string) => Promise<unknown>;
|
|
1494
|
+
replace: (fileId: string, upload: import("./native-experiments.js").NativeFileUpload) => Promise<unknown>;
|
|
1495
|
+
update: (fileId: string, patch: import("./native-experiments.js").NativeItemMetadataPatch & {
|
|
1496
|
+
filename?: string;
|
|
1497
|
+
folderId?: string | null;
|
|
1498
|
+
}) => Promise<unknown>;
|
|
1499
|
+
delete: (fileId: string) => Promise<unknown>;
|
|
1500
|
+
};
|
|
1501
|
+
dashboard: {
|
|
1502
|
+
section: (id: string, field: "header" | "metrics" | "charts" | "metadata") => Promise<unknown>;
|
|
1503
|
+
charts: (id: string, type: "image" | "line" | "video") => Promise<unknown>;
|
|
1504
|
+
};
|
|
1505
|
+
bindrs: {
|
|
1506
|
+
list: (id: string, item?: import("./native-experiments.js").NativeRunItem) => Promise<unknown>;
|
|
1507
|
+
attach: (id: string, ref: import("./native-experiments.js").NativeBindrRef) => Promise<unknown>;
|
|
1508
|
+
detach: (id: string, ref: import("./native-experiments.js").NativeBindrRef) => Promise<unknown>;
|
|
1509
|
+
};
|
|
1510
|
+
tracks: {
|
|
1511
|
+
list: (id: string, query?: {
|
|
1512
|
+
topic?: string;
|
|
1513
|
+
}) => Promise<unknown>;
|
|
1514
|
+
create: (id: string, topic: string, descriptor?: import("./native-experiments.js").NativeItemMetadataPatch) => Promise<unknown>;
|
|
1515
|
+
append: (id: string, topic: string, entries: Array<Record<string, unknown> & {
|
|
1516
|
+
timestamp: number;
|
|
1517
|
+
}>) => Promise<unknown>;
|
|
1518
|
+
read: (id: string, topic: string, query?: import("./native-experiments.js").NativeTrackQuery) => Promise<unknown>;
|
|
1519
|
+
export: (id: string, topic: string, query: import("./native-experiments.js").NativeTrackQuery & {
|
|
1520
|
+
format: "json" | "jsonl" | "parquet" | "mcap";
|
|
1521
|
+
}, options?: {
|
|
1522
|
+
signal?: AbortSignal;
|
|
1523
|
+
}) => Promise<Response>;
|
|
1318
1524
|
};
|
|
1319
|
-
setStatus: (id: string, status: "
|
|
1525
|
+
setStatus: (id: string, status: import("./native-experiments.js").NativeRunStatus) => Promise<unknown>;
|
|
1320
1526
|
};
|
|
1321
1527
|
machine: {
|
|
1322
1528
|
self: () => Promise<unknown>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Transport } from "./client.js";
|
|
2
|
+
import { type Query } from "./common.js";
|
|
2
3
|
export interface NativeExperimentRun {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
@@ -9,6 +10,91 @@ export interface NativeExperimentRun {
|
|
|
9
10
|
createdAt: string;
|
|
10
11
|
updatedAt: string;
|
|
11
12
|
}
|
|
13
|
+
export type NativeRunStatus = "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED";
|
|
14
|
+
export type NativeLogLevel = "info" | "warn" | "error" | "debug" | "fatal";
|
|
15
|
+
/** Human metadata of a file or metric. Absent keys are unchanged; `tags` replaces the set; `null` clears. */
|
|
16
|
+
export interface NativeItemMetadataPatch {
|
|
17
|
+
description?: string | null;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
metadata?: Record<string, unknown> | null;
|
|
20
|
+
}
|
|
21
|
+
/** Filters of `GET runs/:id/logs`. `cursor` is the server's opaque `nextCursor`. */
|
|
22
|
+
export interface NativeLogQuery {
|
|
23
|
+
limit?: number;
|
|
24
|
+
cursor?: string;
|
|
25
|
+
level?: NativeLogLevel[];
|
|
26
|
+
startTime?: string;
|
|
27
|
+
endTime?: string;
|
|
28
|
+
search?: string;
|
|
29
|
+
orderBy?: "sequenceNumber" | "timestamp";
|
|
30
|
+
order?: "asc" | "desc";
|
|
31
|
+
}
|
|
32
|
+
/** `GET runs/:id/tracks/:topic/data` bounds (inclusive) and column selection. */
|
|
33
|
+
export interface NativeTrackQuery {
|
|
34
|
+
startTimestamp?: number;
|
|
35
|
+
endTimestamp?: number;
|
|
36
|
+
columns?: string[];
|
|
37
|
+
format?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface NativeFileUpload {
|
|
40
|
+
/** File bytes. A Blob (e.g. `fs.openAsBlob`) is sent without buffering it whole. */
|
|
41
|
+
data: Blob | Uint8Array;
|
|
42
|
+
filename: string;
|
|
43
|
+
/** Lowercase hex SHA-256 of `data`; computed when omitted (reads `data` once). */
|
|
44
|
+
checksum?: string;
|
|
45
|
+
contentType?: string;
|
|
46
|
+
prefix?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
tags?: string[];
|
|
49
|
+
metadata?: Record<string, unknown>;
|
|
50
|
+
/** Project files: the folder (absent: the project root). */
|
|
51
|
+
folderId?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Every route of one DreamLake project's native Experiments, below the central API origin.
|
|
55
|
+
* Run, file and metric segments are encoded, so a run path can never leave its project.
|
|
56
|
+
*/
|
|
57
|
+
/** The body of a run create-or-get: written with the run in one transaction. `writeProtected` is a person's request. */
|
|
58
|
+
export interface NativeRunCreate {
|
|
59
|
+
description?: string | null;
|
|
60
|
+
tags?: string[];
|
|
61
|
+
metadata?: Record<string, unknown> | null;
|
|
62
|
+
writeProtected?: boolean;
|
|
63
|
+
/** Bindr names (found or created at the top level), attached at create. */
|
|
64
|
+
bindrs?: string[];
|
|
65
|
+
}
|
|
66
|
+
/** A run item a bindr can hold: its metric, file or parameters, by the item's own id. */
|
|
67
|
+
export interface NativeRunItem {
|
|
68
|
+
kind: "metric" | "file" | "parameters";
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
export type NativeBindrRef = ({
|
|
72
|
+
bindrId: string;
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
}) & {
|
|
76
|
+
item?: NativeRunItem;
|
|
77
|
+
};
|
|
78
|
+
export type NativeFolderOperation = "trash" | "restore" | "protect" | "unprotect" | "purge";
|
|
79
|
+
export declare function nativeExperimentPaths(namespace: string, project: string): {
|
|
80
|
+
base: string;
|
|
81
|
+
run: (id: string) => string;
|
|
82
|
+
parameters: (id: string) => string;
|
|
83
|
+
logs: (id: string) => string;
|
|
84
|
+
metrics: (id: string) => string;
|
|
85
|
+
metric: (id: string, name: string) => string;
|
|
86
|
+
metricStats: (id: string, name: string) => string;
|
|
87
|
+
files: (id: string) => string;
|
|
88
|
+
file: (id: string, fileId: string) => string;
|
|
89
|
+
fileDownload: (id: string, fileId: string) => string;
|
|
90
|
+
};
|
|
91
|
+
/** Query parameters of a log read, as the server names them (`level` is a comma list). */
|
|
92
|
+
export declare function nativeLogQuery(query?: NativeLogQuery): Query;
|
|
93
|
+
/**
|
|
94
|
+
* The multipart body of a file upload. Text fields precede the file part: the server reads
|
|
95
|
+
* only the fields received before the file, and verifies `sizeBytes` and `checksum` against it.
|
|
96
|
+
*/
|
|
97
|
+
export declare function nativeFileForm(upload: NativeFileUpload): Promise<FormData>;
|
|
12
98
|
export declare function nativeExperimentsApi(t: Transport, namespace: string, project: string): {
|
|
13
99
|
status: () => Promise<unknown>;
|
|
14
100
|
session: (mode: "read" | "write") => Promise<{
|
|
@@ -17,13 +103,56 @@ export declare function nativeExperimentsApi(t: Transport, namespace: string, pr
|
|
|
17
103
|
apiUrl: string;
|
|
18
104
|
provider: string;
|
|
19
105
|
}>;
|
|
20
|
-
create: (key: string) => Promise<{
|
|
106
|
+
create: (key: string, body?: NativeRunCreate) => Promise<{
|
|
21
107
|
experiment: NativeExperimentRun;
|
|
22
108
|
}>;
|
|
109
|
+
/** ml-dash's `Experiment(prefix="ns/project/a/b/name")`: create-or-get the run named last in folder `a/b`. */
|
|
110
|
+
createAt: (segments: string[], body?: NativeRunCreate) => Promise<{
|
|
111
|
+
experiment: NativeExperimentRun;
|
|
112
|
+
}>;
|
|
113
|
+
/** Purge a trashed run for good (ADMIN): 202, its data deleted in the background. */
|
|
114
|
+
purge: (id: string) => Promise<{
|
|
115
|
+
id: string;
|
|
116
|
+
deleted: boolean;
|
|
117
|
+
purged: boolean;
|
|
118
|
+
}>;
|
|
119
|
+
folders: {
|
|
120
|
+
/** `{ path }` (mkdir -p) or `{ parentId?, name }`: the folder, created if missing. */
|
|
121
|
+
create: (body: {
|
|
122
|
+
path: string;
|
|
123
|
+
} | {
|
|
124
|
+
parentId?: string | null;
|
|
125
|
+
name: string;
|
|
126
|
+
}) => Promise<unknown>;
|
|
127
|
+
list: (query?: {
|
|
128
|
+
parentId?: string;
|
|
129
|
+
limit?: number;
|
|
130
|
+
cursor?: string;
|
|
131
|
+
}) => Promise<unknown>;
|
|
132
|
+
get: (id: string) => Promise<unknown>;
|
|
133
|
+
/** Rename and/or move (`parentId` null: the project root). */
|
|
134
|
+
update: (id: string, patch: {
|
|
135
|
+
name?: string;
|
|
136
|
+
parentId?: string | null;
|
|
137
|
+
}) => Promise<unknown>;
|
|
138
|
+
byPath: (segments: string[]) => Promise<unknown>;
|
|
139
|
+
/** An operation on every run below: 202 `{ operationId, state }`, applied by the server's worker. */
|
|
140
|
+
operate: (id: string, kind: NativeFolderOperation) => Promise<{
|
|
141
|
+
operationId: string;
|
|
142
|
+
state: string;
|
|
143
|
+
}>;
|
|
144
|
+
operation: (operationId: string) => Promise<unknown>;
|
|
145
|
+
};
|
|
146
|
+
/** ml-dash's batch delete: up to 100 runs and folders, each on its own, one receipt per item. */
|
|
147
|
+
batch: (action: "trash" | "purge", items: Array<{
|
|
148
|
+
type: "run" | "folder";
|
|
149
|
+
id: string;
|
|
150
|
+
}>) => Promise<unknown>;
|
|
23
151
|
list: (query?: {
|
|
24
152
|
limit?: number;
|
|
25
153
|
cursor?: string;
|
|
26
154
|
includeArchived?: boolean;
|
|
155
|
+
folderId?: string;
|
|
27
156
|
}) => Promise<{
|
|
28
157
|
runs: NativeExperimentRun[];
|
|
29
158
|
hasMore: boolean;
|
|
@@ -49,15 +178,27 @@ export declare function nativeExperimentsApi(t: Transport, namespace: string, pr
|
|
|
49
178
|
archive: (id: string, archived: boolean) => Promise<{
|
|
50
179
|
experiment: NativeExperimentRun;
|
|
51
180
|
}>;
|
|
181
|
+
/**
|
|
182
|
+
* Run metadata: `description` (null clears), `tags` (replaces the set), ml-dash's `metadata` dict; a person's
|
|
183
|
+
* rename/move (`name`, `folderPath` "" for the root) and `writeProtected` (set or clear).
|
|
184
|
+
*/
|
|
185
|
+
update: (id: string, patch: {
|
|
186
|
+
description?: string | null;
|
|
187
|
+
tags?: string[];
|
|
188
|
+
metadata?: Record<string, unknown> | null;
|
|
189
|
+
name?: string;
|
|
190
|
+
folderPath?: string;
|
|
191
|
+
writeProtected?: boolean;
|
|
192
|
+
}) => Promise<{
|
|
193
|
+
experiment: NativeExperimentRun;
|
|
194
|
+
}>;
|
|
52
195
|
parameters: {
|
|
53
196
|
get: (id: string) => Promise<unknown>;
|
|
54
197
|
set: (id: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
198
|
+
delete: (id: string) => Promise<unknown>;
|
|
55
199
|
};
|
|
56
200
|
logs: {
|
|
57
|
-
list: (id: string, query?:
|
|
58
|
-
limit?: number;
|
|
59
|
-
cursor?: string;
|
|
60
|
-
}) => Promise<unknown>;
|
|
201
|
+
list: (id: string, query?: NativeLogQuery) => Promise<unknown>;
|
|
61
202
|
append: (id: string, entries: Array<{
|
|
62
203
|
timestamp: string;
|
|
63
204
|
level: string;
|
|
@@ -71,7 +212,77 @@ export declare function nativeExperimentsApi(t: Transport, namespace: string, pr
|
|
|
71
212
|
limit?: number;
|
|
72
213
|
cursor?: string;
|
|
73
214
|
}) => Promise<unknown>;
|
|
74
|
-
|
|
215
|
+
/** `descriptor` is stored with the points, atomically, only when this append creates the metric. */
|
|
216
|
+
append: (id: string, name: string, dataPoints: Record<string, unknown>[], descriptor?: NativeItemMetadataPatch) => Promise<unknown>;
|
|
217
|
+
stats: (id: string, name: string) => Promise<unknown>;
|
|
218
|
+
updateMetadata: (id: string, name: string, patch: NativeItemMetadataPatch) => Promise<unknown>;
|
|
219
|
+
};
|
|
220
|
+
files: {
|
|
221
|
+
list: (id: string, query?: {
|
|
222
|
+
prefix?: string;
|
|
223
|
+
tags?: string[];
|
|
224
|
+
}) => Promise<unknown>;
|
|
225
|
+
get: (id: string, fileId: string) => Promise<unknown>;
|
|
226
|
+
upload: (id: string, upload: NativeFileUpload) => Promise<unknown>;
|
|
227
|
+
/** The file's bytes from the central API; redirects are refused, so the bearer never leaves it. */
|
|
228
|
+
download: (id: string, fileId: string, options?: {
|
|
229
|
+
signal?: AbortSignal;
|
|
230
|
+
}) => Promise<Response>;
|
|
231
|
+
update: (id: string, fileId: string, patch: NativeItemMetadataPatch) => Promise<unknown>;
|
|
232
|
+
delete: (id: string, fileId: string) => Promise<unknown>;
|
|
233
|
+
/** A signed read URL (images and video only, short-lived). */
|
|
234
|
+
media: (id: string, fileId: string) => Promise<unknown>;
|
|
235
|
+
};
|
|
236
|
+
/** Project and folder files (README.md, `.dashrc`): not a run's. `folderId` absent or "root": the project root. */
|
|
237
|
+
projectFiles: {
|
|
238
|
+
list: (query?: {
|
|
239
|
+
folderId?: string;
|
|
240
|
+
}) => Promise<unknown>;
|
|
241
|
+
upload: (upload: NativeFileUpload) => Promise<unknown>;
|
|
242
|
+
get: (fileId: string) => Promise<unknown>;
|
|
243
|
+
/** UTF-8 text, at most 512 KiB (larger: 413, never truncated). */
|
|
244
|
+
text: (fileId: string) => Promise<unknown>;
|
|
245
|
+
download: (fileId: string, options?: {
|
|
246
|
+
signal?: AbortSignal;
|
|
247
|
+
}) => Promise<Response>;
|
|
248
|
+
media: (fileId: string) => Promise<unknown>;
|
|
249
|
+
/** New bytes for the same file: its id, name and metadata stay. */
|
|
250
|
+
replace: (fileId: string, upload: NativeFileUpload) => Promise<unknown>;
|
|
251
|
+
/** description/tags/metadata, and/or `filename` and `folderId` (null: the root) to rename or move. */
|
|
252
|
+
update: (fileId: string, patch: NativeItemMetadataPatch & {
|
|
253
|
+
filename?: string;
|
|
254
|
+
folderId?: string | null;
|
|
255
|
+
}) => Promise<unknown>;
|
|
256
|
+
delete: (fileId: string) => Promise<unknown>;
|
|
257
|
+
};
|
|
258
|
+
/** The run's dashboard (its `.dashrc`, else ml-dash's default), read-only: one JSON section, or charts of one type. */
|
|
259
|
+
dashboard: {
|
|
260
|
+
section: (id: string, field: "header" | "metrics" | "charts" | "metadata") => Promise<unknown>;
|
|
261
|
+
charts: (id: string, type: "image" | "line" | "video") => Promise<unknown>;
|
|
262
|
+
};
|
|
263
|
+
/** The bindrs a run, or one item of it, is in; attach (by id, or by name: found or created) and detach. */
|
|
264
|
+
bindrs: {
|
|
265
|
+
list: (id: string, item?: NativeRunItem) => Promise<unknown>;
|
|
266
|
+
attach: (id: string, ref: NativeBindrRef) => Promise<unknown>;
|
|
267
|
+
detach: (id: string, ref: NativeBindrRef) => Promise<unknown>;
|
|
268
|
+
};
|
|
269
|
+
/** Tracks of a Dash-homed run; `topic` may contain `/` (encoded as one path segment). */
|
|
270
|
+
tracks: {
|
|
271
|
+
list: (id: string, query?: {
|
|
272
|
+
topic?: string;
|
|
273
|
+
}) => Promise<unknown>;
|
|
274
|
+
create: (id: string, topic: string, descriptor?: NativeItemMetadataPatch) => Promise<unknown>;
|
|
275
|
+
/** Entries `{ timestamp, ...data }`, at most 10000, appended in one commit. */
|
|
276
|
+
append: (id: string, topic: string, entries: Array<Record<string, unknown> & {
|
|
277
|
+
timestamp: number;
|
|
278
|
+
}>) => Promise<unknown>;
|
|
279
|
+
/** Track data: `json` returns `{ entries, count }`; use `export` for jsonl, parquet (Arrow IPC) or mcap bytes. */
|
|
280
|
+
read: (id: string, topic: string, query?: NativeTrackQuery) => Promise<unknown>;
|
|
281
|
+
export: (id: string, topic: string, query: NativeTrackQuery & {
|
|
282
|
+
format: "json" | "jsonl" | "parquet" | "mcap";
|
|
283
|
+
}, options?: {
|
|
284
|
+
signal?: AbortSignal;
|
|
285
|
+
}) => Promise<Response>;
|
|
75
286
|
};
|
|
76
|
-
setStatus: (id: string, status:
|
|
287
|
+
setStatus: (id: string, status: NativeRunStatus) => Promise<unknown>;
|
|
77
288
|
};
|