deepline 0.3.159 → 0.3.161

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/README.md CHANGED
@@ -16,11 +16,22 @@ Claude Code, Codex, or your terminal.
16
16
 
17
17
  ## Install
18
18
 
19
+ Check `npm --version` and use the matching command.
20
+
21
+ For npm 11.16 or newer:
22
+
23
+ ```bash
24
+ npm install -g --allow-scripts=esbuild deepline@latest
25
+ ```
26
+
27
+ For older npm:
28
+
19
29
  ```bash
20
30
  npm install -g deepline@latest
21
- deepline setup --json
22
31
  ```
23
32
 
33
+ Then run `deepline setup --json`.
34
+
24
35
  Setup opens your browser so you can sign in, then installs Deepline's skills
25
36
  for your coding agent. If global skill setup is unavailable, Deepline retries
26
37
  with project-local skills automatically.
@@ -30,7 +41,7 @@ with project-local skills automatically.
30
41
  Paste this into Claude Code, Codex, or another coding agent:
31
42
 
32
43
  ```text
33
- Set up https://code.deepline.com/INSTALL.md
44
+ Install the official Deepline CLI globally from npm (package: deepline) by following https://code.deepline.com/INSTALL.md.
34
45
  ```
35
46
 
36
47
  Once setup is complete, tell your agent what you want to do:
@@ -3298,8 +3298,12 @@ export class DeeplineClient {
3298
3298
  }
3299
3299
  const timeoutMs =
3300
3300
  options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, inputSnapshot);
3301
+ const isApifySync = toolId.trim().toLowerCase() === 'apify_run_actor_sync';
3301
3302
  const headers = {
3302
3303
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
3304
+ ...(isApifySync
3305
+ ? { 'X-Deepline-Apify-Sync-Response-Budget': 'extended-v1' }
3306
+ : {}),
3303
3307
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
3304
3308
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION,
3305
3309
  ),
