deepline 0.1.19 → 0.1.20

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/cli/index.js CHANGED
@@ -266,7 +266,7 @@ function saveProjectDeeplineEnvValues(baseUrl, values, startDir = projectEnvStar
266
266
  }
267
267
 
268
268
  // src/version.ts
269
- var SDK_VERSION = "0.1.19";
269
+ var SDK_VERSION = "0.1.20";
270
270
  var SDK_API_CONTRACT = "2026-05-runs-v2";
271
271
 
272
272
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -373,7 +373,8 @@ var HttpClient = class {
373
373
  parsed = body;
374
374
  }
375
375
  if (!response.ok) {
376
- const msg = typeof parsed === "object" && parsed && "error" in parsed ? String(parsed.error) : `HTTP ${response.status}`;
376
+ const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
377
+ const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
377
378
  throw new DeeplineError(msg, response.status, "API_ERROR", {
378
379
  response: parsed
379
380
  });
@@ -5206,14 +5207,20 @@ function formatReturnValue(result) {
5206
5207
  }
5207
5208
  return lines;
5208
5209
  }
5209
- function buildOutputSummary(rowsInfo, exportedPath) {
5210
+ function buildOutputSummary(rowsInfo, runId, exportedPath) {
5210
5211
  if (!rowsInfo) {
5211
5212
  return exportedPath ? { csv_path: exportedPath } : null;
5212
5213
  }
5214
+ const isPartial = !rowsInfo.complete;
5213
5215
  return {
5214
5216
  kind: "rows",
5215
5217
  rowCount: rowsInfo.totalRows,
5216
5218
  previewRowCount: rowsInfo.rows.length,
5219
+ ...isPartial ? {
5220
+ isPartial: true,
5221
+ previewCount: rowsInfo.rows.length,
5222
+ totalCount: rowsInfo.totalRows
5223
+ } : { isPartial: false },
5217
5224
  complete: rowsInfo.complete,
5218
5225
  columns: rowsInfo.columns,
5219
5226
  source: rowsInfo.source,
@@ -5224,16 +5231,27 @@ function buildRunWarnings(status, rowsInfo) {
5224
5231
  if (status.status === "completed" && rowsInfo?.totalRows === 0) {
5225
5232
  return ["Run completed with 0 output rows."];
5226
5233
  }
5234
+ if (rowsInfo && !rowsInfo.complete) {
5235
+ return [
5236
+ `Run output is partial: showing ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}.`
5237
+ ];
5238
+ }
5227
5239
  return [];
5228
5240
  }
5229
- function buildRunNextCommands(runId) {
5230
- return {
5241
+ function buildRunNextCommands(runId, rowsInfo) {
5242
+ const commands = {
5231
5243
  get: `deepline runs get ${runId} --json`,
5232
5244
  tail: `deepline runs tail ${runId} --json`,
5233
5245
  stop: `deepline runs stop ${runId} --reason "stale lock" --json`,
5234
- logs: `deepline runs logs ${runId} --out run.log --json`,
5235
- exportCsv: `deepline runs export ${runId} --out output.csv`
5246
+ logs: `deepline runs logs ${runId} --out run.log --json`
5236
5247
  };
5248
+ if (!rowsInfo || rowsInfo.complete) {
5249
+ commands.exportCsv = buildRunExportCommand(runId);
5250
+ }
5251
+ return commands;
5252
+ }
5253
+ function buildRunExportCommand(runId) {
5254
+ return `deepline runs export ${runId} --out output.csv`;
5237
5255
  }
5238
5256
  var RUN_LOG_PREVIEW_LIMIT = 20;
5239
5257
  function getRecordField(value, key) {
@@ -5281,10 +5299,11 @@ function normalizeProgressForEnvelope(status, rowsInfo) {
5281
5299
  wait: status.wait ?? null
5282
5300
  };
5283
5301
  }
5284
- function normalizeOutputsForEnvelope(rowsInfo, exportedPath) {
5302
+ function normalizeOutputsForEnvelope(rowsInfo, runId, exportedPath) {
5285
5303
  if (!rowsInfo) {
5286
5304
  return exportedPath ? [{ name: "output", kind: "file", path: exportedPath }] : [];
5287
5305
  }
5306
+ const isPartial = !rowsInfo.complete;
5288
5307
  return [
5289
5308
  {
5290
5309
  name: "rows",
@@ -5294,6 +5313,11 @@ function normalizeOutputsForEnvelope(rowsInfo, exportedPath) {
5294
5313
  preview: rowsInfo.rows.slice(0, 5),
5295
5314
  previewRowCount: Math.min(rowsInfo.rows.length, 5),
5296
5315
  previewLimit: 5,
5316
+ ...isPartial ? {
5317
+ isPartial: true,
5318
+ previewCount: rowsInfo.rows.length,
5319
+ totalCount: rowsInfo.totalRows
5320
+ } : { isPartial: false },
5297
5321
  complete: rowsInfo.complete,
5298
5322
  source: rowsInfo.source,
5299
5323
  ...exportedPath ? { csv_path: exportedPath } : {}
@@ -5385,19 +5409,23 @@ function compactPlayStatus(status, options) {
5385
5409
  status: status.status,
5386
5410
  run: normalizeRunStatusForEnvelope(status),
5387
5411
  progress: normalizeProgressForEnvelope(status, rowsInfo),
5388
- outputs: normalizeOutputsForEnvelope(rowsInfo, options?.exportedPath),
5412
+ outputs: normalizeOutputsForEnvelope(
5413
+ rowsInfo,
5414
+ status.runId,
5415
+ options?.exportedPath
5416
+ ),
5389
5417
  steps: normalizeStepsForEnvelope(status),
5390
5418
  errors: normalizeErrorsForEnvelope(status, error),
5391
5419
  logs: normalizeLogsForEnvelope(status),
5392
5420
  ...error ? { error } : {},
5393
5421
  ...warnings.length > 0 ? { warnings } : {},
5394
- output: buildOutputSummary(rowsInfo, options?.exportedPath) ?? result ?? null,
5422
+ output: buildOutputSummary(rowsInfo, status.runId, options?.exportedPath) ?? result ?? null,
5395
5423
  ...result !== void 0 ? { result } : {},
5396
5424
  ...status.resultView ? { resultView: status.resultView } : {},
5397
5425
  ...datasetStats ? { dataset_stats: datasetStats } : {},
5398
5426
  ...rowsInfo ? { previewRows: rowsInfo.rows.slice(0, 5) } : {},
5399
5427
  ...billing ? { billing } : {},
5400
- next: buildRunNextCommands(status.runId)
5428
+ next: buildRunNextCommands(status.runId, rowsInfo)
5401
5429
  };
5402
5430
  }
5403
5431
  function enrichPlayStatusWithDatasetStats(status) {
@@ -5457,13 +5485,22 @@ function writePlayResult(status, jsonOutput, options) {
5457
5485
  rowsInfo.columns,
5458
5486
  extractDatasetExecutionStats(status)
5459
5487
  ) : null;
5460
- const outputSummary = buildOutputSummary(rowsInfo, options?.exportedPath);
5488
+ const outputSummary = buildOutputSummary(
5489
+ rowsInfo,
5490
+ runId,
5491
+ options?.exportedPath
5492
+ );
5461
5493
  if (outputSummary) {
5462
5494
  const columns = Array.isArray(outputSummary.columns) ? outputSummary.columns.length : 0;
5463
5495
  const path = typeof outputSummary.csv_path === "string" ? ` file=${outputSummary.csv_path}` : "";
5464
5496
  lines.push(
5465
5497
  ` output: rows=${formatInteger(outputSummary.rowCount)} columns=${formatInteger(columns)}${path}`
5466
5498
  );
5499
+ if (outputSummary.isPartial === true) {
5500
+ lines.push(
5501
+ ` partial output: showing ${formatInteger(outputSummary.previewCount)} preview row(s) of ${formatInteger(outputSummary.totalCount)}`
5502
+ );
5503
+ }
5467
5504
  }
5468
5505
  for (const warning of warnings) {
5469
5506
  lines.push(` warning: ${warning}`);
@@ -5493,6 +5530,11 @@ function exportPlayStatusRows(status, outPath) {
5493
5530
  `Run ${status.runId} did not expose a row-shaped final output to export.`
5494
5531
  );
5495
5532
  }
5533
+ if (!rowsInfo.complete) {
5534
+ throw new DeeplineError(
5535
+ `Run output only includes ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}; full dataset export is not available from this status response yet.`
5536
+ );
5537
+ }
5496
5538
  return writeCanonicalRowsCsv(rowsInfo, outPath);
5497
5539
  }
5498
5540
  function renderServerResultView(value) {
@@ -243,7 +243,7 @@ function saveProjectDeeplineEnvValues(baseUrl, values, startDir = projectEnvStar
243
243
  }
244
244
 
245
245
  // src/version.ts
246
- var SDK_VERSION = "0.1.19";
246
+ var SDK_VERSION = "0.1.20";
247
247
  var SDK_API_CONTRACT = "2026-05-runs-v2";
248
248
 
249
249
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -350,7 +350,8 @@ var HttpClient = class {
350
350
  parsed = body;
351
351
  }
352
352
  if (!response.ok) {
353
- const msg = typeof parsed === "object" && parsed && "error" in parsed ? String(parsed.error) : `HTTP ${response.status}`;
353
+ const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
354
+ const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
354
355
  throw new DeeplineError(msg, response.status, "API_ERROR", {
355
356
  response: parsed
356
357
  });
@@ -5187,14 +5188,20 @@ function formatReturnValue(result) {
5187
5188
  }
5188
5189
  return lines;
5189
5190
  }
5190
- function buildOutputSummary(rowsInfo, exportedPath) {
5191
+ function buildOutputSummary(rowsInfo, runId, exportedPath) {
5191
5192
  if (!rowsInfo) {
5192
5193
  return exportedPath ? { csv_path: exportedPath } : null;
5193
5194
  }
5195
+ const isPartial = !rowsInfo.complete;
5194
5196
  return {
5195
5197
  kind: "rows",
5196
5198
  rowCount: rowsInfo.totalRows,
5197
5199
  previewRowCount: rowsInfo.rows.length,
5200
+ ...isPartial ? {
5201
+ isPartial: true,
5202
+ previewCount: rowsInfo.rows.length,
5203
+ totalCount: rowsInfo.totalRows
5204
+ } : { isPartial: false },
5198
5205
  complete: rowsInfo.complete,
5199
5206
  columns: rowsInfo.columns,
5200
5207
  source: rowsInfo.source,
@@ -5205,16 +5212,27 @@ function buildRunWarnings(status, rowsInfo) {
5205
5212
  if (status.status === "completed" && rowsInfo?.totalRows === 0) {
5206
5213
  return ["Run completed with 0 output rows."];
5207
5214
  }
5215
+ if (rowsInfo && !rowsInfo.complete) {
5216
+ return [
5217
+ `Run output is partial: showing ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}.`
5218
+ ];
5219
+ }
5208
5220
  return [];
5209
5221
  }
5210
- function buildRunNextCommands(runId) {
5211
- return {
5222
+ function buildRunNextCommands(runId, rowsInfo) {
5223
+ const commands = {
5212
5224
  get: `deepline runs get ${runId} --json`,
5213
5225
  tail: `deepline runs tail ${runId} --json`,
5214
5226
  stop: `deepline runs stop ${runId} --reason "stale lock" --json`,
5215
- logs: `deepline runs logs ${runId} --out run.log --json`,
5216
- exportCsv: `deepline runs export ${runId} --out output.csv`
5227
+ logs: `deepline runs logs ${runId} --out run.log --json`
5217
5228
  };
5229
+ if (!rowsInfo || rowsInfo.complete) {
5230
+ commands.exportCsv = buildRunExportCommand(runId);
5231
+ }
5232
+ return commands;
5233
+ }
5234
+ function buildRunExportCommand(runId) {
5235
+ return `deepline runs export ${runId} --out output.csv`;
5218
5236
  }
5219
5237
  var RUN_LOG_PREVIEW_LIMIT = 20;
5220
5238
  function getRecordField(value, key) {
@@ -5262,10 +5280,11 @@ function normalizeProgressForEnvelope(status, rowsInfo) {
5262
5280
  wait: status.wait ?? null
5263
5281
  };
5264
5282
  }
5265
- function normalizeOutputsForEnvelope(rowsInfo, exportedPath) {
5283
+ function normalizeOutputsForEnvelope(rowsInfo, runId, exportedPath) {
5266
5284
  if (!rowsInfo) {
5267
5285
  return exportedPath ? [{ name: "output", kind: "file", path: exportedPath }] : [];
5268
5286
  }
5287
+ const isPartial = !rowsInfo.complete;
5269
5288
  return [
5270
5289
  {
5271
5290
  name: "rows",
@@ -5275,6 +5294,11 @@ function normalizeOutputsForEnvelope(rowsInfo, exportedPath) {
5275
5294
  preview: rowsInfo.rows.slice(0, 5),
5276
5295
  previewRowCount: Math.min(rowsInfo.rows.length, 5),
5277
5296
  previewLimit: 5,
5297
+ ...isPartial ? {
5298
+ isPartial: true,
5299
+ previewCount: rowsInfo.rows.length,
5300
+ totalCount: rowsInfo.totalRows
5301
+ } : { isPartial: false },
5278
5302
  complete: rowsInfo.complete,
5279
5303
  source: rowsInfo.source,
5280
5304
  ...exportedPath ? { csv_path: exportedPath } : {}
@@ -5366,19 +5390,23 @@ function compactPlayStatus(status, options) {
5366
5390
  status: status.status,
5367
5391
  run: normalizeRunStatusForEnvelope(status),
5368
5392
  progress: normalizeProgressForEnvelope(status, rowsInfo),
5369
- outputs: normalizeOutputsForEnvelope(rowsInfo, options?.exportedPath),
5393
+ outputs: normalizeOutputsForEnvelope(
5394
+ rowsInfo,
5395
+ status.runId,
5396
+ options?.exportedPath
5397
+ ),
5370
5398
  steps: normalizeStepsForEnvelope(status),
5371
5399
  errors: normalizeErrorsForEnvelope(status, error),
5372
5400
  logs: normalizeLogsForEnvelope(status),
5373
5401
  ...error ? { error } : {},
5374
5402
  ...warnings.length > 0 ? { warnings } : {},
5375
- output: buildOutputSummary(rowsInfo, options?.exportedPath) ?? result ?? null,
5403
+ output: buildOutputSummary(rowsInfo, status.runId, options?.exportedPath) ?? result ?? null,
5376
5404
  ...result !== void 0 ? { result } : {},
5377
5405
  ...status.resultView ? { resultView: status.resultView } : {},
5378
5406
  ...datasetStats ? { dataset_stats: datasetStats } : {},
5379
5407
  ...rowsInfo ? { previewRows: rowsInfo.rows.slice(0, 5) } : {},
5380
5408
  ...billing ? { billing } : {},
5381
- next: buildRunNextCommands(status.runId)
5409
+ next: buildRunNextCommands(status.runId, rowsInfo)
5382
5410
  };
5383
5411
  }
5384
5412
  function enrichPlayStatusWithDatasetStats(status) {
@@ -5438,13 +5466,22 @@ function writePlayResult(status, jsonOutput, options) {
5438
5466
  rowsInfo.columns,
5439
5467
  extractDatasetExecutionStats(status)
5440
5468
  ) : null;
5441
- const outputSummary = buildOutputSummary(rowsInfo, options?.exportedPath);
5469
+ const outputSummary = buildOutputSummary(
5470
+ rowsInfo,
5471
+ runId,
5472
+ options?.exportedPath
5473
+ );
5442
5474
  if (outputSummary) {
5443
5475
  const columns = Array.isArray(outputSummary.columns) ? outputSummary.columns.length : 0;
5444
5476
  const path = typeof outputSummary.csv_path === "string" ? ` file=${outputSummary.csv_path}` : "";
5445
5477
  lines.push(
5446
5478
  ` output: rows=${formatInteger(outputSummary.rowCount)} columns=${formatInteger(columns)}${path}`
5447
5479
  );
5480
+ if (outputSummary.isPartial === true) {
5481
+ lines.push(
5482
+ ` partial output: showing ${formatInteger(outputSummary.previewCount)} preview row(s) of ${formatInteger(outputSummary.totalCount)}`
5483
+ );
5484
+ }
5448
5485
  }
5449
5486
  for (const warning of warnings) {
5450
5487
  lines.push(` warning: ${warning}`);
@@ -5474,6 +5511,11 @@ function exportPlayStatusRows(status, outPath) {
5474
5511
  `Run ${status.runId} did not expose a row-shaped final output to export.`
5475
5512
  );
5476
5513
  }
5514
+ if (!rowsInfo.complete) {
5515
+ throw new DeeplineError(
5516
+ `Run output only includes ${rowsInfo.rows.length} preview row(s) of ${rowsInfo.totalRows}; full dataset export is not available from this status response yet.`
5517
+ );
5518
+ }
5477
5519
  return writeCanonicalRowsCsv(rowsInfo, outPath);
5478
5520
  }
5479
5521
  function renderServerResultView(value) {
package/dist/index.d.mts CHANGED
@@ -1434,7 +1434,7 @@ declare class DeeplineClient {
1434
1434
  }>;
1435
1435
  }
1436
1436
 
1437
- declare const SDK_VERSION = "0.1.19";
1437
+ declare const SDK_VERSION = "0.1.20";
1438
1438
  declare const SDK_API_CONTRACT = "2026-05-runs-v2";
1439
1439
 
1440
1440
  /**
package/dist/index.d.ts CHANGED
@@ -1434,7 +1434,7 @@ declare class DeeplineClient {
1434
1434
  }>;
1435
1435
  }
1436
1436
 
1437
- declare const SDK_VERSION = "0.1.19";
1437
+ declare const SDK_VERSION = "0.1.20";
1438
1438
  declare const SDK_API_CONTRACT = "2026-05-runs-v2";
1439
1439
 
1440
1440
  /**
package/dist/index.js CHANGED
@@ -241,7 +241,7 @@ function resolveConfig(options) {
241
241
  }
242
242
 
243
243
  // src/version.ts
244
- var SDK_VERSION = "0.1.19";
244
+ var SDK_VERSION = "0.1.20";
245
245
  var SDK_API_CONTRACT = "2026-05-runs-v2";
246
246
 
247
247
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -348,7 +348,8 @@ var HttpClient = class {
348
348
  parsed = body;
349
349
  }
350
350
  if (!response.ok) {
351
- const msg = typeof parsed === "object" && parsed && "error" in parsed ? String(parsed.error) : `HTTP ${response.status}`;
351
+ const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
352
+ const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
352
353
  throw new DeeplineError(msg, response.status, "API_ERROR", {
353
354
  response: parsed
354
355
  });
package/dist/index.mjs CHANGED
@@ -195,7 +195,7 @@ function resolveConfig(options) {
195
195
  }
196
196
 
197
197
  // src/version.ts
198
- var SDK_VERSION = "0.1.19";
198
+ var SDK_VERSION = "0.1.20";
199
199
  var SDK_API_CONTRACT = "2026-05-runs-v2";
200
200
 
201
201
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -302,7 +302,8 @@ var HttpClient = class {
302
302
  parsed = body;
303
303
  }
304
304
  if (!response.ok) {
305
- const msg = typeof parsed === "object" && parsed && "error" in parsed ? String(parsed.error) : `HTTP ${response.status}`;
305
+ const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
306
+ const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
306
307
  throw new DeeplineError(msg, response.status, "API_ERROR", {
307
308
  response: parsed
308
309
  });