deepline 0.1.256 → 0.1.257

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.
@@ -123,7 +123,7 @@ export const SDK_RELEASE = {
123
123
  // Deepline-native radars. Older clients must update before discovering,
124
124
  // checking, or deploying an unlaunched monitor integration.
125
125
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
126
- version: '0.1.256',
126
+ version: '0.1.257',
127
127
  apiContract: '2026-07-native-monitor-launch-hard-cutover',
128
128
  supportPolicy: {
129
129
  minimumSupported: '0.1.53',
package/dist/cli/index.js CHANGED
@@ -636,7 +636,7 @@ var SDK_RELEASE = {
636
636
  // Deepline-native radars. Older clients must update before discovering,
637
637
  // checking, or deploying an unlaunched monitor integration.
638
638
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
639
- version: "0.1.256",
639
+ version: "0.1.257",
640
640
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
641
641
  supportPolicy: {
642
642
  minimumSupported: "0.1.53",
@@ -29186,6 +29186,13 @@ function sidecarRegistryUrl(hostUrl) {
29186
29186
  }
29187
29187
  return new URL("/api/v2/npm/", url).toString();
29188
29188
  }
29189
+ function publicNpmFallbackRegistryUrl(hostUrl) {
29190
+ try {
29191
+ return sidecarRegistryUrl(hostUrl);
29192
+ } catch {
29193
+ return void 0;
29194
+ }
29195
+ }
29189
29196
  function readOptionalText(path) {
29190
29197
  try {
29191
29198
  return (0, import_node_fs17.readFileSync)(path, "utf8").trim();
@@ -29298,6 +29305,9 @@ function resolveUpdatePlan(options = {}) {
29298
29305
  command,
29299
29306
  args,
29300
29307
  ...installPrefix ? { installPrefix } : {},
29308
+ fallbackRegistryUrl: publicNpmFallbackRegistryUrl(
29309
+ env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
29310
+ ),
29301
29311
  manualCommand: `${command} ${args.map(shellQuote6).join(" ")}`
29302
29312
  };
29303
29313
  }
@@ -29384,7 +29394,7 @@ async function runAutomaticUpdatePlan(plan) {
29384
29394
  previousFailure
29385
29395
  };
29386
29396
  }
29387
- const exitCode = await runUpdatePlan(plan, { stdio: "stderr" });
29397
+ const exitCode = await runUpdatePlan(plan);
29388
29398
  return exitCode === 0 ? { status: "updated", exitCode: 0 } : { status: "failed", exitCode };
29389
29399
  }
29390
29400
  function safeVersionSegment(value) {
@@ -29415,31 +29425,75 @@ function installedPackageVersion(versionDir) {
29415
29425
  return "";
29416
29426
  }
29417
29427
  }
29418
- function runCommand(command, args, env = process.env, options = {}) {
29419
- return new Promise((resolveExitCode) => {
29428
+ function runCommand(command, args, env = process.env) {
29429
+ return new Promise((resolveResult) => {
29430
+ let output2 = "";
29420
29431
  const child = (0, import_node_child_process4.spawn)(command, args, {
29421
- stdio: options.stdio === "stderr" ? ["inherit", "pipe", "pipe"] : "inherit",
29432
+ stdio: ["inherit", "pipe", "pipe"],
29422
29433
  shell: process.platform === "win32",
29423
29434
  env
29424
29435
  });
29425
- if (options.stdio === "stderr") {
29426
- child.stdout?.on("data", (chunk) => {
29427
- process.stderr.write(chunk);
29428
- });
29429
- child.stderr?.on("data", (chunk) => {
29430
- process.stderr.write(chunk);
29431
- });
29432
- }
29436
+ child.stdout?.on("data", (chunk) => {
29437
+ output2 += chunk.toString();
29438
+ process.stderr.write(chunk);
29439
+ });
29440
+ child.stderr?.on("data", (chunk) => {
29441
+ output2 += chunk.toString();
29442
+ process.stderr.write(chunk);
29443
+ });
29433
29444
  child.on("error", (error) => {
29434
29445
  process.stderr.write(`Failed to start ${command}: ${error.message}
29435
29446
  `);
29436
- resolveExitCode(1);
29447
+ resolveResult({ exitCode: 1, output: `${output2}
29448
+ ${error.message}` });
29437
29449
  });
29438
29450
  child.on("close", (code) => {
29439
- resolveExitCode(code ?? 1);
29451
+ resolveResult({ exitCode: code ?? 1, output: output2 });
29440
29452
  });
29441
29453
  });
29442
29454
  }
29455
+ var DEFAULT_NPM_REGISTRY_URL = "https://registry.npmjs.org/";
29456
+ function isRegistryAccessFailure(output2, registryUrl) {
29457
+ let registryHost = "";
29458
+ try {
29459
+ registryHost = new URL(registryUrl).hostname;
29460
+ } catch {
29461
+ return false;
29462
+ }
29463
+ if (!registryHost || !output2.toLowerCase().includes(registryHost.toLowerCase())) {
29464
+ return false;
29465
+ }
29466
+ return /\b(?:EAI_AGAIN|ECONNREFUSED|ECONNRESET|ENETUNREACH|ENOTFOUND|EHOSTUNREACH|ETIMEDOUT|E5\d\d)\b|\b5\d\d\b|access denied|blocked|forbidden|network (?:error|timeout)|request .* failed/iu.test(
29467
+ output2
29468
+ );
29469
+ }
29470
+ function withRegistry(args, registryUrl) {
29471
+ return [...args.slice(0, -1), "--registry", registryUrl, args.at(-1) ?? ""];
29472
+ }
29473
+ async function runNpmInstallWithRegistryFallback(input2) {
29474
+ const primaryArgs = input2.primaryRegistryUrl ? withRegistry(input2.installArgs, input2.primaryRegistryUrl) : input2.installArgs;
29475
+ const first = await runCommand(
29476
+ input2.npmCommand,
29477
+ primaryArgs,
29478
+ input2.env ?? process.env
29479
+ );
29480
+ if (first.exitCode === 0 || !input2.fallbackRegistryUrl || !isRegistryAccessFailure(
29481
+ first.output,
29482
+ input2.primaryRegistryUrl ?? DEFAULT_NPM_REGISTRY_URL
29483
+ )) {
29484
+ return first.exitCode;
29485
+ }
29486
+ process.stderr.write(
29487
+ `Primary npm registry access failed; retrying through Deepline's registry: ${input2.fallbackRegistryUrl}
29488
+ `
29489
+ );
29490
+ const fallback = await runCommand(
29491
+ input2.npmCommand,
29492
+ withRegistry(input2.installArgs, input2.fallbackRegistryUrl),
29493
+ input2.env ?? process.env
29494
+ );
29495
+ return fallback.exitCode;
29496
+ }
29443
29497
  function writeSidecarLauncher(input2) {
29444
29498
  (0, import_node_fs17.mkdirSync)((0, import_node_path19.dirname)(input2.path), { recursive: true });
29445
29499
  if (process.platform === "win32") {
@@ -29467,7 +29521,7 @@ function writeSidecarLauncher(input2) {
29467
29521
  { encoding: "utf8", mode: 493 }
29468
29522
  );
29469
29523
  }
29470
- async function runPythonSidecarUpdatePlan(plan, options = {}) {
29524
+ async function runPythonSidecarUpdatePlan(plan) {
29471
29525
  const versionsDir = (0, import_node_path19.join)(plan.stateDir, "versions");
29472
29526
  const tempDir = (0, import_node_path19.join)(
29473
29527
  versionsDir,
@@ -29480,7 +29534,7 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29480
29534
  ...process.env,
29481
29535
  PATH: `${(0, import_node_path19.dirname)(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
29482
29536
  };
29483
- const installExitCode = await runCommand(
29537
+ const installResult = await runCommand(
29484
29538
  plan.npmCommand,
29485
29539
  [
29486
29540
  "install",
@@ -29491,9 +29545,9 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29491
29545
  ...NPM_SDK_INSTALL_COMMON_FLAGS,
29492
29546
  plan.packageSpec
29493
29547
  ],
29494
- env,
29495
- options
29548
+ env
29496
29549
  );
29550
+ const installExitCode = installResult.exitCode;
29497
29551
  if (installExitCode !== 0) {
29498
29552
  (0, import_node_fs17.rmSync)(tempDir, { recursive: true, force: true });
29499
29553
  return installExitCode;
@@ -29565,12 +29619,17 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29565
29619
  );
29566
29620
  return 0;
29567
29621
  }
29568
- async function runUpdatePlan(plan, options = {}) {
29622
+ async function runUpdatePlan(plan) {
29569
29623
  let exitCode = 1;
29570
29624
  if (plan.kind === "npm-global") {
29571
- exitCode = await runCommand(plan.command, plan.args, process.env, options);
29625
+ exitCode = await runNpmInstallWithRegistryFallback({
29626
+ npmCommand: plan.command,
29627
+ installArgs: plan.args,
29628
+ primaryRegistryUrl: plan.primaryRegistryUrl,
29629
+ fallbackRegistryUrl: plan.fallbackRegistryUrl
29630
+ });
29572
29631
  } else if (plan.kind === "python-sidecar") {
29573
- exitCode = await runPythonSidecarUpdatePlan(plan, options);
29632
+ exitCode = await runPythonSidecarUpdatePlan(plan);
29574
29633
  }
29575
29634
  if (exitCode === 0) {
29576
29635
  clearAutoUpdateFailure(plan);
@@ -621,7 +621,7 @@ var SDK_RELEASE = {
621
621
  // Deepline-native radars. Older clients must update before discovering,
622
622
  // checking, or deploying an unlaunched monitor integration.
623
623
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
624
- version: "0.1.256",
624
+ version: "0.1.257",
625
625
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
626
626
  supportPolicy: {
627
627
  minimumSupported: "0.1.53",
@@ -29249,6 +29249,13 @@ function sidecarRegistryUrl(hostUrl) {
29249
29249
  }
29250
29250
  return new URL("/api/v2/npm/", url).toString();
29251
29251
  }
29252
+ function publicNpmFallbackRegistryUrl(hostUrl) {
29253
+ try {
29254
+ return sidecarRegistryUrl(hostUrl);
29255
+ } catch {
29256
+ return void 0;
29257
+ }
29258
+ }
29252
29259
  function readOptionalText(path) {
29253
29260
  try {
29254
29261
  return readFileSync13(path, "utf8").trim();
@@ -29361,6 +29368,9 @@ function resolveUpdatePlan(options = {}) {
29361
29368
  command,
29362
29369
  args,
29363
29370
  ...installPrefix ? { installPrefix } : {},
29371
+ fallbackRegistryUrl: publicNpmFallbackRegistryUrl(
29372
+ env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
29373
+ ),
29364
29374
  manualCommand: `${command} ${args.map(shellQuote6).join(" ")}`
29365
29375
  };
29366
29376
  }
@@ -29447,7 +29457,7 @@ async function runAutomaticUpdatePlan(plan) {
29447
29457
  previousFailure
29448
29458
  };
29449
29459
  }
29450
- const exitCode = await runUpdatePlan(plan, { stdio: "stderr" });
29460
+ const exitCode = await runUpdatePlan(plan);
29451
29461
  return exitCode === 0 ? { status: "updated", exitCode: 0 } : { status: "failed", exitCode };
29452
29462
  }
29453
29463
  function safeVersionSegment(value) {
@@ -29478,31 +29488,75 @@ function installedPackageVersion(versionDir) {
29478
29488
  return "";
29479
29489
  }
29480
29490
  }
29481
- function runCommand(command, args, env = process.env, options = {}) {
29482
- return new Promise((resolveExitCode) => {
29491
+ function runCommand(command, args, env = process.env) {
29492
+ return new Promise((resolveResult) => {
29493
+ let output2 = "";
29483
29494
  const child = spawn4(command, args, {
29484
- stdio: options.stdio === "stderr" ? ["inherit", "pipe", "pipe"] : "inherit",
29495
+ stdio: ["inherit", "pipe", "pipe"],
29485
29496
  shell: process.platform === "win32",
29486
29497
  env
29487
29498
  });
29488
- if (options.stdio === "stderr") {
29489
- child.stdout?.on("data", (chunk) => {
29490
- process.stderr.write(chunk);
29491
- });
29492
- child.stderr?.on("data", (chunk) => {
29493
- process.stderr.write(chunk);
29494
- });
29495
- }
29499
+ child.stdout?.on("data", (chunk) => {
29500
+ output2 += chunk.toString();
29501
+ process.stderr.write(chunk);
29502
+ });
29503
+ child.stderr?.on("data", (chunk) => {
29504
+ output2 += chunk.toString();
29505
+ process.stderr.write(chunk);
29506
+ });
29496
29507
  child.on("error", (error) => {
29497
29508
  process.stderr.write(`Failed to start ${command}: ${error.message}
29498
29509
  `);
29499
- resolveExitCode(1);
29510
+ resolveResult({ exitCode: 1, output: `${output2}
29511
+ ${error.message}` });
29500
29512
  });
29501
29513
  child.on("close", (code) => {
29502
- resolveExitCode(code ?? 1);
29514
+ resolveResult({ exitCode: code ?? 1, output: output2 });
29503
29515
  });
29504
29516
  });
29505
29517
  }
29518
+ var DEFAULT_NPM_REGISTRY_URL = "https://registry.npmjs.org/";
29519
+ function isRegistryAccessFailure(output2, registryUrl) {
29520
+ let registryHost = "";
29521
+ try {
29522
+ registryHost = new URL(registryUrl).hostname;
29523
+ } catch {
29524
+ return false;
29525
+ }
29526
+ if (!registryHost || !output2.toLowerCase().includes(registryHost.toLowerCase())) {
29527
+ return false;
29528
+ }
29529
+ return /\b(?:EAI_AGAIN|ECONNREFUSED|ECONNRESET|ENETUNREACH|ENOTFOUND|EHOSTUNREACH|ETIMEDOUT|E5\d\d)\b|\b5\d\d\b|access denied|blocked|forbidden|network (?:error|timeout)|request .* failed/iu.test(
29530
+ output2
29531
+ );
29532
+ }
29533
+ function withRegistry(args, registryUrl) {
29534
+ return [...args.slice(0, -1), "--registry", registryUrl, args.at(-1) ?? ""];
29535
+ }
29536
+ async function runNpmInstallWithRegistryFallback(input2) {
29537
+ const primaryArgs = input2.primaryRegistryUrl ? withRegistry(input2.installArgs, input2.primaryRegistryUrl) : input2.installArgs;
29538
+ const first = await runCommand(
29539
+ input2.npmCommand,
29540
+ primaryArgs,
29541
+ input2.env ?? process.env
29542
+ );
29543
+ if (first.exitCode === 0 || !input2.fallbackRegistryUrl || !isRegistryAccessFailure(
29544
+ first.output,
29545
+ input2.primaryRegistryUrl ?? DEFAULT_NPM_REGISTRY_URL
29546
+ )) {
29547
+ return first.exitCode;
29548
+ }
29549
+ process.stderr.write(
29550
+ `Primary npm registry access failed; retrying through Deepline's registry: ${input2.fallbackRegistryUrl}
29551
+ `
29552
+ );
29553
+ const fallback = await runCommand(
29554
+ input2.npmCommand,
29555
+ withRegistry(input2.installArgs, input2.fallbackRegistryUrl),
29556
+ input2.env ?? process.env
29557
+ );
29558
+ return fallback.exitCode;
29559
+ }
29506
29560
  function writeSidecarLauncher(input2) {
29507
29561
  mkdirSync10(dirname13(input2.path), { recursive: true });
29508
29562
  if (process.platform === "win32") {
@@ -29530,7 +29584,7 @@ function writeSidecarLauncher(input2) {
29530
29584
  { encoding: "utf8", mode: 493 }
29531
29585
  );
29532
29586
  }
29533
- async function runPythonSidecarUpdatePlan(plan, options = {}) {
29587
+ async function runPythonSidecarUpdatePlan(plan) {
29534
29588
  const versionsDir = join14(plan.stateDir, "versions");
29535
29589
  const tempDir = join14(
29536
29590
  versionsDir,
@@ -29543,7 +29597,7 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29543
29597
  ...process.env,
29544
29598
  PATH: `${dirname13(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
29545
29599
  };
29546
- const installExitCode = await runCommand(
29600
+ const installResult = await runCommand(
29547
29601
  plan.npmCommand,
29548
29602
  [
29549
29603
  "install",
@@ -29554,9 +29608,9 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29554
29608
  ...NPM_SDK_INSTALL_COMMON_FLAGS,
29555
29609
  plan.packageSpec
29556
29610
  ],
29557
- env,
29558
- options
29611
+ env
29559
29612
  );
29613
+ const installExitCode = installResult.exitCode;
29560
29614
  if (installExitCode !== 0) {
29561
29615
  rmSync4(tempDir, { recursive: true, force: true });
29562
29616
  return installExitCode;
@@ -29628,12 +29682,17 @@ async function runPythonSidecarUpdatePlan(plan, options = {}) {
29628
29682
  );
29629
29683
  return 0;
29630
29684
  }
29631
- async function runUpdatePlan(plan, options = {}) {
29685
+ async function runUpdatePlan(plan) {
29632
29686
  let exitCode = 1;
29633
29687
  if (plan.kind === "npm-global") {
29634
- exitCode = await runCommand(plan.command, plan.args, process.env, options);
29688
+ exitCode = await runNpmInstallWithRegistryFallback({
29689
+ npmCommand: plan.command,
29690
+ installArgs: plan.args,
29691
+ primaryRegistryUrl: plan.primaryRegistryUrl,
29692
+ fallbackRegistryUrl: plan.fallbackRegistryUrl
29693
+ });
29635
29694
  } else if (plan.kind === "python-sidecar") {
29636
- exitCode = await runPythonSidecarUpdatePlan(plan, options);
29695
+ exitCode = await runPythonSidecarUpdatePlan(plan);
29637
29696
  }
29638
29697
  if (exitCode === 0) {
29639
29698
  clearAutoUpdateFailure(plan);
package/dist/index.js CHANGED
@@ -435,7 +435,7 @@ var SDK_RELEASE = {
435
435
  // Deepline-native radars. Older clients must update before discovering,
436
436
  // checking, or deploying an unlaunched monitor integration.
437
437
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
438
- version: "0.1.256",
438
+ version: "0.1.257",
439
439
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
440
440
  supportPolicy: {
441
441
  minimumSupported: "0.1.53",
package/dist/index.mjs CHANGED
@@ -365,7 +365,7 @@ var SDK_RELEASE = {
365
365
  // Deepline-native radars. Older clients must update before discovering,
366
366
  // checking, or deploying an unlaunched monitor integration.
367
367
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
368
- version: "0.1.256",
368
+ version: "0.1.257",
369
369
  apiContract: "2026-07-native-monitor-launch-hard-cutover",
370
370
  supportPolicy: {
371
371
  minimumSupported: "0.1.53",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.256",
3
+ "version": "0.1.257",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {