deepline 0.1.28 → 0.1.30

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/index.d.mts CHANGED
@@ -847,11 +847,41 @@ type RunsLogsResult = {
847
847
  hasMore: boolean;
848
848
  entries: string[];
849
849
  };
850
+ type PlaySheetRow = {
851
+ key?: string;
852
+ status?: string;
853
+ data?: Record<string, unknown>;
854
+ [key: string]: unknown;
855
+ };
856
+ type PlaySheetRowsResult = {
857
+ rows: PlaySheetRow[];
858
+ summary?: {
859
+ stats?: {
860
+ total?: number;
861
+ queued?: number;
862
+ running?: number;
863
+ completed?: number;
864
+ failed?: number;
865
+ [key: string]: unknown;
866
+ };
867
+ columns?: Record<string, unknown>;
868
+ [key: string]: unknown;
869
+ };
870
+ customerDbUrl?: string;
871
+ deltaCursor?: number;
872
+ };
850
873
  type RunsNamespace = {
851
874
  get: (runId: string) => Promise<PlayStatus>;
852
875
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
853
876
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
854
877
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
878
+ exportDatasetRows: (input: {
879
+ playName: string;
880
+ tableNamespace: string;
881
+ runId?: string;
882
+ limit?: number;
883
+ offset?: number;
884
+ }) => Promise<PlaySheetRowsResult>;
855
885
  stop: (runId: string, options?: {
856
886
  reason?: string;
857
887
  }) => Promise<StopPlayRunResult>;
@@ -1248,6 +1278,13 @@ declare class DeeplineClient {
1248
1278
  * ```
1249
1279
  */
1250
1280
  getRunLogs(runId: string, options?: RunsLogsOptions): Promise<RunsLogsResult>;
1281
+ getPlaySheetRows(input: {
1282
+ playName: string;
1283
+ tableNamespace: string;
1284
+ runId?: string;
1285
+ limit?: number;
1286
+ offset?: number;
1287
+ }): Promise<PlaySheetRowsResult>;
1251
1288
  /**
1252
1289
  * Stop a run by id using the public runs resource model.
1253
1290
  *
@@ -1401,8 +1438,8 @@ declare class DeeplineClient {
1401
1438
  }>;
1402
1439
  }
1403
1440
 
1404
- declare const SDK_VERSION = "0.1.28";
1405
- declare const SDK_API_CONTRACT = "2026-05-runs-v2";
1441
+ declare const SDK_VERSION = "0.1.30";
1442
+ declare const SDK_API_CONTRACT = "2026-05-runs-v2-datasets";
1406
1443
 
1407
1444
  /**
1408
1445
  * Base error class for all Deepline SDK errors.
@@ -1915,6 +1952,9 @@ interface DeeplinePlayRuntimeContext {
1915
1952
  tool<TOutput = LoosePlayObject>(key: string, toolId: string, input: Record<string, unknown>, options?: {
1916
1953
  description?: string;
1917
1954
  }): Promise<ToolExecuteResult<TOutput>>;
1955
+ runSteps<TInput extends Record<string, unknown>, TOutput>(program: StepProgram<TInput, any, TOutput>, input: TInput, options?: {
1956
+ description?: string;
1957
+ }): Promise<TOutput>;
1918
1958
  step<T>(id: string, run: () => T | Promise<T>): Promise<T>;
1919
1959
  fetch(key: string, url: string | URL, init?: RequestInit): Promise<{
1920
1960
  ok: boolean;
package/dist/index.d.ts CHANGED
@@ -847,11 +847,41 @@ type RunsLogsResult = {
847
847
  hasMore: boolean;
848
848
  entries: string[];
849
849
  };
850
+ type PlaySheetRow = {
851
+ key?: string;
852
+ status?: string;
853
+ data?: Record<string, unknown>;
854
+ [key: string]: unknown;
855
+ };
856
+ type PlaySheetRowsResult = {
857
+ rows: PlaySheetRow[];
858
+ summary?: {
859
+ stats?: {
860
+ total?: number;
861
+ queued?: number;
862
+ running?: number;
863
+ completed?: number;
864
+ failed?: number;
865
+ [key: string]: unknown;
866
+ };
867
+ columns?: Record<string, unknown>;
868
+ [key: string]: unknown;
869
+ };
870
+ customerDbUrl?: string;
871
+ deltaCursor?: number;
872
+ };
850
873
  type RunsNamespace = {
851
874
  get: (runId: string) => Promise<PlayStatus>;
852
875
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
853
876
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
854
877
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
878
+ exportDatasetRows: (input: {
879
+ playName: string;
880
+ tableNamespace: string;
881
+ runId?: string;
882
+ limit?: number;
883
+ offset?: number;
884
+ }) => Promise<PlaySheetRowsResult>;
855
885
  stop: (runId: string, options?: {
856
886
  reason?: string;
857
887
  }) => Promise<StopPlayRunResult>;
@@ -1248,6 +1278,13 @@ declare class DeeplineClient {
1248
1278
  * ```
1249
1279
  */
1250
1280
  getRunLogs(runId: string, options?: RunsLogsOptions): Promise<RunsLogsResult>;
1281
+ getPlaySheetRows(input: {
1282
+ playName: string;
1283
+ tableNamespace: string;
1284
+ runId?: string;
1285
+ limit?: number;
1286
+ offset?: number;
1287
+ }): Promise<PlaySheetRowsResult>;
1251
1288
  /**
1252
1289
  * Stop a run by id using the public runs resource model.
1253
1290
  *
@@ -1401,8 +1438,8 @@ declare class DeeplineClient {
1401
1438
  }>;
1402
1439
  }
1403
1440
 
1404
- declare const SDK_VERSION = "0.1.28";
1405
- declare const SDK_API_CONTRACT = "2026-05-runs-v2";
1441
+ declare const SDK_VERSION = "0.1.30";
1442
+ declare const SDK_API_CONTRACT = "2026-05-runs-v2-datasets";
1406
1443
 
1407
1444
  /**
1408
1445
  * Base error class for all Deepline SDK errors.
@@ -1915,6 +1952,9 @@ interface DeeplinePlayRuntimeContext {
1915
1952
  tool<TOutput = LoosePlayObject>(key: string, toolId: string, input: Record<string, unknown>, options?: {
1916
1953
  description?: string;
1917
1954
  }): Promise<ToolExecuteResult<TOutput>>;
1955
+ runSteps<TInput extends Record<string, unknown>, TOutput>(program: StepProgram<TInput, any, TOutput>, input: TInput, options?: {
1956
+ description?: string;
1957
+ }): Promise<TOutput>;
1918
1958
  step<T>(id: string, run: () => T | Promise<T>): Promise<T>;
1919
1959
  fetch(key: string, url: string | URL, init?: RequestInit): Promise<{
1920
1960
  ok: boolean;
package/dist/index.js CHANGED
@@ -241,8 +241,8 @@ function resolveConfig(options) {
241
241
  }
242
242
 
243
243
  // src/version.ts
244
- var SDK_VERSION = "0.1.28";
245
- var SDK_API_CONTRACT = "2026-05-runs-v2";
244
+ var SDK_VERSION = "0.1.30";
245
+ var SDK_API_CONTRACT = "2026-05-runs-v2-datasets";
246
246
 
247
247
  // ../shared_libs/play-runtime/coordinator-headers.ts
248
248
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
@@ -651,6 +651,7 @@ var DeeplineClient = class {
651
651
  list: (options2) => this.listRuns(options2),
652
652
  tail: (runId, options2) => this.tailRun(runId, options2),
653
653
  logs: (runId, options2) => this.getRunLogs(runId, options2),
654
+ exportDatasetRows: (input) => this.getPlaySheetRows(input),
654
655
  stop: (runId, options2) => this.stopRun(runId, options2)
655
656
  };
656
657
  }
@@ -678,7 +679,7 @@ var DeeplineClient = class {
678
679
  const target = play.reference || play.name;
679
680
  if (options?.csvInput) {
680
681
  const inputField = typeof options.csvInput.inputField === "string" && options.csvInput.inputField.trim() ? options.csvInput.inputField.trim() : "csv";
681
- return `deepline plays run ${target} --${inputField} leads.csv --watch`;
682
+ return `deepline plays run ${target} --input '${JSON.stringify({ [inputField]: "leads.csv" })}' --watch`;
682
683
  }
683
684
  return `deepline plays run ${target} --input '{...}' --watch`;
684
685
  }
@@ -1338,6 +1339,19 @@ var DeeplineClient = class {
1338
1339
  entries
1339
1340
  };
1340
1341
  }
1342
+ async getPlaySheetRows(input) {
1343
+ const params = new URLSearchParams({
1344
+ tableNamespace: input.tableNamespace,
1345
+ limit: String(input.limit ?? 5e3),
1346
+ offset: String(input.offset ?? 0)
1347
+ });
1348
+ if (input.runId?.trim()) {
1349
+ params.set("runId", input.runId.trim());
1350
+ }
1351
+ return await this.http.get(
1352
+ `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
1353
+ );
1354
+ }
1341
1355
  /**
1342
1356
  * Stop a run by id using the public runs resource model.
1343
1357
  *
package/dist/index.mjs CHANGED
@@ -195,8 +195,8 @@ function resolveConfig(options) {
195
195
  }
196
196
 
197
197
  // src/version.ts
198
- var SDK_VERSION = "0.1.28";
199
- var SDK_API_CONTRACT = "2026-05-runs-v2";
198
+ var SDK_VERSION = "0.1.30";
199
+ var SDK_API_CONTRACT = "2026-05-runs-v2-datasets";
200
200
 
201
201
  // ../shared_libs/play-runtime/coordinator-headers.ts
202
202
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
@@ -605,6 +605,7 @@ var DeeplineClient = class {
605
605
  list: (options2) => this.listRuns(options2),
606
606
  tail: (runId, options2) => this.tailRun(runId, options2),
607
607
  logs: (runId, options2) => this.getRunLogs(runId, options2),
608
+ exportDatasetRows: (input) => this.getPlaySheetRows(input),
608
609
  stop: (runId, options2) => this.stopRun(runId, options2)
609
610
  };
610
611
  }
@@ -632,7 +633,7 @@ var DeeplineClient = class {
632
633
  const target = play.reference || play.name;
633
634
  if (options?.csvInput) {
634
635
  const inputField = typeof options.csvInput.inputField === "string" && options.csvInput.inputField.trim() ? options.csvInput.inputField.trim() : "csv";
635
- return `deepline plays run ${target} --${inputField} leads.csv --watch`;
636
+ return `deepline plays run ${target} --input '${JSON.stringify({ [inputField]: "leads.csv" })}' --watch`;
636
637
  }
637
638
  return `deepline plays run ${target} --input '{...}' --watch`;
638
639
  }
@@ -1292,6 +1293,19 @@ var DeeplineClient = class {
1292
1293
  entries
1293
1294
  };
1294
1295
  }
1296
+ async getPlaySheetRows(input) {
1297
+ const params = new URLSearchParams({
1298
+ tableNamespace: input.tableNamespace,
1299
+ limit: String(input.limit ?? 5e3),
1300
+ offset: String(input.offset ?? 0)
1301
+ });
1302
+ if (input.runId?.trim()) {
1303
+ params.set("runId", input.runId.trim());
1304
+ }
1305
+ return await this.http.get(
1306
+ `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
1307
+ );
1308
+ }
1295
1309
  /**
1296
1310
  * Stop a run by id using the public runs resource model.
1297
1311
  *
@@ -24,8 +24,18 @@ type DatasetChunkReader<T extends DatasetRow> = (
24
24
  chunkSize: number,
25
25
  ) => AsyncIterable<T[]>;
26
26
 
27
+ export type WorkerDatasetCapabilities = {
28
+ storage: 'materialized' | 'runtime_sheet' | 'csv_stream' | 'iterable';
29
+ chunkReadable: boolean;
30
+ pageBacked: boolean;
31
+ replayable: boolean;
32
+ countHint: number | null;
33
+ materialization: 'bounded' | 'in_memory';
34
+ };
35
+
27
36
  const datasetChunkReaders = new WeakMap<object, DatasetChunkReader<DatasetRow>>();
28
37
  const datasetCountHints = new WeakMap<object, number | null>();
38
+ const datasetCapabilities = new WeakMap<object, WorkerDatasetCapabilities>();
29
39
 
30
40
  function cloneRow<T extends DatasetRow>(row: T): T {
31
41
  return { ...row };
@@ -35,12 +45,14 @@ function registerChunkReader<T extends DatasetRow>(
35
45
  dataset: PlayDataset<T>,
36
46
  reader: DatasetChunkReader<T>,
37
47
  countHint: number | null,
48
+ capabilities: Omit<WorkerDatasetCapabilities, 'countHint'>,
38
49
  ): PlayDataset<T> {
39
50
  datasetChunkReaders.set(
40
51
  dataset as object,
41
52
  reader as DatasetChunkReader<DatasetRow>,
42
53
  );
43
54
  datasetCountHints.set(dataset as object, countHint);
55
+ datasetCapabilities.set(dataset as object, { ...capabilities, countHint });
44
56
  return dataset;
45
57
  }
46
58
 
@@ -95,6 +107,13 @@ export function createMaterializedDatasetHandle<T extends DatasetRow>(input: {
95
107
  }
96
108
  },
97
109
  Math.max(0, Math.floor(input.count ?? materializedRows.length)),
110
+ {
111
+ storage: 'materialized',
112
+ chunkReadable: true,
113
+ pageBacked: false,
114
+ replayable: true,
115
+ materialization: 'in_memory',
116
+ },
98
117
  );
99
118
  }
100
119
 
@@ -208,7 +227,13 @@ export function createPersistedDatasetHandle<T extends DatasetRow>(input: {
208
227
  }) as AsyncIterable<T>,
209
228
  },
210
229
  });
211
- return registerChunkReader(dataset, (chunkSize) => readChunks(chunkSize), count);
230
+ return registerChunkReader(dataset, (chunkSize) => readChunks(chunkSize), count, {
231
+ storage: 'runtime_sheet',
232
+ chunkReadable: true,
233
+ pageBacked: true,
234
+ replayable: true,
235
+ materialization: 'bounded',
236
+ });
212
237
  }
213
238
 
214
239
  export function createCsvDatasetHandle<T extends DatasetRow>(input: {
@@ -333,7 +358,13 @@ export function createCsvDatasetHandle<T extends DatasetRow>(input: {
333
358
  }) as AsyncIterable<T>,
334
359
  },
335
360
  });
336
- return registerChunkReader(dataset, (chunkSize) => readChunks(chunkSize), null);
361
+ return registerChunkReader(dataset, (chunkSize) => readChunks(chunkSize), null, {
362
+ storage: 'csv_stream',
363
+ chunkReadable: true,
364
+ pageBacked: false,
365
+ replayable: true,
366
+ materialization: 'bounded',
367
+ });
337
368
  }
338
369
 
339
370
  export function createInlineDatasetHandle<T extends DatasetRow>(
@@ -363,6 +394,35 @@ export function datasetRowCountHint<T extends DatasetRow>(
363
394
  return null;
364
395
  }
365
396
 
397
+ export function datasetHandleCapabilities<T extends DatasetRow>(
398
+ input: WorkerDatasetInput<T>,
399
+ ): WorkerDatasetCapabilities {
400
+ if (Array.isArray(input)) {
401
+ return {
402
+ storage: 'materialized',
403
+ chunkReadable: true,
404
+ pageBacked: false,
405
+ replayable: true,
406
+ countHint: input.length,
407
+ materialization: 'in_memory',
408
+ };
409
+ }
410
+ if (isPlayDataset<T>(input)) {
411
+ const capabilities = datasetCapabilities.get(input as object);
412
+ if (capabilities) {
413
+ return capabilities;
414
+ }
415
+ }
416
+ return {
417
+ storage: 'iterable',
418
+ chunkReadable: false,
419
+ pageBacked: false,
420
+ replayable: false,
421
+ countHint: null,
422
+ materialization: 'bounded',
423
+ };
424
+ }
425
+
366
426
  export function isDatasetHandle<T extends DatasetRow>(
367
427
  value: unknown,
368
428
  ): value is WorkerDatasetHandle<T> {
@@ -127,11 +127,43 @@ export type RunsLogsResult = {
127
127
  entries: string[];
128
128
  };
129
129
 
130
+ export type PlaySheetRow = {
131
+ key?: string;
132
+ status?: string;
133
+ data?: Record<string, unknown>;
134
+ [key: string]: unknown;
135
+ };
136
+
137
+ export type PlaySheetRowsResult = {
138
+ rows: PlaySheetRow[];
139
+ summary?: {
140
+ stats?: {
141
+ total?: number;
142
+ queued?: number;
143
+ running?: number;
144
+ completed?: number;
145
+ failed?: number;
146
+ [key: string]: unknown;
147
+ };
148
+ columns?: Record<string, unknown>;
149
+ [key: string]: unknown;
150
+ };
151
+ customerDbUrl?: string;
152
+ deltaCursor?: number;
153
+ };
154
+
130
155
  export type RunsNamespace = {
131
156
  get: (runId: string) => Promise<PlayStatus>;
132
157
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
133
158
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
134
159
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
160
+ exportDatasetRows: (input: {
161
+ playName: string;
162
+ tableNamespace: string;
163
+ runId?: string;
164
+ limit?: number;
165
+ offset?: number;
166
+ }) => Promise<PlaySheetRowsResult>;
135
167
  stop: (
136
168
  runId: string,
137
169
  options?: { reason?: string },
@@ -333,6 +365,7 @@ export class DeeplineClient {
333
365
  list: (options) => this.listRuns(options),
334
366
  tail: (runId, options) => this.tailRun(runId, options),
335
367
  logs: (runId, options) => this.getRunLogs(runId, options),
368
+ exportDatasetRows: (input) => this.getPlaySheetRows(input),
336
369
  stop: (runId, options) => this.stopRun(runId, options),
337
370
  };
338
371
  }
@@ -381,7 +414,7 @@ export class DeeplineClient {
381
414
  options.csvInput.inputField.trim()
382
415
  ? options.csvInput.inputField.trim()
383
416
  : 'csv';
384
- return `deepline plays run ${target} --${inputField} leads.csv --watch`;
417
+ return `deepline plays run ${target} --input '${JSON.stringify({ [inputField]: 'leads.csv' })}' --watch`;
385
418
  }
386
419
  return `deepline plays run ${target} --input '{...}' --watch`;
387
420
  }
@@ -1282,6 +1315,26 @@ export class DeeplineClient {
1282
1315
  };
1283
1316
  }
1284
1317
 
1318
+ async getPlaySheetRows(input: {
1319
+ playName: string;
1320
+ tableNamespace: string;
1321
+ runId?: string;
1322
+ limit?: number;
1323
+ offset?: number;
1324
+ }): Promise<PlaySheetRowsResult> {
1325
+ const params = new URLSearchParams({
1326
+ tableNamespace: input.tableNamespace,
1327
+ limit: String(input.limit ?? 5000),
1328
+ offset: String(input.offset ?? 0),
1329
+ });
1330
+ if (input.runId?.trim()) {
1331
+ params.set('runId', input.runId.trim());
1332
+ }
1333
+ return await this.http.get<PlaySheetRowsResult>(
1334
+ `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
1335
+ );
1336
+ }
1337
+
1285
1338
  /**
1286
1339
  * Stop a run by id using the public runs resource model.
1287
1340
  *
@@ -408,6 +408,11 @@ export interface DeeplinePlayRuntimeContext {
408
408
  input: Record<string, unknown>,
409
409
  options?: { description?: string },
410
410
  ): Promise<ToolExecuteResult<TOutput>>;
411
+ runSteps<TInput extends Record<string, unknown>, TOutput>(
412
+ program: StepProgram<TInput, any, TOutput>,
413
+ input: TInput,
414
+ options?: { description?: string },
415
+ ): Promise<TOutput>;
411
416
  step<T>(id: string, run: () => T | Promise<T>): Promise<T>;
412
417
  fetch(
413
418
  key: string,
@@ -1,2 +1,2 @@
1
- export const SDK_VERSION = "0.1.28";
2
- export const SDK_API_CONTRACT = "2026-05-runs-v2";
1
+ export const SDK_VERSION = "0.1.30";
2
+ export const SDK_API_CONTRACT = "2026-05-runs-v2-datasets";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {