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.
package/dist/cli/index.js CHANGED
@@ -192,7 +192,7 @@ function resolveConfig(options) {
192
192
  }
193
193
 
194
194
  // src/version.ts
195
- var SDK_VERSION = "0.1.7";
195
+ var SDK_VERSION = "0.1.8";
196
196
  var SDK_API_CONTRACT = "2026-04-plays-v1";
197
197
 
198
198
  // ../shared_libs/play-runtime/coordinator-headers.ts
@@ -3838,6 +3838,21 @@ var CliProgress = class {
3838
3838
  this.worker?.terminate().catch(() => void 0);
3839
3839
  this.worker = null;
3840
3840
  process.stderr.write(`\r\x1B[2K${message}
3841
+ `);
3842
+ if (activeMessage) {
3843
+ this.startWorker().postMessage({ type: "phase", message: activeMessage });
3844
+ }
3845
+ }
3846
+ writeLine(line, stream = process.stderr) {
3847
+ if (!this.enabled || !this.interactive) {
3848
+ stream.write(`${line}
3849
+ `);
3850
+ return;
3851
+ }
3852
+ const activeMessage = this.lastMessage;
3853
+ this.worker?.terminate().catch(() => void 0);
3854
+ this.worker = null;
3855
+ stream.write(`\r\x1B[2K${line}
3841
3856
  `);
3842
3857
  if (activeMessage) {
3843
3858
  this.startWorker().postMessage({ type: "phase", message: activeMessage });
@@ -4587,9 +4602,16 @@ async function startAndWaitForPlayCompletionByStream(input) {
4587
4602
  const workflowId = lastKnownWorkflowId || "pending";
4588
4603
  if (workflowId !== "pending" && !emittedDashboardUrl) {
4589
4604
  const dashboardUrl = getDashboardUrlFromLiveEvent(event) ?? buildPlayDashboardUrl(input.client.baseUrl, input.playName);
4590
- input.progress.phase(
4591
- `loading play on ${dashboardUrl}`
4592
- );
4605
+ if (!input.jsonOutput) {
4606
+ writeStartedPlayRun({
4607
+ runId: workflowId,
4608
+ playName: input.playName,
4609
+ dashboardUrl,
4610
+ jsonOutput: false,
4611
+ progress: input.progress
4612
+ });
4613
+ }
4614
+ input.progress.phase(`loading play on ${dashboardUrl}`);
4593
4615
  emittedDashboardUrl = true;
4594
4616
  }
4595
4617
  assertPlayWaitNotTimedOut({
@@ -4700,9 +4722,8 @@ async function waitForPlayCompletionByPolling(input) {
4700
4722
  const now = Date.now();
4701
4723
  if (now - lastTransientPollWarningAt >= 3e4) {
4702
4724
  const message = error instanceof Error ? error.message : String(error);
4703
- process.stderr.write(
4704
- `[play tail] transient status poll failed; retrying: ${message}
4705
- `
4725
+ input.progress.writeLine(
4726
+ `[play tail] transient status poll failed; retrying: ${message}`
4706
4727
  );
4707
4728
  lastTransientPollWarningAt = now;
4708
4729
  }
@@ -5092,7 +5113,12 @@ function writeStartedPlayRun(input) {
5092
5113
  if (input.dashboardUrl) {
5093
5114
  lines.push(` play page: ${input.dashboardUrl}`);
5094
5115
  }
5095
- console.log(lines.join("\n"));
5116
+ const output = lines.join("\n");
5117
+ if (input.progress) {
5118
+ input.progress.writeLine(output, process.stdout);
5119
+ return;
5120
+ }
5121
+ console.log(output);
5096
5122
  }
5097
5123
  function parsePlayRunOptions(args) {
5098
5124
  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]";
@@ -5411,7 +5437,8 @@ async function handleFileBackedRun(options) {
5411
5437
  status: started.status,
5412
5438
  statusUrl: started.statusUrl,
5413
5439
  dashboardUrl,
5414
- jsonOutput: options.jsonOutput
5440
+ jsonOutput: options.jsonOutput,
5441
+ progress
5415
5442
  });
5416
5443
  return 0;
5417
5444
  }
@@ -5511,7 +5538,8 @@ async function handleNamedRun(options) {
5511
5538
  status: started.status,
5512
5539
  statusUrl: started.statusUrl,
5513
5540
  dashboardUrl,
5514
- jsonOutput: options.jsonOutput
5541
+ jsonOutput: options.jsonOutput,
5542
+ progress
5515
5543
  });
5516
5544
  return 0;
5517
5545
  }
@@ -7097,11 +7125,12 @@ async function syncSdkSkillsIfNeeded(baseUrl) {
7097
7125
  const localVersion = readLocalSkillsVersion(baseUrl);
7098
7126
  const update = await fetchSkillsUpdate(baseUrl, localVersion);
7099
7127
  if (!update?.needsUpdate || !update.remoteVersion) return;
7100
- process.stderr.write("SDK skills changed; syncing deepline-sdk skill...\n");
7128
+ const progress = getActiveCliProgress();
7129
+ progress?.writeLine("SDK skills changed; syncing deepline-sdk skill...") ?? process.stderr.write("SDK skills changed; syncing deepline-sdk skill...\n");
7101
7130
  const installed = await runSkillsInstall(baseUrl);
7102
7131
  if (!installed) return;
7103
7132
  writeLocalSkillsVersion(baseUrl, update.remoteVersion);
7104
- process.stderr.write("SDK skills are up to date.\n");
7133
+ progress?.writeLine("SDK skills are up to date.") ?? process.stderr.write("SDK skills are up to date.\n");
7105
7134
  }
7106
7135
 
7107
7136
  // src/cli/index.ts