deepline 0.3.214 → 0.3.216

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
@@ -1963,8 +1963,8 @@ function configureProxyFromEnv() {
1963
1963
  configureProxyFromEnv();
1964
1964
 
1965
1965
  // src/cli/index.ts
1966
- var import_promises14 = require("fs/promises");
1967
- var import_node_path32 = require("path");
1966
+ var import_promises15 = require("fs/promises");
1967
+ var import_node_path33 = require("path");
1968
1968
  var import_node_os20 = require("os");
1969
1969
  var import_commander5 = require("commander");
1970
1970
 
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
3051
3051
  // getters keep their established compatibility behavior.
3052
3052
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3053
3053
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3054
- version: "0.3.214",
3054
+ version: "0.3.216",
3055
3055
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
3056
3056
  packageCapabilities: {
3057
3057
  updatePreferences: 1
@@ -15556,14 +15556,14 @@ function customerDbColumnNames(result) {
15556
15556
  function errorMessage(value) {
15557
15557
  return value instanceof Error ? value.message : String(value ?? "");
15558
15558
  }
15559
- function resolveDbQuerySql(rawSql, readFile7 = (path) => (0, import_node_fs8.readFileSync)(path, "utf8")) {
15559
+ function resolveDbQuerySql(rawSql, readFile8 = (path) => (0, import_node_fs8.readFileSync)(path, "utf8")) {
15560
15560
  const value = rawSql.trim();
15561
15561
  if (!value.startsWith("@")) return value;
15562
15562
  const filePath = value.slice(1).trim();
15563
15563
  if (!filePath) {
15564
15564
  throw new Error("--sql @file requires a file path after `@`.");
15565
15565
  }
15566
- return readFile7((0, import_node_path9.resolve)(filePath)).trim();
15566
+ return readFile8((0, import_node_path9.resolve)(filePath)).trim();
15567
15567
  }
15568
15568
  function collectErrorText(value) {
15569
15569
  if (!value || typeof value !== "object" || Array.isArray(value)) {
@@ -15929,9 +15929,9 @@ Examples:
15929
15929
  }
15930
15930
 
15931
15931
  // src/cli/commands/enrich.ts
15932
- var import_promises10 = require("fs/promises");
15932
+ var import_promises11 = require("fs/promises");
15933
15933
  var import_node_os10 = require("os");
15934
- var import_node_path18 = require("path");
15934
+ var import_node_path19 = require("path");
15935
15935
  var import_commander2 = require("commander");
15936
15936
 
15937
15937
  // ../plays/settings-contract.ts
@@ -16263,8 +16263,8 @@ function registerPlaySettingsCommands(plays) {
16263
16263
  // src/cli/commands/play.ts
16264
16264
  var import_node_crypto7 = require("crypto");
16265
16265
  var import_node_fs12 = require("fs");
16266
- var import_promises9 = require("fs/promises");
16267
- var import_node_path17 = require("path");
16266
+ var import_promises10 = require("fs/promises");
16267
+ var import_node_path18 = require("path");
16268
16268
  var import_sync5 = require("csv-parse/sync");
16269
16269
 
16270
16270
  // src/cli/commands/plays/bootstrap.ts
@@ -21556,13 +21556,13 @@ function normalizeFixtureScopeValue(value, maxLength) {
21556
21556
 
21557
21557
  // src/cli/commands/plays-deploy.ts
21558
21558
  var import_node_crypto6 = require("crypto");
21559
- var import_promises8 = require("fs/promises");
21559
+ var import_promises9 = require("fs/promises");
21560
21560
  var import_node_os9 = require("os");
21561
- var import_node_path16 = require("path");
21561
+ var import_node_path17 = require("path");
21562
21562
 
21563
21563
  // ../plays/deploy/run-deployment.ts
21564
- var import_node_path15 = require("path");
21565
- var import_promises7 = require("fs/promises");
21564
+ var import_node_path16 = require("path");
21565
+ var import_promises8 = require("fs/promises");
21566
21566
 
21567
21567
  // ../plays/deployment-status.ts
21568
21568
  var TERMINAL_PLAY_DEPLOYMENT_STATUSES = /* @__PURE__ */ new Set([
@@ -21670,6 +21670,21 @@ var DeployApiClient = class {
21670
21670
  body: { names }
21671
21671
  });
21672
21672
  }
21673
+ monitors(action, entries) {
21674
+ return this.request({
21675
+ method: "POST",
21676
+ path: this.deploymentPath("/monitors"),
21677
+ body: { action, entries }
21678
+ });
21679
+ }
21680
+ monitorJob(jobId, monitorKey) {
21681
+ return this.request({
21682
+ method: "GET",
21683
+ path: this.deploymentPath(
21684
+ `/monitors?jobId=${encodeURIComponent(jobId)}&monitorKey=${encodeURIComponent(monitorKey)}`
21685
+ )
21686
+ });
21687
+ }
21673
21688
  compileManifest(input2) {
21674
21689
  return this.request({
21675
21690
  method: "POST",
@@ -21722,7 +21737,8 @@ var import_promises6 = require("fs/promises");
21722
21737
  var import_node_path14 = require("path");
21723
21738
  var import_picomatch = __toESM(require_picomatch2(), 1);
21724
21739
  var DEFAULT_PLAY_GLOBS = ["**/*.play.ts"];
21725
- var MAX_DISCOVERED_PLAY_FILES = 200;
21740
+ var DEFAULT_MONITOR_GLOBS = ["**/*.monitor.json"];
21741
+ var MAX_DISCOVERED_FILES = 200;
21726
21742
  var IGNORED_DIRECTORIES = /* @__PURE__ */ new Set([
21727
21743
  "node_modules",
21728
21744
  ".git",
@@ -21736,9 +21752,26 @@ var DeeplineManifestError = class extends Error {
21736
21752
  this.name = "DeeplineManifestError";
21737
21753
  }
21738
21754
  };
21755
+ function readGlobs(value, field) {
21756
+ if (!Array.isArray(value) || field === "plays" && value.length === 0 || !value.every((glob) => typeof glob === "string" && glob.trim().length > 0)) {
21757
+ throw new DeeplineManifestError(
21758
+ `deepline.json "${field}" must be ${field === "plays" ? "a non-empty" : "an"} array of glob strings.`
21759
+ );
21760
+ }
21761
+ const globs = value.map((glob) => glob.trim().replace(/^\.\//, ""));
21762
+ if (globs.some((glob) => glob.startsWith("/") || glob.includes(".."))) {
21763
+ throw new DeeplineManifestError(
21764
+ `deepline.json "${field}" globs must be relative and must not contain "..".`
21765
+ );
21766
+ }
21767
+ return globs;
21768
+ }
21739
21769
  function parseDeeplineManifest(raw) {
21740
21770
  if (raw === null) {
21741
- return { plays: DEFAULT_PLAY_GLOBS };
21771
+ return {
21772
+ plays: DEFAULT_PLAY_GLOBS,
21773
+ monitors: DEFAULT_MONITOR_GLOBS
21774
+ };
21742
21775
  }
21743
21776
  let parsed;
21744
21777
  try {
@@ -21752,24 +21785,14 @@ function parseDeeplineManifest(raw) {
21752
21785
  throw new DeeplineManifestError("deepline.json must be a JSON object.");
21753
21786
  }
21754
21787
  const record3 = parsed;
21755
- let plays = DEFAULT_PLAY_GLOBS;
21756
- if (record3.plays !== void 0) {
21757
- if (!Array.isArray(record3.plays) || record3.plays.length === 0 || !record3.plays.every(
21758
- (glob) => typeof glob === "string" && glob.trim().length > 0
21759
- )) {
21760
- throw new DeeplineManifestError(
21761
- 'deepline.json "plays" must be a non-empty array of glob strings, e.g. ["plays/**/*.play.ts"].'
21762
- );
21763
- }
21764
- plays = record3.plays.map((glob) => glob.trim().replace(/^\.\//, ""));
21765
- }
21766
- if (plays.some((glob) => glob.startsWith("/") || glob.includes(".."))) {
21767
- throw new DeeplineManifestError(
21768
- 'deepline.json "plays" globs must be relative and must not contain "..".'
21769
- );
21770
- }
21788
+ const plays = record3.plays === void 0 ? DEFAULT_PLAY_GLOBS : readGlobs(record3.plays, "plays");
21789
+ const monitors = record3.monitors === void 0 ? DEFAULT_MONITOR_GLOBS : readGlobs(record3.monitors, "monitors");
21771
21790
  const org = typeof record3.org === "string" && record3.org.trim() ? record3.org.trim() : void 0;
21772
- return { plays, ...org ? { org } : {} };
21791
+ return {
21792
+ plays,
21793
+ monitors,
21794
+ ...org ? { org } : {}
21795
+ };
21773
21796
  }
21774
21797
  var DEFAULT_MANIFEST_FILE = "deepline.json";
21775
21798
  async function readDeeplineManifest(projectRoot, manifestFile = DEFAULT_MANIFEST_FILE) {
@@ -21799,7 +21822,7 @@ async function readDeeplineManifest(projectRoot, manifestFile = DEFAULT_MANIFEST
21799
21822
  throw error;
21800
21823
  }
21801
21824
  }
21802
- async function discoverPlayFiles(input2) {
21825
+ async function discoverDeploymentFiles(input2) {
21803
21826
  const matchers = input2.globs.map((glob) => (0, import_picomatch.default)(glob));
21804
21827
  const found = [];
21805
21828
  async function walk(dir) {
@@ -21816,9 +21839,9 @@ async function discoverPlayFiles(input2) {
21816
21839
  const relativePath = (0, import_node_path14.relative)(input2.projectRoot, absolute);
21817
21840
  if (matchers.some((match) => match(relativePath))) {
21818
21841
  found.push(relativePath);
21819
- if (found.length > MAX_DISCOVERED_PLAY_FILES) {
21842
+ if (found.length > MAX_DISCOVERED_FILES) {
21820
21843
  throw new DeeplineManifestError(
21821
- `deepline.json globs matched more than ${MAX_DISCOVERED_PLAY_FILES} play files. Tighten the globs.`
21844
+ `deepline.json globs matched more than ${MAX_DISCOVERED_FILES} files. Tighten the globs.`
21822
21845
  );
21823
21846
  }
21824
21847
  }
@@ -21833,6 +21856,39 @@ async function discoverPlayFiles(input2) {
21833
21856
  await walk(input2.projectRoot);
21834
21857
  return found.sort();
21835
21858
  }
21859
+ var discoverPlayFiles = discoverDeploymentFiles;
21860
+
21861
+ // ../plays/deploy/monitor-files.ts
21862
+ var import_promises7 = require("fs/promises");
21863
+ var import_node_path15 = require("path");
21864
+ async function readMonitorFiles(input2) {
21865
+ const files = await discoverDeploymentFiles(input2);
21866
+ if (files.length > 100) {
21867
+ throw new DeeplineManifestError(
21868
+ "A deployment may contain at most 100 monitor definitions. Split the repository into multiple linked targets."
21869
+ );
21870
+ }
21871
+ return Promise.all(
21872
+ files.map(async (file) => {
21873
+ const sourcePath = input2.rootDirectory ? `${input2.rootDirectory}/${file}` : file;
21874
+ const raw = await (0, import_promises7.readFile)((0, import_node_path15.join)(input2.projectRoot, file), "utf8");
21875
+ try {
21876
+ return { file: sourcePath, definition: JSON.parse(raw) };
21877
+ } catch {
21878
+ throw new DeeplineManifestError(
21879
+ `${sourcePath} must contain a monitor definition as valid JSON.`
21880
+ );
21881
+ }
21882
+ })
21883
+ );
21884
+ }
21885
+ function monitorDeploymentSummary(outcomes) {
21886
+ return outcomes.map(
21887
+ (outcome) => `- Monitor \`${outcome.key}\` (\`${outcome.file}\`): ${outcome.status}${outcome.credits != null ? ` (${outcome.credits} Deepline credits)` : ""}${outcome.jobId ? ` \u2014 job \`${outcome.jobId}\`` : ""}${outcome.error ? `
21888
+ - ${outcome.error}` : ""}${outcome.warning ? `
21889
+ - :warning: ${outcome.warning}` : ""}`
21890
+ ).join("\n");
21891
+ }
21836
21892
 
21837
21893
  // ../plays/play-reference.ts
21838
21894
  var PREBUILT_PLAY_NAMESPACE = "prebuilt";
@@ -22048,12 +22104,15 @@ async function runDeployment(params, hooks) {
22048
22104
  }
22049
22105
  }
22050
22106
  const buildSeconds = () => Math.max(0, (Date.now() - startedAt) / 1e3);
22107
+ let monitorOutcomes = [];
22108
+ const monitorResults = () => monitorOutcomes.length > 0 ? { monitors: monitorOutcomes } : {};
22109
+ const monitorRunResult = () => monitorOutcomes.length > 0 ? { monitorOutcomes } : {};
22051
22110
  const finishFailed = async (input2) => {
22052
22111
  try {
22053
22112
  await setStatus({
22054
22113
  status: "failed",
22055
22114
  error: input2.error.slice(0, 2e3),
22056
- results: { plays: input2.outcomes },
22115
+ results: { plays: input2.outcomes, ...monitorResults() },
22057
22116
  buildSeconds: buildSeconds(),
22058
22117
  ...input2.checkRunId ? { checkRunId: input2.checkRunId } : {}
22059
22118
  });
@@ -22072,15 +22131,18 @@ async function runDeployment(params, hooks) {
22072
22131
  return {
22073
22132
  finalStatus: "failed",
22074
22133
  outcomes: input2.outcomes,
22134
+ ...monitorRunResult(),
22075
22135
  checkRunId: input2.checkRunId
22076
22136
  };
22077
22137
  };
22078
22138
  const finishSucceeded = async (outcomes, checkRun) => {
22079
- const finalStatus = outcomes.some((outcome) => outcome.warning) ? "succeeded_with_warnings" : "succeeded";
22139
+ const finalStatus = [...outcomes, ...monitorOutcomes].some(
22140
+ (outcome) => outcome.warning
22141
+ ) ? "succeeded_with_warnings" : "succeeded";
22080
22142
  try {
22081
22143
  await setStatus({
22082
22144
  status: finalStatus,
22083
- results: { plays: outcomes },
22145
+ results: { plays: outcomes, ...monitorResults() },
22084
22146
  buildSeconds: buildSeconds(),
22085
22147
  ...checkRun ? { checkRunId: checkRun.checkRunId } : {}
22086
22148
  });
@@ -22097,11 +22159,12 @@ async function runDeployment(params, hooks) {
22097
22159
  return {
22098
22160
  finalStatus,
22099
22161
  outcomes,
22162
+ ...monitorRunResult(),
22100
22163
  checkRunId: checkRun?.checkRunId
22101
22164
  };
22102
22165
  };
22103
- await (0, import_promises7.mkdir)(hooks.workRoot, { recursive: true });
22104
- const workDir = await (0, import_promises7.mkdtemp)((0, import_node_path15.join)(hooks.workRoot, "deploy-"));
22166
+ await (0, import_promises8.mkdir)(hooks.workRoot, { recursive: true });
22167
+ const workDir = await (0, import_promises8.mkdtemp)((0, import_node_path16.join)(hooks.workRoot, "deploy-"));
22105
22168
  const postCheck = async (postCheckOnce, input2) => {
22106
22169
  let lastError;
22107
22170
  for (let attempt = 0; ; attempt += 1) {
@@ -22177,7 +22240,7 @@ async function runDeployment(params, hooks) {
22177
22240
  await writeCheck({
22178
22241
  conclusion: "neutral",
22179
22242
  title: `Deployment ${stopped}`,
22180
- summary: "This deployment was stopped before it finished. Nothing from it went live."
22243
+ summary: monitorOutcomes.some((outcome) => outcome.jobId) ? "This deployment was stopped before it finished. Monitor jobs already submitted may have changed live resources; inspect the jobs in its receipt." : "This deployment was stopped before it finished. Nothing from it went live."
22181
22244
  }).catch(() => void 0);
22182
22245
  throw revocation;
22183
22246
  });
@@ -22217,6 +22280,7 @@ async function runDeployment(params, hooks) {
22217
22280
  status: "superseded",
22218
22281
  error: `Branch ${deploymentBranch} is now at ${head?.slice(0, 12) ?? "<deleted>"}; this deployment's commit is no longer the head.`,
22219
22282
  buildSeconds: buildSeconds(),
22283
+ ...monitorOutcomes.length > 0 ? { results: monitorResults() } : {},
22220
22284
  ...head ? { observedHeadSha: head } : {}
22221
22285
  });
22222
22286
  return { finalStatus: "superseded", outcomes: [] };
@@ -22226,16 +22290,28 @@ async function runDeployment(params, hooks) {
22226
22290
  if (superseded) return superseded;
22227
22291
  }
22228
22292
  const { repoRoot } = await source.open(workDir);
22229
- const projectRoot = target.rootDirectory ? (0, import_node_path15.join)(repoRoot, target.rootDirectory) : repoRoot;
22293
+ const projectRoot = target.rootDirectory ? (0, import_node_path16.join)(repoRoot, target.rootDirectory) : repoRoot;
22230
22294
  const manifestFile = target.manifestPath || DEFAULT_MANIFEST_FILE;
22231
22295
  let manifest;
22232
22296
  let playFiles;
22297
+ let monitorEntries;
22233
22298
  try {
22234
22299
  manifest = await readDeeplineManifest(projectRoot, manifestFile);
22235
22300
  playFiles = await discoverPlayFiles({
22236
22301
  projectRoot,
22237
22302
  globs: manifest.plays
22238
22303
  });
22304
+ const discoveredMonitors = await readMonitorFiles({
22305
+ projectRoot,
22306
+ rootDirectory: target.rootDirectory,
22307
+ globs: manifest.monitors
22308
+ });
22309
+ if (!project && discoveredMonitors.length > 0) {
22310
+ throw new DeeplineManifestError(
22311
+ "Monitor Git deployment requires a linked repository. Deploy individual monitor files with deepline monitors deploy --file."
22312
+ );
22313
+ }
22314
+ monitorEntries = project && discoveredMonitors.length > 0 ? discoveredMonitors : void 0;
22239
22315
  } catch (error) {
22240
22316
  if (error instanceof DeeplineManifestError) {
22241
22317
  return await failWithCheck({
@@ -22260,7 +22336,28 @@ async function runDeployment(params, hooks) {
22260
22336
  });
22261
22337
  }
22262
22338
  }
22263
- if (playFiles.length === 0) {
22339
+ if (monitorEntries !== void 0) {
22340
+ const plan = await client2.monitors("plan", monitorEntries);
22341
+ monitorOutcomes = plan.monitors;
22342
+ const failed = monitorOutcomes.filter(
22343
+ (outcome) => outcome.status === "failed"
22344
+ );
22345
+ if (failed.length > 0) {
22346
+ return await failWithCheck({
22347
+ title: "Monitor validation failed",
22348
+ summary: monitorDeploymentSummary(monitorOutcomes),
22349
+ error: `${failed.length} monitor definition(s) failed validation.`,
22350
+ outcomes: [],
22351
+ annotations: failed.map(
22352
+ (outcome) => annotationForFailure({
22353
+ file: outcome.file,
22354
+ message: outcome.error ?? "Monitor validation failed."
22355
+ })
22356
+ )
22357
+ });
22358
+ }
22359
+ }
22360
+ if (playFiles.length === 0 && monitorOutcomes.length === 0) {
22264
22361
  const checkRun2 = await postCheckOrNull({
22265
22362
  conclusion: "neutral",
22266
22363
  title: "No plays matched",
@@ -22287,7 +22384,7 @@ async function runDeployment(params, hooks) {
22287
22384
  annotations.push(annotationForFailure({ file, message }));
22288
22385
  };
22289
22386
  for (const file of playFiles) {
22290
- const entryFile = (0, import_node_path15.join)(projectRoot, file);
22387
+ const entryFile = (0, import_node_path16.join)(projectRoot, file);
22291
22388
  const result = await hooks.bundle(entryFile, {
22292
22389
  sourceIdentityRoot: projectRoot
22293
22390
  });
@@ -22393,7 +22490,7 @@ async function runDeployment(params, hooks) {
22393
22490
  if (superseded) return superseded;
22394
22491
  }
22395
22492
  await setStatus({ status: "publishing" }).catch(() => void 0);
22396
- const states = await client2.playsState(ordered.map((play) => play.name));
22493
+ const states = ordered.length > 0 ? await client2.playsState(ordered.map((play) => play.name)) : { plays: [] };
22397
22494
  const stateByName = new Map(
22398
22495
  states.plays.map((play) => [play.name, play])
22399
22496
  );
@@ -22527,12 +22624,15 @@ async function runDeployment(params, hooks) {
22527
22624
  ).length;
22528
22625
  const checkRun2 = await postCheckOrNull({
22529
22626
  conclusion: "success",
22530
- title: `${ordered.length} play${ordered.length === 1 ? "" : "s"} validated and registered (not deployed)`,
22627
+ title: monitorEntries !== void 0 ? `${ordered.length} play(s) validated and registered; ${monitorEntries.length} monitor(s) checked (not deployed)` : `${ordered.length} play${ordered.length === 1 ? "" : "s"} validated and registered (not deployed)`,
22531
22628
  ...annotations.length > 0 ? { annotations } : {},
22532
- summary: outcomes.map(
22533
- (outcome) => `- \`${outcome.name}\`: ${outcome.status}${outcome.version !== void 0 ? ` (v${outcome.version})` : ""}${outcome.sdkUpdated ? " \u2014 SDK updated" : ""}${outcome.warning ? `
22629
+ summary: [
22630
+ outcomes.map(
22631
+ (outcome) => `- \`${outcome.name}\`: ${outcome.status}${outcome.version !== void 0 ? ` (v${outcome.version})` : ""}${outcome.sdkUpdated ? " \u2014 SDK updated" : ""}${outcome.warning ? `
22534
22632
  - :warning: ${outcome.warning}` : ""}`
22535
- ).join("\n")
22633
+ ).join("\n"),
22634
+ monitorDeploymentSummary(monitorOutcomes)
22635
+ ].filter(Boolean).join("\n")
22536
22636
  });
22537
22637
  const result = await finishSucceeded(outcomes, checkRun2);
22538
22638
  console.info("[deploy-worker] PR registration complete", {
@@ -22546,6 +22646,51 @@ async function runDeployment(params, hooks) {
22546
22646
  const superseded = await supersedeIfHeadMoved();
22547
22647
  if (superseded) return superseded;
22548
22648
  }
22649
+ if (monitorEntries !== void 0) {
22650
+ monitorOutcomes = (await client2.monitors("apply", monitorEntries)).monitors;
22651
+ await setStatus({
22652
+ status: "publishing",
22653
+ results: { plays: outcomes, ...monitorResults() }
22654
+ });
22655
+ const deadline = Date.now() + 10 * 6e4;
22656
+ while (monitorOutcomes.some((outcome) => outcome.status === "applying")) {
22657
+ if (Date.now() >= deadline) {
22658
+ throw new RetryableDeploymentError(
22659
+ "Monitor jobs are still reconciling. Retrying this deployment will resume the same jobs."
22660
+ );
22661
+ }
22662
+ await new Promise((resolve22) => setTimeout(resolve22, 1e3));
22663
+ for (let index = 0; index < monitorOutcomes.length; index += 1) {
22664
+ const outcome = monitorOutcomes[index];
22665
+ if (outcome.status !== "applying") continue;
22666
+ if (!outcome.jobId) {
22667
+ throw new Error(
22668
+ `Monitor ${outcome.key} has no reconciliation job.`
22669
+ );
22670
+ }
22671
+ const result = await client2.monitorJob(outcome.jobId, outcome.key);
22672
+ const settled = result.monitors.find(
22673
+ (monitor) => monitor.key === outcome.key && monitor.jobId === outcome.jobId
22674
+ );
22675
+ if (!settled) {
22676
+ throw new Error(`Monitor job ${outcome.jobId} returned no result.`);
22677
+ }
22678
+ monitorOutcomes[index] = { ...outcome, ...settled };
22679
+ }
22680
+ }
22681
+ if (monitorOutcomes.some(
22682
+ (outcome) => outcome.status === "failed" || outcome.status === "planned"
22683
+ )) {
22684
+ return await failWithCheck({
22685
+ title: "Monitor deployment failed",
22686
+ summary: monitorDeploymentSummary(monitorOutcomes),
22687
+ error: "Some monitor changes failed. Applied changes remain live; inspect the reported jobs before retrying.",
22688
+ outcomes
22689
+ });
22690
+ }
22691
+ const superseded = await supersedeIfHeadMoved();
22692
+ if (superseded) return { ...superseded, ...monitorRunResult() };
22693
+ }
22549
22694
  if (toPromote.length > 0) {
22550
22695
  try {
22551
22696
  const promotion = await client2.promote(toPromote);
@@ -22603,12 +22748,15 @@ async function runDeployment(params, hooks) {
22603
22748
  }
22604
22749
  const checkRun = await postCheckOrNull({
22605
22750
  conclusion: "success",
22606
- title: `Deployed ${outcomes.filter((o) => o.status === "promoted").length} play(s) (${outcomes.filter((o) => o.status === "unchanged").length} unchanged)`,
22751
+ title: `Deployed ${outcomes.filter((o) => o.status === "promoted").length} play(s) (${outcomes.filter((o) => o.status === "unchanged").length} unchanged)${monitorEntries !== void 0 ? `; ${monitorOutcomes.filter((outcome) => outcome.status === "applied").length} monitor(s) applied` : ""}`,
22607
22752
  ...annotations.length > 0 ? { annotations } : {},
22608
- summary: outcomes.map(
22609
- (outcome) => `- \`${outcome.name}\`: ${outcome.status}${outcome.sdkUpdated ? " \u2014 SDK updated" : ""}${outcome.warning ? `
22753
+ summary: [
22754
+ outcomes.map(
22755
+ (outcome) => `- \`${outcome.name}\`: ${outcome.status}${outcome.sdkUpdated ? " \u2014 SDK updated" : ""}${outcome.warning ? `
22610
22756
  - :warning: ${outcome.warning}` : ""}`
22611
- ).join("\n")
22757
+ ).join("\n"),
22758
+ monitorDeploymentSummary(monitorOutcomes)
22759
+ ].filter(Boolean).join("\n")
22612
22760
  });
22613
22761
  return await finishSucceeded(outcomes, checkRun);
22614
22762
  } catch (error) {
@@ -22654,12 +22802,13 @@ async function runDeployment(params, hooks) {
22654
22802
  await setStatus({
22655
22803
  status: "failed",
22656
22804
  error: message.slice(0, 2e3),
22805
+ ...monitorOutcomes.length > 0 ? { results: monitorResults() } : {},
22657
22806
  buildSeconds: buildSeconds(),
22658
22807
  ...checkRunId ? { checkRunId } : {}
22659
22808
  }).catch(() => void 0);
22660
22809
  throw error;
22661
22810
  } finally {
22662
- await (0, import_promises7.rm)(workDir, { recursive: true, force: true }).catch(() => void 0);
22811
+ await (0, import_promises8.rm)(workDir, { recursive: true, force: true }).catch(() => void 0);
22663
22812
  }
22664
22813
  }
22665
22814
  function topoSortByPlayDependencies(plays) {
@@ -22723,8 +22872,8 @@ function printResult(input2) {
22723
22872
  );
22724
22873
  }
22725
22874
  async function handlePlaysDeploy(directory, options) {
22726
- const root = await (0, import_promises8.realpath)((0, import_node_path16.resolve)(directory ?? ".")).catch(() => {
22727
- throw new Error(`No such directory: ${(0, import_node_path16.resolve)(directory ?? ".")}`);
22875
+ const root = await (0, import_promises9.realpath)((0, import_node_path17.resolve)(directory ?? ".")).catch(() => {
22876
+ throw new Error(`No such directory: ${(0, import_node_path17.resolve)(directory ?? ".")}`);
22728
22877
  });
22729
22878
  const { http, config } = getAuthedHttpClient();
22730
22879
  const deliveryId = `local:${(0, import_node_crypto6.randomUUID)()}`;
@@ -22735,7 +22884,7 @@ async function handlePlaysDeploy(directory, options) {
22735
22884
  ...options.commit ? { commit: options.commit } : {}
22736
22885
  });
22737
22886
  const { bundleDeployPlayFile } = await loadPlayBundler();
22738
- const workRoot = await (0, import_promises8.mkdtemp)((0, import_node_path16.join)((0, import_node_os9.tmpdir)(), "deepline-deploy-"));
22887
+ const workRoot = await (0, import_promises9.mkdtemp)((0, import_node_path17.join)((0, import_node_os9.tmpdir)(), "deepline-deploy-"));
22739
22888
  const consoleInfo = console.info;
22740
22889
  console.info = console.error;
22741
22890
  try {
@@ -22789,7 +22938,7 @@ async function handlePlaysDeploy(directory, options) {
22789
22938
  }
22790
22939
  } finally {
22791
22940
  console.info = consoleInfo;
22792
- await (0, import_promises8.rm)(workRoot, { recursive: true, force: true });
22941
+ await (0, import_promises9.rm)(workRoot, { recursive: true, force: true });
22793
22942
  }
22794
22943
  }
22795
22944
 
@@ -23137,10 +23286,22 @@ function renderDeploymentPlayLines(results) {
23137
23286
  ];
23138
23287
  });
23139
23288
  }
23289
+ function renderDeploymentMonitorLines(results) {
23290
+ const monitors = results?.monitors;
23291
+ if (!Array.isArray(monitors)) return [];
23292
+ return monitors.flatMap((monitor) => [
23293
+ `${monitor.key ?? "?"}${monitor.file ? ` (${monitor.file})` : ""} - ${monitor.status ?? "?"}`,
23294
+ ...monitor.jobId ? [` job: ${monitor.jobId}`] : [],
23295
+ ...monitor.credits != null ? [` Deepline credits: ${monitor.credits}`] : [],
23296
+ ...monitor.error ? [` error: ${monitor.error}`] : [],
23297
+ ...monitor.warning ? [` warning: ${monitor.warning}`] : []
23298
+ ]);
23299
+ }
23140
23300
  async function handleDeploymentGet(id, options) {
23141
23301
  const { http } = getAuthedHttpClient();
23142
23302
  const payload = await http.get(`/api/v2/deployments/${encodeURIComponent(id)}`);
23143
23303
  const playLines = renderDeploymentPlayLines(payload.deployment.results);
23304
+ const monitorLines = renderDeploymentMonitorLines(payload.deployment.results);
23144
23305
  const repository = payload.project?.repoFullName ?? payload.deployment.repoFullName;
23145
23306
  printCommandEnvelope(
23146
23307
  {
@@ -23152,7 +23313,8 @@ async function handleDeploymentGet(id, options) {
23152
23313
  title: `deployment ${payload.deployment.id}${repository ? ` (${repository})` : ""}`,
23153
23314
  lines: [renderDeployment(payload.deployment)]
23154
23315
  },
23155
- ...playLines.length ? [{ title: "plays", lines: playLines }] : []
23316
+ ...playLines.length ? [{ title: "plays", lines: playLines }] : [],
23317
+ ...monitorLines.length ? [{ title: "monitors", lines: monitorLines }] : []
23156
23318
  ]
23157
23319
  }
23158
23320
  },
@@ -23348,7 +23510,7 @@ function isBarePlayRunDebugFlag(args, index) {
23348
23510
  }
23349
23511
  async function pathExistsIncludingSymlink(path) {
23350
23512
  try {
23351
- await (0, import_promises9.lstat)(path);
23513
+ await (0, import_promises10.lstat)(path);
23352
23514
  return true;
23353
23515
  } catch (error) {
23354
23516
  if (error.code === "ENOENT") {
@@ -23358,14 +23520,14 @@ async function pathExistsIncludingSymlink(path) {
23358
23520
  }
23359
23521
  }
23360
23522
  function runIdFileTempPath(destination) {
23361
- return (0, import_node_path17.join)(
23362
- (0, import_node_path17.dirname)(destination),
23363
- `.${(0, import_node_path17.basename)(destination)}.${process.pid}.${(0, import_node_crypto7.randomUUID)()}.tmp`
23523
+ return (0, import_node_path18.join)(
23524
+ (0, import_node_path18.dirname)(destination),
23525
+ `.${(0, import_node_path18.basename)(destination)}.${process.pid}.${(0, import_node_crypto7.randomUUID)()}.tmp`
23364
23526
  );
23365
23527
  }
23366
23528
  async function removeRunIdTempFile(path) {
23367
23529
  try {
23368
- await (0, import_promises9.unlink)(path);
23530
+ await (0, import_promises10.unlink)(path);
23369
23531
  } catch (error) {
23370
23532
  if (error.code !== "ENOENT") {
23371
23533
  throw error;
@@ -23373,7 +23535,7 @@ async function removeRunIdTempFile(path) {
23373
23535
  }
23374
23536
  }
23375
23537
  async function preflightRunIdFile(path) {
23376
- const destination = (0, import_node_path17.resolve)(path);
23538
+ const destination = (0, import_node_path18.resolve)(path);
23377
23539
  if (await pathExistsIncludingSymlink(destination)) {
23378
23540
  throw new Error(
23379
23541
  `--run-id-file destination already exists: ${destination}. Choose a new path so this run cannot overwrite another run identity.`
@@ -23382,7 +23544,7 @@ async function preflightRunIdFile(path) {
23382
23544
  const tempPath = runIdFileTempPath(destination);
23383
23545
  let handle = null;
23384
23546
  try {
23385
- handle = await (0, import_promises9.open)(tempPath, "wx", 384);
23547
+ handle = await (0, import_promises10.open)(tempPath, "wx", 384);
23386
23548
  await handle.sync();
23387
23549
  } catch (error) {
23388
23550
  throw new Error(
@@ -23400,7 +23562,7 @@ async function readRunIdFile(destination) {
23400
23562
  }
23401
23563
  let parsed;
23402
23564
  try {
23403
- parsed = JSON.parse(await (0, import_promises9.readFile)(destination, "utf8"));
23565
+ parsed = JSON.parse(await (0, import_promises10.readFile)(destination, "utf8"));
23404
23566
  } catch (error) {
23405
23567
  throw new Error(
23406
23568
  `--run-id-file destination contains invalid JSON: ${destination}. Refusing to overwrite it (${error instanceof Error ? error.message : String(error)}).`
@@ -23426,7 +23588,7 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
23426
23588
  const tempPath = runIdFileTempPath(destination);
23427
23589
  let handle = null;
23428
23590
  try {
23429
- handle = await (0, import_promises9.open)(tempPath, "wx", 384);
23591
+ handle = await (0, import_promises10.open)(tempPath, "wx", 384);
23430
23592
  await handle.writeFile(
23431
23593
  `${JSON.stringify({ version: 1, runId, ...options })}
23432
23594
  `,
@@ -23436,10 +23598,10 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
23436
23598
  await handle.close();
23437
23599
  handle = null;
23438
23600
  if (existing) {
23439
- await (0, import_promises9.rename)(tempPath, destination);
23601
+ await (0, import_promises10.rename)(tempPath, destination);
23440
23602
  } else {
23441
23603
  try {
23442
- await (0, import_promises9.link)(tempPath, destination);
23604
+ await (0, import_promises10.link)(tempPath, destination);
23443
23605
  } catch (error) {
23444
23606
  if (error.code !== "EEXIST") throw error;
23445
23607
  const raced = await readRunIdFile(destination);
@@ -23449,11 +23611,11 @@ async function writePlayRunIdFile(destination, runId, options = {}) {
23449
23611
  );
23450
23612
  }
23451
23613
  if (!options.launchConfirmed || raced.launchConfirmed) return;
23452
- await (0, import_promises9.rename)(tempPath, destination);
23614
+ await (0, import_promises10.rename)(tempPath, destination);
23453
23615
  }
23454
23616
  }
23455
23617
  if (process.platform !== "win32") {
23456
- const directory = await (0, import_promises9.open)((0, import_node_path17.dirname)(destination), "r");
23618
+ const directory = await (0, import_promises10.open)((0, import_node_path18.dirname)(destination), "r");
23457
23619
  try {
23458
23620
  await directory.sync();
23459
23621
  } finally {
@@ -23742,7 +23904,7 @@ function formatPlayListReference(play) {
23742
23904
  return play.reference || play.name;
23743
23905
  }
23744
23906
  function defaultMaterializedPlayPath(reference) {
23745
- return (0, import_node_path17.resolve)(defaultStarterPlayPath(reference));
23907
+ return (0, import_node_path18.resolve)(defaultStarterPlayPath(reference));
23746
23908
  }
23747
23909
  function defaultStarterPlayPath(reference) {
23748
23910
  const playName = parseReferencedPlayTarget2(reference).unqualifiedPlayName;
@@ -23775,18 +23937,18 @@ function materializeRemotePlaySource(input2) {
23775
23937
  `Play ${input2.playName} has ${files.length} source files. Use --out <directory> to write the complete bundle.`
23776
23938
  );
23777
23939
  }
23778
- const outputDirectory = (0, import_node_path17.resolve)(input2.outPath);
23940
+ const outputDirectory = (0, import_node_path18.resolve)(input2.outPath);
23779
23941
  let created = 0;
23780
23942
  let updated = 0;
23781
23943
  for (const [logicalPath, sourceCode] of files) {
23782
- const outputPath2 = (0, import_node_path17.resolve)(outputDirectory, logicalPath);
23783
- const outputRelativePath = (0, import_node_path17.relative)(outputDirectory, outputPath2);
23784
- if (!outputRelativePath || outputRelativePath.startsWith("..") || (0, import_node_path17.isAbsolute)(outputRelativePath)) {
23944
+ const outputPath2 = (0, import_node_path18.resolve)(outputDirectory, logicalPath);
23945
+ const outputRelativePath = (0, import_node_path18.relative)(outputDirectory, outputPath2);
23946
+ if (!outputRelativePath || outputRelativePath.startsWith("..") || (0, import_node_path18.isAbsolute)(outputRelativePath)) {
23785
23947
  throw new Error(
23786
23948
  `Refusing to materialize unsafe Play source path ${JSON.stringify(logicalPath)}.`
23787
23949
  );
23788
23950
  }
23789
- (0, import_node_fs12.mkdirSync)((0, import_node_path17.dirname)(outputPath2), { recursive: true });
23951
+ (0, import_node_fs12.mkdirSync)((0, import_node_path18.dirname)(outputPath2), { recursive: true });
23790
23952
  if (!(0, import_node_fs12.existsSync)(outputPath2)) {
23791
23953
  (0, import_node_fs12.writeFileSync)(outputPath2, sourceCode, "utf-8");
23792
23954
  created += 1;
@@ -23856,7 +24018,7 @@ function extractPlayName(code, filePath) {
23856
24018
  throw buildMissingDefinePlayError(filePath);
23857
24019
  }
23858
24020
  function isFileTarget(target) {
23859
- return (0, import_node_fs12.existsSync)((0, import_node_path17.resolve)(target));
24021
+ return (0, import_node_fs12.existsSync)((0, import_node_path18.resolve)(target));
23860
24022
  }
23861
24023
  function looksLikeRunId(target) {
23862
24024
  return /^play\/[^/]+\/run\/[^/]+/.test(target.trim());
@@ -23885,7 +24047,7 @@ function parsePositiveInteger3(value, flagName) {
23885
24047
  return parsed;
23886
24048
  }
23887
24049
  function parseJsonInput(raw) {
23888
- const source = raw.startsWith("@") ? (0, import_node_fs12.readFileSync)((0, import_node_path17.resolve)(raw.slice(1)), "utf-8") : raw;
24050
+ const source = raw.startsWith("@") ? (0, import_node_fs12.readFileSync)((0, import_node_path18.resolve)(raw.slice(1)), "utf-8") : raw;
23889
24051
  const parsed = JSON.parse(source);
23890
24052
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
23891
24053
  throw new Error("--input must be a JSON object.");
@@ -23989,7 +24151,7 @@ function fileInputBindingsFromStaticPipeline(staticPipeline) {
23989
24151
  function isLocalFilePathValue(value) {
23990
24152
  if (typeof value !== "string" || !value.trim()) return false;
23991
24153
  if (/^[a-z][a-z0-9+.-]*:\/\//i.test(value.trim())) return false;
23992
- return (0, import_node_fs12.existsSync)((0, import_node_path17.resolve)(value));
24154
+ return (0, import_node_fs12.existsSync)((0, import_node_path18.resolve)(value));
23993
24155
  }
23994
24156
  function inputContainsLocalFilePath(value) {
23995
24157
  if (isLocalFilePathValue(value)) {
@@ -24036,7 +24198,7 @@ function collectLocalFileInputRefs(value, inputPath, key, out) {
24036
24198
  const looksLikeFile = /\.[a-z0-9]{1,8}$/i.test(trimmed);
24037
24199
  if (keyIsCsvData) {
24038
24200
  out.push({ inputPath, value: trimmed, isCsvData: true });
24039
- } else if (endsWithCsv || looksLikeFile && (0, import_node_fs12.existsSync)((0, import_node_path17.resolve)(trimmed))) {
24201
+ } else if (endsWithCsv || looksLikeFile && (0, import_node_fs12.existsSync)((0, import_node_path18.resolve)(trimmed))) {
24040
24202
  out.push({ inputPath, value: trimmed, isCsvData: false });
24041
24203
  }
24042
24204
  return;
@@ -24078,7 +24240,7 @@ function preflightLocalFileInputs(runtimeInput) {
24078
24240
  collectLocalFileInputRefs(value, key, key, refs);
24079
24241
  }
24080
24242
  for (const ref of refs) {
24081
- const absolutePath = (0, import_node_path17.resolve)(ref.value);
24243
+ const absolutePath = (0, import_node_path18.resolve)(ref.value);
24082
24244
  if (!(0, import_node_fs12.existsSync)(absolutePath)) {
24083
24245
  throw new DeeplineError(
24084
24246
  `Input ${ref.inputPath} references a local file that does not exist: ${ref.value} (resolved to ${absolutePath}). No run was created.`,
@@ -24197,8 +24359,8 @@ async function stageFileInputArgs(input2) {
24197
24359
  const localFiles = uniqueBindings.flatMap((binding) => {
24198
24360
  const value = getDottedInputValue(input2.runtimeInput, binding.inputPath);
24199
24361
  if (!isLocalFilePathValue(value)) return [];
24200
- const absolutePath = (0, import_node_path17.resolve)(value);
24201
- return [{ binding, absolutePath, logicalPath: (0, import_node_path17.basename)(absolutePath) }];
24362
+ const absolutePath = (0, import_node_path18.resolve)(value);
24363
+ return [{ binding, absolutePath, logicalPath: (0, import_node_path18.basename)(absolutePath) }];
24202
24364
  });
24203
24365
  if (localFiles.length === 0) {
24204
24366
  return { inputFile: null, packagedFiles: [] };
@@ -24241,9 +24403,9 @@ function stageFile(logicalPath, absolutePath) {
24241
24403
  }
24242
24404
  function normalizePlayPath(filePath) {
24243
24405
  try {
24244
- return import_node_fs12.realpathSync.native((0, import_node_path17.resolve)(filePath));
24406
+ return import_node_fs12.realpathSync.native((0, import_node_path18.resolve)(filePath));
24245
24407
  } catch {
24246
- return (0, import_node_path17.resolve)(filePath);
24408
+ return (0, import_node_path18.resolve)(filePath);
24247
24409
  }
24248
24410
  }
24249
24411
  function formatBundlingErrors(filePath, errors) {
@@ -27103,7 +27265,7 @@ function shellSingleQuote(value) {
27103
27265
  return `'${value.replace(/'/g, `'\\''`)}'`;
27104
27266
  }
27105
27267
  function runExportRetryCommand(runId, outPath, datasetPath) {
27106
- return `deepline runs export ${runId}${datasetPath ? ` --dataset ${shellSingleQuote(datasetPath)}` : ""} --out ${shellSingleQuote((0, import_node_path17.resolve)(outPath))}`;
27268
+ return `deepline runs export ${runId}${datasetPath ? ` --dataset ${shellSingleQuote(datasetPath)}` : ""} --out ${shellSingleQuote((0, import_node_path18.resolve)(outPath))}`;
27107
27269
  }
27108
27270
  function extractRunPlayName(status) {
27109
27271
  const run = status.run;
@@ -27245,7 +27407,7 @@ async function fetchBackingDatasetRows(input2) {
27245
27407
  function exportDatasetCommand(input2) {
27246
27408
  return `deepline runs export ${input2.runId} --dataset ${shellSingleQuote(
27247
27409
  input2.datasetPath
27248
- )} --out ${shellSingleQuote((0, import_node_path17.resolve)(input2.outPath))}`;
27410
+ )} --out ${shellSingleQuote((0, import_node_path18.resolve)(input2.outPath))}`;
27249
27411
  }
27250
27412
  function datasetChoiceLines(input2) {
27251
27413
  return input2.datasets.flatMap((dataset) => {
@@ -28569,7 +28731,7 @@ async function handlePlayCheck(args) {
28569
28731
  }
28570
28732
  return 0;
28571
28733
  } catch (error) {
28572
- const resolved = (0, import_node_path17.resolve)(options.target);
28734
+ const resolved = (0, import_node_path18.resolve)(options.target);
28573
28735
  const message = error instanceof Error && error.message ? error.message : `File not found: ${resolved}`;
28574
28736
  if (options.jsonOutput) {
28575
28737
  printCompactJson({
@@ -28583,7 +28745,7 @@ async function handlePlayCheck(args) {
28583
28745
  return 1;
28584
28746
  }
28585
28747
  }
28586
- const absolutePlayPath = (0, import_node_path17.resolve)(options.target);
28748
+ const absolutePlayPath = (0, import_node_path18.resolve)(options.target);
28587
28749
  const sourceCode = (0, import_node_fs12.readFileSync)(absolutePlayPath, "utf-8");
28588
28750
  const exportNames = resolvePlayCheckExportNames(sourceCode);
28589
28751
  const outcomes = [];
@@ -28825,7 +28987,7 @@ async function handleFileBackedRun(options, hooks) {
28825
28987
  }
28826
28988
  const client2 = new DeeplineClient(playRunClientOptions(options));
28827
28989
  const progress = getActiveCliProgress() ?? createCliProgress(!options.jsonOutput);
28828
- const absolutePlayPath = (0, import_node_path17.resolve)(options.target.path);
28990
+ const absolutePlayPath = (0, import_node_path18.resolve)(options.target.path);
28829
28991
  progress.phase("compiling play");
28830
28992
  const sourceCode = traceCliSync(
28831
28993
  "cli.play_file_read_source",
@@ -29242,11 +29404,11 @@ async function handlePlayRun(args, hooks) {
29242
29404
  if (isFileTarget(options.target.path)) {
29243
29405
  return handleFileBackedRun(options, runHooks);
29244
29406
  }
29245
- const resolved = (0, import_node_path17.resolve)(options.target.path);
29407
+ const resolved = (0, import_node_path18.resolve)(options.target.path);
29246
29408
  console.error(`File not found: ${resolved}`);
29247
- const dir = (0, import_node_path17.dirname)(resolved);
29409
+ const dir = (0, import_node_path18.dirname)(resolved);
29248
29410
  if ((0, import_node_fs12.existsSync)(dir)) {
29249
- const base = (0, import_node_path17.basename)(resolved);
29411
+ const base = (0, import_node_path18.basename)(resolved);
29250
29412
  try {
29251
29413
  const siblings = (0, import_node_fs12.readdirSync)(dir).filter(
29252
29414
  (f) => f.includes(base.replace(/\.(play\.)?ts$/, "")) || f.endsWith(".play.ts")
@@ -29254,7 +29416,7 @@ async function handlePlayRun(args, hooks) {
29254
29416
  if (siblings.length > 0) {
29255
29417
  console.error(`Did you mean one of these?`);
29256
29418
  for (const s of siblings.slice(0, 5)) {
29257
- console.error(` ${(0, import_node_path17.join)(dir, s)}`);
29419
+ console.error(` ${(0, import_node_path18.join)(dir, s)}`);
29258
29420
  }
29259
29421
  }
29260
29422
  } catch {
@@ -29691,7 +29853,7 @@ async function handleRunLogs(args) {
29691
29853
  continue;
29692
29854
  }
29693
29855
  if (arg === "--out" && args[index + 1]) {
29694
- outPath = (0, import_node_path17.resolve)(args[++index]);
29856
+ outPath = (0, import_node_path18.resolve)(args[++index]);
29695
29857
  continue;
29696
29858
  }
29697
29859
  if (arg.startsWith("--")) {
@@ -29987,7 +30149,7 @@ async function handleRunExport(args) {
29987
30149
  for (let index = 0; index < args.length; index += 1) {
29988
30150
  const arg = args[index];
29989
30151
  if (arg === "--out" && args[index + 1]) {
29990
- outPath = (0, import_node_path17.resolve)(args[++index]);
30152
+ outPath = (0, import_node_path18.resolve)(args[++index]);
29991
30153
  continue;
29992
30154
  }
29993
30155
  if (arg === "--dataset" && args[index + 1]) {
@@ -29995,7 +30157,7 @@ async function handleRunExport(args) {
29995
30157
  continue;
29996
30158
  }
29997
30159
  if (arg === "--metadata-out" && args[index + 1]) {
29998
- metadataOutPath = (0, import_node_path17.resolve)(args[++index]);
30160
+ metadataOutPath = (0, import_node_path18.resolve)(args[++index]);
29999
30161
  }
30000
30162
  }
30001
30163
  if (!outPath) {
@@ -30091,7 +30253,7 @@ async function handlePlayGet(args) {
30091
30253
  for (let index = 1; index < args.length; index += 1) {
30092
30254
  const arg = args[index];
30093
30255
  if (arg === "--out" && args[index + 1]) {
30094
- outPath = (0, import_node_path17.resolve)(args[++index]);
30256
+ outPath = (0, import_node_path18.resolve)(args[++index]);
30095
30257
  }
30096
30258
  if (arg === "--revision") {
30097
30259
  const rawVersion = args[++index];
@@ -30112,7 +30274,7 @@ async function handlePlayGet(args) {
30112
30274
  );
30113
30275
  return 2;
30114
30276
  }
30115
- const playName = isFileTarget(target) ? extractPlayName((0, import_node_fs12.readFileSync)((0, import_node_path17.resolve)(target), "utf-8"), (0, import_node_path17.resolve)(target)) : parseReferencedPlayTarget2(target).playName;
30277
+ const playName = isFileTarget(target) ? extractPlayName((0, import_node_fs12.readFileSync)((0, import_node_path18.resolve)(target), "utf-8"), (0, import_node_path18.resolve)(target)) : parseReferencedPlayTarget2(target).playName;
30116
30278
  const includeSource = sourceOutput || outPath !== null;
30117
30279
  const detail = isFileTarget(target) ? await client2.getPlay(
30118
30280
  playName,
@@ -30658,7 +30820,7 @@ async function handlePlayDescribe(args) {
30658
30820
  const definedName = isFileTarget(playName) ? (() => {
30659
30821
  try {
30660
30822
  return extractPlayName(
30661
- (0, import_node_fs12.readFileSync)((0, import_node_path17.resolve)(playName), "utf-8"),
30823
+ (0, import_node_fs12.readFileSync)((0, import_node_path18.resolve)(playName), "utf-8"),
30662
30824
  playName
30663
30825
  );
30664
30826
  } catch {
@@ -30720,7 +30882,7 @@ async function handlePlaySave(args) {
30720
30882
  graph = await traceCliSpan(
30721
30883
  "cli.play_save_bundle_graph",
30722
30884
  { targetKind: "file" },
30723
- () => collectBundledPlayGraph((0, import_node_path17.resolve)(options.target))
30885
+ () => collectBundledPlayGraph((0, import_node_path18.resolve)(options.target))
30724
30886
  );
30725
30887
  assertBundledPlayGraphDescriptions(graph);
30726
30888
  } catch (error) {
@@ -30845,7 +31007,7 @@ async function handlePlayPublish(args) {
30845
31007
  graph = await traceCliSpan(
30846
31008
  "cli.play_publish_bundle_graph",
30847
31009
  { targetKind: "file" },
30848
- () => collectBundledPlayGraph((0, import_node_path17.resolve)(playName))
31010
+ () => collectBundledPlayGraph((0, import_node_path18.resolve)(playName))
30849
31011
  );
30850
31012
  assertBundledPlayGraphDescriptions(graph);
30851
31013
  } catch (error) {
@@ -33971,7 +34133,7 @@ function expandAtFilePath(rawPath) {
33971
34133
  return (0, import_node_os10.homedir)();
33972
34134
  }
33973
34135
  if (expanded.startsWith("~/") || expanded.startsWith("~\\")) {
33974
- return (0, import_node_path18.join)((0, import_node_os10.homedir)(), expanded.slice(2));
34136
+ return (0, import_node_path19.join)((0, import_node_os10.homedir)(), expanded.slice(2));
33975
34137
  }
33976
34138
  return expanded;
33977
34139
  }
@@ -33984,7 +34146,7 @@ async function readAtFileReference(value, argumentName, strip = true) {
33984
34146
  throw new Error(`Invalid ${argumentName} value: empty @file path.`);
33985
34147
  }
33986
34148
  try {
33987
- const text = await (0, import_promises10.readFile)(filePath, "utf8");
34149
+ const text = await (0, import_promises11.readFile)(filePath, "utf8");
33988
34150
  const normalized = text.replace(/^\uFEFF/, "");
33989
34151
  return strip ? normalized.trim() : normalized;
33990
34152
  } catch (error) {
@@ -34148,7 +34310,7 @@ function createSdkEnrichTelemetryContext(input2) {
34148
34310
  runId: `sdk-enrich-${process.pid}-${Date.now()}`,
34149
34311
  command: sdkEnrichCommandText(input2.args),
34150
34312
  rowsRange: input2.rowsRange,
34151
- inputPath: (0, import_node_path18.basename)(input2.inputCsv),
34313
+ inputPath: (0, import_node_path19.basename)(input2.inputCsv),
34152
34314
  startedAtMs: Date.now(),
34153
34315
  rowsTargeted: input2.selectedRange.count,
34154
34316
  columnsTargeted: countConfiguredEnrichColumns(input2.config)
@@ -34280,9 +34442,9 @@ async function buildPlanArgs(args) {
34280
34442
  return planArgs;
34281
34443
  }
34282
34444
  async function assertInputCsvExists(inputCsv) {
34283
- const path = (0, import_node_path18.resolve)(inputCsv);
34445
+ const path = (0, import_node_path19.resolve)(inputCsv);
34284
34446
  try {
34285
- const info = await (0, import_promises10.stat)(path);
34447
+ const info = await (0, import_promises11.stat)(path);
34286
34448
  if (info.isFile()) {
34287
34449
  return;
34288
34450
  }
@@ -34294,8 +34456,8 @@ async function assertInputCsvExists(inputCsv) {
34294
34456
  }
34295
34457
  }
34296
34458
  async function assertSafeOutputPath(inputCsv, outputPath) {
34297
- const input2 = (0, import_node_path18.resolve)(inputCsv);
34298
- const output2 = (0, import_node_path18.resolve)(outputPath);
34459
+ const input2 = (0, import_node_path19.resolve)(inputCsv);
34460
+ const output2 = (0, import_node_path19.resolve)(outputPath);
34299
34461
  if (input2 === output2) {
34300
34462
  throw new Error(
34301
34463
  "--input and --output must be different files when not using --in-place."
@@ -34303,8 +34465,8 @@ async function assertSafeOutputPath(inputCsv, outputPath) {
34303
34465
  }
34304
34466
  try {
34305
34467
  const [inputInfo, outputInfo] = await Promise.all([
34306
- (0, import_promises10.stat)(input2),
34307
- (0, import_promises10.stat)(output2)
34468
+ (0, import_promises11.stat)(input2),
34469
+ (0, import_promises11.stat)(output2)
34308
34470
  ]);
34309
34471
  if (inputInfo.dev === outputInfo.dev && inputInfo.ino === outputInfo.ino) {
34310
34472
  throw new Error(
@@ -34324,7 +34486,7 @@ async function assertSafeOutputPath(inputCsv, outputPath) {
34324
34486
  }
34325
34487
  async function regularFileExists(path) {
34326
34488
  try {
34327
- const info = await (0, import_promises10.stat)((0, import_node_path18.resolve)(path));
34489
+ const info = await (0, import_promises11.stat)((0, import_node_path19.resolve)(path));
34328
34490
  return info.isFile();
34329
34491
  } catch (error) {
34330
34492
  const code = error && typeof error === "object" ? error.code : void 0;
@@ -34335,7 +34497,7 @@ async function regularFileExists(path) {
34335
34497
  }
34336
34498
  }
34337
34499
  async function readConfig(path) {
34338
- const source = await (0, import_promises10.readFile)((0, import_node_path18.resolve)(path), "utf8");
34500
+ const source = await (0, import_promises11.readFile)((0, import_node_path19.resolve)(path), "utf8");
34339
34501
  let parsed;
34340
34502
  try {
34341
34503
  parsed = JSON.parse(source);
@@ -34756,8 +34918,8 @@ async function writeOutputCsv(outputPath, status, options) {
34756
34918
  ]),
34757
34919
  options?.config
34758
34920
  );
34759
- await (0, import_promises10.writeFile)(
34760
- (0, import_node_path18.resolve)(outputPath),
34921
+ await (0, import_promises11.writeFile)(
34922
+ (0, import_node_path19.resolve)(outputPath),
34761
34923
  csvStringFromRows(merged.rows, columns),
34762
34924
  "utf8"
34763
34925
  );
@@ -34767,7 +34929,7 @@ async function writeOutputCsv(outputPath, status, options) {
34767
34929
  selectedRows: rowsInfo.totalRows,
34768
34930
  enrichedRows: rowsInfo.rows.length,
34769
34931
  rows: merged.rows.length,
34770
- path: (0, import_node_path18.resolve)(outputPath),
34932
+ path: (0, import_node_path19.resolve)(outputPath),
34771
34933
  partial: !rowsInfo.complete,
34772
34934
  enrichedDataRows: rowsInfo.rows
34773
34935
  };
@@ -34948,7 +35110,7 @@ function enrichCustomerDbJson(input2) {
34948
35110
  ...actions.slowExportAsCsvCommand ? { command: actions.slowExportAsCsvCommand } : runId && input2.outputPath ? {
34949
35111
  command: `deepline runs export ${runId} --dataset ${shellSingleQuote2(
34950
35112
  exportDatasetPath
34951
- )} --out ${shellSingleQuote2((0, import_node_path18.resolve)(input2.outputPath))}`
35113
+ )} --out ${shellSingleQuote2((0, import_node_path19.resolve)(input2.outputPath))}`
34952
35114
  } : {},
34953
35115
  action: actions.exportCsv ?? {}
34954
35116
  }
@@ -36345,15 +36507,15 @@ function addEnrichRowsExportFollowUpCommand(commands, seen, input2) {
36345
36507
  label: "export enrich rows",
36346
36508
  path: GENERATED_ENRICH_ROWS_TABLE_NAMESPACE,
36347
36509
  command: `deepline runs export ${input2.runId} --dataset ${GENERATED_ENRICH_ROWS_TABLE_NAMESPACE} --out ${shellSingleQuote2(
36348
- (0, import_node_path18.resolve)(input2.outputPath)
36510
+ (0, import_node_path19.resolve)(input2.outputPath)
36349
36511
  )}`
36350
36512
  });
36351
36513
  }
36352
36514
  function sidecarEnrichRowsExportPath(outputPath) {
36353
- const resolved = (0, import_node_path18.resolve)(outputPath);
36354
- const ext = (0, import_node_path18.extname)(resolved) || ".csv";
36355
- const stem = (0, import_node_path18.basename)(resolved, ext);
36356
- return (0, import_node_path18.join)((0, import_node_path18.dirname)(resolved), `${stem}.deepline-enrich-rows${ext}`);
36515
+ const resolved = (0, import_node_path19.resolve)(outputPath);
36516
+ const ext = (0, import_node_path19.extname)(resolved) || ".csv";
36517
+ const stem = (0, import_node_path19.basename)(resolved, ext);
36518
+ return (0, import_node_path19.join)((0, import_node_path19.dirname)(resolved), `${stem}.deepline-enrich-rows${ext}`);
36357
36519
  }
36358
36520
  function collectDatasetFollowUpCommands(value, state) {
36359
36521
  if (state.depth > 12 || !value || typeof value !== "object" || state.commands.length >= 8) {
@@ -36394,7 +36556,7 @@ function collectDatasetFollowUpCommands(value, state) {
36394
36556
  path: selector,
36395
36557
  command: `deepline runs export ${state.runId} --dataset ${shellSingleQuote2(
36396
36558
  selector
36397
- )} --out ${shellSingleQuote2((0, import_node_path18.resolve)(state.outputPath))}`
36559
+ )} --out ${shellSingleQuote2((0, import_node_path19.resolve)(state.outputPath))}`
36398
36560
  });
36399
36561
  }
36400
36562
  }
@@ -36434,10 +36596,10 @@ async function persistEnrichFailureReport(input2) {
36434
36596
  if (input2.jobs.length === 0 && input2.issues.length === 0) {
36435
36597
  return null;
36436
36598
  }
36437
- const stateDir = (0, import_node_path18.join)((0, import_node_os10.homedir)(), ".local", "deepline", "runtime", "state");
36599
+ const stateDir = (0, import_node_path19.join)((0, import_node_os10.homedir)(), ".local", "deepline", "runtime", "state");
36438
36600
  const reportPrefix = input2.jobs.length > 0 ? "run-block-failures" : "enrich-issues";
36439
- await (0, import_promises10.mkdir)(stateDir, { recursive: true });
36440
- const reportPath = (0, import_node_path18.join)(
36601
+ await (0, import_promises11.mkdir)(stateDir, { recursive: true });
36602
+ const reportPath = (0, import_node_path19.join)(
36441
36603
  stateDir,
36442
36604
  `${reportPrefix}-${Math.floor(Date.now() / 1e3)}-${process.pid}.json`
36443
36605
  );
@@ -36462,7 +36624,7 @@ async function persistEnrichFailureReport(input2) {
36462
36624
  if (input2.rows.rowStart !== null && input2.rows.rowEnd !== null) {
36463
36625
  report.rows = { start: input2.rows.rowStart, end: input2.rows.rowEnd };
36464
36626
  }
36465
- await (0, import_promises10.writeFile)(reportPath, `${JSON.stringify(report, null, 2)}
36627
+ await (0, import_promises11.writeFile)(reportPath, `${JSON.stringify(report, null, 2)}
36466
36628
  `, "utf8");
36467
36629
  return reportPath;
36468
36630
  }
@@ -37320,8 +37482,8 @@ function registerEnrichCommand(program) {
37320
37482
  if (options.json) {
37321
37483
  printJson({
37322
37484
  dryRun: true,
37323
- input: (0, import_node_path18.resolve)(inputCsv),
37324
- output: options.output ? (0, import_node_path18.resolve)(options.output) : null,
37485
+ input: (0, import_node_path19.resolve)(inputCsv),
37486
+ output: options.output ? (0, import_node_path19.resolve)(options.output) : null,
37325
37487
  plan: summary
37326
37488
  });
37327
37489
  return;
@@ -37332,7 +37494,7 @@ function registerEnrichCommand(program) {
37332
37494
  }
37333
37495
  const rows = parseRows(options.rows, options.all);
37334
37496
  let outputPath = options.inPlace ? inputCsv : options.output;
37335
- const requestedOutputPath = options.inPlace ? (0, import_node_path18.resolve)(inputCsv) : options.output ? (0, import_node_path18.resolve)(options.output) : void 0;
37497
+ const requestedOutputPath = options.inPlace ? (0, import_node_path19.resolve)(inputCsv) : options.output ? (0, import_node_path19.resolve)(options.output) : void 0;
37336
37498
  const sourceCsvPath = !options.inPlace && outputPath && await regularFileExists(outputPath) ? outputPath : inputCsv;
37337
37499
  const forceAliases = resolveForceAliases(config, options);
37338
37500
  for (const alias of collectFailedInputAliases(
@@ -37366,13 +37528,13 @@ function registerEnrichCommand(program) {
37366
37528
  sdkEnrichTelemetryCompleted = true;
37367
37529
  await completeSdkEnrichTelemetry(sdkEnrichTelemetry, input2);
37368
37530
  };
37369
- const tempDir = await (0, import_promises10.mkdtemp)((0, import_node_path18.join)((0, import_node_os10.tmpdir)(), "deepline-enrich-play-"));
37531
+ const tempDir = await (0, import_promises11.mkdtemp)((0, import_node_path19.join)((0, import_node_os10.tmpdir)(), "deepline-enrich-play-"));
37370
37532
  await emitSdkEnrichTelemetry(sdkEnrichTelemetry, "enrich_started");
37371
- const tempPlay = (0, import_node_path18.join)(tempDir, "deepline-enrich.play.ts");
37533
+ const tempPlay = (0, import_node_path19.join)(tempDir, "deepline-enrich.play.ts");
37372
37534
  let inPlaceTempDir = null;
37373
37535
  let inPlaceTempOutputPath = null;
37374
- const inPlaceFinalOutputPath = options.inPlace ? (0, import_node_path18.resolve)(inputCsv) : null;
37375
- const inPlaceCommitOutputPath = options.inPlace ? (await (0, import_promises10.lstat)(inputCsv)).isSymbolicLink() ? await (0, import_promises10.realpath)(inputCsv) : inPlaceFinalOutputPath : null;
37536
+ const inPlaceFinalOutputPath = options.inPlace ? (0, import_node_path19.resolve)(inputCsv) : null;
37537
+ const inPlaceCommitOutputPath = options.inPlace ? (await (0, import_promises11.lstat)(inputCsv)).isSymbolicLink() ? await (0, import_promises11.realpath)(inputCsv) : inPlaceFinalOutputPath : null;
37376
37538
  const failureReportOutputPath = options.inPlace ? inPlaceFinalOutputPath : null;
37377
37539
  const enrichIssueFollowUpOutputPath = options.inPlace && inPlaceFinalOutputPath ? sidecarEnrichRowsExportPath(inPlaceFinalOutputPath) : null;
37378
37540
  let activeRunId2 = null;
@@ -37393,16 +37555,16 @@ function registerEnrichCommand(program) {
37393
37555
  return;
37394
37556
  }
37395
37557
  if (inPlaceTempDir) {
37396
- await (0, import_promises10.rm)(inPlaceTempDir, { recursive: true, force: true });
37558
+ await (0, import_promises11.rm)(inPlaceTempDir, { recursive: true, force: true });
37397
37559
  }
37398
- inPlaceTempDir = await (0, import_promises10.mkdtemp)(
37399
- (0, import_node_path18.join)(
37400
- (0, import_node_path18.dirname)(inPlaceCommitOutputPath ?? (0, import_node_path18.resolve)(inputCsv)),
37560
+ inPlaceTempDir = await (0, import_promises11.mkdtemp)(
37561
+ (0, import_node_path19.join)(
37562
+ (0, import_node_path19.dirname)(inPlaceCommitOutputPath ?? (0, import_node_path19.resolve)(inputCsv)),
37401
37563
  ".deepline-enrich-in-place-"
37402
37564
  )
37403
37565
  );
37404
- inPlaceTempOutputPath = (0, import_node_path18.join)(inPlaceTempDir, "output.csv");
37405
- await (0, import_promises10.copyFile)((0, import_node_path18.resolve)(inputCsv), inPlaceTempOutputPath);
37566
+ inPlaceTempOutputPath = (0, import_node_path19.join)(inPlaceTempDir, "output.csv");
37567
+ await (0, import_promises11.copyFile)((0, import_node_path19.resolve)(inputCsv), inPlaceTempOutputPath);
37406
37568
  outputPath = inPlaceTempOutputPath;
37407
37569
  };
37408
37570
  const commitInPlaceOutput = async (exportResult) => {
@@ -37410,12 +37572,12 @@ function registerEnrichCommand(program) {
37410
37572
  return exportResult;
37411
37573
  }
37412
37574
  const committedTempDir = inPlaceTempDir;
37413
- await (0, import_promises10.rename)(inPlaceTempOutputPath, inPlaceCommitOutputPath);
37575
+ await (0, import_promises11.rename)(inPlaceTempOutputPath, inPlaceCommitOutputPath);
37414
37576
  inPlaceTempDir = null;
37415
37577
  inPlaceTempOutputPath = null;
37416
37578
  outputPath = inPlaceFinalOutputPath;
37417
37579
  if (committedTempDir) {
37418
- await (0, import_promises10.rm)(committedTempDir, { recursive: true, force: true });
37580
+ await (0, import_promises11.rm)(committedTempDir, { recursive: true, force: true });
37419
37581
  }
37420
37582
  if (!exportResult) {
37421
37583
  return null;
@@ -37428,13 +37590,13 @@ function registerEnrichCommand(program) {
37428
37590
  try {
37429
37591
  process.once("SIGINT", onSigint);
37430
37592
  process.once("SIGTERM", onSigterm);
37431
- await (0, import_promises10.writeFile)(tempPlay, playSource, "utf8");
37593
+ await (0, import_promises11.writeFile)(tempPlay, playSource, "utf8");
37432
37594
  if (options.inPlace) {
37433
37595
  await prepareInPlaceOutput();
37434
37596
  }
37435
37597
  const runOne = async (input2) => {
37436
37598
  const runtimeInput = {
37437
- file: (0, import_node_path18.resolve)(input2.sourceCsvPath),
37599
+ file: (0, import_node_path19.resolve)(input2.sourceCsvPath),
37438
37600
  ...input2.rows.rowStart !== null ? { rowStart: input2.rows.rowStart } : {},
37439
37601
  ...input2.rows.rowEnd !== null ? { rowEnd: input2.rows.rowEnd } : {}
37440
37602
  };
@@ -37622,11 +37784,11 @@ function registerEnrichCommand(program) {
37622
37784
  process.removeListener("SIGINT", onSigint);
37623
37785
  process.removeListener("SIGTERM", onSigterm);
37624
37786
  if (inPlaceTempDir) {
37625
- await (0, import_promises10.rm)(inPlaceTempDir, { recursive: true, force: true });
37787
+ await (0, import_promises11.rm)(inPlaceTempDir, { recursive: true, force: true });
37626
37788
  } else if (inPlaceTempOutputPath) {
37627
- await (0, import_promises10.rm)(inPlaceTempOutputPath, { force: true });
37789
+ await (0, import_promises11.rm)(inPlaceTempOutputPath, { force: true });
37628
37790
  }
37629
- await (0, import_promises10.rm)(tempDir, { recursive: true, force: true });
37791
+ await (0, import_promises11.rm)(tempDir, { recursive: true, force: true });
37630
37792
  }
37631
37793
  });
37632
37794
  }
@@ -37668,7 +37830,7 @@ async function handleFeedback(text, options) {
37668
37830
  { json: options.json }
37669
37831
  );
37670
37832
  }
37671
- function resolveFeedbackText(text, file, readFile7 = (path) => (0, import_node_fs13.readFileSync)(path, "utf8")) {
37833
+ function resolveFeedbackText(text, file, readFile8 = (path) => (0, import_node_fs13.readFileSync)(path, "utf8")) {
37672
37834
  if (text !== void 0 && file !== void 0) {
37673
37835
  throw new Error(
37674
37836
  "Pass feedback text positionally or with --file, not both."
@@ -37677,7 +37839,7 @@ function resolveFeedbackText(text, file, readFile7 = (path) => (0, import_node_f
37677
37839
  let value;
37678
37840
  if (file !== void 0) {
37679
37841
  try {
37680
- value = readFile7(file === "-" ? 0 : file);
37842
+ value = readFile8(file === "-" ? 0 : file);
37681
37843
  } catch (error) {
37682
37844
  throw new Error(
37683
37845
  `Could not read feedback ${file === "-" ? "from stdin" : `file ${file}`}: ${error instanceof Error ? error.message : String(error)}`
@@ -37686,7 +37848,7 @@ function resolveFeedbackText(text, file, readFile7 = (path) => (0, import_node_f
37686
37848
  } else if (text !== void 0) {
37687
37849
  value = text;
37688
37850
  } else if (!process.stdin.isTTY) {
37689
- value = readFile7(0);
37851
+ value = readFile8(0);
37690
37852
  } else {
37691
37853
  throw new Error(
37692
37854
  "Feedback text is required. Pass it positionally, use --file <path>, or pipe stdin."
@@ -37737,7 +37899,7 @@ Examples:
37737
37899
  // src/cli/commands/sessions.ts
37738
37900
  var import_node_fs14 = require("fs");
37739
37901
  var import_node_os11 = require("os");
37740
- var import_node_path19 = require("path");
37902
+ var import_node_path20 = require("path");
37741
37903
  var import_node_zlib = require("zlib");
37742
37904
  var import_node_crypto8 = require("crypto");
37743
37905
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -37756,17 +37918,17 @@ function homeDir() {
37756
37918
  function detectShellContext() {
37757
37919
  const shellPath = process.env.SHELL?.trim() || process.env.ComSpec?.trim() || process.env.COMSPEC?.trim() || "";
37758
37920
  return {
37759
- shell: shellPath ? (0, import_node_path19.basename)(shellPath).replace(/\.exe$/i, "") : "unknown",
37921
+ shell: shellPath ? (0, import_node_path20.basename)(shellPath).replace(/\.exe$/i, "") : "unknown",
37760
37922
  shell_path: shellPath || null,
37761
37923
  os: (0, import_node_os11.platform)(),
37762
37924
  cwd: process.cwd()
37763
37925
  };
37764
37926
  }
37765
37927
  function claudeProjectsRoot() {
37766
- return (0, import_node_path19.join)(homeDir(), ".claude", "projects");
37928
+ return (0, import_node_path20.join)(homeDir(), ".claude", "projects");
37767
37929
  }
37768
37930
  function codexSessionsRoot() {
37769
- return (0, import_node_path19.join)(homeDir(), ".codex", "sessions");
37931
+ return (0, import_node_path20.join)(homeDir(), ".codex", "sessions");
37770
37932
  }
37771
37933
  function listClaudeSessionFiles() {
37772
37934
  const root = claudeProjectsRoot();
@@ -37774,10 +37936,10 @@ function listClaudeSessionFiles() {
37774
37936
  const projectDirs = readDirectoryNames(root);
37775
37937
  const files = [];
37776
37938
  for (const projectDir of projectDirs) {
37777
- const fullProjectDir = (0, import_node_path19.join)(root, projectDir);
37939
+ const fullProjectDir = (0, import_node_path20.join)(root, projectDir);
37778
37940
  for (const fileName of readDirectoryNames(fullProjectDir)) {
37779
37941
  if (fileName.endsWith(".jsonl")) {
37780
- const filePath = (0, import_node_path19.join)(fullProjectDir, fileName);
37942
+ const filePath = (0, import_node_path20.join)(fullProjectDir, fileName);
37781
37943
  const sessionId = sessionIdFromClaudeFilePath(filePath);
37782
37944
  const stat5 = statIfReadable(filePath);
37783
37945
  if (sessionId && stat5) {
@@ -37834,7 +37996,7 @@ function listJsonlFilesRecursive(root, maxDepth) {
37834
37996
  return;
37835
37997
  }
37836
37998
  for (const entry of entries) {
37837
- const fullPath = (0, import_node_path19.join)(dir, entry.name);
37999
+ const fullPath = (0, import_node_path20.join)(dir, entry.name);
37838
38000
  if (entry.isDirectory()) {
37839
38001
  visit(fullPath, depth + 1);
37840
38002
  } else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
@@ -37862,10 +38024,10 @@ function newestSessionFile(agent) {
37862
38024
  return newest;
37863
38025
  }
37864
38026
  function sessionIdFromClaudeFilePath(filePath) {
37865
- return (0, import_node_path19.basename)(filePath, ".jsonl");
38027
+ return (0, import_node_path20.basename)(filePath, ".jsonl");
37866
38028
  }
37867
38029
  function sessionIdFromCodexFilePath(filePath) {
37868
- const match = (0, import_node_path19.basename)(filePath, ".jsonl").match(UUID_IN_TEXT_RE);
38030
+ const match = (0, import_node_path20.basename)(filePath, ".jsonl").match(UUID_IN_TEXT_RE);
37869
38031
  return match?.[0] ?? null;
37870
38032
  }
37871
38033
  function readCodexSessionId(filePath) {
@@ -38194,26 +38356,26 @@ async function uploadChunkedSessions(sessions, options) {
38194
38356
  async function handleSessionsSend(options) {
38195
38357
  const rating = parseSessionRating(options.rating);
38196
38358
  if (options.file) {
38197
- const filePath = (0, import_node_path19.resolve)(options.file);
38359
+ const filePath = (0, import_node_path20.resolve)(options.file);
38198
38360
  if (!(0, import_node_fs14.existsSync)(filePath)) {
38199
38361
  throw new Error(`File not found: ${options.file}`);
38200
38362
  }
38201
38363
  const response2 = await uploadPayload("/api/v2/cli/send-session", {
38202
38364
  file: (0, import_node_fs14.readFileSync)(filePath).toString("base64"),
38203
- filename: (0, import_node_path19.basename)(filePath),
38365
+ filename: (0, import_node_path20.basename)(filePath),
38204
38366
  ...rating ? { rating } : {}
38205
38367
  });
38206
38368
  printCommandEnvelope(
38207
38369
  {
38208
38370
  ...response2,
38209
38371
  ok: true,
38210
- filename: (0, import_node_path19.basename)(filePath),
38372
+ filename: (0, import_node_path20.basename)(filePath),
38211
38373
  render: {
38212
38374
  sections: [
38213
38375
  {
38214
38376
  title: "sessions send",
38215
38377
  lines: [
38216
- `File '${(0, import_node_path19.basename)(filePath)}' uploaded to #internal-reports.`
38378
+ `File '${(0, import_node_path20.basename)(filePath)}' uploaded to #internal-reports.`
38217
38379
  ]
38218
38380
  }
38219
38381
  ]
@@ -38270,24 +38432,24 @@ async function handleSessionsSend(options) {
38270
38432
  );
38271
38433
  }
38272
38434
  function loadViewerAssets() {
38273
- const cliEntry = process.argv[1]?.trim() ? (0, import_node_fs14.realpathSync)((0, import_node_path19.resolve)(process.argv[1])) : null;
38435
+ const cliEntry = process.argv[1]?.trim() ? (0, import_node_fs14.realpathSync)((0, import_node_path20.resolve)(process.argv[1])) : null;
38274
38436
  const candidateRoots2 = [
38275
38437
  ...cliEntry ? [
38276
- (0, import_node_path19.join)((0, import_node_path19.dirname)((0, import_node_path19.dirname)(cliEntry)), "viewer"),
38277
- (0, import_node_path19.join)(
38278
- (0, import_node_path19.dirname)((0, import_node_path19.dirname)((0, import_node_path19.dirname)(cliEntry))),
38438
+ (0, import_node_path20.join)((0, import_node_path20.dirname)((0, import_node_path20.dirname)(cliEntry)), "viewer"),
38439
+ (0, import_node_path20.join)(
38440
+ (0, import_node_path20.dirname)((0, import_node_path20.dirname)((0, import_node_path20.dirname)(cliEntry))),
38279
38441
  "src",
38280
38442
  "lib",
38281
38443
  "cli",
38282
38444
  "viewer"
38283
38445
  )
38284
38446
  ] : [],
38285
- (0, import_node_path19.join)(process.cwd(), "packages", "sdk", "assets", "viewer")
38447
+ (0, import_node_path20.join)(process.cwd(), "packages", "sdk", "assets", "viewer")
38286
38448
  ];
38287
38449
  for (const root of candidateRoots2) {
38288
38450
  try {
38289
- const cssPath = (0, import_node_path19.join)(root, "viewer.css");
38290
- const jsPath = (0, import_node_path19.join)(root, "viewer.js");
38451
+ const cssPath = (0, import_node_path20.join)(root, "viewer.css");
38452
+ const jsPath = (0, import_node_path20.join)(root, "viewer.js");
38291
38453
  if (!(0, import_node_fs14.existsSync)(cssPath) || !(0, import_node_fs14.existsSync)(jsPath)) continue;
38292
38454
  return {
38293
38455
  css: (0, import_node_fs14.readFileSync)(cssPath, "utf8"),
@@ -38317,16 +38479,16 @@ async function handleSessionsRender(options) {
38317
38479
  currentSession: options.currentSession,
38318
38480
  agent: options.agent
38319
38481
  });
38320
- let outputPath = options.output ? (0, import_node_path19.resolve)(options.output) : "";
38482
+ let outputPath = options.output ? (0, import_node_path20.resolve)(options.output) : "";
38321
38483
  if (!outputPath) {
38322
- const outputDir = (0, import_node_path19.join)(process.cwd(), "deepline", "data");
38484
+ const outputDir = (0, import_node_path20.join)(process.cwd(), "deepline", "data");
38323
38485
  (0, import_node_fs14.mkdirSync)(outputDir, { recursive: true });
38324
- outputPath = (0, import_node_path19.join)(
38486
+ outputPath = (0, import_node_path20.join)(
38325
38487
  outputDir,
38326
38488
  targets.length > 1 ? "session-viewer.html" : `session-${targets[0]?.sessionId}.html`
38327
38489
  );
38328
38490
  } else {
38329
- (0, import_node_fs14.mkdirSync)((0, import_node_path19.dirname)(outputPath), { recursive: true });
38491
+ (0, import_node_fs14.mkdirSync)((0, import_node_path20.dirname)(outputPath), { recursive: true });
38330
38492
  }
38331
38493
  const sessions = targets.map((target) => ({
38332
38494
  label: target.label,
@@ -38570,8 +38732,8 @@ Examples:
38570
38732
  // src/cli/commands/monitors.ts
38571
38733
  var import_node_crypto9 = require("crypto");
38572
38734
  var import_node_fs15 = require("fs");
38573
- var import_node_path20 = require("path");
38574
- var import_promises11 = require("readline/promises");
38735
+ var import_node_path21 = require("path");
38736
+ var import_promises12 = require("readline/promises");
38575
38737
 
38576
38738
  // ../integration-contracts/monitor-input-contract.ts
38577
38739
  var import_handlebars = __toESM(require("handlebars"), 1);
@@ -39433,7 +39595,7 @@ function parseJsonObjectArg(raw, argLabel) {
39433
39595
  return parsed;
39434
39596
  }
39435
39597
  function resolveMonitorJsonBody(input2) {
39436
- const readFile7 = input2.readFile ?? ((path) => (0, import_node_fs15.readFileSync)(path, "utf-8"));
39598
+ const readFile8 = input2.readFile ?? ((path) => (0, import_node_fs15.readFileSync)(path, "utf-8"));
39437
39599
  const readStdin = input2.readStdin ?? (() => (0, import_node_fs15.readFileSync)(0, "utf-8"));
39438
39600
  if (input2.positional !== void 0 && input2.file !== void 0) {
39439
39601
  throw new MonitorsUsageError(
@@ -39449,7 +39611,7 @@ function resolveMonitorJsonBody(input2) {
39449
39611
  }
39450
39612
  let raw;
39451
39613
  try {
39452
- raw = readFile7(input2.file);
39614
+ raw = readFile8(input2.file);
39453
39615
  } catch (error) {
39454
39616
  throw new MonitorsUsageError(
39455
39617
  `Could not read --file ${input2.file}: ${error instanceof Error ? error.message : String(error)}`
@@ -40731,7 +40893,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
40731
40893
  }
40732
40894
  };
40733
40895
  const definition = requireCompiledFleetDefinition(authoredDefinition);
40734
- const file = (0, import_node_path20.resolve)(out);
40896
+ const file = (0, import_node_path21.resolve)(out);
40735
40897
  (0, import_node_fs15.writeFileSync)(file, `${JSON.stringify(definition, null, 2)}
40736
40898
  `, "utf8");
40737
40899
  const next = `deepline monitors fleets deploy --file ${fleetShellArg(file)} --dry-run --json`;
@@ -40992,7 +41154,7 @@ function fleetDeactivateCommandLine(fleetId, options) {
40992
41154
  }
40993
41155
  async function confirmFleetDeactivate(fleetId, plan) {
40994
41156
  process.stderr.write(renderFleetDeactivatePlan(plan, fleetId));
40995
- const rl = (0, import_promises11.createInterface)({ input: process.stdin, output: process.stderr });
41157
+ const rl = (0, import_promises12.createInterface)({ input: process.stdin, output: process.stderr });
40996
41158
  try {
40997
41159
  const answer = await rl.question(
40998
41160
  `Deactivate fleet "${fleetId}" and the monitors it owns? [y/N] `
@@ -41306,7 +41468,7 @@ async function handleMonitorsValidate(key, options) {
41306
41468
  if (result.valid === false) process.exitCode = 7;
41307
41469
  }
41308
41470
  async function confirmMonitorDelete(key) {
41309
- const rl = (0, import_promises11.createInterface)({
41471
+ const rl = (0, import_promises12.createInterface)({
41310
41472
  input: process.stdin,
41311
41473
  output: process.stderr
41312
41474
  });
@@ -41612,7 +41774,7 @@ async function handleMonitorBatchDeploy(options) {
41612
41774
  }
41613
41775
  let manifestNdjson;
41614
41776
  try {
41615
- manifestNdjson = (0, import_node_fs15.readFileSync)((0, import_node_path20.resolve)(options.file), "utf8");
41777
+ manifestNdjson = (0, import_node_fs15.readFileSync)((0, import_node_path21.resolve)(options.file), "utf8");
41616
41778
  } catch (error) {
41617
41779
  throw new MonitorsUsageError(
41618
41780
  `Could not read monitor batch manifest '${options.file}': ${error instanceof Error ? error.message : String(error)}`
@@ -42513,10 +42675,10 @@ Example:
42513
42675
  // src/cli/commands/org.ts
42514
42676
  var import_node_crypto10 = require("crypto");
42515
42677
  var import_node_fs16 = require("fs");
42516
- var import_node_path21 = require("path");
42678
+ var import_node_path22 = require("path");
42517
42679
  function pendingOrgCreatePath(baseUrl, accountId, sourceOrgId, name) {
42518
42680
  const intent = (0, import_node_crypto10.createHash)("sha256").update(accountId).update("\0").update(sourceOrgId).update("\0").update(name).digest("hex");
42519
- return (0, import_node_path21.join)(sdkCliStateDirPath(baseUrl), `pending-org-create-${intent}.json`);
42681
+ return (0, import_node_path22.join)(sdkCliStateDirPath(baseUrl), `pending-org-create-${intent}.json`);
42520
42682
  }
42521
42683
  function readPendingOrgCreate(path, accountId, sourceOrgId, name) {
42522
42684
  let value;
@@ -43399,7 +43561,7 @@ Deprecated:
43399
43561
 
43400
43562
  // src/cli/commands/secrets.ts
43401
43563
  var import_node_process = require("process");
43402
- var import_promises12 = require("fs/promises");
43564
+ var import_promises13 = require("fs/promises");
43403
43565
  var hiddenInputBuffer = "";
43404
43566
  function normalizeSecretName(value) {
43405
43567
  const normalized = value.trim().toUpperCase();
@@ -43572,7 +43734,7 @@ async function readSecretValueFromOptions(options) {
43572
43734
  }
43573
43735
  value = envValue;
43574
43736
  } else {
43575
- value = trimOneTerminalNewline(await (0, import_promises12.readFile)(options.fromFile, "utf8"));
43737
+ value = trimOneTerminalNewline(await (0, import_promises13.readFile)(options.fromFile, "utf8"));
43576
43738
  }
43577
43739
  if (!value) throw new Error("Secret value is required.");
43578
43740
  return value;
@@ -43776,11 +43938,11 @@ Examples:
43776
43938
  var import_node_child_process5 = require("child_process");
43777
43939
  var import_node_fs20 = require("fs");
43778
43940
  var import_node_os15 = require("os");
43779
- var import_node_path25 = require("path");
43941
+ var import_node_path26 = require("path");
43780
43942
 
43781
43943
  // src/cli/installation-lifecycle.ts
43782
43944
  var import_node_fs17 = require("fs");
43783
- var import_node_path22 = require("path");
43945
+ var import_node_path23 = require("path");
43784
43946
  var nodeFileSystem = {
43785
43947
  exists: import_node_fs17.existsSync,
43786
43948
  isSymbolicLink(path) {
@@ -43836,25 +43998,25 @@ var CliInstallation = class _CliInstallation {
43836
43998
  });
43837
43999
  }
43838
44000
  static isNpmPackagePath(path) {
43839
- return path?.includes(`${(0, import_node_path22.join)("node_modules", "deepline")}`) ?? false;
44001
+ return path?.includes(`${(0, import_node_path23.join)("node_modules", "deepline")}`) ?? false;
43840
44002
  }
43841
44003
  launcher(path) {
43842
44004
  return inspectLauncher(path, this.input.fileSystem);
43843
44005
  }
43844
44006
  retiredArtifacts() {
43845
- const hostDir = (0, import_node_path22.join)(
44007
+ const hostDir = (0, import_node_path23.join)(
43846
44008
  this.input.home,
43847
44009
  ".local",
43848
44010
  "deepline",
43849
44011
  this.input.baseUrlSlug
43850
44012
  );
43851
- const legacyLauncherPath = (0, import_node_path22.join)(
44013
+ const legacyLauncherPath = (0, import_node_path23.join)(
43852
44014
  this.input.home,
43853
44015
  ".local",
43854
44016
  "bin",
43855
44017
  "deepline"
43856
44018
  );
43857
- const installerCommandPath = this.input.fileSystem.read((0, import_node_path22.join)(hostDir, "sdk", ".command-path")).trim();
44019
+ const installerCommandPath = this.input.fileSystem.read((0, import_node_path23.join)(hostDir, "sdk", ".command-path")).trim();
43858
44020
  const ownedInstallerCommand = isOwnedInstallerCommandPath({
43859
44021
  hostDir,
43860
44022
  commandPath: installerCommandPath
@@ -43862,16 +44024,16 @@ var CliInstallation = class _CliInstallation {
43862
44024
  const legacyLauncher = this.launcher(legacyLauncherPath);
43863
44025
  const candidates = [
43864
44026
  ...legacyLauncher.ownership === "installer_legacy" ? [legacyLauncherPath] : [],
43865
- (0, import_node_path22.join)(this.input.home, ".local", "bin", "deepline-real"),
43866
- (0, import_node_path22.join)(hostDir, "bin", "deepline"),
43867
- (0, import_node_path22.join)(hostDir, "bin", "deepline-real"),
43868
- (0, import_node_path22.join)(hostDir, "cli", ".install-method"),
43869
- (0, import_node_path22.join)(hostDir, "cli", ".version"),
43870
- (0, import_node_path22.join)(hostDir, "sdk", ".install-method"),
43871
- (0, import_node_path22.join)(hostDir, "sdk", ".command-path"),
44027
+ (0, import_node_path23.join)(this.input.home, ".local", "bin", "deepline-real"),
44028
+ (0, import_node_path23.join)(hostDir, "bin", "deepline"),
44029
+ (0, import_node_path23.join)(hostDir, "bin", "deepline-real"),
44030
+ (0, import_node_path23.join)(hostDir, "cli", ".install-method"),
44031
+ (0, import_node_path23.join)(hostDir, "cli", ".version"),
44032
+ (0, import_node_path23.join)(hostDir, "sdk", ".install-method"),
44033
+ (0, import_node_path23.join)(hostDir, "sdk", ".command-path"),
43872
44034
  ...ownedInstallerCommand ? [
43873
44035
  installerCommandPath,
43874
- (0, import_node_path22.join)((0, import_node_path22.dirname)(installerCommandPath), "deepline-sdk")
44036
+ (0, import_node_path23.join)((0, import_node_path23.dirname)(installerCommandPath), "deepline-sdk")
43875
44037
  ] : []
43876
44038
  ];
43877
44039
  return {
@@ -43892,11 +44054,11 @@ function removeArtifacts(plan, fileSystem) {
43892
44054
  return plan.paths;
43893
44055
  }
43894
44056
  function isOwnedInstallerCommandPath(input2) {
43895
- if (!input2.commandPath || (0, import_node_path22.basename)(input2.commandPath) !== "deepline") {
44057
+ if (!input2.commandPath || (0, import_node_path23.basename)(input2.commandPath) !== "deepline") {
43896
44058
  return false;
43897
44059
  }
43898
- const commandPath = (0, import_node_path22.resolve)(input2.commandPath);
43899
- const fromHost = (0, import_node_path22.relative)((0, import_node_path22.resolve)(input2.hostDir), commandPath);
44060
+ const commandPath = (0, import_node_path23.resolve)(input2.commandPath);
44061
+ const fromHost = (0, import_node_path23.relative)((0, import_node_path23.resolve)(input2.hostDir), commandPath);
43900
44062
  return fromHost !== "" && fromHost !== ".." && !fromHost.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`);
43901
44063
  }
43902
44064
 
@@ -43904,7 +44066,7 @@ function isOwnedInstallerCommandPath(input2) {
43904
44066
  var import_node_child_process3 = require("child_process");
43905
44067
  var import_node_fs19 = require("fs");
43906
44068
  var import_node_os14 = require("os");
43907
- var import_node_path24 = require("path");
44069
+ var import_node_path25 = require("path");
43908
44070
 
43909
44071
  // contracts/install-commands.json
43910
44072
  var install_commands_default = {
@@ -44021,7 +44183,7 @@ var import_node_crypto11 = require("crypto");
44021
44183
  var import_node_os13 = require("os");
44022
44184
  var import_node_zlib2 = require("zlib");
44023
44185
  var import_node_fs18 = require("fs");
44024
- var import_node_path23 = require("path");
44186
+ var import_node_path24 = require("path");
44025
44187
 
44026
44188
  // src/cli/windows-arg-escape.ts
44027
44189
  var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
@@ -44386,7 +44548,7 @@ function shouldSkipSkillsSync() {
44386
44548
  return value === "1" || value === "true" || value === "yes" || value === "on";
44387
44549
  }
44388
44550
  function unavailableSkillsNoticePath(baseUrl) {
44389
- return (0, import_node_path23.join)(sdkCliStateDirPath(baseUrl), "skills-sync-unavailable-version");
44551
+ return (0, import_node_path24.join)(sdkCliStateDirPath(baseUrl), "skills-sync-unavailable-version");
44390
44552
  }
44391
44553
  var SKILLS_SYNC_IN_PROGRESS_TTL_MS = 10 * 60 * 1e3;
44392
44554
  var SKILLS_SYNC_IN_PROGRESS_PID_CAP_MS = 6 * 60 * 60 * 1e3;
@@ -44396,21 +44558,21 @@ function sortedLeaseAgents(agents) {
44396
44558
  return [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
44397
44559
  }
44398
44560
  function inProgressSkillsSyncPath(baseUrl, agent) {
44399
- return (0, import_node_path23.join)(
44561
+ return (0, import_node_path24.join)(
44400
44562
  sdkCliStateDirPath(baseUrl),
44401
44563
  `skills-sync-in-progress-${agentLeaseSegment(agent)}`
44402
44564
  );
44403
44565
  }
44404
44566
  function readInProgressSkillsSyncLeaseFromDir(dir) {
44405
- const claim = readMarkedSkillsSyncVersion((0, import_node_path23.join)(dir, "claim"));
44567
+ const claim = readMarkedSkillsSyncVersion((0, import_node_path24.join)(dir, "claim"));
44406
44568
  const [version = "", startedAt = ""] = claim.split(" ");
44407
- const pidRaw = readMarkedSkillsSyncVersion((0, import_node_path23.join)(dir, "pid"));
44569
+ const pidRaw = readMarkedSkillsSyncVersion((0, import_node_path24.join)(dir, "pid"));
44408
44570
  return {
44409
44571
  claimToken: version && startedAt ? `${version} ${startedAt}` : "",
44410
44572
  version,
44411
44573
  startedAt: Number(startedAt),
44412
44574
  pid: /^\d+$/.test(pidRaw) ? Number(pidRaw) : null,
44413
- owner: readMarkedSkillsSyncVersion((0, import_node_path23.join)(dir, "owner"))
44575
+ owner: readMarkedSkillsSyncVersion((0, import_node_path24.join)(dir, "owner"))
44414
44576
  };
44415
44577
  }
44416
44578
  function readInProgressSkillsSyncLease(baseUrl, agent) {
@@ -44468,9 +44630,9 @@ function claimOneInProgressSkillsSync(baseUrl, remoteVersion, agent, owner) {
44468
44630
  const claimToken = `${remoteVersion} ${Date.now()}`;
44469
44631
  const staging = `${dir}.staging-${process.pid}-${Date.now()}`;
44470
44632
  (0, import_node_fs18.mkdirSync)(staging);
44471
- (0, import_node_fs18.writeFileSync)((0, import_node_path23.join)(staging, "claim"), `${claimToken}
44633
+ (0, import_node_fs18.writeFileSync)((0, import_node_path24.join)(staging, "claim"), `${claimToken}
44472
44634
  `, "utf-8");
44473
- (0, import_node_fs18.writeFileSync)((0, import_node_path23.join)(staging, "owner"), `${owner}
44635
+ (0, import_node_fs18.writeFileSync)((0, import_node_path24.join)(staging, "owner"), `${owner}
44474
44636
  `, "utf-8");
44475
44637
  try {
44476
44638
  (0, import_node_fs18.renameSync)(staging, dir);
@@ -44484,7 +44646,7 @@ function claimOneInProgressSkillsSync(baseUrl, remoteVersion, agent, owner) {
44484
44646
  return { state: "claimed", claimToken };
44485
44647
  };
44486
44648
  try {
44487
- (0, import_node_fs18.mkdirSync)((0, import_node_path23.dirname)(dir), { recursive: true });
44649
+ (0, import_node_fs18.mkdirSync)((0, import_node_path24.dirname)(dir), { recursive: true });
44488
44650
  return create();
44489
44651
  } catch (error) {
44490
44652
  if (errorCode(error) !== "EEXIST") return { state: "unavailable" };
@@ -44544,7 +44706,7 @@ function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
44544
44706
  if (!lease.claimToken) continue;
44545
44707
  try {
44546
44708
  (0, import_node_fs18.writeFileSync)(
44547
- (0, import_node_path23.join)(inProgressSkillsSyncPath(baseUrl, agent), "pid"),
44709
+ (0, import_node_path24.join)(inProgressSkillsSyncPath(baseUrl, agent), "pid"),
44548
44710
  `${process.pid}
44549
44711
  `,
44550
44712
  "utf-8"
@@ -44613,7 +44775,7 @@ function skillsInstallLeasePath(baseUrl, agents) {
44613
44775
  return sortedLeaseAgents(agents).map((agent) => inProgressSkillsSyncPath(baseUrl, agent)).join(", ");
44614
44776
  }
44615
44777
  function deferredSkillsNoticePath(baseUrl, agents) {
44616
- return (0, import_node_path23.join)(
44778
+ return (0, import_node_path24.join)(
44617
44779
  sdkCliStateDirPath(baseUrl),
44618
44780
  `skills-sync-notice-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}`
44619
44781
  );
@@ -44622,7 +44784,7 @@ function deferSkillsNotice(baseUrl, agents) {
44622
44784
  const path = deferredSkillsNoticePath(baseUrl, agents);
44623
44785
  return (text) => {
44624
44786
  try {
44625
- (0, import_node_fs18.mkdirSync)((0, import_node_path23.dirname)(path), { recursive: true });
44787
+ (0, import_node_fs18.mkdirSync)((0, import_node_path24.dirname)(path), { recursive: true });
44626
44788
  (0, import_node_fs18.appendFileSync)(path, `${text.trimEnd()}
44627
44789
  `, "utf-8");
44628
44790
  } catch {
@@ -44664,7 +44826,7 @@ function spawnDetachedSkillsSyncChild(argv, onSpawnError) {
44664
44826
  child.unref();
44665
44827
  }
44666
44828
  function failedSkillsSyncPath(baseUrl, agents) {
44667
- return (0, import_node_path23.join)(
44829
+ return (0, import_node_path24.join)(
44668
44830
  sdkCliStateDirPath(baseUrl),
44669
44831
  `skills-sync-failed-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}-version`
44670
44832
  );
@@ -44681,7 +44843,7 @@ function readMarkedSkillsSyncVersion(path) {
44681
44843
  }
44682
44844
  function writeMarkedSkillsSyncVersion(path, version) {
44683
44845
  try {
44684
- (0, import_node_fs18.mkdirSync)((0, import_node_path23.dirname)(path), { recursive: true });
44846
+ (0, import_node_fs18.mkdirSync)((0, import_node_path24.dirname)(path), { recursive: true });
44685
44847
  (0, import_node_fs18.writeFileSync)(path, `${version}
44686
44848
  `, "utf-8");
44687
44849
  return true;
@@ -44791,7 +44953,7 @@ function safeSkillFilePath(value) {
44791
44953
  }
44792
44954
  function installedSkillFiles(root, prefix = "") {
44793
44955
  const files = [];
44794
- for (const entry of (0, import_node_fs18.readdirSync)((0, import_node_path23.join)(root, prefix), {
44956
+ for (const entry of (0, import_node_fs18.readdirSync)((0, import_node_path24.join)(root, prefix), {
44795
44957
  withFileTypes: true
44796
44958
  })) {
44797
44959
  const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name;
@@ -44911,11 +45073,11 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
44911
45073
  controller.abort();
44912
45074
  }
44913
45075
  const home = (0, import_node_os13.homedir)();
44914
- const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || (0, import_node_path23.join)(home, ".claude");
45076
+ const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || (0, import_node_path24.join)(home, ".claude");
44915
45077
  for (const [name, { files }] of published) {
44916
45078
  for (const root of [
44917
- (0, import_node_path23.join)(home, ".agents", "skills", name),
44918
- (0, import_node_path23.join)(claudeConfigDir, "skills", name)
45079
+ (0, import_node_path24.join)(home, ".agents", "skills", name),
45080
+ (0, import_node_path24.join)(claudeConfigDir, "skills", name)
44919
45081
  ]) {
44920
45082
  const installed = installedSkillFiles(root);
44921
45083
  if (installed.length !== files.length || installed.some((file, index2) => file !== files[index2])) {
@@ -44923,7 +45085,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
44923
45085
  }
44924
45086
  for (const file of files) {
44925
45087
  const publishedContent = expected.get(`${name}/${file}`);
44926
- if (!publishedContent || !(0, import_node_fs18.readFileSync)((0, import_node_path23.join)(root, file)).equals(publishedContent)) {
45088
+ if (!publishedContent || !(0, import_node_fs18.readFileSync)((0, import_node_path24.join)(root, file)).equals(publishedContent)) {
44927
45089
  throw new Error(`installed content differs for ${name}/${file}`);
44928
45090
  }
44929
45091
  }
@@ -44977,7 +45139,7 @@ function probeInstallers(timeoutMs) {
44977
45139
  };
44978
45140
  }
44979
45141
  function noInstallerProbePath(baseUrl) {
44980
- return (0, import_node_path23.join)(
45142
+ return (0, import_node_path24.join)(
44981
45143
  sdkCliStateDirPath(baseUrl),
44982
45144
  "skills-sync-no-installer-unknown.json"
44983
45145
  );
@@ -44994,7 +45156,7 @@ function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
44994
45156
  const probes = probeInstallers(INSTALLER_PROBE_TIMEOUT_MS);
44995
45157
  if (probes.bunx !== "available" && probes.npx !== "available") {
44996
45158
  try {
44997
- (0, import_node_fs18.mkdirSync)((0, import_node_path23.dirname)(path), { recursive: true });
45159
+ (0, import_node_fs18.mkdirSync)((0, import_node_path24.dirname)(path), { recursive: true });
44998
45160
  (0, import_node_fs18.writeFileSync)(
44999
45161
  path,
45000
45162
  JSON.stringify({
@@ -45446,13 +45608,13 @@ function detectSkillsAgents(input2) {
45446
45608
  ];
45447
45609
  const detected = AGENT_MARKERS.filter(
45448
45610
  (marker) => roots.some(
45449
- (root) => marker.paths.some((path) => (0, import_node_fs19.existsSync)((0, import_node_path24.join)(root, path)))
45611
+ (root) => marker.paths.some((path) => (0, import_node_fs19.existsSync)((0, import_node_path25.join)(root, path)))
45450
45612
  )
45451
45613
  ).map((marker) => marker.agent);
45452
45614
  return detected.length > 0 ? detected : ["*"];
45453
45615
  }
45454
45616
  function skillsStatePathForScope(baseUrl, scope, root) {
45455
- return scope === "local" && root ? (0, import_node_path24.join)(root, ".deepline", "setup", "skills.json") : (0, import_node_path24.join)(sdkCliStateDirPath(baseUrl), "skills-install.json");
45617
+ return scope === "local" && root ? (0, import_node_path25.join)(root, ".deepline", "setup", "skills.json") : (0, import_node_path25.join)(sdkCliStateDirPath(baseUrl), "skills-install.json");
45456
45618
  }
45457
45619
  function buildSkillsPlan(input2) {
45458
45620
  const scopeArgs = input2.scope === "global" ? ["--global"] : [];
@@ -45723,7 +45885,7 @@ async function runSkillsInstallWithLease(input2) {
45723
45885
  `
45724
45886
  );
45725
45887
  }
45726
- (0, import_node_fs19.mkdirSync)((0, import_node_path24.dirname)(plan.statePath), { recursive: true });
45888
+ (0, import_node_fs19.mkdirSync)((0, import_node_path25.dirname)(plan.statePath), { recursive: true });
45727
45889
  (0, import_node_fs19.writeFileSync)(
45728
45890
  plan.statePath,
45729
45891
  `${JSON.stringify(
@@ -46002,7 +46164,7 @@ function buildPendingAuthorizationOutput(input2) {
46002
46164
  };
46003
46165
  }
46004
46166
  function setupStatePath(baseUrl, scope, root) {
46005
- return scope === "local" && root ? (0, import_node_path25.join)(root, ".deepline", "setup", "state.json") : (0, import_node_path25.join)(sdkCliStateDirPath(baseUrl), "setup.json");
46167
+ return scope === "local" && root ? (0, import_node_path26.join)(root, ".deepline", "setup", "state.json") : (0, import_node_path26.join)(sdkCliStateDirPath(baseUrl), "setup.json");
46006
46168
  }
46007
46169
  async function captureStdout2(run) {
46008
46170
  let stdout = "";
@@ -46050,7 +46212,7 @@ function resolvePathCommands(command) {
46050
46212
  );
46051
46213
  return [
46052
46214
  ...new Set(
46053
- String(lookup.stdout ?? "").split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((path) => (0, import_node_path25.resolve)(path))
46215
+ String(lookup.stdout ?? "").split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((path) => (0, import_node_path26.resolve)(path))
46054
46216
  )
46055
46217
  ];
46056
46218
  }
@@ -46083,7 +46245,7 @@ function resolvePersistentGlobalCommand(dependencies = {}) {
46083
46245
  if (prefix.status !== 0) return null;
46084
46246
  const root = String(prefix.stdout ?? "").trim();
46085
46247
  if (!root) return null;
46086
- const candidates = platform3 === "win32" ? [(0, import_node_path25.join)(root, "deepline.cmd"), (0, import_node_path25.join)(root, "deepline")] : [(0, import_node_path25.join)(root, "bin", "deepline")];
46248
+ const candidates = platform3 === "win32" ? [(0, import_node_path26.join)(root, "deepline.cmd"), (0, import_node_path26.join)(root, "deepline")] : [(0, import_node_path26.join)(root, "bin", "deepline")];
46087
46249
  return candidates.find((candidate) => pathExists(candidate)) ?? null;
46088
46250
  }
46089
46251
  function inspectGlobalCliAvailability(input2) {
@@ -46098,18 +46260,18 @@ function pathsResolveToSameFile(left, right) {
46098
46260
  try {
46099
46261
  return (0, import_node_fs20.realpathSync)(left) === (0, import_node_fs20.realpathSync)(right);
46100
46262
  } catch {
46101
- return (0, import_node_path25.resolve)(left) === (0, import_node_path25.resolve)(right);
46263
+ return (0, import_node_path26.resolve)(left) === (0, import_node_path26.resolve)(right);
46102
46264
  }
46103
46265
  }
46104
46266
  function isKnownDeeplineCommand(path) {
46105
- const entrypoint = process.argv[1] ? (0, import_node_path25.resolve)(process.argv[1]) : "";
46267
+ const entrypoint = process.argv[1] ? (0, import_node_path26.resolve)(process.argv[1]) : "";
46106
46268
  let resolvedPath = path;
46107
46269
  try {
46108
46270
  resolvedPath = (0, import_node_fs20.realpathSync)(path);
46109
46271
  } catch {
46110
46272
  }
46111
46273
  if (entrypoint && resolvedPath === entrypoint) return true;
46112
- if (resolvedPath.includes(`${(0, import_node_path25.join)("node_modules", "deepline")}`)) return true;
46274
+ if (resolvedPath.includes(`${(0, import_node_path26.join)("node_modules", "deepline")}`)) return true;
46113
46275
  const content = safeRead(path);
46114
46276
  return content.includes("node_modules/deepline") || content.includes("node_modules\\deepline") || content.includes("DEEPLINE_CONFIG_SCOPE") || content.includes("deepline-real");
46115
46277
  }
@@ -46119,7 +46281,7 @@ function inspectPathConflict() {
46119
46281
  try {
46120
46282
  if ((0, import_node_fs20.lstatSync)(commandPath).isSymbolicLink()) {
46121
46283
  const target = (0, import_node_fs20.realpathSync)(commandPath);
46122
- if (target.includes(`${(0, import_node_path25.join)("node_modules", "deepline")}`)) return null;
46284
+ if (target.includes(`${(0, import_node_path26.join)("node_modules", "deepline")}`)) return null;
46123
46285
  }
46124
46286
  } catch {
46125
46287
  }
@@ -46127,7 +46289,7 @@ function inspectPathConflict() {
46127
46289
  }
46128
46290
  function writeSetupState(input2) {
46129
46291
  const path = setupStatePath(input2.baseUrl, input2.scope, input2.root);
46130
- (0, import_node_fs20.mkdirSync)((0, import_node_path25.dirname)(path), { recursive: true });
46292
+ (0, import_node_fs20.mkdirSync)((0, import_node_path26.dirname)(path), { recursive: true });
46131
46293
  (0, import_node_fs20.writeFileSync)(
46132
46294
  path,
46133
46295
  `${JSON.stringify(
@@ -46168,7 +46330,7 @@ function failSetupPhase(phases, phase, code) {
46168
46330
  phases[phase] = { status: "failed", code };
46169
46331
  }
46170
46332
  function rollbackCommand(scope, root) {
46171
- const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path25.join)(root, ".deepline", "runtime"))}` : "";
46333
+ const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path26.join)(root, ".deepline", "runtime"))}` : "";
46172
46334
  const allowScriptsFlag = npmSupportsAllowScripts(readNpmVersion(process.env)) ? " --allow-scripts=esbuild" : "";
46173
46335
  return `npm install -g${prefix} --no-audit --no-fund --include=optional${allowScriptsFlag} deepline@${SDK_VERSION}`;
46174
46336
  }
@@ -46258,12 +46420,12 @@ function buildDoctorAssessment(input2) {
46258
46420
  const connected = input2.authStatus.payload?.connected === true;
46259
46421
  const authScopeOk = input2.scope === "local" ? Boolean(projectAuth) : Boolean(apiKey && !projectAuth);
46260
46422
  const skillsOk = skillsState?.scope === input2.scope && typeof skillsState.skillsVersion === "string" && Array.isArray(skillsState.agents) && skillsState.agents.length > 0;
46261
- const runningCliPath = process.argv[1] ? (0, import_node_path25.resolve)(process.argv[1]) : null;
46423
+ const runningCliPath = process.argv[1] ? (0, import_node_path26.resolve)(process.argv[1]) : null;
46262
46424
  const globalCli = input2.scope === "global" ? inspectGlobalCliAvailability() : null;
46263
46425
  const pathGlobalCli = globalCli?.path ?? null;
46264
46426
  const cliPath = input2.scope === "global" ? pathGlobalCli : runningCliPath;
46265
46427
  const cliScopeOk = input2.scope === "global" ? Boolean(pathGlobalCli) : Boolean(
46266
- input2.root && runningCliPath?.includes((0, import_node_path25.join)(input2.root, ".deepline", "runtime"))
46428
+ input2.root && runningCliPath?.includes((0, import_node_path26.join)(input2.root, ".deepline", "runtime"))
46267
46429
  );
46268
46430
  const checks = {
46269
46431
  cli: {
@@ -46883,7 +47045,7 @@ var import_node_fs24 = require("fs");
46883
47045
  // src/cli/update-preferences.ts
46884
47046
  var import_node_fs21 = require("fs");
46885
47047
  var import_node_os16 = require("os");
46886
- var import_node_path26 = require("path");
47048
+ var import_node_path27 = require("path");
46887
47049
  var UPDATE_PREFERENCES_SCHEMA_VERSION = 1;
46888
47050
  var CLI_UPDATE_MESSAGES = [
46889
47051
  {
@@ -46912,7 +47074,7 @@ function unreadablePreferences(path, error) {
46912
47074
  };
46913
47075
  }
46914
47076
  function cliUpdatePreferencesPath(homeDir2 = (0, import_node_os16.homedir)()) {
46915
- return (0, import_node_path26.join)(
47077
+ return (0, import_node_path27.join)(
46916
47078
  homeDir2,
46917
47079
  ".local",
46918
47080
  "deepline",
@@ -46940,7 +47102,7 @@ function readCliUpdatePreferences(homeDir2 = (0, import_node_os16.homedir)()) {
46940
47102
  function writeCliUpdatePreferences(preferences, homeDir2 = (0, import_node_os16.homedir)()) {
46941
47103
  const path = cliUpdatePreferencesPath(homeDir2);
46942
47104
  const tempPath = `${path}.${process.pid}.tmp`;
46943
- (0, import_node_fs21.mkdirSync)((0, import_node_path26.dirname)(path), { recursive: true });
47105
+ (0, import_node_fs21.mkdirSync)((0, import_node_path27.dirname)(path), { recursive: true });
46944
47106
  try {
46945
47107
  (0, import_node_fs21.writeFileSync)(tempPath, `${JSON.stringify(preferences, null, 2)}
46946
47108
  `, {
@@ -47001,12 +47163,12 @@ function consumePendingCliUpdateMessages(homeDir2 = (0, import_node_os16.homedir
47001
47163
  var import_node_child_process6 = require("child_process");
47002
47164
  var import_node_fs23 = require("fs");
47003
47165
  var import_node_os17 = require("os");
47004
- var import_node_path28 = require("path");
47166
+ var import_node_path29 = require("path");
47005
47167
 
47006
47168
  // src/cli/install-integrity.ts
47007
47169
  var import_node_module2 = require("module");
47008
47170
  var import_node_fs22 = require("fs");
47009
- var import_node_path27 = require("path");
47171
+ var import_node_path28 = require("path");
47010
47172
  var SDK_SIDECAR_CRITICAL_PACKAGE_FILES = [
47011
47173
  "dist/cli/index.mjs",
47012
47174
  "dist/index.mjs",
@@ -47025,7 +47187,7 @@ var SDK_SIDECAR_CRITICAL_DEPENDENCY_FILES = [
47025
47187
  "esbuild/lib/main.js"
47026
47188
  ];
47027
47189
  function safeRelativePath(value) {
47028
- if (typeof value !== "string" || !value || (0, import_node_path27.isAbsolute)(value)) return false;
47190
+ if (typeof value !== "string" || !value || (0, import_node_path28.isAbsolute)(value)) return false;
47029
47191
  const segments = value.split(/[\\/]+/);
47030
47192
  return segments.every(
47031
47193
  (segment) => Boolean(segment) && segment !== "." && segment !== ".."
@@ -47033,9 +47195,9 @@ function safeRelativePath(value) {
47033
47195
  }
47034
47196
  function resolveContainedPath(root, value) {
47035
47197
  if (!safeRelativePath(value)) return null;
47036
- const target = (0, import_node_path27.resolve)(root, value);
47037
- const relativeTarget = (0, import_node_path27.relative)((0, import_node_path27.resolve)(root), target);
47038
- if (!relativeTarget || relativeTarget.startsWith("..") || (0, import_node_path27.isAbsolute)(relativeTarget)) {
47198
+ const target = (0, import_node_path28.resolve)(root, value);
47199
+ const relativeTarget = (0, import_node_path28.relative)((0, import_node_path28.resolve)(root), target);
47200
+ if (!relativeTarget || relativeTarget.startsWith("..") || (0, import_node_path28.isAbsolute)(relativeTarget)) {
47039
47201
  return null;
47040
47202
  }
47041
47203
  return target;
@@ -47051,7 +47213,7 @@ function isFile(path) {
47051
47213
  }
47052
47214
  }
47053
47215
  function readManifest(packageRoot) {
47054
- const packageJsonPath = (0, import_node_path27.join)(packageRoot, "package.json");
47216
+ const packageJsonPath = (0, import_node_path28.join)(packageRoot, "package.json");
47055
47217
  let packageJson;
47056
47218
  try {
47057
47219
  packageJson = parseJson(packageJsonPath);
@@ -47125,8 +47287,8 @@ function readManifest(packageRoot) {
47125
47287
  return { mode: "manifest", manifest };
47126
47288
  }
47127
47289
  function inspectSdkSidecarInstall(versionDir) {
47128
- const nodeModulesRoot = (0, import_node_path27.join)(versionDir, "node_modules");
47129
- const packageRoot = (0, import_node_path27.join)(nodeModulesRoot, "deepline");
47290
+ const nodeModulesRoot = (0, import_node_path28.join)(versionDir, "node_modules");
47291
+ const packageRoot = (0, import_node_path28.join)(nodeModulesRoot, "deepline");
47130
47292
  const manifestResult = readManifest(packageRoot);
47131
47293
  if ("invalidReason" in manifestResult) {
47132
47294
  return {
@@ -47137,8 +47299,8 @@ function inspectSdkSidecarInstall(versionDir) {
47137
47299
  };
47138
47300
  }
47139
47301
  const missing = [
47140
- ...manifestResult.manifest.packageFiles.filter((path) => !isFile((0, import_node_path27.join)(packageRoot, path))).map((path) => `deepline/${path}`),
47141
- ...manifestResult.manifest.dependencyFiles.filter((path) => !isFile((0, import_node_path27.join)(nodeModulesRoot, path))).map((path) => `node_modules/${path}`)
47302
+ ...manifestResult.manifest.packageFiles.filter((path) => !isFile((0, import_node_path28.join)(packageRoot, path))).map((path) => `deepline/${path}`),
47303
+ ...manifestResult.manifest.dependencyFiles.filter((path) => !isFile((0, import_node_path28.join)(nodeModulesRoot, path))).map((path) => `node_modules/${path}`)
47142
47304
  ];
47143
47305
  return {
47144
47306
  ok: missing.length === 0,
@@ -47149,7 +47311,7 @@ function inspectSdkSidecarInstall(versionDir) {
47149
47311
  }
47150
47312
  function probeSdkSidecarEsbuild(versionDir) {
47151
47313
  try {
47152
- const requireFromInstall = (0, import_node_module2.createRequire)((0, import_node_path27.join)(versionDir, "package.json"));
47314
+ const requireFromInstall = (0, import_node_module2.createRequire)((0, import_node_path28.join)(versionDir, "package.json"));
47153
47315
  const esbuild = requireFromInstall("esbuild");
47154
47316
  if (typeof esbuild.transformSync !== "function") {
47155
47317
  return "esbuild does not export transformSync";
@@ -47218,7 +47380,7 @@ function sidecarStateDir(input2) {
47218
47380
  if (!scope || scope.includes("/") || scope.includes("\\")) {
47219
47381
  return null;
47220
47382
  }
47221
- return (0, import_node_path28.join)(input2.homeDir, ".local", "deepline", scope, "sdk-cli");
47383
+ return (0, import_node_path29.join)(input2.homeDir, ".local", "deepline", scope, "sdk-cli");
47222
47384
  }
47223
47385
  function sidecarRegistryUrl(hostUrl) {
47224
47386
  let url;
@@ -47253,19 +47415,19 @@ function readOptionalText(path) {
47253
47415
  function resolvePythonSidecarUpdatePlan(options) {
47254
47416
  const stateDir = sidecarStateDir(options);
47255
47417
  if (!stateDir) return null;
47256
- const relativeEntrypoint = (0, import_node_path28.relative)(
47257
- (0, import_node_path28.resolve)(stateDir),
47258
- (0, import_node_path28.resolve)(options.entrypoint)
47418
+ const relativeEntrypoint = (0, import_node_path29.relative)(
47419
+ (0, import_node_path29.resolve)(stateDir),
47420
+ (0, import_node_path29.resolve)(options.entrypoint)
47259
47421
  );
47260
- if (!relativeEntrypoint || relativeEntrypoint.startsWith("..") || (0, import_node_path28.isAbsolute)(relativeEntrypoint)) {
47422
+ if (!relativeEntrypoint || relativeEntrypoint.startsWith("..") || (0, import_node_path29.isAbsolute)(relativeEntrypoint)) {
47261
47423
  return null;
47262
47424
  }
47263
- const installMethod = readOptionalText((0, import_node_path28.join)(stateDir, ".install-method"));
47425
+ const installMethod = readOptionalText((0, import_node_path29.join)(stateDir, ".install-method"));
47264
47426
  if (installMethod !== "python-sidecar") return null;
47265
47427
  const scope = options.env.DEEPLINE_CONFIG_SCOPE?.trim() || "";
47266
47428
  const hostUrl = options.env.DEEPLINE_HOST_URL?.trim() || "";
47267
- const nodeBin = readOptionalText((0, import_node_path28.join)(stateDir, ".node-bin")) || process.execPath;
47268
- const sidecarPath = readOptionalText((0, import_node_path28.join)(stateDir, ".command-path")) || (0, import_node_path28.join)(
47429
+ const nodeBin = readOptionalText((0, import_node_path29.join)(stateDir, ".node-bin")) || process.execPath;
47430
+ const sidecarPath = readOptionalText((0, import_node_path29.join)(stateDir, ".command-path")) || (0, import_node_path29.join)(
47269
47431
  stateDir,
47270
47432
  "bin",
47271
47433
  process.platform === "win32" ? "deepline-sdk.cmd" : "deepline-sdk"
@@ -47273,7 +47435,7 @@ function resolvePythonSidecarUpdatePlan(options) {
47273
47435
  const packageSpec = options.packageSpec || "deepline@latest";
47274
47436
  const npmCommand = "npm";
47275
47437
  const registryUrl = sidecarRegistryUrl(hostUrl);
47276
- const versionDir = (0, import_node_path28.join)(stateDir, "versions", "<version>");
47438
+ const versionDir = (0, import_node_path29.join)(stateDir, "versions", "<version>");
47277
47439
  const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote5(versionDir)} --registry ${shellQuote5(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote5).join(" ")} ${shellQuote5(packageSpec)}`;
47278
47440
  return {
47279
47441
  kind: "python-sidecar",
@@ -47289,16 +47451,16 @@ function resolvePythonSidecarUpdatePlan(options) {
47289
47451
  };
47290
47452
  }
47291
47453
  function findRepoBackedSdkRoot(startPath) {
47292
- let current = (0, import_node_path28.resolve)(startPath);
47454
+ let current = (0, import_node_path29.resolve)(startPath);
47293
47455
  while (true) {
47294
- if ((0, import_node_fs23.existsSync)((0, import_node_path28.join)(current, "package.json")) && (0, import_node_fs23.existsSync)((0, import_node_path28.join)(current, "bin", "deepline-dev.ts"))) {
47295
- const parent2 = (0, import_node_path28.dirname)(current);
47296
- return (0, import_node_path28.basename)(parent2) === "packages" && (0, import_node_path28.basename)(current) === "sdk" ? (0, import_node_path28.dirname)(parent2) : parent2;
47456
+ if ((0, import_node_fs23.existsSync)((0, import_node_path29.join)(current, "package.json")) && (0, import_node_fs23.existsSync)((0, import_node_path29.join)(current, "bin", "deepline-dev.ts"))) {
47457
+ const parent2 = (0, import_node_path29.dirname)(current);
47458
+ return (0, import_node_path29.basename)(parent2) === "packages" && (0, import_node_path29.basename)(current) === "sdk" ? (0, import_node_path29.dirname)(parent2) : parent2;
47297
47459
  }
47298
- if ((0, import_node_fs23.existsSync)((0, import_node_path28.join)(current, "sdk", "package.json")) && (0, import_node_fs23.existsSync)((0, import_node_path28.join)(current, "sdk", "bin", "deepline-dev.ts"))) {
47460
+ if ((0, import_node_fs23.existsSync)((0, import_node_path29.join)(current, "sdk", "package.json")) && (0, import_node_fs23.existsSync)((0, import_node_path29.join)(current, "sdk", "bin", "deepline-dev.ts"))) {
47299
47461
  return current;
47300
47462
  }
47301
- const parent = (0, import_node_path28.dirname)(current);
47463
+ const parent = (0, import_node_path29.dirname)(current);
47302
47464
  if (parent === current) return null;
47303
47465
  current = parent;
47304
47466
  }
@@ -47308,7 +47470,7 @@ function inferNpmGlobalPrefixFromEntrypoint(entrypoint, env) {
47308
47470
  try {
47309
47471
  return (0, import_node_fs23.realpathSync)(entrypoint);
47310
47472
  } catch {
47311
- return (0, import_node_path28.resolve)(entrypoint);
47473
+ return (0, import_node_path29.resolve)(entrypoint);
47312
47474
  }
47313
47475
  })();
47314
47476
  const parts = normalized.split(/[\\/]+/);
@@ -47323,10 +47485,10 @@ function inferNpmGlobalPrefixFromEntrypoint(entrypoint, env) {
47323
47485
  const directPrefix = prefixParts.join("/").toLowerCase();
47324
47486
  const knownWindowsPrefixes = [
47325
47487
  env.npm_config_prefix,
47326
- env.APPDATA ? (0, import_node_path28.join)(env.APPDATA, "npm") : void 0
47327
- ].filter((value) => Boolean(value)).map((value) => (0, import_node_path28.resolve)(value).replace(/\\/g, "/").toLowerCase());
47488
+ env.APPDATA ? (0, import_node_path29.join)(env.APPDATA, "npm") : void 0
47489
+ ].filter((value) => Boolean(value)).map((value) => (0, import_node_path29.resolve)(value).replace(/\\/g, "/").toLowerCase());
47328
47490
  if (!knownWindowsPrefixes.includes(
47329
- (0, import_node_path28.resolve)(directPrefix).replace(/\\/g, "/").toLowerCase()
47491
+ (0, import_node_path29.resolve)(directPrefix).replace(/\\/g, "/").toLowerCase()
47330
47492
  )) {
47331
47493
  return null;
47332
47494
  }
@@ -47339,9 +47501,9 @@ function normalizedNpmPrefix(value) {
47339
47501
  if (!trimmed) return null;
47340
47502
  const normalized = (() => {
47341
47503
  try {
47342
- return (0, import_node_fs23.realpathSync)((0, import_node_path28.resolve)(trimmed));
47504
+ return (0, import_node_fs23.realpathSync)((0, import_node_path29.resolve)(trimmed));
47343
47505
  } catch {
47344
- return (0, import_node_path28.resolve)(trimmed);
47506
+ return (0, import_node_path29.resolve)(trimmed);
47345
47507
  }
47346
47508
  })().replace(/\\/g, "/");
47347
47509
  return process.platform === "win32" ? normalized.toLowerCase() : normalized;
@@ -47366,7 +47528,7 @@ function isHomebrewFormulaEntrypoint(entrypoint) {
47366
47528
  try {
47367
47529
  return (0, import_node_fs23.realpathSync)(entrypoint);
47368
47530
  } catch {
47369
- return (0, import_node_path28.resolve)(entrypoint);
47531
+ return (0, import_node_path29.resolve)(entrypoint);
47370
47532
  }
47371
47533
  })();
47372
47534
  const parts = normalized.split(/[\\/]+/);
@@ -47376,8 +47538,8 @@ function isHomebrewFormulaEntrypoint(entrypoint) {
47376
47538
  function resolveUpdatePlan(options = {}) {
47377
47539
  const env = options.env ?? process.env;
47378
47540
  const homeDir2 = options.homeDir ?? (0, import_node_os17.homedir)();
47379
- const entrypoint = options.entrypoint ?? (process.argv[1] ? (0, import_node_path28.resolve)(process.argv[1]) : "");
47380
- const sourceRoot = entrypoint ? findRepoBackedSdkRoot((0, import_node_path28.dirname)(entrypoint)) : null;
47541
+ const entrypoint = options.entrypoint ?? (process.argv[1] ? (0, import_node_path29.resolve)(process.argv[1]) : "");
47542
+ const sourceRoot = entrypoint ? findRepoBackedSdkRoot((0, import_node_path29.dirname)(entrypoint)) : null;
47381
47543
  if (sourceRoot) {
47382
47544
  return {
47383
47545
  kind: "source",
@@ -47430,9 +47592,9 @@ var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
47430
47592
  function autoUpdateFailurePath(plan) {
47431
47593
  if (plan.kind === "source" || plan.kind === "homebrew") return null;
47432
47594
  if (plan.kind === "python-sidecar") {
47433
- return (0, import_node_path28.join)(plan.stateDir, AUTO_UPDATE_FAILURE_FILE);
47595
+ return (0, import_node_path29.join)(plan.stateDir, AUTO_UPDATE_FAILURE_FILE);
47434
47596
  }
47435
- return (0, import_node_path28.join)(
47597
+ return (0, import_node_path29.join)(
47436
47598
  (0, import_node_os17.homedir)(),
47437
47599
  ".local",
47438
47600
  "deepline",
@@ -47471,7 +47633,7 @@ function writeAutoUpdateFailure(plan, exitCode) {
47471
47633
  manualCommand: plan.manualCommand
47472
47634
  };
47473
47635
  try {
47474
- (0, import_node_fs23.mkdirSync)((0, import_node_path28.dirname)(path), { recursive: true });
47636
+ (0, import_node_fs23.mkdirSync)((0, import_node_path29.dirname)(path), { recursive: true });
47475
47637
  (0, import_node_fs23.writeFileSync)(path, `${JSON.stringify(marker, null, 2)}
47476
47638
  `, "utf8");
47477
47639
  } catch {
@@ -47519,7 +47681,7 @@ function safeVersionSegment(value) {
47519
47681
  return /^[0-9A-Za-z._-]+$/.test(normalized) ? normalized : "";
47520
47682
  }
47521
47683
  function entryPathInVersionDir(versionDir) {
47522
- return (0, import_node_path28.join)(
47684
+ return (0, import_node_path29.join)(
47523
47685
  versionDir,
47524
47686
  "node_modules",
47525
47687
  "deepline",
@@ -47529,7 +47691,7 @@ function entryPathInVersionDir(versionDir) {
47529
47691
  );
47530
47692
  }
47531
47693
  function installedPackageVersion(versionDir) {
47532
- const packageJsonPath = (0, import_node_path28.join)(
47694
+ const packageJsonPath = (0, import_node_path29.join)(
47533
47695
  versionDir,
47534
47696
  "node_modules",
47535
47697
  "deepline",
@@ -47651,16 +47813,16 @@ async function runNpmInstallWithRegistryFallback(input2) {
47651
47813
  return first.exitCode;
47652
47814
  }
47653
47815
  function writeSidecarLauncher(input2) {
47654
- (0, import_node_fs23.mkdirSync)((0, import_node_path28.dirname)(input2.path), { recursive: true });
47655
- const packageRoot = (0, import_node_path28.dirname)((0, import_node_path28.dirname)((0, import_node_path28.dirname)(input2.entryPath)));
47656
- const versionDir = (0, import_node_path28.dirname)((0, import_node_path28.dirname)(packageRoot));
47816
+ (0, import_node_fs23.mkdirSync)((0, import_node_path29.dirname)(input2.path), { recursive: true });
47817
+ const packageRoot = (0, import_node_path29.dirname)((0, import_node_path29.dirname)((0, import_node_path29.dirname)(input2.entryPath)));
47818
+ const versionDir = (0, import_node_path29.dirname)((0, import_node_path29.dirname)(packageRoot));
47657
47819
  const esbuildProbe = "const {createRequire}=require('node:module');const path=require('node:path');const req=createRequire(path.join(process.argv[1],'package.json'));const result=req('esbuild').transformSync('const value: number = 1;',{loader:'ts'});if(!result||typeof result.code!=='string')process.exit(3);";
47658
47820
  const criticalPaths = [
47659
47821
  ...SDK_SIDECAR_CRITICAL_PACKAGE_FILES.map(
47660
- (path) => (0, import_node_path28.join)(packageRoot, path)
47822
+ (path) => (0, import_node_path29.join)(packageRoot, path)
47661
47823
  ),
47662
47824
  ...SDK_SIDECAR_CRITICAL_DEPENDENCY_FILES.map(
47663
- (path) => (0, import_node_path28.join)(versionDir, "node_modules", path)
47825
+ (path) => (0, import_node_path29.join)(versionDir, "node_modules", path)
47664
47826
  )
47665
47827
  ];
47666
47828
  if (process.platform === "win32") {
@@ -47714,17 +47876,17 @@ function writeSidecarLauncher(input2) {
47714
47876
  );
47715
47877
  }
47716
47878
  async function runPythonSidecarUpdatePlan(plan) {
47717
- const versionsDir = (0, import_node_path28.join)(plan.stateDir, "versions");
47718
- const tempDir = (0, import_node_path28.join)(
47879
+ const versionsDir = (0, import_node_path29.join)(plan.stateDir, "versions");
47880
+ const tempDir = (0, import_node_path29.join)(
47719
47881
  versionsDir,
47720
47882
  `.tmp-sdk-update-${process.pid}-${Date.now()}`
47721
47883
  );
47722
47884
  (0, import_node_fs23.rmSync)(tempDir, { recursive: true, force: true });
47723
47885
  (0, import_node_fs23.mkdirSync)(tempDir, { recursive: true });
47724
- (0, import_node_fs23.writeFileSync)((0, import_node_path28.join)(tempDir, "package.json"), NPM_SDK_SIDECAR_PACKAGE_JSON);
47886
+ (0, import_node_fs23.writeFileSync)((0, import_node_path29.join)(tempDir, "package.json"), NPM_SDK_SIDECAR_PACKAGE_JSON);
47725
47887
  const env = {
47726
47888
  ...process.env,
47727
- PATH: `${(0, import_node_path28.dirname)(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
47889
+ PATH: `${(0, import_node_path29.dirname)(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
47728
47890
  };
47729
47891
  const installResult = await runCommand(
47730
47892
  plan.npmCommand,
@@ -47761,7 +47923,7 @@ async function runPythonSidecarUpdatePlan(plan) {
47761
47923
  (0, import_node_fs23.rmSync)(tempDir, { recursive: true, force: true });
47762
47924
  return 1;
47763
47925
  }
47764
- const finalDir = (0, import_node_path28.join)(versionsDir, installedVersion);
47926
+ const finalDir = (0, import_node_path29.join)(versionsDir, installedVersion);
47765
47927
  const finalEntryPath = entryPathInVersionDir(finalDir);
47766
47928
  const finalFailure = sidecarInstallFailure(finalDir);
47767
47929
  let backupDir = null;
@@ -47770,7 +47932,7 @@ async function runPythonSidecarUpdatePlan(plan) {
47770
47932
  } else {
47771
47933
  let shouldPublishTemp = true;
47772
47934
  if ((0, import_node_fs23.existsSync)(finalDir)) {
47773
- backupDir = (0, import_node_path28.join)(
47935
+ backupDir = (0, import_node_path29.join)(
47774
47936
  versionsDir,
47775
47937
  `.backup-${installedVersion}-${process.pid}-${Date.now()}`
47776
47938
  );
@@ -47845,27 +48007,27 @@ async function runPythonSidecarUpdatePlan(plan) {
47845
48007
  entryPath: finalEntryPath
47846
48008
  });
47847
48009
  (0, import_node_fs23.writeFileSync)(
47848
- (0, import_node_path28.join)(plan.stateDir, ".version"),
48010
+ (0, import_node_path29.join)(plan.stateDir, ".version"),
47849
48011
  `${installedVersion}
47850
48012
  `,
47851
48013
  "utf8"
47852
48014
  );
47853
48015
  (0, import_node_fs23.writeFileSync)(
47854
- (0, import_node_path28.join)(plan.stateDir, ".install-method"),
48016
+ (0, import_node_path29.join)(plan.stateDir, ".install-method"),
47855
48017
  "python-sidecar\n",
47856
48018
  "utf8"
47857
48019
  );
47858
48020
  (0, import_node_fs23.writeFileSync)(
47859
- (0, import_node_path28.join)(plan.stateDir, ".command-path"),
48021
+ (0, import_node_path29.join)(plan.stateDir, ".command-path"),
47860
48022
  `${plan.sidecarPath}
47861
48023
  `,
47862
48024
  "utf8"
47863
48025
  );
47864
- (0, import_node_fs23.writeFileSync)((0, import_node_path28.join)(plan.stateDir, ".runner"), "node\n", "utf8");
47865
- (0, import_node_fs23.writeFileSync)((0, import_node_path28.join)(plan.stateDir, ".node-bin"), `${plan.nodeBin}
48026
+ (0, import_node_fs23.writeFileSync)((0, import_node_path29.join)(plan.stateDir, ".runner"), "node\n", "utf8");
48027
+ (0, import_node_fs23.writeFileSync)((0, import_node_path29.join)(plan.stateDir, ".node-bin"), `${plan.nodeBin}
47866
48028
  `, "utf8");
47867
48029
  (0, import_node_fs23.writeFileSync)(
47868
- (0, import_node_path28.join)(plan.stateDir, ".entry-path"),
48030
+ (0, import_node_path29.join)(plan.stateDir, ".entry-path"),
47869
48031
  `${finalEntryPath}
47870
48032
  `,
47871
48033
  "utf8"
@@ -48936,12 +49098,12 @@ function stableStringify(value) {
48936
49098
  // src/cli/commands/tools.ts
48937
49099
  var import_node_fs26 = require("fs");
48938
49100
  var import_node_os19 = require("os");
48939
- var import_node_path30 = require("path");
49101
+ var import_node_path31 = require("path");
48940
49102
 
48941
49103
  // src/tool-output.ts
48942
49104
  var import_node_fs25 = require("fs");
48943
49105
  var import_node_os18 = require("os");
48944
- var import_node_path29 = require("path");
49106
+ var import_node_path30 = require("path");
48945
49107
  function isPlainObject(value) {
48946
49108
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
48947
49109
  }
@@ -49068,19 +49230,19 @@ function projectRowOutput(conversion) {
49068
49230
  };
49069
49231
  }
49070
49232
  function ensureOutputDir() {
49071
- const outputDir = (0, import_node_path29.join)((0, import_node_os18.homedir)(), ".local", "share", "deepline", "data");
49233
+ const outputDir = (0, import_node_path30.join)((0, import_node_os18.homedir)(), ".local", "share", "deepline", "data");
49072
49234
  (0, import_node_fs25.mkdirSync)(outputDir, { recursive: true });
49073
49235
  return outputDir;
49074
49236
  }
49075
49237
  function writeJsonOutputFile(payload, stem) {
49076
49238
  const outputDir = ensureOutputDir();
49077
- const outputPath = (0, import_node_path29.join)(outputDir, `${stem}_${Date.now()}.json`);
49239
+ const outputPath = (0, import_node_path30.join)(outputDir, `${stem}_${Date.now()}.json`);
49078
49240
  (0, import_node_fs25.writeFileSync)(outputPath, JSON.stringify(payload, null, 2), "utf-8");
49079
49241
  return outputPath;
49080
49242
  }
49081
49243
  function writeCsvOutputFile(rows, stem, options) {
49082
- const outputPath = options?.outPath ? options.outPath : (0, import_node_path29.join)(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
49083
- (0, import_node_fs25.mkdirSync)((0, import_node_path29.dirname)(outputPath), { recursive: true });
49244
+ const outputPath = options?.outPath ? options.outPath : (0, import_node_path30.join)(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
49245
+ (0, import_node_fs25.mkdirSync)((0, import_node_path30.dirname)(outputPath), { recursive: true });
49084
49246
  const columns = columnsForRows(rows);
49085
49247
  const escapeCell = (value) => {
49086
49248
  const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
@@ -51280,10 +51442,10 @@ function normalizeOutputFormat(raw) {
51280
51442
  }
51281
51443
  function resolveAtFilePath(rawPath) {
51282
51444
  const trimmed = rawPath.trim();
51283
- const resolved = (0, import_node_path30.resolve)(trimmed);
51445
+ const resolved = (0, import_node_path31.resolve)(trimmed);
51284
51446
  if ((0, import_node_fs26.existsSync)(resolved)) return resolved;
51285
51447
  if (process.platform !== "win32" && trimmed.includes("\\")) {
51286
- const normalized = (0, import_node_path30.resolve)(trimmed.replace(/\\/g, "/"));
51448
+ const normalized = (0, import_node_path31.resolve)(trimmed.replace(/\\/g, "/"));
51287
51449
  if ((0, import_node_fs26.existsSync)(normalized)) return normalized;
51288
51450
  }
51289
51451
  return resolved;
@@ -51396,7 +51558,7 @@ function parseExecuteOptions(args) {
51396
51558
  continue;
51397
51559
  }
51398
51560
  if ((arg === "--out" || arg === "-o") && args[index + 1]) {
51399
- outPath = (0, import_node_path30.resolve)(args[++index]);
51561
+ outPath = (0, import_node_path31.resolve)(args[++index]);
51400
51562
  continue;
51401
51563
  }
51402
51564
  throw new Error(`Unknown option: ${arg}`);
@@ -51434,13 +51596,13 @@ function parseToolExecuteTimeout(raw) {
51434
51596
  function pendingToolExecutionPath(input2) {
51435
51597
  const config = resolveConfig();
51436
51598
  const fingerprint = (0, import_node_crypto12.createHash)("sha256").update(config.baseUrl).update("\0").update((0, import_node_crypto12.createHash)("sha256").update(config.apiKey).digest("hex")).update("\0").update(input2.toolId).update("\0").update(stableStringify(input2.params)).update("\0").update(input2.responseIntent).digest("hex");
51437
- return (0, import_node_path30.join)(
51599
+ return (0, import_node_path31.join)(
51438
51600
  sdkCliStateDirPath(resolveConfig().baseUrl),
51439
51601
  `pending-tool-execution-${fingerprint}.json`
51440
51602
  );
51441
51603
  }
51442
51604
  function loadOrCreatePendingToolExecution(path) {
51443
- (0, import_node_fs26.mkdirSync)((0, import_node_path30.dirname)(path), { recursive: true });
51605
+ (0, import_node_fs26.mkdirSync)((0, import_node_path31.dirname)(path), { recursive: true });
51444
51606
  if ((0, import_node_fs26.existsSync)(path)) {
51445
51607
  return readPendingToolExecution(path);
51446
51608
  }
@@ -51518,9 +51680,9 @@ function starterScriptJson(script) {
51518
51680
  function seedToolListScript(input2) {
51519
51681
  const stem = safeFileStem(input2.toolId);
51520
51682
  const fileName = `${stem}-workflow-seed-${Date.now()}.play.ts`;
51521
- const scriptDir = (0, import_node_fs26.mkdtempSync)((0, import_node_path30.join)((0, import_node_os19.tmpdir)(), "deepline-workflow-seed-"));
51683
+ const scriptDir = (0, import_node_fs26.mkdtempSync)((0, import_node_path31.join)((0, import_node_os19.tmpdir)(), "deepline-workflow-seed-"));
51522
51684
  (0, import_node_fs26.chmodSync)(scriptDir, 448);
51523
- const scriptPath = (0, import_node_path30.join)(scriptDir, fileName);
51685
+ const scriptPath = (0, import_node_path31.join)(scriptDir, fileName);
51524
51686
  const projectDir = `deepline/projects/${stem}-workflow`;
51525
51687
  const playName = `${stem}-workflow`;
51526
51688
  const sampleRows = input2.rows.length > 0 ? `${JSON.stringify(input2.rows.slice(0, 2)).replace(/\]$/, "")}, ...]` : "[]";
@@ -52025,8 +52187,8 @@ Examples:
52025
52187
  }
52026
52188
 
52027
52189
  // src/cli/commands/workflow.ts
52028
- var import_promises13 = require("fs/promises");
52029
- var import_node_path31 = require("path");
52190
+ var import_promises14 = require("fs/promises");
52191
+ var import_node_path32 = require("path");
52030
52192
 
52031
52193
  // src/cli/workflow-to-play.ts
52032
52194
  var import_node_crypto13 = require("crypto");
@@ -52243,7 +52405,7 @@ function readStatus(payload) {
52243
52405
  }
52244
52406
  async function readJsonOption(payload, file) {
52245
52407
  if (file) {
52246
- const raw = await (0, import_promises13.readFile)((0, import_node_path31.resolve)(file), "utf8");
52408
+ const raw = await (0, import_promises14.readFile)((0, import_node_path32.resolve)(file), "utf8");
52247
52409
  return JSON.parse(raw);
52248
52410
  }
52249
52411
  if (payload) {
@@ -52277,9 +52439,9 @@ async function transformOne(api, workflowId, outDir, publish) {
52277
52439
  revision.config,
52278
52440
  { workflowName: workflow.name, version: revision.version }
52279
52441
  );
52280
- const file = (0, import_node_path31.join)((0, import_node_path31.resolve)(outDir), `${compiled.playName}.play.ts`);
52281
- await (0, import_promises13.mkdir)((0, import_node_path31.dirname)(file), { recursive: true });
52282
- await (0, import_promises13.writeFile)(file, compiled.sourceCode, "utf8");
52442
+ const file = (0, import_node_path32.join)((0, import_node_path32.resolve)(outDir), `${compiled.playName}.play.ts`);
52443
+ await (0, import_promises14.mkdir)((0, import_node_path32.dirname)(file), { recursive: true });
52444
+ await (0, import_promises14.writeFile)(file, compiled.sourceCode, "utf8");
52283
52445
  let published = false;
52284
52446
  if (publish) {
52285
52447
  const code = await handlePlayPublish([file]);
@@ -52824,10 +52986,10 @@ function topLevelCommandKnown(program, commandName) {
52824
52986
  );
52825
52987
  }
52826
52988
  async function runPlayRunnerHealthCheck() {
52827
- const dir = await (0, import_promises14.mkdtemp)((0, import_node_path32.join)((0, import_node_os20.tmpdir)(), "deepline-health-play-"));
52828
- const file = (0, import_node_path32.join)(dir, "health-check.play.ts");
52989
+ const dir = await (0, import_promises15.mkdtemp)((0, import_node_path33.join)((0, import_node_os20.tmpdir)(), "deepline-health-play-"));
52990
+ const file = (0, import_node_path33.join)(dir, "health-check.play.ts");
52829
52991
  try {
52830
- await (0, import_promises14.writeFile)(
52992
+ await (0, import_promises15.writeFile)(
52831
52993
  file,
52832
52994
  [
52833
52995
  "import { definePlay } from 'deepline';",
@@ -52876,7 +53038,7 @@ async function runPlayRunnerHealthCheck() {
52876
53038
  }
52877
53039
  };
52878
53040
  } finally {
52879
- await (0, import_promises14.rm)(dir, { recursive: true, force: true });
53041
+ await (0, import_promises15.rm)(dir, { recursive: true, force: true });
52880
53042
  }
52881
53043
  }
52882
53044
  function pickString(value, ...keys) {