@@ -410,6 +410,7 @@ export function isCiEnvironment(): boolean {
410
410
 
411
411
  export function enforceSdkCompatibilityResponse(
412
412
  response: SdkCompatibilityResponse | null,
413
+ options: { quietAdvisory?: boolean } = {},
413
414
  ): void {
414
415
  if (!response) {
415
416
  return;
@@ -421,7 +422,8 @@ export function enforceSdkCompatibilityResponse(
421
422
  if (
422
423
  (response.status === 'deprecated' ||
423
424
  response.status === 'update_available') &&
424
- !isCiEnvironment()
425
+ !isCiEnvironment() &&
426
+ options.quietAdvisory !== true
425
427
  ) {
426
428
  process.stderr.write(`${response.message}\n`);
427
429
  }
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.159',
203
+ version: '0.3.161',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
package/dist/cli/index.js CHANGED
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
3051
3051
  // getters keep their established compatibility behavior.
3052
3052
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3053
3053
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3054
- version: "0.3.159",
3054
+ version: "0.3.161",
3055
3055
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
3056
3056
  packageCapabilities: {
3057
3057
  updatePreferences: 1
@@ -7539,8 +7539,10 @@ var DeeplineClient = class _DeeplineClient {
7539
7539
  await this.lookupExecutionByKey(idempotencyKey, timeoutMs2);
7540
7540
  }
7541
7541
  const timeoutMs = options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, inputSnapshot);
7542
+ const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
7542
7543
  const headers = {
7543
7544
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
7545
+ ...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
7544
7546
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
7545
7547
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
7546
7548
  ),
@@ -10678,14 +10680,14 @@ function isCiEnvironment() {
10678
10680
  return value === "1" || value === "true" || value === "yes";
10679
10681
  });
10680
10682
  }
10681
- function enforceSdkCompatibilityResponse(response) {
10683
+ function enforceSdkCompatibilityResponse(response, options = {}) {
10682
10684
  if (!response) {
10683
10685
  return;
10684
10686
  }
10685
10687
  if (response.update_required) {
10686
10688
  throw new Error(response.message);
10687
10689
  }
10688
- if ((response.status === "deprecated" || response.status === "update_available") && !isCiEnvironment()) {
10690
+ if ((response.status === "deprecated" || response.status === "update_available") && !isCiEnvironment() && options.quietAdvisory !== true) {
10689
10691
  process.stderr.write(`${response.message}
10690
10692
  `);
10691
10693
  }
@@ -42467,7 +42469,7 @@ Examples:
42467
42469
  }
42468
42470
 
42469
42471
  // src/cli/commands/setup.ts
42470
- var import_node_child_process4 = require("child_process");
42472
+ var import_node_child_process5 = require("child_process");
42471
42473
  var import_node_fs20 = require("fs");
42472
42474
  var import_node_os14 = require("os");
42473
42475
  var import_node_path25 = require("path");
@@ -44222,6 +44224,32 @@ Examples:
44222
44224
  });
44223
44225
  }
44224
44226
 
44227
+ // src/cli/npm-script-policy.ts
44228
+ var import_node_child_process4 = require("child_process");
44229
+ function npmSupportsAllowScripts(version) {
44230
+ const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version?.trim() ?? "");
44231
+ if (!match) return false;
44232
+ const major = Number(match[1]);
44233
+ const minor = Number(match[2]);
44234
+ return major > 11 || major === 11 && minor >= 16;
44235
+ }
44236
+ function readNpmVersion(env) {
44237
+ try {
44238
+ const plan = resolveShellSpawn("npm", ["--version"]);
44239
+ const result = (0, import_node_child_process4.spawnSync)(plan.command, plan.args, {
44240
+ encoding: "utf8",
44241
+ env,
44242
+ shell: plan.shell,
44243
+ stdio: ["ignore", "pipe", "ignore"],
44244
+ timeout: 5e3
44245
+ });
44246
+ if (result.status !== 0) return null;
44247
+ return String(result.stdout ?? "").trim() || null;
44248
+ } catch {
44249
+ return null;
44250
+ }
44251
+ }
44252
+
44225
44253
  // src/cli/commands/setup.ts
44226
44254
  var SETUP_PHASE_NAMES = [
44227
44255
  "cli",
@@ -44411,7 +44439,7 @@ function removeKnownLegacyPaths(baseUrl) {
44411
44439
  }).removeRetiredArtifacts();
44412
44440
  }
