deepline 0.1.7 → 0.1.8

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.
@@ -169,7 +169,7 @@ function resolveConfig(options) {
169
169
  }
170
170
 
171
171
  // src/version.ts
172
- var SDK_VERSION = "0.1.7";
172
+ var SDK_VERSION = "0.1.8";
173
173
  var SDK_API_CONTRACT = "2026-04-plays-v1";
174
174
 
175
175
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -3820,6 +3820,21 @@ var CliProgress = class {
3820
3820
  this.worker?.terminate().catch(() => void 0);
3821
3821
  this.worker = null;
3822
3822
  process.stderr.write(`\r\x1B[2K${message}
3823
+ `);
3824
+ if (activeMessage) {
3825
+ this.startWorker().postMessage({ type: "phase", message: activeMessage });
3826
+ }
3827
+ }
3828
+ writeLine(line, stream = process.stderr) {
3829
+ if (!this.enabled || !this.interactive) {
3830
+ stream.write(`${line}
3831
+ `);
3832
+ return;
3833
+ }
3834
+ const activeMessage = this.lastMessage;
3835
+ this.worker?.terminate().catch(() => void 0);
3836
+ this.worker = null;
3837
+ stream.write(`\r\x1B[2K${line}
3823
3838
  `);
3824
3839
  if (activeMessage) {
3825
3840
  this.startWorker().postMessage({ type: "phase", message: activeMessage });
@@ -4569,9 +4584,16 @@ async function startAndWaitForPlayCompletionByStream(input) {
4569
4584
  const workflowId = lastKnownWorkflowId || "pending";
4570
4585
  if (workflowId !== "pending" && !emittedDashboardUrl) {
4571
4586
  const dashboardUrl = getDashboardUrlFromLiveEvent(event) ?? buildPlayDashboardUrl(input.client.baseUrl, input.playName);
4572
- input.progress.phase(
4573
- `loading play on ${dashboardUrl}`
4574
- );
4587
+ if (!input.jsonOutput) {
4588
+ writeStartedPlayRun({
4589
+ runId: workflowId,
4590
+ playName: input.playName,
4591
+ dashboardUrl,
4592
+ jsonOutput: false,
4593
+ progress: input.progress
4594
+ });
4595
+ }
4596
+ input.progress.phase(`loading play on ${dashboardUrl}`);
4575
4597
  emittedDashboardUrl = true;
4576
4598
  }
4577
4599
  assertPlayWaitNotTimedOut({
@@ -4682,9 +4704,8 @@ async function waitForPlayCompletionByPolling(input) {
4682
4704
  const now = Date.now();
4683
4705
  if (now - lastTransientPollWarningAt >= 3e4) {
4684
4706
  const message = error instanceof Error ? error.message : String(error);
4685
- process.stderr.write(
4686
- `[play tail] transient status poll failed; retrying: ${message}
4687
- `
4707
+ input.progress.writeLine(
4708
+ `[play tail] transient status poll failed; retrying: ${message}`
4688
4709
  );
4689
4710
  lastTransientPollWarningAt = now;
4690
4711
  }
@@ -5074,7 +5095,12 @@ function writeStartedPlayRun(input) {
5074
5095
  if (input.dashboardUrl) {
5075
5096
  lines.push(` play page: ${input.dashboardUrl}`);
5076
5097
  }
5077
- console.log(lines.join("\n"));
5098
+ const output = lines.join("\n");
5099
+ if (input.progress) {
5100
+ input.progress.writeLine(output, process.stdout);
5101
+ return;
5102
+ }
5103
+ console.log(output);
5078
5104
  }
5079
5105
  function parsePlayRunOptions(args) {
5080
5106
  const usage = "Usage: deepline plays run <play-name> [--input '{...}'] [--csv file.csv] [--live|--latest|--revision-id <id>] [--watch] [--out output.csv] [--tail-timeout-ms 30000] [--force]\n deepline plays run <play-file.ts> [--input '{...}'] [--csv file.csv] [--watch] [--out output.csv] [--tail-timeout-ms 30000] [--force]\n deepline plays run --file <play-file.ts> [--input '{...}'] [--csv file.csv] [--watch] [--out output.csv] [--tail-timeout-ms 30000] [--force]\n deepline plays run --name <name> [--input '{...}'] [--csv file.csv] [--live|--latest|--revision-id <id>] [--watch] [--out output.csv] [--tail-timeout-ms 30000] [--force] [--json]";
@@ -5393,7 +5419,8 @@ async function handleFileBackedRun(options) {
5393
5419
  status: started.status,
5394
5420
  statusUrl: started.statusUrl,
5395
5421
  dashboardUrl,
5396
- jsonOutput: options.jsonOutput
5422
+ jsonOutput: options.jsonOutput,
5423
+ progress
5397
5424
  });
5398
5425
  return 0;
5399
5426
  }
@@ -5493,7 +5520,8 @@ async function handleNamedRun(options) {
5493
5520
  status: started.status,
5494
5521
  statusUrl: started.statusUrl,
5495
5522
  dashboardUrl,
5496
- jsonOutput: options.jsonOutput
5523
+ jsonOutput: options.jsonOutput,
5524
+ progress
5497
5525
  });
5498
5526
  return 0;
5499
5527
  }
@@ -7079,11 +7107,12 @@ async function syncSdkSkillsIfNeeded(baseUrl) {
7079
7107
  const localVersion = readLocalSkillsVersion(baseUrl);
7080
7108
  const update = await fetchSkillsUpdate(baseUrl, localVersion);
7081
7109
  if (!update?.needsUpdate || !update.remoteVersion) return;
7082
- process.stderr.write("SDK skills changed; syncing deepline-sdk skill...\n");
7110
+ const progress = getActiveCliProgress();
7111
+ progress?.writeLine("SDK skills changed; syncing deepline-sdk skill...") ?? process.stderr.write("SDK skills changed; syncing deepline-sdk skill...\n");
7083
7112
  const installed = await runSkillsInstall(baseUrl);
7084
7113
  if (!installed) return;
7085
7114
  writeLocalSkillsVersion(baseUrl, update.remoteVersion);
7086
- process.stderr.write("SDK skills are up to date.\n");
7115
+ progress?.writeLine("SDK skills are up to date.") ?? process.stderr.write("SDK skills are up to date.\n");
7087
7116
  }
7088
7117
 
7089
7118
  // src/cli/index.ts