deepline 0.3.23 → 0.3.24

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
@@ -186,8 +186,8 @@ configureProxyFromEnv();
186
186
 
187
187
  // src/cli/index.ts
188
188
  var import_promises10 = require("fs/promises");
189
- var import_node_path26 = require("path");
190
- var import_node_os19 = require("os");
189
+ var import_node_path25 = require("path");
190
+ var import_node_os17 = require("os");
191
191
  var import_commander4 = require("commander");
192
192
 
193
193
  // src/config.ts
@@ -994,11 +994,6 @@ function getActiveProjectAuthSource(startDir = process.cwd()) {
994
994
  return loadProjectEnvCandidates(startDir)[0] ?? null;
995
995
  }
996
996
 
997
- // src/http.ts
998
- var import_node_fs2 = require("fs");
999
- var import_node_os3 = require("os");
1000
- var import_node_path2 = require("path");
1001
-
1002
997
  // ../shared_libs/plays/artifact-contract-version.ts
1003
998
  var CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION = 2;
1004
999
 
@@ -1047,7 +1042,7 @@ var SDK_RELEASE = {
1047
1042
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1048
1043
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1049
1044
  // getters keep their established compatibility behavior.
1050
- version: "0.3.23",
1045
+ version: "0.3.24",
1051
1046
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1052
1047
  contracts: {
1053
1048
  api: {
@@ -1236,6 +1231,88 @@ function detectAgentRuntime(options = {}) {
1236
1231
  return options.defaultRuntime ?? "unknown";
1237
1232
  }
1238
1233
 
1234
+ // src/skills-version.ts
1235
+ var import_node_fs2 = require("fs");
1236
+ var import_node_path2 = require("path");
1237
+ function activePluginSkillsDir() {
1238
+ const pluginMode = process.env.DEEPLINE_PLUGIN_MODE?.trim().toLowerCase();
1239
+ if (pluginMode !== "true" && pluginMode !== "1" && pluginMode !== "yes" && pluginMode !== "on") {
1240
+ return "";
1241
+ }
1242
+ const dir = process.env.DEEPLINE_PLUGIN_SKILLS_DIR?.trim() ?? "";
1243
+ return dir && (0, import_node_fs2.existsSync)(dir) ? dir : "";
1244
+ }
1245
+ function hasActivePluginSkills() {
1246
+ return Boolean(activePluginSkillsDir());
1247
+ }
1248
+ function readPluginSkillsVersion() {
1249
+ const dir = activePluginSkillsDir();
1250
+ if (!dir) return "";
1251
+ try {
1252
+ return (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(dir, ".version"), "utf-8").trim();
1253
+ } catch {
1254
+ return "";
1255
+ }
1256
+ }
1257
+ function sdkSkillsVersionPath(baseUrl, agents = []) {
1258
+ const suffix = agents.length > 0 ? `-${agents.join("-")}` : "";
1259
+ return (0, import_node_path2.join)(sdkCliStateDirPath(baseUrl), `skills${suffix}-version`);
1260
+ }
1261
+ function legacySdkSkillsVersionPath(baseUrl) {
1262
+ return (0, import_node_path2.join)((0, import_node_path2.dirname)(sdkCliStateDirPath(baseUrl)), "sdk-skills", ".version");
1263
+ }
1264
+ function resolveAutoSyncSkillAgents() {
1265
+ switch (detectAgentRuntime()) {
1266
+ case "codex":
1267
+ return ["codex"];
1268
+ case "claude_code":
1269
+ return ["claude-code"];
1270
+ case "cursor":
1271
+ return ["cursor"];
1272
+ case "gemini":
1273
+ return ["gemini-cli"];
1274
+ case "antigravity":
1275
+ return ["antigravity"];
1276
+ default:
1277
+ return [];
1278
+ }
1279
+ }
1280
+ function readSdkSkillsLocalVersion(baseUrl) {
1281
+ const pluginVersion = readPluginSkillsVersion();
1282
+ if (pluginVersion) return pluginVersion;
1283
+ const agents = resolveAutoSyncSkillAgents();
1284
+ const scopedPath = sdkSkillsVersionPath(baseUrl, agents);
1285
+ if (agents.length > 0 && (0, import_node_fs2.existsSync)(scopedPath)) {
1286
+ try {
1287
+ return (0, import_node_fs2.readFileSync)(scopedPath, "utf-8").trim();
1288
+ } catch {
1289
+ return "";
1290
+ }
1291
+ }
1292
+ if (agents.length > 0) {
1293
+ const legacyPath = legacySdkSkillsVersionPath(baseUrl);
1294
+ if (!(0, import_node_fs2.existsSync)(legacyPath)) return "";
1295
+ try {
1296
+ return (0, import_node_fs2.readFileSync)(legacyPath, "utf-8").trim();
1297
+ } catch {
1298
+ return "";
1299
+ }
1300
+ }
1301
+ const path = (0, import_node_fs2.existsSync)(sdkSkillsVersionPath(baseUrl)) ? sdkSkillsVersionPath(baseUrl) : legacySdkSkillsVersionPath(baseUrl);
1302
+ if (!(0, import_node_fs2.existsSync)(path)) return "";
1303
+ try {
1304
+ return (0, import_node_fs2.readFileSync)(path, "utf-8").trim();
1305
+ } catch {
1306
+ return "";
1307
+ }
1308
+ }
1309
+ function writeSdkSkillsLocalVersion(baseUrl, version, agents) {
1310
+ const path = sdkSkillsVersionPath(baseUrl, agents);
1311
+ (0, import_node_fs2.mkdirSync)((0, import_node_path2.dirname)(path), { recursive: true });
1312
+ (0, import_node_fs2.writeFileSync)(path, `${version}
1313
+ `, "utf-8");
1314
+ }
1315
+
1239
1316
  // ../shared_libs/play-runtime/coordinator-headers.ts
1240
1317
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
1241
1318
  var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
@@ -1572,21 +1649,9 @@ var HttpClient = class {
1572
1649
  );
1573
1650
  if (explicit) return explicit;
1574
1651
  try {
1575
- const versionPath = (0, import_node_path2.join)(
1576
- sdkCliStateDirPath(this.config.baseUrl),
1577
- "skills-version"
1652
+ return this.cleanDiagnosticHeader(
1653
+ readSdkSkillsLocalVersion(this.config.baseUrl)
1578
1654
  );
1579
- const legacyVersionPath = (0, import_node_path2.join)(
1580
- process.env.HOME?.trim() || (0, import_node_os3.homedir)(),
1581
- ".local",
1582
- "deepline",
1583
- baseUrlSlug(this.config.baseUrl),
1584
- "sdk-skills",
1585
- ".version"
1586
- );
1587
- const resolvedPath = (0, import_node_fs2.existsSync)(versionPath) ? versionPath : legacyVersionPath;
1588
- if (!(0, import_node_fs2.existsSync)(resolvedPath)) return null;
1589
- return this.cleanDiagnosticHeader((0, import_node_fs2.readFileSync)(resolvedPath, "utf-8"));
1590
1655
  } catch {
1591
1656
  return null;
1592
1657
  }
@@ -6992,7 +7057,7 @@ var DeeplineClient = class {
6992
7057
 
6993
7058
  // src/compat.ts
6994
7059
  var import_node_fs3 = require("fs");
6995
- var import_node_os4 = require("os");
7060
+ var import_node_os3 = require("os");
6996
7061
  var import_node_path3 = require("path");
6997
7062
  var CHECK_TIMEOUT_MS = 2e3;
6998
7063
  var SDK_COMPATIBILITY_CACHE_TTL_MS = 5 * 60 * 1e3;
@@ -7000,10 +7065,10 @@ function shouldSkipCompatibilityCheck() {
7000
7065
  const value = process.env.DEEPLINE_SKIP_SDK_COMPAT_CHECK?.trim().toLowerCase();
7001
7066
  return value === "1" || value === "true" || value === "yes";
7002
7067
  }
7003
- function sdkCompatibilityCachePath(baseUrl, homeDir2 = (0, import_node_os4.homedir)()) {
7068
+ function sdkCompatibilityCachePath(baseUrl, homeDir2 = (0, import_node_os3.homedir)()) {
7004
7069
  return (0, import_node_path3.join)(sdkCliStateDirPath(baseUrl, homeDir2), "compat-cache.json");
7005
7070
  }
7006
- function legacySdkCompatibilityCachePath(homeDir2 = (0, import_node_os4.homedir)()) {
7071
+ function legacySdkCompatibilityCachePath(homeDir2 = (0, import_node_os3.homedir)()) {
7007
7072
  return (0, import_node_path3.join)(homeDir2, ".cache", "deepline", "sdk-compat-cache.json");
7008
7073
  }
7009
7074
  function compatibilityCacheKey(baseUrl, command, skillsVersion) {
@@ -7127,14 +7192,14 @@ function enforceSdkCompatibilityResponse(response) {
7127
7192
 
7128
7193
  // src/cli/commands/auth.ts
7129
7194
  var import_node_fs5 = require("fs");
7130
- var import_node_os6 = require("os");
7195
+ var import_node_os5 = require("os");
7131
7196
  var import_node_path5 = require("path");
7132
7197
 
7133
7198
  // src/cli/utils.ts
7134
7199
  var import_node_crypto = require("crypto");
7135
7200
  var import_node_fs4 = require("fs");
7136
7201
  var import_promises = require("fs/promises");
7137
- var import_node_os5 = require("os");
7202
+ var import_node_os4 = require("os");
7138
7203
  var import_node_path4 = require("path");
7139
7204
  var childProcess = __toESM(require("child_process"));
7140
7205
  var import_sync = require("csv-parse/sync");
@@ -7155,7 +7220,7 @@ async function writeOutputFile(filename, content) {
7155
7220
  }
7156
7221
  function stableOsUserId() {
7157
7222
  try {
7158
- const info = (0, import_node_os5.userInfo)();
7223
+ const info = (0, import_node_os4.userInfo)();
7159
7224
  if (typeof info.uid === "number") return `uid-${info.uid}`;
7160
7225
  if (info.username) return `user-${info.username}`;
7161
7226
  } catch {
@@ -7163,7 +7228,7 @@ function stableOsUserId() {
7163
7228
  return "unknown-user";
7164
7229
  }
7165
7230
  function defaultBrowserOpenStateDir() {
7166
- return (0, import_node_path4.join)((0, import_node_os5.tmpdir)(), `deepline-${stableOsUserId()}`, "runtime", "state");
7231
+ return (0, import_node_path4.join)((0, import_node_os4.tmpdir)(), `deepline-${stableOsUserId()}`, "runtime", "state");
7167
7232
  }
7168
7233
  function browserOpenStateFile(stateDir = defaultBrowserOpenStateDir()) {
7169
7234
  return (0, import_node_path4.join)(stateDir, "browser-open.json");
@@ -7246,7 +7311,7 @@ function browserAppNameFromBundleId(bundleId) {
7246
7311
  }
7247
7312
  function currentOsUsername() {
7248
7313
  try {
7249
- return (0, import_node_os5.userInfo)().username || "";
7314
+ return (0, import_node_os4.userInfo)().username || "";
7250
7315
  } catch {
7251
7316
  return "";
7252
7317
  }
@@ -7266,7 +7331,7 @@ function readMacosUserHome(runner = defaultBrowserCommandRunner) {
7266
7331
  } catch {
7267
7332
  }
7268
7333
  }
7269
- return (0, import_node_os5.homedir)();
7334
+ return (0, import_node_os4.homedir)();
7270
7335
  }
7271
7336
  function readDefaultMacBrowserBundleId(runner = defaultBrowserCommandRunner) {
7272
7337
  try {
@@ -7454,9 +7519,7 @@ function openUrlMacos(targetUrl, allowFocus, runner = defaultBrowserCommandRunne
7454
7519
  }
7455
7520
  }
7456
7521
  function browserOpeningDisabled() {
7457
- const value = String(
7458
- process.env.DEEPLINE_NO_BROWSER ?? process.env.PLAYGROUND_HEADLESS ?? ""
7459
- ).trim().toLowerCase();
7522
+ const value = String(process.env.DEEPLINE_NO_BROWSER ?? "").trim().toLowerCase();
7460
7523
  return value === "1" || value === "true" || value === "yes" || value === "on";
7461
7524
  }
7462
7525
  function openInBrowser(url, options = {}) {
@@ -7488,7 +7551,7 @@ function sleep3(ms) {
7488
7551
  return new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
7489
7552
  }
7490
7553
  function collectLocalEnvInfo() {
7491
- const homeDir2 = process.env.HOME?.trim() || (0, import_node_os5.homedir)();
7554
+ const homeDir2 = process.env.HOME?.trim() || (0, import_node_os4.homedir)();
7492
7555
  const info = {
7493
7556
  os: `${process.platform} ${process.arch}`,
7494
7557
  node_version: process.version,
@@ -8109,7 +8172,7 @@ async function handleRegister(args) {
8109
8172
  }
8110
8173
  if (!agentName) {
8111
8174
  try {
8112
- agentName = (0, import_node_os6.hostname)() || "Deepline CLI (TS)";
8175
+ agentName = (0, import_node_os5.hostname)() || "Deepline CLI (TS)";
8113
8176
  } catch {
8114
8177
  agentName = "Deepline CLI (TS)";
8115
8178
  }
@@ -9991,7 +10054,7 @@ Examples:
9991
10054
  var import_node_child_process = require("child_process");
9992
10055
  var import_node_crypto3 = require("crypto");
9993
10056
  var import_node_fs7 = require("fs");
9994
- var import_node_os7 = require("os");
10057
+ var import_node_os6 = require("os");
9995
10058
  var import_node_path8 = require("path");
9996
10059
 
9997
10060
  // src/cli/dataset-stats.ts
@@ -10758,13 +10821,13 @@ async function handleCsvShow(options) {
10758
10821
  );
10759
10822
  }
10760
10823
  function csvRenderStatePath() {
10761
- return (0, import_node_path8.join)((0, import_node_os7.homedir)(), ".local", "deepline", "runtime", "csv-render.json");
10824
+ return (0, import_node_path8.join)((0, import_node_os6.homedir)(), ".local", "deepline", "runtime", "csv-render.json");
10762
10825
  }
10763
10826
  function csvRenderLogPath() {
10764
- return (0, import_node_path8.join)((0, import_node_os7.homedir)(), ".local", "deepline", "runtime", "csv-render.log");
10827
+ return (0, import_node_path8.join)((0, import_node_os6.homedir)(), ".local", "deepline", "runtime", "csv-render.log");
10765
10828
  }
10766
10829
  function ensureCsvRenderStateDir() {
10767
- (0, import_node_fs7.mkdirSync)((0, import_node_path8.join)((0, import_node_os7.homedir)(), ".local", "deepline", "runtime"), {
10830
+ (0, import_node_fs7.mkdirSync)((0, import_node_path8.join)((0, import_node_os6.homedir)(), ".local", "deepline", "runtime"), {
10768
10831
  recursive: true
10769
10832
  });
10770
10833
  }
@@ -10930,7 +10993,7 @@ async function handleCsvRenderStart(options) {
10930
10993
  (0, import_node_fs7.rmSync)(csvRenderStatePath(), { force: true });
10931
10994
  } else if (existingOwned) {
10932
10995
  process.stdout.write(
10933
- "Playground render is already running; reusing current process.\n"
10996
+ "CSV render is already running; reusing current process.\n"
10934
10997
  );
10935
10998
  process.stdout.write(`Render URL: ${existing.url}
10936
10999
  `);
@@ -10946,20 +11009,16 @@ async function handleCsvRenderStart(options) {
10946
11009
  const logPath = csvRenderLogPath();
10947
11010
  const logFd = (0, import_node_fs7.openSync)(logPath, "w");
10948
11011
  const token = (0, import_node_crypto3.randomUUID)();
10949
- const child = (0, import_node_child_process.spawn)(
10950
- process.execPath,
10951
- ["-e", CSV_RENDER_SERVER_SOURCE],
10952
- {
10953
- detached: true,
10954
- stdio: ["ignore", logFd, logFd],
10955
- env: {
10956
- ...process.env,
10957
- DEEPLINE_CSV_RENDER_PORT: String(port),
10958
- DEEPLINE_CSV_RENDER_CSV: csvPath,
10959
- DEEPLINE_CSV_RENDER_TOKEN: token
10960
- }
11012
+ const child = (0, import_node_child_process.spawn)(process.execPath, ["-e", CSV_RENDER_SERVER_SOURCE], {
11013
+ detached: true,
11014
+ stdio: ["ignore", logFd, logFd],
11015
+ env: {
11016
+ ...process.env,
11017
+ DEEPLINE_CSV_RENDER_PORT: String(port),
11018
+ DEEPLINE_CSV_RENDER_CSV: csvPath,
11019
+ DEEPLINE_CSV_RENDER_TOKEN: token
10961
11020
  }
10962
- );
11021
+ });
10963
11022
  (0, import_node_fs7.closeSync)(logFd);
10964
11023
  child.unref();
10965
11024
  const state = {
@@ -10996,7 +11055,7 @@ ${clip(log, 2e3)}`;
10996
11055
  `CSV render started at ${state.startedAt} on ${url}
10997
11056
  `
10998
11057
  );
10999
- process.stdout.write("Playground render is running.\n");
11058
+ process.stdout.write("CSV render is running.\n");
11000
11059
  process.stdout.write(`Render PID: ${child.pid}
11001
11060
  `);
11002
11061
  process.stdout.write(`Render URL: ${url}
@@ -11067,8 +11126,8 @@ async function handleCsvRenderStop(options) {
11067
11126
  stopped_pids: stopped,
11068
11127
  failed_pids: failed
11069
11128
  };
11070
- const text = stopped.length > 0 ? `Stopped playground render process(es): ${stopped.join(" ")}
11071
- ` : "No running playground render process found.\n";
11129
+ const text = stopped.length > 0 ? `Stopped CSV render process(es): ${stopped.join(" ")}
11130
+ ` : "No running CSV render process found.\n";
11072
11131
  printCommandEnvelope(payload, { json: options.json, text });
11073
11132
  }
11074
11133
  async function handleCsvRender(action, options) {
@@ -11550,7 +11609,7 @@ Examples:
11550
11609
 
11551
11610
  // src/cli/commands/enrich.ts
11552
11611
  var import_promises7 = require("fs/promises");
11553
- var import_node_os10 = require("os");
11612
+ var import_node_os9 = require("os");
11554
11613
  var import_node_path15 = require("path");
11555
11614
  var import_commander2 = require("commander");
11556
11615
 
@@ -13260,7 +13319,7 @@ Examples:
13260
13319
  }
13261
13320
 
13262
13321
  // src/plays/bundle-play-file.ts
13263
- var import_node_os9 = require("os");
13322
+ var import_node_os8 = require("os");
13264
13323
  var import_node_path13 = require("path");
13265
13324
  var import_node_url = require("url");
13266
13325
  var import_node_fs11 = require("fs");
@@ -13270,7 +13329,7 @@ var import_promises5 = require("fs/promises");
13270
13329
  var import_node_crypto4 = require("crypto");
13271
13330
  var import_node_fs10 = require("fs");
13272
13331
  var import_promises3 = require("fs/promises");
13273
- var import_node_os8 = require("os");
13332
+ var import_node_os7 = require("os");
13274
13333
  var import_node_path11 = require("path");
13275
13334
  var import_node_module = require("module");
13276
13335
  var import_acorn2 = require("acorn");
@@ -17504,7 +17563,7 @@ var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
17504
17563
  // ../shared_libs/plays/bundling/index.ts
17505
17564
  var PLAY_BUNDLE_CACHE_VERSION = 36;
17506
17565
  var PLAY_ARTIFACT_CACHE_DIR = (0, import_node_path11.join)(
17507
- (0, import_node_os8.tmpdir)(),
17566
+ (0, import_node_os7.tmpdir)(),
17508
17567
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
17509
17568
  );
17510
17569
  var NODE_BUILTIN_SET = new Set(
@@ -19559,7 +19618,9 @@ function stringMetadata(metadata, key) {
19559
19618
  }
19560
19619
  function inputFieldFromCsvArg(csvArg) {
19561
19620
  if (typeof csvArg !== "string") return null;
19562
- const match = /^input\.([A-Za-z_$][\w$]*)$/.exec(csvArg.trim());
19621
+ const match = /^\(?\s*input\.([A-Za-z_$][\w$]*)\s*\)?(?:\s*\?\?[\s\S]+)?$/.exec(
19622
+ csvArg.trim()
19623
+ );
19563
19624
  return match?.[1] ?? null;
19564
19625
  }
19565
19626
  function fileInputBindingsFromPlaySchema(inputSchema) {
@@ -23332,6 +23393,21 @@ function printPlayCheckLimits(limits) {
23332
23393
  console.log(
23333
23394
  ` bundle: ${formatByteBudget(limits.bundle.usedBytes, limits.bundle.limitBytes)}`
23334
23395
  );
23396
+ if (limits.activeScheduledPlays) {
23397
+ const { used, limit, remaining } = limits.activeScheduledPlays;
23398
+ console.log(
23399
+ ` scheduled plays: ${used} / ${limit} active (${remaining} available)`
23400
+ );
23401
+ }
23402
+ }
23403
+ function formatPlayRuntimeLimit(runtimeLimit) {
23404
+ if (!runtimeLimit || !Number.isFinite(runtimeLimit.timeoutSeconds)) {
23405
+ return null;
23406
+ }
23407
+ const seconds = runtimeLimit.timeoutSeconds;
23408
+ if (seconds % 3600 === 0) return `${seconds / 3600}h`;
23409
+ if (seconds % 60 === 0) return `${seconds / 60}m`;
23410
+ return `${seconds}s`;
23335
23411
  }
23336
23412
  function isRecord10(value) {
23337
23413
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
@@ -23826,6 +23902,8 @@ function printPlayCheckOutcome(outcome, target, prefix) {
23826
23902
  if (result.sourceHash) {
23827
23903
  console.log(` source: ${result.sourceHash.slice(0, 12)}`);
23828
23904
  }
23905
+ const runtimeLimit = formatPlayRuntimeLimit(result.runtimeLimit);
23906
+ if (runtimeLimit) console.log(` runtime limit: ${runtimeLimit}`);
23829
23907
  printPlayCheckLimits(result.limits);
23830
23908
  if (result.artifactHash && outcome.exportName === PLAY_DEFAULT_EXPORT) {
23831
23909
  console.log(
@@ -28524,10 +28602,10 @@ function expandAtFilePath(rawPath) {
28524
28602
  (_match, bareName, bracedName) => process.env[bareName ?? bracedName ?? ""] ?? ""
28525
28603
  );
28526
28604
  if (expanded === "~") {
28527
- return (0, import_node_os10.homedir)();
28605
+ return (0, import_node_os9.homedir)();
28528
28606
  }
28529
28607
  if (expanded.startsWith("~/") || expanded.startsWith("~\\")) {
28530
- return (0, import_node_path15.join)((0, import_node_os10.homedir)(), expanded.slice(2));
28608
+ return (0, import_node_path15.join)((0, import_node_os9.homedir)(), expanded.slice(2));
28531
28609
  }
28532
28610
  return expanded;
28533
28611
  }
@@ -30990,7 +31068,7 @@ async function persistEnrichFailureReport(input2) {
30990
31068
  if (input2.jobs.length === 0 && input2.issues.length === 0) {
30991
31069
  return null;
30992
31070
  }
30993
- const stateDir = (0, import_node_path15.join)((0, import_node_os10.homedir)(), ".local", "deepline", "runtime", "state");
31071
+ const stateDir = (0, import_node_path15.join)((0, import_node_os9.homedir)(), ".local", "deepline", "runtime", "state");
30994
31072
  const reportPrefix = input2.jobs.length > 0 ? "run-block-failures" : "enrich-issues";
30995
31073
  await (0, import_promises7.mkdir)(stateDir, { recursive: true });
30996
31074
  const reportPath = (0, import_node_path15.join)(
@@ -31922,7 +32000,7 @@ function registerEnrichCommand(program) {
31922
32000
  sdkEnrichTelemetryCompleted = true;
31923
32001
  await completeSdkEnrichTelemetry(sdkEnrichTelemetry, input2);
31924
32002
  };
31925
- const tempDir = await (0, import_promises7.mkdtemp)((0, import_node_path15.join)((0, import_node_os10.tmpdir)(), "deepline-enrich-play-"));
32003
+ const tempDir = await (0, import_promises7.mkdtemp)((0, import_node_path15.join)((0, import_node_os9.tmpdir)(), "deepline-enrich-play-"));
31926
32004
  await emitSdkEnrichTelemetry(sdkEnrichTelemetry, "enrich_started");
31927
32005
  const tempPlay = (0, import_node_path15.join)(tempDir, "deepline-enrich.play.ts");
31928
32006
  let inPlaceTempDir = null;
@@ -32233,7 +32311,7 @@ Examples:
32233
32311
 
32234
32312
  // src/cli/commands/sessions.ts
32235
32313
  var import_node_fs13 = require("fs");
32236
- var import_node_os11 = require("os");
32314
+ var import_node_os10 = require("os");
32237
32315
  var import_node_path16 = require("path");
32238
32316
  var import_node_zlib = require("zlib");
32239
32317
  var import_node_crypto7 = require("crypto");
@@ -32248,14 +32326,14 @@ var MAX_EVENT_OBJECT_KEYS = 80;
32248
32326
  var TRUNCATION_MARKER = "...[truncated]";
32249
32327
  var NOISE_EVENT_TYPES = /* @__PURE__ */ new Set(["progress", "file-history-snapshot"]);
32250
32328
  function homeDir() {
32251
- return process.env.HOME?.trim() || (0, import_node_os11.homedir)();
32329
+ return process.env.HOME?.trim() || (0, import_node_os10.homedir)();
32252
32330
  }
32253
32331
  function detectShellContext() {
32254
32332
  const shellPath = process.env.SHELL?.trim() || process.env.ComSpec?.trim() || process.env.COMSPEC?.trim() || "";
32255
32333
  return {
32256
32334
  shell: shellPath ? (0, import_node_path16.basename)(shellPath).replace(/\.exe$/i, "") : "unknown",
32257
32335
  shell_path: shellPath || null,
32258
- os: (0, import_node_os11.platform)(),
32336
+ os: (0, import_node_os10.platform)(),
32259
32337
  cwd: process.cwd()
32260
32338
  };
32261
32339
  }
@@ -32971,30 +33049,31 @@ var BACKEND_SUBCOMMANDS = [
32971
33049
  "refresh-runtime",
32972
33050
  "sync-runtime"
32973
33051
  ];
32974
- function legacyNoopEnvelope(input2) {
33052
+ function deprecatedCommandEnvelope(input2) {
32975
33053
  const command = ["deepline", input2.family, input2.subcommand].filter(Boolean).join(" ");
32976
- const subject = input2.family === "session" ? "Legacy Session UI/playground command" : "Legacy local playground backend command";
32977
- const note = input2.family === "session" ? "The SDK CLI does not manage the legacy Python Session UI. This command is accepted for backwards compatibility and intentionally does nothing." : "The SDK CLI does not start or stop the legacy Python local playground backend. This command is accepted for backwards compatibility and intentionally does nothing.";
33054
+ const commandLabel = input2.family === "session" ? "Legacy session command" : "Legacy backend command";
33055
+ const note = input2.family === "session" ? "This command was retired with the legacy Python Session UI. Use `deepline sessions send` or `deepline sessions render`." : "This command was retired with the legacy local backend. Use `deepline-admin dev start`, `deepline-admin dev status`, or `deepline-admin dev stop`.";
32978
33056
  return {
32979
- ok: true,
32980
- noop: true,
33057
+ ok: false,
32981
33058
  command,
32982
- compatibility: {
32983
- family: "legacy_python_cli",
32984
- sdk_behavior: "noop"
32985
- },
33059
+ code: "DEPRECATED_COMMAND",
33060
+ error: `${commandLabel} is deprecated. ${note}`,
33061
+ next: input2.family === "session" ? "deepline sessions send --current-session --json" : "deepline-admin dev status --json",
32986
33062
  render: {
32987
33063
  sections: [
32988
33064
  {
32989
- title: subject,
33065
+ title: `${commandLabel} deprecated`,
32990
33066
  lines: [note]
32991
33067
  }
32992
33068
  ]
32993
33069
  }
32994
33070
  };
32995
33071
  }
32996
- function printLegacyNoop(input2) {
32997
- printCommandEnvelope(legacyNoopEnvelope(input2), { json: input2.options.json });
33072
+ function printDeprecatedCommand(input2) {
33073
+ printCommandEnvelope(deprecatedCommandEnvelope(input2), {
33074
+ json: input2.options.json
33075
+ });
33076
+ process.exitCode = 2;
32998
33077
  }
32999
33078
  function legacySubcommandFromArgv(family) {
33000
33079
  const args = process.argv.slice(2);
@@ -33002,18 +33081,18 @@ function legacySubcommandFromArgv(family) {
33002
33081
  const nextToken = familyIndex >= 0 ? args[familyIndex + 1] : void 0;
33003
33082
  return nextToken && !nextToken.startsWith("-") ? nextToken : void 0;
33004
33083
  }
33005
- function addLegacyNoopSubcommand(parent, family, subcommand, description) {
33084
+ function addDeprecatedSubcommand(parent, family, subcommand, description) {
33006
33085
  parent.command(subcommand).description(description).allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").action((_args, options) => {
33007
- printLegacyNoop({ family, subcommand, options });
33086
+ printDeprecatedCommand({ family, subcommand, options });
33008
33087
  });
33009
33088
  }
33010
- function registerLegacyNoopCommands(program) {
33011
- const session = program.command("session").description("Compatibility no-ops for legacy Python Session UI commands.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
33089
+ function registerDeprecatedCommands(program) {
33090
+ const session = program.command("session").description("Deprecated legacy session command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
33012
33091
  "after",
33013
33092
  `
33014
33093
  Notes:
33015
- The SDK CLI accepts singular session commands from older agent skills so they
33016
- do not fail, but it does not manage the legacy Python Session UI.
33094
+ The legacy Python Session UI was retired. Legacy session commands now fail
33095
+ with a migration instruction; they no longer report a successful no-op.
33017
33096
  Use "deepline sessions send" or "deepline sessions render" for real SDK
33018
33097
  transcript workflows. "deepline session send" and "deepline session render"
33019
33098
  are accepted aliases for those real SDK workflows.
@@ -33025,7 +33104,7 @@ Examples:
33025
33104
  `
33026
33105
  ).action((args, options) => {
33027
33106
  void args;
33028
- printLegacyNoop({
33107
+ printDeprecatedCommand({
33029
33108
  family: "session",
33030
33109
  subcommand: legacySubcommandFromArgv("session"),
33031
33110
  options
@@ -33033,21 +33112,19 @@ Examples:
33033
33112
  });
33034
33113
  registerSessionSendRenderCommands(session, "session");
33035
33114
  for (const subcommand of SESSION_SUBCOMMANDS) {
33036
- addLegacyNoopSubcommand(
33115
+ addDeprecatedSubcommand(
33037
33116
  session,
33038
33117
  "session",
33039
33118
  subcommand,
33040
- `Accept legacy "deepline session ${subcommand}" as an SDK no-op.`
33119
+ `Deprecated legacy "deepline session ${subcommand}" command.`
33041
33120
  );
33042
33121
  }
33043
- const backend = program.command("backend").description(
33044
- "Compatibility no-ops for legacy Python local backend commands."
33045
- ).allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
33122
+ const backend = program.command("backend").description("Deprecated legacy local backend command namespace.").allowUnknownOption(true).allowExcessArguments(true).option("--json", "Emit JSON output").argument("[args...]").addHelpText(
33046
33123
  "after",
33047
33124
  `
33048
33125
  Notes:
33049
- The SDK CLI uses the configured Deepline host and V2 play runtime. It does not
33050
- start, stop, or refresh the legacy Python local playground backend.
33126
+ The legacy local backend was retired. Use deepline-admin for local runtime
33127
+ lifecycle operations.
33051
33128
 
33052
33129
  Examples:
33053
33130
  deepline backend start
@@ -33056,18 +33133,18 @@ Examples:
33056
33133
  `
33057
33134
  ).action((args, options) => {
33058
33135
  void args;
33059
- printLegacyNoop({
33136
+ printDeprecatedCommand({
33060
33137
  family: "backend",
33061
33138
  subcommand: legacySubcommandFromArgv("backend"),
33062
33139
  options
33063
33140
  });
33064
33141
  });
33065
33142
  for (const subcommand of BACKEND_SUBCOMMANDS) {
33066
- addLegacyNoopSubcommand(
33143
+ addDeprecatedSubcommand(
33067
33144
  backend,
33068
33145
  "backend",
33069
33146
  subcommand,
33070
- `Accept legacy "deepline backend ${subcommand}" as an SDK no-op.`
33147
+ `Deprecated legacy "deepline backend ${subcommand}" command.`
33071
33148
  );
33072
33149
  }
33073
33150
  }
@@ -34135,6 +34212,11 @@ Notes:
34135
34212
  Deploy is a full desired definition for its key: omitting a previously stored
34136
34213
  field removes it and can replace the upstream resource. Use \`monitors update\`
34137
34214
  for a patch-style change.
34215
+ Repeating the exact saved definition resumes an incomplete deploy cleanup:
34216
+ Deepline keeps the replacement, removes only the stored previous binding after
34217
+ provider confirmation, and never creates or charges another monitor. Deepline
34218
+ also retries eligible incomplete deploy cleanups automatically in bounded
34219
+ background passes; no separate repair command is required.
34138
34220
  For a bounded urgent Deepline Native preview, set
34139
34221
  controls.execution_type="priority". Deepline injects the provider custom
34140
34222
  field and enforces a ten-slot per-org cap; do not use it for regular or bulk
@@ -35106,17 +35188,17 @@ Examples:
35106
35188
  }
35107
35189
 
35108
35190
  // src/cli/commands/setup.ts
35191
+ var import_node_child_process4 = require("child_process");
35192
+ var import_node_fs17 = require("fs");
35193
+ var import_node_os12 = require("os");
35194
+ var import_node_path19 = require("path");
35195
+
35196
+ // src/cli/commands/skills.ts
35109
35197
  var import_node_child_process3 = require("child_process");
35110
35198
  var import_node_fs16 = require("fs");
35111
- var import_node_os13 = require("os");
35199
+ var import_node_os11 = require("os");
35112
35200
  var import_node_path18 = require("path");
35113
35201
 
35114
- // src/cli/commands/skills.ts
35115
- var import_node_child_process2 = require("child_process");
35116
- var import_node_fs15 = require("fs");
35117
- var import_node_os12 = require("os");
35118
- var import_node_path17 = require("path");
35119
-
35120
35202
  // ../shared_libs/cli/install-commands.json
35121
35203
  var install_commands_default = {
35122
35204
  skills: {
@@ -35144,7 +35226,6 @@ var install_commands_default = {
35144
35226
  ]
35145
35227
  },
35146
35228
  cli: {
35147
- legacy_python_shell_template: "curl -s {base_url}/api/v2/cli/install | bash",
35148
35229
  sdk_npm_global: "npm install -g deepline@latest"
35149
35230
  }
35150
35231
  };
@@ -35183,9 +35264,6 @@ function renderTemplate(template, values) {
35183
35264
  return values[key] ?? match;
35184
35265
  });
35185
35266
  }
35186
- function shellJoin(args) {
35187
- return args.join(" ");
35188
- }
35189
35267
  function skillsIndexUrl(baseUrl) {
35190
35268
  return `${normalizeBaseUrl2(baseUrl)}${INSTALL_COMMANDS.skills.index_path}`;
35191
35269
  }
@@ -35220,19 +35298,11 @@ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
35220
35298
  );
35221
35299
  return rendered;
35222
35300
  }
35223
- function skillsInstallCommand(baseUrl, skillName) {
35224
- return `${INSTALL_COMMANDS.skills.npx_binary} ${shellJoin(
35225
- buildSkillsAddArgs(baseUrl, skillName)
35226
- )}`;
35227
- }
35228
- function legacyPythonInstallCommand(baseUrl) {
35229
- return renderTemplate(INSTALL_COMMANDS.cli.legacy_python_shell_template, {
35230
- base_url: normalizeBaseUrl2(baseUrl)
35231
- });
35232
- }
35233
- function sdkNpmGlobalInstallCommand() {
35234
- return INSTALL_COMMANDS.cli.sdk_npm_global;
35235
- }
35301
+
35302
+ // src/cli/skills-sync.ts
35303
+ var import_node_child_process2 = require("child_process");
35304
+ var import_node_fs15 = require("fs");
35305
+ var import_node_path17 = require("path");
35236
35306
 
35237
35307
  // src/cli/windows-arg-escape.ts
35238
35308
  var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
@@ -35257,6 +35327,351 @@ function resolveShellSpawn(command, args, platform3 = process.platform) {
35257
35327
  };
35258
35328
  }
35259
35329
 
35330
+ // src/cli/skills-sync.ts
35331
+ var CHECK_TIMEOUT_MS2 = 3e3;
35332
+ function shouldSkipSkillsSync() {
35333
+ if (detectAgentRuntime() === "claude_cowork") {
35334
+ return true;
35335
+ }
35336
+ const value = process.env.DEEPLINE_SKIP_SKILLS_SYNC?.trim().toLowerCase();
35337
+ return value === "1" || value === "true" || value === "yes" || value === "on";
35338
+ }
35339
+ function unavailableSkillsNoticePath(baseUrl) {
35340
+ return (0, import_node_path17.join)(sdkCliStateDirPath(baseUrl), "skills-sync-unavailable-version");
35341
+ }
35342
+ function failedSkillsSyncPath(baseUrl, agents) {
35343
+ return (0, import_node_path17.join)(
35344
+ sdkCliStateDirPath(baseUrl),
35345
+ `skills-sync-failed-${agents.join("-")}-version`
35346
+ );
35347
+ }
35348
+ function hasMarkedSkillsSyncVersion(path, version) {
35349
+ return Boolean(version) && readMarkedSkillsSyncVersion(path) === version;
35350
+ }
35351
+ function readMarkedSkillsSyncVersion(path) {
35352
+ try {
35353
+ return (0, import_node_fs15.existsSync)(path) ? (0, import_node_fs15.readFileSync)(path, "utf-8").trim() : "";
35354
+ } catch {
35355
+ return "";
35356
+ }
35357
+ }
35358
+ function writeMarkedSkillsSyncVersion(path, version) {
35359
+ try {
35360
+ (0, import_node_fs15.mkdirSync)((0, import_node_path17.dirname)(path), { recursive: true });
35361
+ (0, import_node_fs15.writeFileSync)(path, `${version}
35362
+ `, "utf-8");
35363
+ } catch {
35364
+ }
35365
+ }
35366
+ function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames) {
35367
+ const path = unavailableSkillsNoticePath(baseUrl);
35368
+ if (hasMarkedSkillsSyncVersion(path, remoteVersion)) return;
35369
+ writeMarkedSkillsSyncVersion(path, remoteVersion);
35370
+ const manualCommand = `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
35371
+ writeSdkSkillsStatusLine(
35372
+ `Deepline agent skills are out of date, but neither \`bunx\` nor \`npx\` is available. Install Node.js/npm or Bun, then run:
35373
+ ${manualCommand}`
35374
+ );
35375
+ }
35376
+ function clearUnavailableSkillsNotice(baseUrl) {
35377
+ try {
35378
+ (0, import_node_fs15.unlinkSync)(unavailableSkillsNoticePath(baseUrl));
35379
+ } catch {
35380
+ }
35381
+ }
35382
+ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
35383
+ return hasMarkedSkillsSyncVersion(
35384
+ failedSkillsSyncPath(baseUrl, agents),
35385
+ remoteVersion
35386
+ );
35387
+ }
35388
+ function hasFailedAutomaticSkillsSync(baseUrl, agents) {
35389
+ return (0, import_node_fs15.existsSync)(failedSkillsSyncPath(baseUrl, agents));
35390
+ }
35391
+ function markFailedSkillsSync(baseUrl, remoteVersion, agents) {
35392
+ writeMarkedSkillsSyncVersion(
35393
+ failedSkillsSyncPath(baseUrl, agents),
35394
+ remoteVersion
35395
+ );
35396
+ }
35397
+ function clearFailedSkillsSync(baseUrl, agents) {
35398
+ try {
35399
+ (0, import_node_fs15.unlinkSync)(failedSkillsSyncPath(baseUrl, agents));
35400
+ } catch {
35401
+ }
35402
+ }
35403
+ function clearFailedAutomaticSkillsSync(baseUrl, agents) {
35404
+ clearFailedSkillsSync(baseUrl, agents);
35405
+ }
35406
+ function sortedUniqueSkillNames(names) {
35407
+ return [...new Set(names.map((name) => name.trim()).filter(Boolean))].sort(
35408
+ (a, b) => a.localeCompare(b)
35409
+ );
35410
+ }
35411
+ async function fetchV1SkillNames(baseUrl) {
35412
+ const controller = new AbortController();
35413
+ const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS2);
35414
+ try {
35415
+ const response = await fetch(
35416
+ new URL("/.well-known/skills/index.json", baseUrl),
35417
+ { signal: controller.signal }
35418
+ );
35419
+ if (!response.ok) return [];
35420
+ const data = await response.json().catch(() => null);
35421
+ const names = (data?.skills ?? []).filter((skill) => skill.install_surface === "v1").map((skill) => skill.name).filter(
35422
+ (name) => typeof name === "string" && name.length > 0
35423
+ );
35424
+ return sortedUniqueSkillNames(names);
35425
+ } catch {
35426
+ return [];
35427
+ } finally {
35428
+ clearTimeout(timeout);
35429
+ }
35430
+ }
35431
+ function buildSdkSkillNames(v1SkillNames) {
35432
+ return sortedUniqueSkillNames(v1SkillNames);
35433
+ }
35434
+ async function fetchSkillsUpdate(baseUrl, localVersion) {
35435
+ const controller = new AbortController();
35436
+ const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS2);
35437
+ try {
35438
+ const response = await fetch(new URL("/api/v2/cli/update-check", baseUrl), {
35439
+ method: "POST",
35440
+ headers: { "Content-Type": "application/json" },
35441
+ body: JSON.stringify({
35442
+ skills: {
35443
+ version: localVersion
35444
+ }
35445
+ }),
35446
+ signal: controller.signal
35447
+ });
35448
+ if (!response.ok) return null;
35449
+ const data = await response.json().catch(() => null);
35450
+ const skills = data?.skills;
35451
+ if (!skills) return null;
35452
+ return {
35453
+ needsUpdate: skills.needs_update === true,
35454
+ remoteVersion: typeof skills.remote?.version === "string" ? skills.remote.version.trim() : ""
35455
+ };
35456
+ } catch {
35457
+ return null;
35458
+ } finally {
35459
+ clearTimeout(timeout);
35460
+ }
35461
+ }
35462
+ function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents) {
35463
+ return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
35464
+ agents
35465
+ });
35466
+ }
35467
+ function buildBunxSkillsInstallArgs(baseUrl, skillNames, agents) {
35468
+ return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
35469
+ firstArg: "--bun",
35470
+ agents
35471
+ });
35472
+ }
35473
+ function hasCommand(command) {
35474
+ const plan = resolveShellSpawn(command, ["--version"]);
35475
+ const result = (0, import_node_child_process2.spawnSync)(plan.command, plan.args, {
35476
+ stdio: "ignore",
35477
+ shell: plan.shell
35478
+ });
35479
+ return result.status === 0;
35480
+ }
35481
+ function shellQuote3(arg) {
35482
+ return `'${arg.replace(/'/g, `'\\''`)}'`;
35483
+ }
35484
+ function temporarySkillsSyncSkipCommand() {
35485
+ if (process.platform === "win32") {
35486
+ return "set DEEPLINE_SKIP_SKILLS_SYNC=1 && deepline <command> (cmd), or $env:DEEPLINE_SKIP_SKILLS_SYNC='1'; deepline <command> (PowerShell)";
35487
+ }
35488
+ return "DEEPLINE_SKIP_SKILLS_SYNC=1 deepline <command>";
35489
+ }
35490
+ function resolveSkillsInstallSpawn(install, platform3 = process.platform) {
35491
+ return resolveShellSpawn(install.command, install.args, platform3);
35492
+ }
35493
+ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = DEFAULT_SKILL_AGENTS) {
35494
+ const commands = [];
35495
+ if (hasCommand("bunx")) {
35496
+ const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames, agents);
35497
+ commands.push({
35498
+ command: "bunx",
35499
+ args: bunxArgs,
35500
+ manualCommand: `bunx ${bunxArgs.map(shellQuote3).join(" ")}`
35501
+ });
35502
+ }
35503
+ if (hasCommand("npx")) {
35504
+ const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames, agents);
35505
+ commands.push({
35506
+ command: "npx",
35507
+ args: npxArgs,
35508
+ manualCommand: `npx ${npxArgs.map(shellQuote3).join(" ")}`
35509
+ });
35510
+ }
35511
+ return commands;
35512
+ }
35513
+ function runOneSkillsInstall(install) {
35514
+ return new Promise((resolve19) => {
35515
+ const plan = resolveSkillsInstallSpawn(install);
35516
+ const child = (0, import_node_child_process2.spawn)(plan.command, plan.args, {
35517
+ stdio: ["ignore", "ignore", "pipe"],
35518
+ env: process.env,
35519
+ shell: plan.shell
35520
+ });
35521
+ let stderr = "";
35522
+ child.stderr.on("data", (chunk) => {
35523
+ stderr += chunk.toString("utf-8");
35524
+ });
35525
+ child.on("error", (error) => {
35526
+ resolve19({
35527
+ ok: false,
35528
+ detail: `failed to start ${install.command}: ${error.message}`,
35529
+ manualCommand: install.manualCommand
35530
+ });
35531
+ });
35532
+ child.on("close", (code) => {
35533
+ if (code === 0) {
35534
+ resolve19({ ok: true, detail: "", manualCommand: install.manualCommand });
35535
+ return;
35536
+ }
35537
+ const detail = stderr.trim();
35538
+ resolve19({
35539
+ ok: false,
35540
+ detail: detail ? `${install.command}: ${detail}` : `${install.command} exited ${code}`,
35541
+ manualCommand: install.manualCommand
35542
+ });
35543
+ });
35544
+ });
35545
+ }
35546
+ async function runSkillsInstall(installs, agents) {
35547
+ const failures = [];
35548
+ for (const install of installs) {
35549
+ const result = await runOneSkillsInstall(install);
35550
+ if (result.ok) return true;
35551
+ failures.push(result);
35552
+ }
35553
+ const details = failures.map((failure) => failure.detail).filter(Boolean).join("\n");
35554
+ const attemptedCommands = failures.map((failure) => ` ${failure.manualCommand}`).join("\n");
35555
+ const retryAgent = agents.at(0);
35556
+ process.stderr.write(
35557
+ `Deepline agent-skills refresh failed for ${agents.join(", ")}. The Deepline command will continue; this only affects optional local agent instructions, not authentication, data, or billing.
35558
+ ` + (attemptedCommands ? `Attempted installer command${failures.length === 1 ? "" : "s"}:
35559
+ ${attemptedCommands}
35560
+ ` : "") + (details ? `Installer output:
35561
+ ${details}
35562
+ ` : "") + (retryAgent ? `To retry with full installer output: deepline skills --agent ${retryAgent} --json
35563
+ ` : "") + `To temporarily suppress automatic skills sync: ${temporarySkillsSyncSkipCommand()}
35564
+ `
35565
+ );
35566
+ return false;
35567
+ }
35568
+ function runLegacySkillsCleanup(agents) {
35569
+ const candidates = hasCommand("bunx") ? [
35570
+ {
35571
+ command: "bunx",
35572
+ args: [
35573
+ "--bun",
35574
+ "skills",
35575
+ "remove",
35576
+ "--global",
35577
+ "--agent",
35578
+ ...agents,
35579
+ "-y",
35580
+ ...LEGACY_SKILL_NAMES_TO_REMOVE
35581
+ ]
35582
+ },
35583
+ {
35584
+ command: "npx",
35585
+ args: [
35586
+ "--yes",
35587
+ "skills",
35588
+ "remove",
35589
+ "--global",
35590
+ "--agent",
35591
+ ...agents,
35592
+ "-y",
35593
+ ...LEGACY_SKILL_NAMES_TO_REMOVE
35594
+ ]
35595
+ }
35596
+ ] : [
35597
+ {
35598
+ command: "npx",
35599
+ args: [
35600
+ "--yes",
35601
+ "skills",
35602
+ "remove",
35603
+ "--global",
35604
+ "--agent",
35605
+ ...agents,
35606
+ "-y",
35607
+ ...LEGACY_SKILL_NAMES_TO_REMOVE
35608
+ ]
35609
+ }
35610
+ ];
35611
+ for (const candidate of candidates) {
35612
+ const plan = resolveShellSpawn(candidate.command, candidate.args);
35613
+ const result = (0, import_node_child_process2.spawnSync)(plan.command, plan.args, {
35614
+ stdio: "ignore",
35615
+ env: process.env,
35616
+ shell: plan.shell
35617
+ });
35618
+ if (result.status === 0) return;
35619
+ }
35620
+ }
35621
+ function writeSdkSkillsStatusLine(line) {
35622
+ const progress = getActiveCliProgress();
35623
+ if (progress) {
35624
+ progress.writeLine(line);
35625
+ return;
35626
+ }
35627
+ process.stderr.write(`${line}
35628
+ `);
35629
+ }
35630
+ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
35631
+ if (shouldSkipSkillsSync()) return;
35632
+ const usingPluginSkills = hasActivePluginSkills();
35633
+ if (usingPluginSkills) {
35634
+ return;
35635
+ }
35636
+ const localVersion = readSdkSkillsLocalVersion(baseUrl);
35637
+ const update = options.update === void 0 ? await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
35638
+ needsUpdate: options.update.needs_update,
35639
+ remoteVersion: options.update.remote.version
35640
+ } : null;
35641
+ if (!update?.needsUpdate || !update.remoteVersion) {
35642
+ return;
35643
+ }
35644
+ const agents = resolveAutoSyncSkillAgents();
35645
+ if (agents.length > 0 && hasFailedSkillsSync(baseUrl, update.remoteVersion, agents)) {
35646
+ return;
35647
+ }
35648
+ const remoteSkillNames = await fetchV1SkillNames(baseUrl);
35649
+ const skillNames = buildSdkSkillNames(
35650
+ remoteSkillNames.length > 0 ? remoteSkillNames : DEFAULT_SDK_SKILL_NAMES
35651
+ );
35652
+ if (skillNames.length === 0) return;
35653
+ if (agents.length === 0) {
35654
+ writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
35655
+ return;
35656
+ }
35657
+ const installs = resolveSkillsInstallCommands(baseUrl, skillNames, agents);
35658
+ if (installs.length === 0) {
35659
+ writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
35660
+ return;
35661
+ }
35662
+ writeSdkSkillsStatusLine("Deepline skills changed; syncing agent skills...");
35663
+ const installed = await runSkillsInstall(installs, agents);
35664
+ if (!installed) {
35665
+ markFailedSkillsSync(baseUrl, update.remoteVersion, agents);
35666
+ return;
35667
+ }
35668
+ runLegacySkillsCleanup(agents);
35669
+ writeSdkSkillsLocalVersion(baseUrl, update.remoteVersion, agents);
35670
+ clearUnavailableSkillsNotice(baseUrl);
35671
+ clearFailedSkillsSync(baseUrl, agents);
35672
+ writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
35673
+ }
35674
+
35260
35675
  // src/cli/commands/skills.ts
35261
35676
  var RUNTIME_TO_SKILLS_AGENT = {
35262
35677
  antigravity: "antigravity",
@@ -35318,17 +35733,17 @@ function detectSkillsAgents(input2) {
35318
35733
  if (knownAgent) return [knownAgent];
35319
35734
  const roots = [
35320
35735
  ...input2.scope === "local" && input2.root ? [input2.root] : [],
35321
- input2.homeDir ?? (0, import_node_os12.homedir)()
35736
+ input2.homeDir ?? (0, import_node_os11.homedir)()
35322
35737
  ];
35323
35738
  const detected = AGENT_MARKERS.filter(
35324
35739
  (marker) => roots.some(
35325
- (root) => marker.paths.some((path) => (0, import_node_fs15.existsSync)((0, import_node_path17.join)(root, path)))
35740
+ (root) => marker.paths.some((path) => (0, import_node_fs16.existsSync)((0, import_node_path18.join)(root, path)))
35326
35741
  )
35327
35742
  ).map((marker) => marker.agent);
35328
35743
  return detected.length > 0 ? detected : ["*"];
35329
35744
  }
35330
35745
  function skillsStatePathForScope(baseUrl, scope, root) {
35331
- return scope === "local" && root ? (0, import_node_path17.join)(root, ".deepline", "setup", "skills.json") : (0, import_node_path17.join)(sdkCliStateDirPath(baseUrl), "skills-install.json");
35746
+ return scope === "local" && root ? (0, import_node_path18.join)(root, ".deepline", "setup", "skills.json") : (0, import_node_path18.join)(sdkCliStateDirPath(baseUrl), "skills-install.json");
35332
35747
  }
35333
35748
  function buildSkillsPlan(input2) {
35334
35749
  const scopeArgs = input2.scope === "global" ? ["--global"] : [];
@@ -35395,7 +35810,7 @@ function isSkillsPlanCurrent(plan, state) {
35395
35810
  }
35396
35811
  function readSkillsInstallState(path) {
35397
35812
  try {
35398
- const parsed = JSON.parse((0, import_node_fs15.readFileSync)(path, "utf8"));
35813
+ const parsed = JSON.parse((0, import_node_fs16.readFileSync)(path, "utf8"));
35399
35814
  return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
35400
35815
  } catch {
35401
35816
  return null;
@@ -35404,7 +35819,7 @@ function readSkillsInstallState(path) {
35404
35819
  function runProcess(command, args, cwd) {
35405
35820
  return new Promise((resolve19, reject) => {
35406
35821
  const plan = resolveShellSpawn(command, args);
35407
- const child = (0, import_node_child_process2.spawn)(plan.command, plan.args, {
35822
+ const child = (0, import_node_child_process3.spawn)(plan.command, plan.args, {
35408
35823
  cwd,
35409
35824
  env: process.env,
35410
35825
  stdio: ["ignore", "ignore", "pipe"],
@@ -35458,7 +35873,7 @@ async function runSkillsCommand(options, dependencies = {}) {
35458
35873
  );
35459
35874
  return 0;
35460
35875
  }
35461
- if (isSkillsPlanCurrent(plan, readSkillsInstallState(plan.statePath))) {
35876
+ if (isSkillsPlanCurrent(plan, readSkillsInstallState(plan.statePath)) && !hasFailedAutomaticSkillsSync(baseUrl, agents)) {
35462
35877
  printCommandEnvelope(
35463
35878
  {
35464
35879
  ok: true,
@@ -35539,8 +35954,8 @@ async function runSkillsCommand(options, dependencies = {}) {
35539
35954
  );
35540
35955
  return 5;
35541
35956
  }
35542
- (0, import_node_fs15.mkdirSync)((0, import_node_path17.dirname)(plan.statePath), { recursive: true });
35543
- (0, import_node_fs15.writeFileSync)(
35957
+ (0, import_node_fs16.mkdirSync)((0, import_node_path18.dirname)(plan.statePath), { recursive: true });
35958
+ (0, import_node_fs16.writeFileSync)(
35544
35959
  plan.statePath,
35545
35960
  `${JSON.stringify(
35546
35961
  {
@@ -35558,6 +35973,9 @@ async function runSkillsCommand(options, dependencies = {}) {
35558
35973
  `,
35559
35974
  "utf8"
35560
35975
  );
35976
+ if (scope === "global") {
35977
+ clearFailedAutomaticSkillsSync(baseUrl, agents);
35978
+ }
35561
35979
  printCommandEnvelope(
35562
35980
  {
35563
35981
  ok: true,
@@ -35674,7 +36092,7 @@ function phasesFromLegacyStatus(status) {
35674
36092
  function readSetupState(input2) {
35675
36093
  try {
35676
36094
  const parsed = JSON.parse(
35677
- (0, import_node_fs16.readFileSync)(
36095
+ (0, import_node_fs17.readFileSync)(
35678
36096
  setupStatePath(input2.baseUrl, input2.scope, input2.root),
35679
36097
  "utf8"
35680
36098
  )
@@ -35750,7 +36168,7 @@ function buildPendingAuthorizationOutput(input2) {
35750
36168
  };
35751
36169
  }
35752
36170
  function setupStatePath(baseUrl, scope, root) {
35753
- return scope === "local" && root ? (0, import_node_path18.join)(root, ".deepline", "setup", "state.json") : (0, import_node_path18.join)(sdkCliStateDirPath(baseUrl), "setup.json");
36171
+ return scope === "local" && root ? (0, import_node_path19.join)(root, ".deepline", "setup", "state.json") : (0, import_node_path19.join)(sdkCliStateDirPath(baseUrl), "setup.json");
35754
36172
  }
35755
36173
  async function captureStdout2(run) {
35756
36174
  let stdout = "";
@@ -35779,14 +36197,14 @@ function asRecord3(value) {
35779
36197
  }
35780
36198
  function safeRead(path) {
35781
36199
  try {
35782
- return (0, import_node_fs16.readFileSync)(path, "utf8");
36200
+ return (0, import_node_fs17.readFileSync)(path, "utf8");
35783
36201
  } catch {
35784
36202
  return "";
35785
36203
  }
35786
36204
  }
35787
36205
  function isNpmManagedDeeplinePath(path) {
35788
36206
  try {
35789
- return (0, import_node_fs16.realpathSync)(path).includes(`${(0, import_node_path18.join)("node_modules", "deepline")}`);
36207
+ return (0, import_node_fs17.realpathSync)(path).includes(`${(0, import_node_path19.join)("node_modules", "deepline")}`);
35790
36208
  } catch {
35791
36209
  return false;
35792
36210
  }
@@ -35796,50 +36214,50 @@ function isInstallerManagedLegacyLauncher(path) {
35796
36214
  return content.includes("DEEPLINE_REAL_BINARY") && content.includes("DEEPLINE_ACTIVE_FILE");
35797
36215
  }
35798
36216
  function removeKnownLegacyPaths(baseUrl) {
35799
- const home = (0, import_node_os13.homedir)();
35800
- const hostDir = (0, import_node_path18.join)(home, ".local", "deepline", baseUrlSlug(baseUrl));
35801
- const legacyLauncherPath = (0, import_node_path18.join)(home, ".local", "bin", "deepline");
36217
+ const home = (0, import_node_os12.homedir)();
36218
+ const hostDir = (0, import_node_path19.join)(home, ".local", "deepline", baseUrlSlug(baseUrl));
36219
+ const legacyLauncherPath = (0, import_node_path19.join)(home, ".local", "bin", "deepline");
35802
36220
  const installerCommandPath = safeRead(
35803
- (0, import_node_path18.join)(hostDir, "sdk", ".command-path")
36221
+ (0, import_node_path19.join)(hostDir, "sdk", ".command-path")
35804
36222
  ).trim();
35805
- const relativeInstallerCommandPath = installerCommandPath ? (0, import_node_path18.relative)((0, import_node_path18.resolve)(hostDir), (0, import_node_path18.resolve)(installerCommandPath)) : "";
36223
+ const relativeInstallerCommandPath = installerCommandPath ? (0, import_node_path19.relative)((0, import_node_path19.resolve)(hostDir), (0, import_node_path19.resolve)(installerCommandPath)) : "";
35806
36224
  const isOwnedInstallerCommand = Boolean(installerCommandPath) && relativeInstallerCommandPath !== "" && !relativeInstallerCommandPath.startsWith(
35807
36225
  `..${process.platform === "win32" ? "\\" : "/"}`
35808
- ) && relativeInstallerCommandPath !== ".." && (0, import_node_path18.basename)(installerCommandPath) === "deepline";
36226
+ ) && relativeInstallerCommandPath !== ".." && (0, import_node_path19.basename)(installerCommandPath) === "deepline";
35809
36227
  const candidates = [
35810
36228
  ...isInstallerManagedLegacyLauncher(legacyLauncherPath) ? [legacyLauncherPath] : [],
35811
- (0, import_node_path18.join)(home, ".local", "bin", "deepline-real"),
35812
- (0, import_node_path18.join)(hostDir, "bin", "deepline"),
35813
- (0, import_node_path18.join)(hostDir, "bin", "deepline-real"),
35814
- (0, import_node_path18.join)(hostDir, "cli", ".install-method"),
35815
- (0, import_node_path18.join)(hostDir, "cli", ".version"),
35816
- (0, import_node_path18.join)(hostDir, "sdk", ".install-method"),
35817
- (0, import_node_path18.join)(hostDir, "sdk", ".command-path"),
36229
+ (0, import_node_path19.join)(home, ".local", "bin", "deepline-real"),
36230
+ (0, import_node_path19.join)(hostDir, "bin", "deepline"),
36231
+ (0, import_node_path19.join)(hostDir, "bin", "deepline-real"),
36232
+ (0, import_node_path19.join)(hostDir, "cli", ".install-method"),
36233
+ (0, import_node_path19.join)(hostDir, "cli", ".version"),
36234
+ (0, import_node_path19.join)(hostDir, "sdk", ".install-method"),
36235
+ (0, import_node_path19.join)(hostDir, "sdk", ".command-path"),
35818
36236
  ...isOwnedInstallerCommand ? [
35819
36237
  installerCommandPath,
35820
- (0, import_node_path18.join)((0, import_node_path18.dirname)(installerCommandPath), "deepline-sdk")
36238
+ (0, import_node_path19.join)((0, import_node_path19.dirname)(installerCommandPath), "deepline-sdk")
35821
36239
  ] : []
35822
36240
  ];
35823
36241
  const removed = [];
35824
36242
  for (const path of candidates) {
35825
- if (!(0, import_node_fs16.existsSync)(path)) continue;
36243
+ if (!(0, import_node_fs17.existsSync)(path)) continue;
35826
36244
  if (path === installerCommandPath && isNpmManagedDeeplinePath(path)) {
35827
36245
  continue;
35828
36246
  }
35829
- (0, import_node_fs16.rmSync)(path, { force: true });
36247
+ (0, import_node_fs17.rmSync)(path, { force: true });
35830
36248
  removed.push(path);
35831
36249
  }
35832
36250
  return removed;
35833
36251
  }
35834
36252
  function resolvePathCommands(command) {
35835
- const lookup = (0, import_node_child_process3.spawnSync)(
36253
+ const lookup = (0, import_node_child_process4.spawnSync)(
35836
36254
  process.platform === "win32" ? "where" : "which",
35837
36255
  process.platform === "win32" ? [command] : ["-a", command],
35838
36256
  { encoding: "utf8", shell: process.platform === "win32" }
35839
36257
  );
35840
36258
  return [
35841
36259
  ...new Set(
35842
- String(lookup.stdout ?? "").split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((path) => (0, import_node_path18.resolve)(path))
36260
+ String(lookup.stdout ?? "").split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((path) => (0, import_node_path19.resolve)(path))
35843
36261
  )
35844
36262
  ];
35845
36263
  }
@@ -35849,7 +36267,7 @@ function resolvePathCommand(command) {
35849
36267
  function isHomebrewFormulaCommand(path) {
35850
36268
  let resolvedPath = path;
35851
36269
  try {
35852
- resolvedPath = (0, import_node_fs16.realpathSync)(path);
36270
+ resolvedPath = (0, import_node_fs17.realpathSync)(path);
35853
36271
  } catch {
35854
36272
  return false;
35855
36273
  }
@@ -35859,8 +36277,8 @@ function isHomebrewFormulaCommand(path) {
35859
36277
  }
35860
36278
  function resolvePersistentGlobalCommand(dependencies = {}) {
35861
36279
  const platform3 = dependencies.platform ?? process.platform;
35862
- const run = dependencies.spawn ?? import_node_child_process3.spawnSync;
35863
- const pathExists = dependencies.exists ?? import_node_fs16.existsSync;
36280
+ const run = dependencies.spawn ?? import_node_child_process4.spawnSync;
36281
+ const pathExists = dependencies.exists ?? import_node_fs17.existsSync;
35864
36282
  const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
35865
36283
  const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
35866
36284
  if (homebrewCommand) return homebrewCommand;
@@ -35872,7 +36290,7 @@ function resolvePersistentGlobalCommand(dependencies = {}) {
35872
36290
  if (prefix.status !== 0) return null;
35873
36291
  const root = String(prefix.stdout ?? "").trim();
35874
36292
  if (!root) return null;
35875
- const candidates = platform3 === "win32" ? [(0, import_node_path18.join)(root, "deepline.cmd"), (0, import_node_path18.join)(root, "deepline")] : [(0, import_node_path18.join)(root, "bin", "deepline")];
36293
+ const candidates = platform3 === "win32" ? [(0, import_node_path19.join)(root, "deepline.cmd"), (0, import_node_path19.join)(root, "deepline")] : [(0, import_node_path19.join)(root, "bin", "deepline")];
35876
36294
  return candidates.find((candidate) => pathExists(candidate)) ?? null;
35877
36295
  }
35878
36296
  function inspectGlobalCliAvailability(input2) {
@@ -35885,20 +36303,20 @@ function inspectGlobalCliAvailability(input2) {
35885
36303
  }
35886
36304
  function pathsResolveToSameFile(left, right) {
35887
36305
  try {
35888
- return (0, import_node_fs16.realpathSync)(left) === (0, import_node_fs16.realpathSync)(right);
36306
+ return (0, import_node_fs17.realpathSync)(left) === (0, import_node_fs17.realpathSync)(right);
35889
36307
  } catch {
35890
- return (0, import_node_path18.resolve)(left) === (0, import_node_path18.resolve)(right);
36308
+ return (0, import_node_path19.resolve)(left) === (0, import_node_path19.resolve)(right);
35891
36309
  }
35892
36310
  }
35893
36311
  function isKnownDeeplineCommand(path) {
35894
- const entrypoint = process.argv[1] ? (0, import_node_path18.resolve)(process.argv[1]) : "";
36312
+ const entrypoint = process.argv[1] ? (0, import_node_path19.resolve)(process.argv[1]) : "";
35895
36313
  let resolvedPath = path;
35896
36314
  try {
35897
- resolvedPath = (0, import_node_fs16.realpathSync)(path);
36315
+ resolvedPath = (0, import_node_fs17.realpathSync)(path);
35898
36316
  } catch {
35899
36317
  }
35900
36318
  if (entrypoint && resolvedPath === entrypoint) return true;
35901
- if (resolvedPath.includes(`${(0, import_node_path18.join)("node_modules", "deepline")}`)) return true;
36319
+ if (resolvedPath.includes(`${(0, import_node_path19.join)("node_modules", "deepline")}`)) return true;
35902
36320
  const content = safeRead(path);
35903
36321
  return content.includes("node_modules/deepline") || content.includes("node_modules\\deepline") || content.includes("DEEPLINE_CONFIG_SCOPE") || content.includes("deepline-real");
35904
36322
  }
@@ -35906,9 +36324,9 @@ function inspectPathConflict() {
35906
36324
  const commandPath = resolvePathCommand("deepline");
35907
36325
  if (!commandPath || isKnownDeeplineCommand(commandPath)) return null;
35908
36326
  try {
35909
- if ((0, import_node_fs16.lstatSync)(commandPath).isSymbolicLink()) {
35910
- const target = (0, import_node_fs16.realpathSync)(commandPath);
35911
- if (target.includes(`${(0, import_node_path18.join)("node_modules", "deepline")}`)) return null;
36327
+ if ((0, import_node_fs17.lstatSync)(commandPath).isSymbolicLink()) {
36328
+ const target = (0, import_node_fs17.realpathSync)(commandPath);
36329
+ if (target.includes(`${(0, import_node_path19.join)("node_modules", "deepline")}`)) return null;
35912
36330
  }
35913
36331
  } catch {
35914
36332
  }
@@ -35916,8 +36334,8 @@ function inspectPathConflict() {
35916
36334
  }
35917
36335
  function writeSetupState(input2) {
35918
36336
  const path = setupStatePath(input2.baseUrl, input2.scope, input2.root);
35919
- (0, import_node_fs16.mkdirSync)((0, import_node_path18.dirname)(path), { recursive: true });
35920
- (0, import_node_fs16.writeFileSync)(
36337
+ (0, import_node_fs17.mkdirSync)((0, import_node_path19.dirname)(path), { recursive: true });
36338
+ (0, import_node_fs17.writeFileSync)(
35921
36339
  path,
35922
36340
  `${JSON.stringify(
35923
36341
  {
@@ -35957,7 +36375,7 @@ function failSetupPhase(phases, phase, code) {
35957
36375
  phases[phase] = { status: "failed", code };
35958
36376
  }
35959
36377
  function rollbackCommand(scope, root) {
35960
- const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path18.join)(root, ".deepline", "runtime"))}` : "";
36378
+ const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path19.join)(root, ".deepline", "runtime"))}` : "";
35961
36379
  return `npm install -g${prefix} --no-audit --no-fund --include=optional --allow-scripts=esbuild deepline@${SDK_VERSION}`;
35962
36380
  }
35963
36381
  function setupResumeCommand(baseUrl, scope) {
@@ -36044,12 +36462,12 @@ function buildDoctorAssessment(input2) {
36044
36462
  const connected = input2.authStatus.payload?.connected === true;
36045
36463
  const authScopeOk = input2.scope === "local" ? Boolean(projectAuth) : Boolean(apiKey && !projectAuth);
36046
36464
  const skillsOk = skillsState?.scope === input2.scope && typeof skillsState.skillsVersion === "string" && Array.isArray(skillsState.agents) && skillsState.agents.length > 0;
36047
- const runningCliPath = process.argv[1] ? (0, import_node_path18.resolve)(process.argv[1]) : null;
36465
+ const runningCliPath = process.argv[1] ? (0, import_node_path19.resolve)(process.argv[1]) : null;
36048
36466
  const globalCli = input2.scope === "global" ? inspectGlobalCliAvailability() : null;
36049
36467
  const pathGlobalCli = globalCli?.path ?? null;
36050
36468
  const cliPath = input2.scope === "global" ? pathGlobalCli : runningCliPath;
36051
36469
  const cliScopeOk = input2.scope === "global" ? Boolean(pathGlobalCli) : Boolean(
36052
- input2.root && runningCliPath?.includes((0, import_node_path18.join)(input2.root, ".deepline", "runtime"))
36470
+ input2.root && runningCliPath?.includes((0, import_node_path19.join)(input2.root, ".deepline", "runtime"))
36053
36471
  );
36054
36472
  const checks = {
36055
36473
  cli: {
@@ -37204,174 +37622,15 @@ chooses the connected Slack channel or member and the events it receives.
37204
37622
  });
37205
37623
  }
37206
37624
 
37207
- // src/cli/commands/switch.ts
37208
- var import_node_fs17 = require("fs");
37209
- var import_node_os14 = require("os");
37210
- var import_node_path19 = require("path");
37211
- function hostSlugFromBaseUrl(baseUrl) {
37212
- try {
37213
- const url = new URL(baseUrl);
37214
- const port = url.port ? Number.parseInt(url.port, 10) : null;
37215
- let slug = (url.hostname || "unknown").replace(/[^a-zA-Z0-9]/g, "-");
37216
- if (port && port !== 80 && port !== 443) {
37217
- slug = `${slug}-${port}`;
37218
- }
37219
- return slug.toLowerCase().replace(/^-+|-+$/g, "") || "unknown";
37220
- } catch {
37221
- return "unknown";
37222
- }
37223
- }
37224
- function resolveConfigScope() {
37225
- const explicit = (process.env.DEEPLINE_CONFIG_SCOPE || "").trim();
37226
- if (explicit) return explicit;
37227
- return hostSlugFromBaseUrl(autoDetectBaseUrl());
37228
- }
37229
- function activeFamilyPath() {
37230
- const home = process.env.HOME || process.env.USERPROFILE || (0, import_node_os14.homedir)();
37231
- return (0, import_node_path19.join)(
37232
- home,
37233
- ".local",
37234
- "deepline",
37235
- resolveConfigScope(),
37236
- "cli",
37237
- ".active-family"
37238
- );
37239
- }
37240
- function readActiveFamily() {
37241
- const path = activeFamilyPath();
37242
- try {
37243
- return (0, import_node_fs17.readFileSync)(path, "utf-8").trim() || "sdk";
37244
- } catch {
37245
- return "sdk";
37246
- }
37247
- }
37248
- function writeActiveFamily(family) {
37249
- const path = activeFamilyPath();
37250
- (0, import_node_fs17.mkdirSync)((0, import_node_path19.dirname)(path), { recursive: true });
37251
- (0, import_node_fs17.writeFileSync)(path, `${family}
37252
- `, "utf-8");
37253
- return path;
37254
- }
37255
- function forcePythonCliFamily() {
37256
- return writeActiveFamily("python");
37257
- }
37258
- function handleSwitch(action, options) {
37259
- const normalized = (action || "status").trim().toLowerCase();
37260
- if (normalized === "status") {
37261
- const path = activeFamilyPath();
37262
- const activeFamily = readActiveFamily();
37263
- printCommandEnvelope(
37264
- {
37265
- ok: true,
37266
- active_family: activeFamily,
37267
- active_family_path: path,
37268
- active_family_file_exists: (0, import_node_fs17.existsSync)(path),
37269
- render: {
37270
- sections: [
37271
- {
37272
- title: "cli switch",
37273
- lines: [
37274
- `Active CLI family: ${activeFamily}`,
37275
- `Active family file: ${path}`
37276
- ]
37277
- }
37278
- ]
37279
- }
37280
- },
37281
- { json: options.json }
37282
- );
37283
- return 0;
37284
- }
37285
- if (normalized === "python" || normalized === "rollback") {
37286
- const path = writeActiveFamily("python");
37287
- printCommandEnvelope(
37288
- {
37289
- ok: true,
37290
- active_family: "python",
37291
- active_family_path: path,
37292
- render: {
37293
- sections: [
37294
- {
37295
- title: "cli switch",
37296
- lines: [
37297
- "Switched installer-managed `deepline` to the Python CLI."
37298
- ]
37299
- }
37300
- ]
37301
- }
37302
- },
37303
- { json: options.json }
37304
- );
37305
- return 0;
37306
- }
37307
- if (normalized === "sdk") {
37308
- const path = writeActiveFamily("sdk");
37309
- printCommandEnvelope(
37310
- {
37311
- ok: true,
37312
- active_family: "sdk",
37313
- active_family_path: path,
37314
- render: {
37315
- sections: [
37316
- {
37317
- title: "cli switch",
37318
- lines: ["Switched installer-managed `deepline` to the SDK CLI."]
37319
- }
37320
- ]
37321
- }
37322
- },
37323
- { json: options.json }
37324
- );
37325
- return 0;
37326
- }
37327
- const message = `Unknown switch target: ${action}. Use one of: status, sdk, python, rollback.`;
37328
- const envelope = {
37329
- ok: false,
37330
- error: message,
37331
- code: "usage_error",
37332
- render: {
37333
- sections: [{ title: "cli switch", lines: [message] }]
37334
- }
37335
- };
37336
- const wantsJson = options.json === true;
37337
- if (wantsJson) {
37338
- printCommandEnvelope(envelope, { json: true });
37339
- } else {
37340
- process.stderr.write(`${message}
37341
- `);
37342
- }
37343
- return 2;
37344
- }
37345
- function registerSwitchCommands(program) {
37346
- program.command("switch [target]").description(
37347
- "Switch the installer-managed Deepline CLI between SDK and Python families."
37348
- ).option("--json", "Emit JSON output").addHelpText(
37349
- "after",
37350
- `
37351
- Notes:
37352
- This command changes only the local installer-managed wrapper state. It does
37353
- not re-authenticate, reinstall packages, or contact Deepline servers.
37354
-
37355
- Examples:
37356
- deepline switch status
37357
- deepline switch python
37358
- deepline switch rollback
37359
- deepline switch sdk
37360
- `
37361
- ).action((target, options) => {
37362
- process.exitCode = handleSwitch(target, options);
37363
- });
37364
- }
37365
-
37366
37625
  // src/cli/commands/tools.ts
37367
37626
  var import_commander3 = require("commander");
37368
37627
  var import_node_fs19 = require("fs");
37369
- var import_node_os16 = require("os");
37628
+ var import_node_os14 = require("os");
37370
37629
  var import_node_path21 = require("path");
37371
37630
 
37372
37631
  // src/tool-output.ts
37373
37632
  var import_node_fs18 = require("fs");
37374
- var import_node_os15 = require("os");
37633
+ var import_node_os13 = require("os");
37375
37634
  var import_node_path20 = require("path");
37376
37635
  function isPlainObject(value) {
37377
37636
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -37499,7 +37758,7 @@ function projectRowOutput(conversion) {
37499
37758
  };
37500
37759
  }
37501
37760
  function ensureOutputDir() {
37502
- const outputDir = (0, import_node_path20.join)((0, import_node_os15.homedir)(), ".local", "share", "deepline", "data");
37761
+ const outputDir = (0, import_node_path20.join)((0, import_node_os13.homedir)(), ".local", "share", "deepline", "data");
37503
37762
  (0, import_node_fs18.mkdirSync)(outputDir, { recursive: true });
37504
37763
  return outputDir;
37505
37764
  }
@@ -37587,6 +37846,9 @@ var TOOL_CATEGORY_DESCRIPTIONS = {
37587
37846
  premium: "Higher-cost tools with premium provider coverage.",
37588
37847
  free: "Free tools that do not spend Deepline credits."
37589
37848
  };
37849
+ var WELL_KNOWN_TOOL_CATEGORIES = Object.freeze(
37850
+ Object.keys(TOOL_CATEGORY_DESCRIPTIONS)
37851
+ );
37590
37852
  function describeToolCategory(category) {
37591
37853
  return TOOL_CATEGORY_DESCRIPTIONS[category] ?? null;
37592
37854
  }
@@ -38571,17 +38833,7 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
38571
38833
  const extractedValues = extractionContractEntries(
38572
38834
  arrayField2(toolExecutionResult, "extractedValues", "extracted_values")
38573
38835
  );
38574
- const cost = recordField2(tool, "cost");
38575
- const deeplineCredits = numberField2(
38576
- tool,
38577
- "deeplineCreditsPerPricingUnit",
38578
- "deepline_credits_per_pricing_unit"
38579
- );
38580
- const deeplineUsdPerPricingUnit = numberField2(
38581
- tool,
38582
- "deeplineUsdPerPricingUnit",
38583
- "deepline_usd_per_pricing_unit"
38584
- );
38836
+ const pricing = toolPricingContractForDescribe(tool);
38585
38837
  const deprecation = recordField2(tool, "deprecation");
38586
38838
  const replacementToolId = stringField2(
38587
38839
  deprecation,
@@ -38623,12 +38875,7 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
38623
38875
  ...Object.prototype.hasOwnProperty.call(field, "default") ? { default: field.default } : {}
38624
38876
  })),
38625
38877
  inputSchema,
38626
- cost: {
38627
- pricingModel: stringField2(cost, "pricingModel", "pricing_model") || null,
38628
- billingMode: stringField2(cost, "billingMode", "billing_mode") || null,
38629
- deeplineCreditsPerPricingUnit: deeplineCredits,
38630
- deeplineUsdPerPricingUnit
38631
- },
38878
+ cost: pricing,
38632
38879
  getters: {
38633
38880
  extractedLists,
38634
38881
  extractedValues
@@ -38637,6 +38884,38 @@ function toolContractJsonForDescribe(tool, requestedToolId) {
38637
38884
  ...starterScript ? { starterScript } : {}
38638
38885
  };
38639
38886
  }
38887
+ function toolPricingContractForDescribe(tool) {
38888
+ const legacyCost = recordField2(tool, "cost");
38889
+ const pricingValue = tool.pricing;
38890
+ const hasCanonicalPricing = isRecord12(pricingValue);
38891
+ const canonicalPricing = hasCanonicalPricing ? pricingValue : {};
38892
+ const unit = stringField2(canonicalPricing, "unit");
38893
+ const legacyPricingModel = stringField2(
38894
+ legacyCost,
38895
+ "pricingModel",
38896
+ "pricing_model"
38897
+ );
38898
+ const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
38899
+ return {
38900
+ pricingModel: pricingModel || null,
38901
+ unit: unit || null,
38902
+ displayText: stringField2(canonicalPricing, "displayText", "display_text") || null,
38903
+ summary: stringField2(canonicalPricing, "summary") || null,
38904
+ billingMode: stringField2(legacyCost, "billingMode", "billing_mode") || null,
38905
+ billingSource: stringField2(tool, "billingSource", "billing_source") || null,
38906
+ billingSourceLabel: stringField2(tool, "billingSourceLabel", "billing_source_label") || null,
38907
+ deeplineCreditsPerPricingUnit: hasCanonicalPricing ? numberField2(canonicalPricing, "creditsPerUnit", "credits_per_unit") : numberField2(
38908
+ tool,
38909
+ "deeplineCreditsPerPricingUnit",
38910
+ "deepline_credits_per_pricing_unit"
38911
+ ),
38912
+ deeplineUsdPerPricingUnit: hasCanonicalPricing ? numberField2(canonicalPricing, "usdPerUnit", "usd_per_unit") : numberField2(
38913
+ tool,
38914
+ "deeplineUsdPerPricingUnit",
38915
+ "deepline_usd_per_pricing_unit"
38916
+ )
38917
+ };
38918
+ }
38640
38919
  function extractionContractEntries(entries) {
38641
38920
  return entries.flatMap((entry) => {
38642
38921
  if (!isRecord12(entry)) return [];
@@ -38866,13 +39145,16 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
38866
39145
  const contract = toolContractJsonForDescribe(tool, requestedToolId);
38867
39146
  const cost = isRecord12(contract.cost) ? contract.cost : {};
38868
39147
  const pricingModel = stringField2(cost, "pricingModel") || "unknown";
38869
- const billingMode = stringField2(cost, "billingMode") || "unknown";
38870
- const unit = pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit";
39148
+ const billing = stringField2(cost, "billingMode") || stringField2(cost, "billingSourceLabel") || stringField2(cost, "billingSource") || "unknown";
39149
+ const explicitUnit = stringField2(cost, "unit");
39150
+ const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
38871
39151
  const credits = numberField2(cost, "deeplineCreditsPerPricingUnit");
38872
39152
  const usd = numberField2(cost, "deeplineUsdPerPricingUnit");
38873
- const price = credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable";
39153
+ const displayText = stringField2(cost, "displayText");
39154
+ const summary = stringField2(cost, "summary");
39155
+ const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
38874
39156
  console.log(`${options.heading ?? `Pricing: ${contract.toolId}`}: ${price}`);
38875
- console.log(`Billing: ${billingMode}`);
39157
+ console.log(`Billing: ${billing}`);
38876
39158
  }
38877
39159
  function printToolSchemaOnly(tool, requestedToolId) {
38878
39160
  if (isMonitorTypeTool(tool)) {
@@ -39343,9 +39625,9 @@ function apifySyncRecoveryNext(rawResponse) {
39343
39625
  const getDatasetItemsTool = stringField2(getDatasetItems, "tool");
39344
39626
  const getDatasetItemsPayload = recordField2(getDatasetItems, "payload");
39345
39627
  return {
39346
- getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote3(JSON.stringify(getActorRunPayload))} --json`,
39628
+ getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote4(JSON.stringify(getActorRunPayload))} --json`,
39347
39629
  ...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
39348
- getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote3(JSON.stringify(getDatasetItemsPayload))} --json`
39630
+ getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote4(JSON.stringify(getDatasetItemsPayload))} --json`
39349
39631
  } : {}
39350
39632
  };
39351
39633
  }
@@ -39518,7 +39800,7 @@ function parseExecuteOptions(args) {
39518
39800
  function safeFileStem(value) {
39519
39801
  return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
39520
39802
  }
39521
- function shellQuote3(value) {
39803
+ function shellQuote4(value) {
39522
39804
  return `'${value.replace(/'/g, `'\\''`)}'`;
39523
39805
  }
39524
39806
  function powerShellQuote(value) {
@@ -39538,7 +39820,7 @@ function starterScriptJson(script) {
39538
39820
  function seedToolListScript(input2) {
39539
39821
  const stem = safeFileStem(input2.toolId);
39540
39822
  const fileName = `${stem}-workflow-seed-${Date.now()}.play.ts`;
39541
- const scriptDir = (0, import_node_fs19.mkdtempSync)((0, import_node_path21.join)((0, import_node_os16.tmpdir)(), "deepline-workflow-seed-"));
39823
+ const scriptDir = (0, import_node_fs19.mkdtempSync)((0, import_node_path21.join)((0, import_node_os14.tmpdir)(), "deepline-workflow-seed-"));
39542
39824
  (0, import_node_fs19.chmodSync)(scriptDir, 448);
39543
39825
  const scriptPath = (0, import_node_path21.join)(scriptDir, fileName);
39544
39826
  const projectDir = `deepline/projects/${stem}-workflow`;
@@ -39588,7 +39870,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
39588
39870
  path: scriptPath,
39589
39871
  sourceCode: script,
39590
39872
  projectDir,
39591
- macCopyCommand: `mkdir -p ${shellQuote3(projectDir)} && cp ${shellQuote3(scriptPath)} ${shellQuote3(`${projectDir}/${fileName}`)}`,
39873
+ macCopyCommand: `mkdir -p ${shellQuote4(projectDir)} && cp ${shellQuote4(scriptPath)} ${shellQuote4(`${projectDir}/${fileName}`)}`,
39592
39874
  windowsCopyCommand: `New-Item -ItemType Directory -Force -Path ${powerShellQuote(projectDir.replace(/\//g, "\\"))} | Out-Null; Copy-Item -LiteralPath ${powerShellQuote(scriptPath)} -Destination ${powerShellQuote(`${projectDir.replace(/\//g, "\\")}\\${fileName}`)}`
39593
39875
  };
39594
39876
  }
@@ -39615,7 +39897,7 @@ function buildToolExecuteBaseEnvelope(input2) {
39615
39897
  envelope,
39616
39898
  "output"
39617
39899
  );
39618
- const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote3(JSON.stringify(input2.params))} --json`;
39900
+ const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote4(JSON.stringify(input2.params))} --json`;
39619
39901
  const actions = input2.listConversion ? [
39620
39902
  {
39621
39903
  label: "next",
@@ -40008,9 +40290,9 @@ Examples:
40008
40290
  }
40009
40291
 
40010
40292
  // src/cli/commands/update.ts
40011
- var import_node_child_process4 = require("child_process");
40293
+ var import_node_child_process5 = require("child_process");
40012
40294
  var import_node_fs21 = require("fs");
40013
- var import_node_os17 = require("os");
40295
+ var import_node_os15 = require("os");
40014
40296
  var import_node_path23 = require("path");
40015
40297
 
40016
40298
  // src/cli/install-integrity.ts
@@ -40203,14 +40485,14 @@ function posixShellQuote(value) {
40203
40485
  function windowsCmdQuote(value) {
40204
40486
  return `"${value.replace(/"/g, '""')}"`;
40205
40487
  }
40206
- function shellQuote4(value) {
40488
+ function shellQuote5(value) {
40207
40489
  if (process.platform === "win32") {
40208
40490
  return /^[A-Za-z0-9_./:@%+=,-]+$/.test(value) ? value : windowsCmdQuote(value);
40209
40491
  }
40210
40492
  return posixShellQuote(value);
40211
40493
  }
40212
40494
  function buildSourceUpdateCommand(sourceRoot) {
40213
- const quotedRoot = shellQuote4(sourceRoot);
40495
+ const quotedRoot = shellQuote5(sourceRoot);
40214
40496
  const cdCommand = process.platform === "win32" ? `cd /d ${quotedRoot}` : `cd ${quotedRoot}`;
40215
40497
  return `${cdCommand} && git fetch origin main --tags && git merge --ff-only origin/main`;
40216
40498
  }
@@ -40222,7 +40504,7 @@ function buildSidecarProjectConfigCommand(versionDir, nodeBin) {
40222
40504
  "fs.mkdirSync(dir,{recursive:true});",
40223
40505
  `fs.writeFileSync(path.join(dir,'package.json'),${JSON.stringify(NPM_SDK_SIDECAR_PACKAGE_JSON)});`
40224
40506
  ].join("");
40225
- return `${shellQuote4(nodeBin)} -e ${shellQuote4(script)} ${shellQuote4(versionDir)}`;
40507
+ return `${shellQuote5(nodeBin)} -e ${shellQuote5(script)} ${shellQuote5(versionDir)}`;
40226
40508
  }
40227
40509
  function sidecarStateDir(input2) {
40228
40510
  const scope = input2.env.DEEPLINE_CONFIG_SCOPE?.trim();
@@ -40285,7 +40567,7 @@ function resolvePythonSidecarUpdatePlan(options) {
40285
40567
  const npmCommand = "npm";
40286
40568
  const registryUrl = sidecarRegistryUrl(hostUrl);
40287
40569
  const versionDir = (0, import_node_path23.join)(stateDir, "versions", "<version>");
40288
- const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote4(versionDir)} --registry ${shellQuote4(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote4).join(" ")} ${shellQuote4(packageSpec)}`;
40570
+ const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote5(versionDir)} --registry ${shellQuote5(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote5).join(" ")} ${shellQuote5(packageSpec)}`;
40289
40571
  return {
40290
40572
  kind: "python-sidecar",
40291
40573
  stateDir,
@@ -40345,7 +40627,7 @@ function isHomebrewFormulaEntrypoint(entrypoint) {
40345
40627
  }
40346
40628
  function resolveUpdatePlan(options = {}) {
40347
40629
  const env = options.env ?? process.env;
40348
- const homeDir2 = options.homeDir ?? (0, import_node_os17.homedir)();
40630
+ const homeDir2 = options.homeDir ?? (0, import_node_os15.homedir)();
40349
40631
  const entrypoint = options.entrypoint ?? (process.argv[1] ? (0, import_node_path23.resolve)(process.argv[1]) : "");
40350
40632
  const sourceRoot = entrypoint ? findRepoBackedSdkRoot((0, import_node_path23.dirname)(entrypoint)) : null;
40351
40633
  if (sourceRoot) {
@@ -40387,7 +40669,7 @@ function resolveUpdatePlan(options = {}) {
40387
40669
  fallbackRegistryUrl: publicNpmFallbackRegistryUrl(
40388
40670
  env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
40389
40671
  ),
40390
- manualCommand: `${command} ${args.map(shellQuote4).join(" ")}`
40672
+ manualCommand: `${command} ${args.map(shellQuote5).join(" ")}`
40391
40673
  };
40392
40674
  }
40393
40675
  var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
@@ -40397,7 +40679,7 @@ function autoUpdateFailurePath(plan) {
40397
40679
  return (0, import_node_path23.join)(plan.stateDir, AUTO_UPDATE_FAILURE_FILE);
40398
40680
  }
40399
40681
  return (0, import_node_path23.join)(
40400
- (0, import_node_os17.homedir)(),
40682
+ (0, import_node_os15.homedir)(),
40401
40683
  ".local",
40402
40684
  "deepline",
40403
40685
  "sdk-cli",
@@ -40527,7 +40809,7 @@ function runCommand(command, args, env = process.env) {
40527
40809
  return new Promise((resolveResult) => {
40528
40810
  let output2 = "";
40529
40811
  const plan = resolveShellSpawn(command, args);
40530
- const child = (0, import_node_child_process4.spawn)(plan.command, plan.args, {
40812
+ const child = (0, import_node_child_process5.spawn)(plan.command, plan.args, {
40531
40813
  stdio: ["inherit", "pipe", "pipe"],
40532
40814
  shell: plan.shell,
40533
40815
  env
@@ -40655,23 +40937,23 @@ function writeSidecarLauncher(input2) {
40655
40937
  input2.path,
40656
40938
  [
40657
40939
  "#!/usr/bin/env sh",
40658
- `export DEEPLINE_HOST_URL=${shellQuote4(input2.hostUrl)}`,
40659
- `export DEEPLINE_CONFIG_SCOPE=${shellQuote4(input2.scope)}`,
40660
- `if ${criticalPaths.map((path) => `[ ! -f ${shellQuote4(path)} ]`).join(" || ")}; then`,
40940
+ `export DEEPLINE_HOST_URL=${shellQuote5(input2.hostUrl)}`,
40941
+ `export DEEPLINE_CONFIG_SCOPE=${shellQuote5(input2.scope)}`,
40942
+ `if ${criticalPaths.map((path) => `[ ! -f ${shellQuote5(path)} ]`).join(" || ")}; then`,
40661
40943
  ' if [ -n "${DEEPLINE_REAL_BINARY:-}" ] && [ -x "$DEEPLINE_REAL_BINARY" ]; then',
40662
40944
  ' exec "$DEEPLINE_REAL_BINARY" --version=v2 "$@"',
40663
40945
  " fi",
40664
40946
  ' printf "%s\\n" "Deepline SDK CLI install is incomplete. Run \\`deepline update\\` to repair it." >&2',
40665
40947
  " exit 1",
40666
40948
  "fi",
40667
- `if ! ${shellQuote4(input2.nodeBin)} -e ${shellQuote4(esbuildProbe)} ${shellQuote4(versionDir)} >/dev/null 2>&1; then`,
40949
+ `if ! ${shellQuote5(input2.nodeBin)} -e ${shellQuote5(esbuildProbe)} ${shellQuote5(versionDir)} >/dev/null 2>&1; then`,
40668
40950
  ' if [ -n "${DEEPLINE_REAL_BINARY:-}" ] && [ -x "$DEEPLINE_REAL_BINARY" ]; then',
40669
40951
  ' exec "$DEEPLINE_REAL_BINARY" --version=v2 "$@"',
40670
40952
  " fi",
40671
40953
  ' printf "%s\\n" "Deepline SDK CLI install is incomplete. Run \\`deepline update\\` to repair it." >&2',
40672
40954
  " exit 1",
40673
40955
  "fi",
40674
- `exec ${shellQuote4(input2.nodeBin)} ${shellQuote4(input2.entryPath)} "$@"`,
40956
+ `exec ${shellQuote5(input2.nodeBin)} ${shellQuote5(input2.entryPath)} "$@"`,
40675
40957
  ""
40676
40958
  ].join("\n"),
40677
40959
  { encoding: "utf8", mode: 493 }
@@ -40924,7 +41206,17 @@ async function runUpdateCommand(options, dependencies = {}) {
40924
41206
  if (updateExitCode !== 0) {
40925
41207
  return updateExitCode;
40926
41208
  }
40927
- await syncSkills(normalizeBaseUrl3(detectBaseUrl()));
41209
+ try {
41210
+ await syncSkills(normalizeBaseUrl3(detectBaseUrl()));
41211
+ } catch (error) {
41212
+ const detail = error instanceof Error ? error.message : String(error);
41213
+ stderr.write(
41214
+ `Deepline SDK/CLI update completed, but the optional local agent-skills refresh failed. Your CLI update succeeded; this does not affect authentication, data, billing, or the command result.
41215
+ Skills refresh detail: ${detail}
41216
+ To retry with full installer output, run: deepline skills --json
41217
+ `
41218
+ );
41219
+ }
40928
41220
  return 0;
40929
41221
  }
40930
41222
  function registerUpdateCommand(program) {
@@ -41475,108 +41767,15 @@ function registerDeeplineCommandGroups(program) {
41475
41767
  registerCsvCommands(program);
41476
41768
  registerDbCommands(program);
41477
41769
  registerFeedbackCommands(program);
41478
- registerLegacyNoopCommands(program);
41770
+ registerDeprecatedCommands(program);
41479
41771
  registerUpdateCommand(program);
41480
41772
  registerSkillsCommand(program);
41481
41773
  registerSetupCommands(program);
41482
41774
  registerQuickstartCommands(program);
41483
- registerSwitchCommands(program);
41484
- }
41485
-
41486
- // ../shared_libs/cli/command-compatibility.json
41487
- var command_compatibility_default = {
41488
- enrich: {
41489
- family: "python",
41490
- label: "a legacy Python CLI enrichment command",
41491
- sdk_alternative: "Use `deepline plays ...` for durable workflows or `deepline tools execute ...` for one tool call."
41492
- },
41493
- session: {
41494
- family: "python",
41495
- label: "a legacy Python CLI session/playground command",
41496
- sdk_alternative: "Use `deepline sessions send ...` or `deepline sessions render ...` for transcript workflows."
41497
- },
41498
- workflows: {
41499
- family: "python",
41500
- label: "a legacy Python CLI workflow command",
41501
- sdk_alternative: "Use `deepline plays ...` in the SDK CLI."
41502
- },
41503
- events: {
41504
- family: "python",
41505
- label: "a legacy Python CLI event command"
41506
- },
41507
- plays: {
41508
- family: "sdk",
41509
- label: "an SDK CLI play command",
41510
- python_alternative: "Use `deepline workflows ...` only for legacy workflows."
41511
- },
41512
- runs: {
41513
- family: "sdk",
41514
- label: "an SDK CLI run inspection command"
41515
- },
41516
- sessions: {
41517
- family: "sdk",
41518
- label: "an SDK CLI session transcript command"
41519
- },
41520
- health: {
41521
- family: "sdk",
41522
- label: "an SDK CLI health command"
41523
- }
41524
- };
41525
-
41526
- // src/cli/command-compatibility.ts
41527
- var COMMAND_COMPATIBILITY = command_compatibility_default;
41528
- function cliFamilyLabel(family) {
41529
- return family === "sdk" ? "SDK CLI" : "legacy Python CLI";
41530
- }
41531
- function commandCompatibilityHint(currentFamily, commandName, baseUrl) {
41532
- const compatibility = COMMAND_COMPATIBILITY[commandName];
41533
- if (!compatibility || compatibility.family === currentFamily) {
41534
- return null;
41535
- }
41536
- const expectedFamily = compatibility.family;
41537
- const currentLabel = cliFamilyLabel(currentFamily);
41538
- const expectedLabel = cliFamilyLabel(expectedFamily);
41539
- const lines = [
41540
- "",
41541
- "Command compatibility:",
41542
- ` \`deepline ${commandName}\` is ${compatibility.label}.`,
41543
- ` Current binary: ${currentLabel}. Required binary: ${expectedLabel}.`,
41544
- " If this came from an agent skill, the installed skill likely targets the other Deepline CLI."
41545
- ];
41546
- if (currentFamily === "sdk") {
41547
- lines.push(
41548
- "",
41549
- " To stay on the SDK CLI, refresh the Deepline agent skills:",
41550
- ` ${skillsInstallCommand(baseUrl, DEFAULT_SDK_SKILL_NAMES)}`,
41551
- " To use the legacy Python CLI instead:",
41552
- ` ${legacyPythonInstallCommand(baseUrl)}`,
41553
- " `deepline update` updates this SDK CLI, but it will not switch CLI families."
41554
- );
41555
- if (compatibility.sdk_alternative) {
41556
- lines.push(` SDK alternative: ${compatibility.sdk_alternative}`);
41557
- }
41558
- } else {
41559
- lines.push(
41560
- "",
41561
- " To use SDK commands, install the SDK CLI and refresh Deepline agent skills:",
41562
- ` ${sdkNpmGlobalInstallCommand()}`,
41563
- ` ${skillsInstallCommand(baseUrl, DEFAULT_SDK_SKILL_NAMES)}`,
41564
- " `deepline update` updates this Python CLI and its skills, but it will not switch CLI families."
41565
- );
41566
- if (compatibility.python_alternative) {
41567
- lines.push(` Python alternative: ${compatibility.python_alternative}`);
41568
- }
41569
- }
41570
- return lines.join("\n");
41571
- }
41572
- function unknownCommandNameFromMessage(message) {
41573
- const match = message.match(/unknown command ['"]([^'"]+)['"]/i);
41574
- const command = match?.[1]?.trim();
41575
- return command ? command : null;
41576
41775
  }
41577
41776
 
41578
41777
  // src/cli/self-update.ts
41579
- var import_node_child_process5 = require("child_process");
41778
+ var import_node_child_process6 = require("child_process");
41580
41779
  function envTruthy(name) {
41581
41780
  const value = process.env[name]?.trim().toLowerCase();
41582
41781
  return value === "1" || value === "true" || value === "yes";
@@ -41623,7 +41822,7 @@ function relaunchCurrentCommand(plan) {
41623
41822
  return new Promise((resolve19) => {
41624
41823
  const command = plan.kind === "python-sidecar" ? plan.sidecarPath : process.execPath;
41625
41824
  const args = plan.kind === "python-sidecar" ? process.argv.slice(2) : process.argv.slice(1);
41626
- const child = (0, import_node_child_process5.spawn)(command, args, {
41825
+ const child = (0, import_node_child_process6.spawn)(command, args, {
41627
41826
  stdio: "inherit",
41628
41827
  shell: process.platform === "win32",
41629
41828
  env: {
@@ -41692,353 +41891,8 @@ What changed in ${response.update_summary.version}: ${response.update_summary.su
41692
41891
  return true;
41693
41892
  }
41694
41893
 
41695
- // src/cli/skills-sync.ts
41696
- var import_node_child_process6 = require("child_process");
41697
- var import_node_fs22 = require("fs");
41698
- var import_node_path25 = require("path");
41699
- var CHECK_TIMEOUT_MS2 = 3e3;
41700
- function shouldSkipSkillsSync() {
41701
- if (detectAgentRuntime() === "claude_cowork") {
41702
- return true;
41703
- }
41704
- const value = process.env.DEEPLINE_SKIP_SKILLS_SYNC?.trim().toLowerCase();
41705
- return value === "1" || value === "true" || value === "yes" || value === "on";
41706
- }
41707
- function activePluginSkillsDir() {
41708
- const pluginMode = process.env.DEEPLINE_PLUGIN_MODE?.trim().toLowerCase();
41709
- if (pluginMode !== "true" && pluginMode !== "1" && pluginMode !== "yes" && pluginMode !== "on") {
41710
- return "";
41711
- }
41712
- const dir = process.env.DEEPLINE_PLUGIN_SKILLS_DIR?.trim() ?? "";
41713
- return dir && (0, import_node_fs22.existsSync)(dir) ? dir : "";
41714
- }
41715
- function readPluginSkillsVersion() {
41716
- const dir = activePluginSkillsDir();
41717
- if (!dir) return "";
41718
- try {
41719
- return (0, import_node_fs22.readFileSync)((0, import_node_path25.join)(dir, ".version"), "utf-8").trim();
41720
- } catch {
41721
- return "";
41722
- }
41723
- }
41724
- function sdkSkillsVersionPath(baseUrl) {
41725
- return (0, import_node_path25.join)(sdkCliStateDirPath(baseUrl), "skills-version");
41726
- }
41727
- function legacySdkSkillsVersionPath(baseUrl) {
41728
- return (0, import_node_path25.join)((0, import_node_path25.dirname)(sdkCliStateDirPath(baseUrl)), "sdk-skills", ".version");
41729
- }
41730
- function unavailableSkillsNoticePath(baseUrl) {
41731
- return (0, import_node_path25.join)(sdkCliStateDirPath(baseUrl), "skills-sync-unavailable-version");
41732
- }
41733
- function readSdkSkillsLocalVersion(baseUrl) {
41734
- const pluginVersion = readPluginSkillsVersion();
41735
- if (pluginVersion) return pluginVersion;
41736
- const path = (0, import_node_fs22.existsSync)(sdkSkillsVersionPath(baseUrl)) ? sdkSkillsVersionPath(baseUrl) : legacySdkSkillsVersionPath(baseUrl);
41737
- if (!(0, import_node_fs22.existsSync)(path)) return "";
41738
- try {
41739
- return (0, import_node_fs22.readFileSync)(path, "utf-8").trim();
41740
- } catch {
41741
- return "";
41742
- }
41743
- }
41744
- function writeLocalSkillsVersion(baseUrl, version) {
41745
- const path = sdkSkillsVersionPath(baseUrl);
41746
- (0, import_node_fs22.mkdirSync)((0, import_node_path25.dirname)(path), { recursive: true });
41747
- (0, import_node_fs22.writeFileSync)(path, `${version}
41748
- `, "utf-8");
41749
- }
41750
- function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames) {
41751
- const path = unavailableSkillsNoticePath(baseUrl);
41752
- try {
41753
- if ((0, import_node_fs22.existsSync)(path) && (0, import_node_fs22.readFileSync)(path, "utf-8").trim() === remoteVersion) {
41754
- return;
41755
- }
41756
- (0, import_node_fs22.mkdirSync)((0, import_node_path25.dirname)(path), { recursive: true });
41757
- (0, import_node_fs22.writeFileSync)(path, `${remoteVersion}
41758
- `, "utf-8");
41759
- } catch {
41760
- }
41761
- const manualCommand = `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
41762
- writeSdkSkillsStatusLine(
41763
- `Deepline agent skills are out of date, but neither \`bunx\` nor \`npx\` is available. Install Node.js/npm or Bun, then run:
41764
- ${manualCommand}`
41765
- );
41766
- }
41767
- function clearUnavailableSkillsNotice(baseUrl) {
41768
- try {
41769
- (0, import_node_fs22.unlinkSync)(unavailableSkillsNoticePath(baseUrl));
41770
- } catch {
41771
- }
41772
- }
41773
- function sortedUniqueSkillNames(names) {
41774
- return [...new Set(names.map((name) => name.trim()).filter(Boolean))].sort(
41775
- (a, b) => a.localeCompare(b)
41776
- );
41777
- }
41778
- async function fetchV1SkillNames(baseUrl) {
41779
- const controller = new AbortController();
41780
- const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS2);
41781
- try {
41782
- const response = await fetch(
41783
- new URL("/.well-known/skills/index.json", baseUrl),
41784
- { signal: controller.signal }
41785
- );
41786
- if (!response.ok) return [];
41787
- const data = await response.json().catch(() => null);
41788
- const names = (data?.skills ?? []).filter((skill) => skill.install_surface === "v1").map((skill) => skill.name).filter(
41789
- (name) => typeof name === "string" && name.length > 0
41790
- );
41791
- return sortedUniqueSkillNames(names);
41792
- } catch {
41793
- return [];
41794
- } finally {
41795
- clearTimeout(timeout);
41796
- }
41797
- }
41798
- function buildSdkSkillNames(v1SkillNames) {
41799
- return sortedUniqueSkillNames(v1SkillNames);
41800
- }
41801
- async function fetchSkillsUpdate(baseUrl, localVersion) {
41802
- const controller = new AbortController();
41803
- const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS2);
41804
- try {
41805
- const response = await fetch(new URL("/api/v2/cli/update-check", baseUrl), {
41806
- method: "POST",
41807
- headers: { "Content-Type": "application/json" },
41808
- body: JSON.stringify({
41809
- skills: {
41810
- version: localVersion
41811
- }
41812
- }),
41813
- signal: controller.signal
41814
- });
41815
- if (!response.ok) return null;
41816
- const data = await response.json().catch(() => null);
41817
- const skills = data?.skills;
41818
- if (!skills) return null;
41819
- return {
41820
- needsUpdate: skills.needs_update === true,
41821
- remoteVersion: typeof skills.remote?.version === "string" ? skills.remote.version.trim() : ""
41822
- };
41823
- } catch {
41824
- return null;
41825
- } finally {
41826
- clearTimeout(timeout);
41827
- }
41828
- }
41829
- function buildSkillsInstallArgs(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents) {
41830
- return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
41831
- agents
41832
- });
41833
- }
41834
- function buildBunxSkillsInstallArgs(baseUrl, skillNames, agents) {
41835
- return buildSkillsAddArgs(baseUrl, sortedUniqueSkillNames(skillNames), {
41836
- firstArg: "--bun",
41837
- agents
41838
- });
41839
- }
41840
- function resolveAutoSyncSkillAgents() {
41841
- switch (detectAgentRuntime()) {
41842
- case "codex":
41843
- return ["codex"];
41844
- case "claude_code":
41845
- return ["claude-code"];
41846
- case "cursor":
41847
- return ["cursor"];
41848
- case "gemini":
41849
- return ["gemini-cli"];
41850
- case "antigravity":
41851
- return ["antigravity"];
41852
- default:
41853
- return [];
41854
- }
41855
- }
41856
- function hasCommand(command) {
41857
- const plan = resolveShellSpawn(command, ["--version"]);
41858
- const result = (0, import_node_child_process6.spawnSync)(plan.command, plan.args, {
41859
- stdio: "ignore",
41860
- shell: plan.shell
41861
- });
41862
- return result.status === 0;
41863
- }
41864
- function shellQuote5(arg) {
41865
- return `'${arg.replace(/'/g, `'\\''`)}'`;
41866
- }
41867
- function resolveSkillsInstallSpawn(install, platform3 = process.platform) {
41868
- return resolveShellSpawn(install.command, install.args, platform3);
41869
- }
41870
- function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = DEFAULT_SKILL_AGENTS) {
41871
- const commands = [];
41872
- if (hasCommand("bunx")) {
41873
- const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames, agents);
41874
- commands.push({
41875
- command: "bunx",
41876
- args: bunxArgs,
41877
- manualCommand: `bunx ${bunxArgs.map(shellQuote5).join(" ")}`
41878
- });
41879
- }
41880
- if (hasCommand("npx")) {
41881
- const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames, agents);
41882
- commands.push({
41883
- command: "npx",
41884
- args: npxArgs,
41885
- manualCommand: `npx ${npxArgs.map(shellQuote5).join(" ")}`
41886
- });
41887
- }
41888
- return commands;
41889
- }
41890
- function runOneSkillsInstall(install) {
41891
- return new Promise((resolve19) => {
41892
- const plan = resolveSkillsInstallSpawn(install);
41893
- const child = (0, import_node_child_process6.spawn)(plan.command, plan.args, {
41894
- stdio: ["ignore", "ignore", "pipe"],
41895
- env: process.env,
41896
- shell: plan.shell
41897
- });
41898
- let stderr = "";
41899
- child.stderr.on("data", (chunk) => {
41900
- stderr += chunk.toString("utf-8");
41901
- });
41902
- child.on("error", (error) => {
41903
- resolve19({
41904
- ok: false,
41905
- detail: `failed to start ${install.command}: ${error.message}`,
41906
- manualCommand: install.manualCommand
41907
- });
41908
- });
41909
- child.on("close", (code) => {
41910
- if (code === 0) {
41911
- resolve19({ ok: true, detail: "", manualCommand: install.manualCommand });
41912
- return;
41913
- }
41914
- const detail = stderr.trim();
41915
- resolve19({
41916
- ok: false,
41917
- detail: detail ? `${install.command}: ${detail}` : `${install.command} exited ${code}`,
41918
- manualCommand: install.manualCommand
41919
- });
41920
- });
41921
- });
41922
- }
41923
- async function runSkillsInstall(installs) {
41924
- const failures = [];
41925
- for (const install of installs) {
41926
- const result = await runOneSkillsInstall(install);
41927
- if (result.ok) return true;
41928
- failures.push(result);
41929
- }
41930
- const details = failures.map((failure) => failure.detail).filter(Boolean).join("\n");
41931
- const manualCommand = failures.at(-1)?.manualCommand;
41932
- process.stderr.write(
41933
- `SDK skills sync failed${details ? `:
41934
- ${details}` : ""}
41935
- ` + (manualCommand ? `Run manually: ${manualCommand}
41936
- ` : "")
41937
- );
41938
- return false;
41939
- }
41940
- function runLegacySkillsCleanup(agents) {
41941
- const candidates = hasCommand("bunx") ? [
41942
- {
41943
- command: "bunx",
41944
- args: [
41945
- "--bun",
41946
- "skills",
41947
- "remove",
41948
- "--global",
41949
- "--agent",
41950
- ...agents,
41951
- "-y",
41952
- ...LEGACY_SKILL_NAMES_TO_REMOVE
41953
- ]
41954
- },
41955
- {
41956
- command: "npx",
41957
- args: [
41958
- "--yes",
41959
- "skills",
41960
- "remove",
41961
- "--global",
41962
- "--agent",
41963
- ...agents,
41964
- "-y",
41965
- ...LEGACY_SKILL_NAMES_TO_REMOVE
41966
- ]
41967
- }
41968
- ] : [
41969
- {
41970
- command: "npx",
41971
- args: [
41972
- "--yes",
41973
- "skills",
41974
- "remove",
41975
- "--global",
41976
- "--agent",
41977
- ...agents,
41978
- "-y",
41979
- ...LEGACY_SKILL_NAMES_TO_REMOVE
41980
- ]
41981
- }
41982
- ];
41983
- for (const candidate of candidates) {
41984
- const plan = resolveShellSpawn(candidate.command, candidate.args);
41985
- const result = (0, import_node_child_process6.spawnSync)(plan.command, plan.args, {
41986
- stdio: "ignore",
41987
- env: process.env,
41988
- shell: plan.shell
41989
- });
41990
- if (result.status === 0) return;
41991
- }
41992
- }
41993
- function writeSdkSkillsStatusLine(line) {
41994
- const progress = getActiveCliProgress();
41995
- if (progress) {
41996
- progress.writeLine(line);
41997
- return;
41998
- }
41999
- process.stderr.write(`${line}
42000
- `);
42001
- }
42002
- async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
42003
- if (shouldSkipSkillsSync()) return;
42004
- const usingPluginSkills = Boolean(activePluginSkillsDir());
42005
- if (usingPluginSkills) {
42006
- return;
42007
- }
42008
- const localVersion = readSdkSkillsLocalVersion(baseUrl);
42009
- const update = options.update === void 0 ? await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
42010
- needsUpdate: options.update.needs_update,
42011
- remoteVersion: options.update.remote.version
42012
- } : null;
42013
- if (!update?.needsUpdate || !update.remoteVersion) {
42014
- return;
42015
- }
42016
- const remoteSkillNames = await fetchV1SkillNames(baseUrl);
42017
- const skillNames = buildSdkSkillNames(
42018
- remoteSkillNames.length > 0 ? remoteSkillNames : DEFAULT_SDK_SKILL_NAMES
42019
- );
42020
- if (skillNames.length === 0) return;
42021
- const agents = resolveAutoSyncSkillAgents();
42022
- if (agents.length === 0) {
42023
- writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
42024
- return;
42025
- }
42026
- const installs = resolveSkillsInstallCommands(baseUrl, skillNames, agents);
42027
- if (installs.length === 0) {
42028
- writeUnavailableSkillsNotice(baseUrl, update.remoteVersion, skillNames);
42029
- return;
42030
- }
42031
- writeSdkSkillsStatusLine("Deepline skills changed; syncing agent skills...");
42032
- const installed = await runSkillsInstall(installs);
42033
- if (!installed) return;
42034
- runLegacySkillsCleanup(agents);
42035
- writeLocalSkillsVersion(baseUrl, update.remoteVersion);
42036
- clearUnavailableSkillsNotice(baseUrl);
42037
- writeSdkSkillsStatusLine("Deepline agent skills are up to date.");
42038
- }
42039
-
42040
41894
  // src/cli/failure-reporting.ts
42041
- var import_node_os18 = require("os");
41895
+ var import_node_os16 = require("os");
42042
41896
  var FAILURE_REPORT_DISABLE_ENV = "DEEPLINE_DISABLE_FAILURE_REPORTING";
42043
41897
  var REPORT_FAILURE_TIMEOUT_MS = 1e4;
42044
41898
  var MAX_FAILURE_TEXT_CHARS = 4e3;
@@ -42140,12 +41994,12 @@ function isNetworkFailure(error) {
42140
41994
  }
42141
41995
  function buildEnvironmentContext() {
42142
41996
  const context = {
42143
- os: (0, import_node_os18.platform)(),
42144
- os_release: (0, import_node_os18.release)(),
42145
- platform: `${(0, import_node_os18.platform)()}-${(0, import_node_os18.release)()}-${process.arch}`,
41997
+ os: (0, import_node_os16.platform)(),
41998
+ os_release: (0, import_node_os16.release)(),
41999
+ platform: `${(0, import_node_os16.platform)()}-${(0, import_node_os16.release)()}-${process.arch}`,
42146
42000
  node_version: process.version,
42147
42001
  runtime: "Node.js",
42148
- hostname: (0, import_node_os18.hostname)(),
42002
+ hostname: (0, import_node_os16.hostname)(),
42149
42003
  agent_runtime: detectAgentRuntime()
42150
42004
  };
42151
42005
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
@@ -42315,7 +42169,7 @@ function shouldDeferSkillsSyncForCommand() {
42315
42169
  if (command === "providers" && subcommand === "list") return true;
42316
42170
  return (command === "play" || command === "plays") && subcommand === "run" && args.includes("--json");
42317
42171
  }
42318
- function isLegacyNoopInvocation() {
42172
+ function isDeprecatedCommandInvocation() {
42319
42173
  const command = process.argv.slice(2)[0];
42320
42174
  return command === "session" || command === "backend";
42321
42175
  }
@@ -42339,8 +42193,8 @@ function topLevelCommandKnown(program, commandName) {
42339
42193
  );
42340
42194
  }
42341
42195
  async function runPlayRunnerHealthCheck() {
42342
- const dir = await (0, import_promises10.mkdtemp)((0, import_node_path26.join)((0, import_node_os19.tmpdir)(), "deepline-health-play-"));
42343
- const file = (0, import_node_path26.join)(dir, "health-check.play.ts");
42196
+ const dir = await (0, import_promises10.mkdtemp)((0, import_node_path25.join)((0, import_node_os17.tmpdir)(), "deepline-health-play-"));
42197
+ const file = (0, import_node_path25.join)(dir, "health-check.play.ts");
42344
42198
  try {
42345
42199
  await (0, import_promises10.writeFile)(
42346
42200
  file,
@@ -42582,7 +42436,7 @@ Exit codes:
42582
42436
  `
42583
42437
  );
42584
42438
  program.hook("preAction", async (_thisCommand, actionCommand) => {
42585
- if (actionCommand.name() === "version" || actionCommand.name() === "update" || actionCommand.name() === "switch" || actionCommand.name() === "setup" || actionCommand.name() === "skills" || actionCommand.name() === "doctor" || isLegacyNoopInvocation()) {
42439
+ if (actionCommand.name() === "version" || actionCommand.name() === "update" || actionCommand.name() === "setup" || actionCommand.name() === "skills" || actionCommand.name() === "doctor" || isDeprecatedCommandInvocation()) {
42586
42440
  return;
42587
42441
  }
42588
42442
  if (printStartupPhase) {
@@ -42611,18 +42465,6 @@ Exit codes:
42611
42465
  if (relaunched) {
42612
42466
  return;
42613
42467
  }
42614
- if (compatibility.response?.cli_family?.action === "force_python") {
42615
- forcePythonCliFamily();
42616
- process.stderr.write(
42617
- "Deepline SDK CLI rollback is active; switched installer-managed `deepline` back to the Python CLI. Re-run your command.\n"
42618
- );
42619
- const error = new Error(
42620
- "SDK CLI rollback is active"
42621
- );
42622
- error.code = "deepline.sdk_cli_rollback";
42623
- error.exitCode = 7;
42624
- throw error;
42625
- }
42626
42468
  enforceSdkCompatibilityResponse(compatibility.response);
42627
42469
  if (printStartupPhase) {
42628
42470
  progress?.phase("checking sdk skills");
@@ -42750,14 +42592,6 @@ Examples:
42750
42592
  process.exitCode = 2;
42751
42593
  return;
42752
42594
  }
42753
- const hint = commandCompatibilityHint(
42754
- "sdk",
42755
- requestedTopLevelCommand,
42756
- baseUrl
42757
- );
42758
- if (hint && !process.argv.includes("--json")) {
42759
- console.error(hint);
42760
- }
42761
42595
  process.exitCode = 2;
42762
42596
  return;
42763
42597
  }
@@ -42785,19 +42619,6 @@ Examples:
42785
42619
  const wantsJson = process.argv.includes("--json");
42786
42620
  if (commanderError) {
42787
42621
  if (commanderError.code === "commander.unknownCommand") {
42788
- const commandName = unknownCommandNameFromMessage(
42789
- commanderError.message
42790
- );
42791
- if (commandName && !wantsJson) {
42792
- const hint = commandCompatibilityHint(
42793
- "sdk",
42794
- commandName,
42795
- autoDetectBaseUrl()
42796
- );
42797
- if (hint) {
42798
- console.error(hint);
42799
- }
42800
- }
42801
42622
  }
42802
42623
  process.exitCode = commanderError.code === "commander.unknownCommand" && !wantsJson ? 2 : commanderError.exitCode ?? 1;
42803
42624
  return;