44413
44441
  function resolvePathCommands(command) {
44414
- const lookup = (0, import_node_child_process4.spawnSync)(
44442
+ const lookup = (0, import_node_child_process5.spawnSync)(
44415
44443
  process.platform === "win32" ? "where" : "which",
44416
44444
  process.platform === "win32" ? [command] : ["-a", command],
44417
44445
  { encoding: "utf8", shell: process.platform === "win32" }
@@ -44438,7 +44466,7 @@ function isHomebrewFormulaCommand(path) {
44438
44466
  }
44439
44467
  function resolvePersistentGlobalCommand(dependencies = {}) {
44440
44468
  const platform3 = dependencies.platform ?? process.platform;
44441
- const run = dependencies.spawn ?? import_node_child_process4.spawnSync;
44469
+ const run = dependencies.spawn ?? import_node_child_process5.spawnSync;
44442
44470
  const pathExists = dependencies.exists ?? import_node_fs20.existsSync;
44443
44471
  const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
44444
44472
  const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
@@ -44537,7 +44565,8 @@ function failSetupPhase(phases, phase, code) {
44537
44565
  }
44538
44566
  function rollbackCommand(scope, root) {
44539
44567
  const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path25.join)(root, ".deepline", "runtime"))}` : "";
44540
- return `npm install -g${prefix} --no-audit --no-fund --include=optional deepline@${SDK_VERSION}`;
44568
+ const allowScriptsFlag = npmSupportsAllowScripts(readNpmVersion(process.env)) ? " --allow-scripts=esbuild" : "";
44569
+ return `npm install -g${prefix} --no-audit --no-fund --include=optional${allowScriptsFlag} deepline@${SDK_VERSION}`;
44541
44570
  }
44542
44571
  function setupResumeCommand(baseUrl, scope) {
44543
44572
  const hostPrefix = baseUrl === "https://code.deepline.com" ? "" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} `;
@@ -45278,7 +45307,7 @@ function consumePendingCliUpdateMessages(homeDir2 = (0, import_node_os15.homedir
45278
45307
  }
45279
45308
 
45280
45309
  // src/cli/commands/update.ts
45281
- var import_node_child_process5 = require("child_process");
45310
+ var import_node_child_process6 = require("child_process");
45282
45311
  var import_node_fs23 = require("fs");
45283
45312
  var import_node_os16 = require("os");
45284
45313
  var import_node_path28 = require("path");
@@ -45629,7 +45658,7 @@ function normalizedNpmPrefix(value) {
45629
45658
  function resolveNpmGlobalPrefix(env) {
45630
45659
  try {
45631
45660
  const plan = resolveShellSpawn("npm", ["prefix", "-g"]);
45632
- const result = (0, import_node_child_process5.spawnSync)(plan.command, plan.args, {
45661
+ const result = (0, import_node_child_process6.spawnSync)(plan.command, plan.args, {
45633
45662
  encoding: "utf8",
45634
45663
  env,
45635
45664
  shell: plan.shell,
@@ -45684,14 +45713,16 @@ function resolveUpdatePlan(options = {}) {
45684
45713
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
45685
45714
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
45686
45715
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
45716
+ const npmVersion = options.npmVersion === void 0 ? readNpmVersion(env) : options.npmVersion;
45717
+ const npmGlobalInstallFlags = npmSupportsAllowScripts(npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
45687
45718
  const args = installPrefix ? [
45688
45719
  "install",
45689
45720
  "-g",
45690
45721
  "--prefix",
45691
45722
  installPrefix,
45692
- ...NPM_SDK_INSTALL_COMMON_FLAGS,
45723
+ ...npmGlobalInstallFlags,
45693
45724
  packageSpec
45694
- ] : ["install", "-g", ...NPM_SDK_INSTALL_COMMON_FLAGS, packageSpec];
45725
+ ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
45695
45726
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
45696
45727
  env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
45697
45728
  );
@@ -45841,7 +45872,7 @@ function runCommand(command, args, env = process.env) {
45841
45872
  return new Promise((resolveResult) => {
45842
45873
  let output2 = "";
45843
45874
  const plan = resolveShellSpawn(command, args);
45844
- const child = (0, import_node_child_process5.spawn)(plan.command, plan.args, {
45875
+ const child = (0, import_node_child_process6.spawn)(plan.command, plan.args, {
45845
45876
  stdio: ["inherit", "pipe", "pipe"],
45846
45877
  shell: plan.shell,
45847
45878
  env
@@ -49434,6 +49465,9 @@ function samplePayload(samples, key) {
49434
49465
  function commandEnvelopeFromRawResponse(rawResponse) {
49435
49466
  return isRecord12(rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
49436
49467
  }
49468
+ function toolExecuteExitCode(envelope) {
49469
+ return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
49470
+ }
49437
49471
  function extractToolExecutionWarningMessages(rawResponse) {
49438
49472
  if (!isRecord12(rawResponse)) return [];
49439
49473
  const candidates = [
@@ -50093,10 +50127,11 @@ async function executeTool(args) {
50093
50127
  listConversion,
50094
50128
  summary
50095
50129
  });
50130
+ const executeExitCode = toolExecuteExitCode(baseEnvelope);
50096
50131
  if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && shouldEmitJson())) {
50097
50132
  printCommandEnvelope(baseEnvelope, { json: true });
50098
50133
  await completePendingToolExecution(pendingRecoveryPath);
50099
- return 0;
50134
+ return executeExitCode;
50100
50135
  }
50101
50136
  if (parsed.outputFormat === "json_file") {
50102
50137
  const jsonPath = writeJsonOutputFile(
@@ -50114,7 +50149,7 @@ async function executeTool(args) {
50114
50149
  { json: true }
50115
50150
  );
50116
50151
  await completePendingToolExecution(pendingRecoveryPath);
50117
- return 0;
50152
+ return executeExitCode;
50118
50153
  }
50119
50154
  if (!listConversion) {
50120
50155
  if (parsed.outPath) {
@@ -50143,11 +50178,11 @@ async function executeTool(args) {
50143
50178
  { json: parsed.outputFormat === "csv_file" || shouldEmitJson() }
50144
50179
  );
50145
50180
  await completePendingToolExecution(pendingRecoveryPath);
50146
- return 0;
50181
+ return executeExitCode;
50147
50182
  }
50148
50183
  printCommandEnvelope(baseEnvelope, { json: false });
50149
50184
  await completePendingToolExecution(pendingRecoveryPath);
50150
- return 0;
50185
+ return executeExitCode;
50151
50186
  }
50152
50187
  const rowOutput = projectRowOutput(listConversion);
50153
50188
  const csv = writeCsvOutputFile(
@@ -50170,7 +50205,7 @@ async function executeTool(args) {
50170
50205
  if (parsed.outputFormat === "csv_file") {
50171
50206
  printCommandEnvelope(materializedEnvelope, { json: true });
50172
50207
  await completePendingToolExecution(pendingRecoveryPath);
50173
- return 0;
50208
+ return executeExitCode;
50174
50209
  }
50175
50210
  if (parsed.outPath) {
50176
50211
  printCommandEnvelope(materializedEnvelope, {
@@ -50179,7 +50214,7 @@ async function executeTool(args) {
50179
50214
  `
50180
50215
  });
50181
50216
  await completePendingToolExecution(pendingRecoveryPath);
50182
- return 0;
50217
+ return executeExitCode;
50183
50218
  }
50184
50219
  if (parsed.noPreview) {
50185
50220
  printCommandEnvelope(
@@ -50194,11 +50229,11 @@ async function executeTool(args) {
50194
50229
  ` }
50195
50230
  );
50196
50231
  await completePendingToolExecution(pendingRecoveryPath);
50197
- return 0;
50232
+ return executeExitCode;
50198
50233
  }
50199
50234
  printCommandEnvelope(materializedEnvelope, { json: false });
50200
50235
  await completePendingToolExecution(pendingRecoveryPath);
50201
- return 0;
50236
+ return executeExitCode;
50202
50237
  }
50203
50238
 
50204
50239
  // src/cli/commands/providers.ts
@@ -50817,7 +50852,7 @@ function registerDeeplineCommandGroups(program) {
50817
50852
  }
50818
50853
 
50819
50854
  // src/cli/self-update.ts
50820
- var import_node_child_process6 = require("child_process");
50855
+ var import_node_child_process7 = require("child_process");
50821
50856
  var AUTO_UPDATE_TELEMETRY_TIMEOUT_MS = 2e3;
50822
50857
  var TRUSTED_AUTO_UPDATE_ORIGIN = "https://code.deepline.com";
50823
50858
  function trustedAutoUpdateRegistryUrl(baseUrl) {
@@ -50875,7 +50910,7 @@ function envTruthy(name) {
50875
50910
  return value === "1" || value === "true" || value === "yes";
50876
50911
  }
50877
50912
  function shouldSkipSelfUpdate() {
50878
- return envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !shouldRunCliAutoUpdate() || isCiEnvironment();
50913
+ return process.argv.includes("--json") || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !shouldRunCliAutoUpdate() || isCiEnvironment();
50879
50914
  }
50880
50915
  function parseSemver(version) {
50881
50916
  const trimmed = version?.trim();
@@ -50913,7 +50948,7 @@ function relaunchCurrentCommand(plan) {
50913
50948
  return new Promise((resolve22) => {
50914
50949
  const command = plan.kind === "python-sidecar" ? plan.sidecarPath : process.execPath;
50915
50950
  const args = plan.kind === "python-sidecar" ? process.argv.slice(2) : process.argv.slice(1);
50916
- const child = (0, import_node_child_process6.spawn)(command, args, {
50951
+ const child = (0, import_node_child_process7.spawn)(command, args, {
50917
50952
  stdio: "inherit",
50918
50953
  shell: process.platform === "win32",
50919
50954
  env: {
@@ -51377,7 +51412,9 @@ Exit codes:
51377
51412
  if (relaunched) {
51378
51413
  return;
51379
51414
  }
51380
- enforceSdkCompatibilityResponse(compatibility.response);
51415
+ enforceSdkCompatibilityResponse(compatibility.response, {
51416
+ quietAdvisory: process.argv.includes("--json")
51417
+ });
51381
51418
  if (printStartupPhase) {
51382
51419
  progress?.phase("checking sdk skills");
51383
51420
  }
@@ -3046,7 +3046,7 @@ var SDK_RELEASE = {
3046
3046
  // getters keep their established compatibility behavior.
3047
3047
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
3048
3048
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
3049
- version: "0.3.159",
3049
+ version: "0.3.161",
3050
3050
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
3051
3051
  packageCapabilities: {
3052
3052
  updatePreferences: 1
@@ -7534,8 +7534,10 @@ var DeeplineClient = class _DeeplineClient {
7534
7534
  await this.lookupExecutionByKey(idempotencyKey, timeoutMs2);
7535
7535
  }
7536
7536
  const timeoutMs = options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, inputSnapshot);
7537
+ const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
7537
7538
  const headers = {
7538
7539
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
7540
+ ...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
7539
7541
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
7540
7542
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
7541
7543
  ),
@@ -10673,14 +10675,14 @@ function isCiEnvironment() {
10673
10675
  return value === "1" || value === "true" || value === "yes";
10674
10676
  });
10675
10677
  }
10676
- function enforceSdkCompatibilityResponse(response) {
10678
+ function enforceSdkCompatibilityResponse(response, options = {}) {
10677
10679
  if (!response) {
10678
10680
  return;
10679
10681
  }
10680
10682
  if (response.update_required) {
10681
10683
  throw new Error(response.message);
10682
10684
  }
10683
- if ((response.status === "deprecated" || response.status === "update_available") && !isCiEnvironment()) {
10685
+ if ((response.status === "deprecated" || response.status === "update_available") && !isCiEnvironment() && options.quietAdvisory !== true) {
10684
10686
  process.stderr.write(`${response.message}
10685
10687
  `);
10686
10688
  }
@@ -42552,7 +42554,7 @@ Examples:
42552
42554
  }
42553
42555
 
42554
42556
  // src/cli/commands/setup.ts
42555
- import { spawnSync as spawnSync2 } from "child_process";
42557
+ import { spawnSync as spawnSync3 } from "child_process";
42556
42558
  import {
42557
42559
  existsSync as existsSync15,
42558
42560
  lstatSync as lstatSync2,
@@ -44329,6 +44331,32 @@ Examples:
44329
44331
  });
44330
44332
  }
44331
44333
 
44334
+ // src/cli/npm-script-policy.ts
44335
+ import { spawnSync as spawnSync2 } from "child_process";
44336
+ function npmSupportsAllowScripts(version) {
44337
+ const match = /^(\d+)\.(\d+)(?:\.|$)/.exec(version?.trim() ?? "");
44338
+ if (!match) return false;
44339
+ const major = Number(match[1]);
44340
+ const minor = Number(match[2]);
44341
+ return major > 11 || major === 11 && minor >= 16;
44342
+ }
44343
+ function readNpmVersion(env) {
44344
+ try {
44345
+ const plan = resolveShellSpawn("npm", ["--version"]);
44346
+ const result = spawnSync2(plan.command, plan.args, {
44347
+ encoding: "utf8",
44348
+ env,
44349
+ shell: plan.shell,
44350
+ stdio: ["ignore", "pipe", "ignore"],
44351
+ timeout: 5e3
44352
+ });
44353
+ if (result.status !== 0) return null;
44354
+ return String(result.stdout ?? "").trim() || null;
44355
+ } catch {
44356
+ return null;
44357
+ }
44358
+ }
44359
+
44332
44360
  // src/cli/commands/setup.ts
44333
44361
  var SETUP_PHASE_NAMES = [
44334
44362
  "cli",
@@ -44518,7 +44546,7 @@ function removeKnownLegacyPaths(baseUrl) {
44518
44546
  }).removeRetiredArtifacts();
44519
44547
  }
44520
44548
  function resolvePathCommands(command) {
44521
- const lookup = spawnSync2(
44549
+ const lookup = spawnSync3(
44522
44550
  process.platform === "win32" ? "where" : "which",
44523
44551
  process.platform === "win32" ? [command] : ["-a", command],
44524
44552
  { encoding: "utf8", shell: process.platform === "win32" }
@@ -44545,7 +44573,7 @@ function isHomebrewFormulaCommand(path) {
44545
44573
  }
44546
44574
  function resolvePersistentGlobalCommand(dependencies = {}) {
44547
44575
  const platform3 = dependencies.platform ?? process.platform;
44548
- const run = dependencies.spawn ?? spawnSync2;
44576
+ const run = dependencies.spawn ?? spawnSync3;
44549
44577
  const pathExists = dependencies.exists ?? existsSync15;
44550
44578
  const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
44551
44579
  const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
@@ -44644,7 +44672,8 @@ function failSetupPhase(phases, phase, code) {
44644
44672
  }
44645
44673
  function rollbackCommand(scope, root) {
44646
44674
  const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify(join20(root, ".deepline", "runtime"))}` : "";
44647
- return `npm install -g${prefix} --no-audit --no-fund --include=optional deepline@${SDK_VERSION}`;
44675
+ const allowScriptsFlag = npmSupportsAllowScripts(readNpmVersion(process.env)) ? " --allow-scripts=esbuild" : "";
44676
+ return `npm install -g${prefix} --no-audit --no-fund --include=optional${allowScriptsFlag} deepline@${SDK_VERSION}`;
44648
44677
  }
44649
44678
  function setupResumeCommand(baseUrl, scope) {
44650
44679
  const hostPrefix = baseUrl === "https://code.deepline.com" ? "" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} `;
@@ -45392,7 +45421,7 @@ function consumePendingCliUpdateMessages(homeDir2 = homedir10()) {
45392
45421
  }
45393
45422
 
45394
45423
  // src/cli/commands/update.ts
45395
- import { spawn as spawn4, spawnSync as spawnSync3 } from "child_process";
45424
+ import { spawn as spawn4, spawnSync as spawnSync4 } from "child_process";
45396
45425
  import {
45397
45426
  existsSync as existsSync18,
45398
45427
  mkdirSync as mkdirSync14,
@@ -45759,7 +45788,7 @@ function normalizedNpmPrefix(value) {
45759
45788
  function resolveNpmGlobalPrefix(env) {
45760
45789
  try {
45761
45790
  const plan = resolveShellSpawn("npm", ["prefix", "-g"]);
45762
- const result = spawnSync3(plan.command, plan.args, {
45791
+ const result = spawnSync4(plan.command, plan.args, {
45763
45792
  encoding: "utf8",
45764
45793
  env,
45765
45794
  shell: plan.shell,
@@ -45814,14 +45843,16 @@ function resolveUpdatePlan(options = {}) {
45814
45843
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
45815
45844
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
45816
45845
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
45846
+ const npmVersion = options.npmVersion === void 0 ? readNpmVersion(env) : options.npmVersion;
45847
+ const npmGlobalInstallFlags = npmSupportsAllowScripts(npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
45817
45848
  const args = installPrefix ? [
45818
45849
  "install",
45819
45850
  "-g",
45820
45851
  "--prefix",
45821
45852
  installPrefix,
45822
- ...NPM_SDK_INSTALL_COMMON_FLAGS,
45853
+ ...npmGlobalInstallFlags,
45823
45854
  packageSpec
45824
- ] : ["install", "-g", ...NPM_SDK_INSTALL_COMMON_FLAGS, packageSpec];
45855
+ ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
45825
45856
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
45826
45857
  env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
45827
45858
  );
@@ -49579,6 +49610,9 @@ function samplePayload(samples, key) {
49579
49610
  function commandEnvelopeFromRawResponse(rawResponse) {
49580
49611
  return isRecord12(rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
49581
49612
  }
49613
+ function toolExecuteExitCode(envelope) {
49614
+ return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
49615
+ }
49582
49616
  function extractToolExecutionWarningMessages(rawResponse) {
49583
49617
  if (!isRecord12(rawResponse)) return [];
49584
49618
  const candidates = [
@@ -50238,10 +50272,11 @@ async function executeTool(args) {
50238
50272
  listConversion,
50239
50273
  summary
50240
50274
  });
50275
+ const executeExitCode = toolExecuteExitCode(baseEnvelope);
50241
50276
  if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && shouldEmitJson())) {
50242
50277
  printCommandEnvelope(baseEnvelope, { json: true });
50243
50278
  await completePendingToolExecution(pendingRecoveryPath);
50244
- return 0;
50279
+ return executeExitCode;
50245
50280
  }
50246
50281
  if (parsed.outputFormat === "json_file") {
50247
50282
  const jsonPath = writeJsonOutputFile(
@@ -50259,7 +50294,7 @@ async function executeTool(args) {
50259
50294
  { json: true }
50260
50295
  );
50261
50296
  await completePendingToolExecution(pendingRecoveryPath);
50262
- return 0;
50297
+ return executeExitCode;
50263
50298
  }
50264
50299
  if (!listConversion) {
50265
50300
  if (parsed.outPath) {
@@ -50288,11 +50323,11 @@ async function executeTool(args) {
50288
50323
  { json: parsed.outputFormat === "csv_file" || shouldEmitJson() }
50289
50324
  );
50290
50325
  await completePendingToolExecution(pendingRecoveryPath);
50291
- return 0;
50326
+ return executeExitCode;
50292
50327
  }
50293
50328
  printCommandEnvelope(baseEnvelope, { json: false });
50294
50329
  await completePendingToolExecution(pendingRecoveryPath);
50295
- return 0;
50330
+ return executeExitCode;
50296
50331
  }
50297
50332
  const rowOutput = projectRowOutput(listConversion);
50298
50333
  const csv = writeCsvOutputFile(
@@ -50315,7 +50350,7 @@ async function executeTool(args) {
50315
50350
  if (parsed.outputFormat === "csv_file") {
50316
50351
  printCommandEnvelope(materializedEnvelope, { json: true });
50317
50352
  await completePendingToolExecution(pendingRecoveryPath);
50318
- return 0;
50353
+ return executeExitCode;
50319
50354
  }
50320
50355
  if (parsed.outPath) {
50321
50356
  printCommandEnvelope(materializedEnvelope, {
@@ -50324,7 +50359,7 @@ async function executeTool(args) {
50324
50359
  `
50325
50360
  });
50326
50361
  await completePendingToolExecution(pendingRecoveryPath);
50327
- return 0;
50362
+ return executeExitCode;
50328
50363
  }
50329
50364
  if (parsed.noPreview) {
50330
50365
  printCommandEnvelope(
@@ -50339,11 +50374,11 @@ async function executeTool(args) {
50339
50374
  ` }
50340
50375
  );
50341
50376
  await completePendingToolExecution(pendingRecoveryPath);
50342
- return 0;
50377
+ return executeExitCode;
50343
50378
  }
50344
50379
  printCommandEnvelope(materializedEnvelope, { json: false });
50345
50380
  await completePendingToolExecution(pendingRecoveryPath);
50346
- return 0;
50381
+ return executeExitCode;
50347
50382
  }
50348
50383
 
50349
50384
  // src/cli/commands/providers.ts
@@ -51020,7 +51055,7 @@ function envTruthy(name) {
51020
51055
  return value === "1" || value === "true" || value === "yes";
51021
51056
  }
51022
51057
  function shouldSkipSelfUpdate() {
51023
- return envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !shouldRunCliAutoUpdate() || isCiEnvironment();
51058
+ return process.argv.includes("--json") || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !shouldRunCliAutoUpdate() || isCiEnvironment();
51024
51059
  }
51025
51060
  function parseSemver(version) {
51026
51061
  const trimmed = version?.trim();
@@ -51522,7 +51557,9 @@ Exit codes:
51522
51557
  if (relaunched) {
51523
51558
  return;
51524
51559
  }
51525
- enforceSdkCompatibilityResponse(compatibility.response);
51560
+ enforceSdkCompatibilityResponse(compatibility.response, {
51561
+ quietAdvisory: process.argv.includes("--json")
51562
+ });
51526
51563
  if (printStartupPhase) {
51527
51564
  progress?.phase("checking sdk skills");
51528
51565
  }
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.159",
867
+ version: "0.3.161",
868
868
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
@@ -5230,8 +5230,10 @@ var DeeplineClient = class _DeeplineClient {
5230
5230
  await this.lookupExecutionByKey(idempotencyKey, timeoutMs2);
5231
5231
  }
5232
5232
  const timeoutMs = options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, inputSnapshot);
5233
+ const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
5233
5234
  const headers = {
5234
5235
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
5236
+ ...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
5235
5237
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
5236
5238
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
5237
5239
  ),
package/dist/index.mjs CHANGED
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
768
768
  // getters keep their established compatibility behavior.
769
769
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
770
770
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
771
- version: "0.3.159",
771
+ version: "0.3.161",
772
772
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
773
773
  packageCapabilities: {
774
774
  updatePreferences: 1
@@ -5134,8 +5134,10 @@ var DeeplineClient = class _DeeplineClient {
5134
5134
  await this.lookupExecutionByKey(idempotencyKey, timeoutMs2);
5135
5135
  }
5136
5136
  const timeoutMs = options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, inputSnapshot);
5137
+ const isApifySync = toolId.trim().toLowerCase() === "apify_run_actor_sync";
5137
5138
  const headers = {
5138
5139
  [EXECUTE_RESPONSE_CONTRACT_HEADER]: RAW_V2_EXECUTE_RESPONSE_CONTRACT,
5140
+ ...isApifySync ? { "X-Deepline-Apify-Sync-Response-Budget": "extended-v1" } : {},
5139
5141
  [TOOL_EXECUTION_ERROR_SCHEMA_HEADER]: String(
5140
5142
  TOOL_EXECUTION_ERROR_SCHEMA_VERSION
5141
5143
  ),
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.159";
152
+ readonly version: "0.3.161";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.d.ts CHANGED
@@ -149,7 +149,7 @@ type SdkRelease = {
149
149
  supportPolicy: SdkSupportPolicy;
150
150
  };
151
151
  declare const SDK_RELEASE: {
152
- readonly version: "0.3.159";
152
+ readonly version: "0.3.161";
153
153
  readonly updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.";
154
154
  readonly packageCapabilities: {
155
155
  readonly updatePreferences: 1;
package/dist/release.js CHANGED
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
74
74
  // getters keep their established compatibility behavior.
75
75
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
76
76
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
77
- version: "0.3.159",
77
+ version: "0.3.161",
78
78
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
79
79
  packageCapabilities: {
80
80
  updatePreferences: 1
package/dist/release.mjs CHANGED
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
48
48
  // getters keep their established compatibility behavior.
49
49
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
50
50
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
51
- version: "0.3.159",
51
+ version: "0.3.161",
52
52
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
53
53
  packageCapabilities: {
54
54
  updatePreferences: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.159",
3
+ "version": "0.3.161",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",