deepline 0.1.115 → 0.1.117

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.
@@ -358,7 +358,7 @@ function resolveConfig(options) {
358
358
 
359
359
  // src/http.ts
360
360
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
361
- import { homedir as homedir2 } from "os";
361
+ import { homedir as homedir3 } from "os";
362
362
  import { join as join2 } from "path";
363
363
 
364
364
  // src/release.ts
@@ -380,10 +380,10 @@ var SDK_RELEASE = {
380
380
  // skill on the sdk sync surface, and the people-search-to-email prebuilt.
381
381
  // 0.1.108 ships explicit dataset column/tool recompute policy and removes
382
382
  // the SDK enrich generator's one-second stale policy.
383
- version: "0.1.115",
383
+ version: "0.1.117",
384
384
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
385
385
  supportPolicy: {
386
- latest: "0.1.115",
386
+ latest: "0.1.117",
387
387
  minimumSupported: "0.1.53",
388
388
  deprecatedBelow: "0.1.53",
389
389
  commandMinimumSupported: [
@@ -401,6 +401,63 @@ var SDK_RELEASE = {
401
401
  var SDK_VERSION = SDK_RELEASE.version;
402
402
  var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
403
403
 
404
+ // src/agent-runtime.ts
405
+ import { homedir as homedir2 } from "os";
406
+ var EXPLICIT_AGENT_RUNTIMES = /* @__PURE__ */ new Set([
407
+ "claude_code",
408
+ "claude_cowork",
409
+ "codex",
410
+ "cline",
411
+ "cursor",
412
+ "gemini",
413
+ "antigravity",
414
+ "windsurf",
415
+ "unknown"
416
+ ]);
417
+ function truthyEnv(name) {
418
+ return ["1", "true", "yes", "on"].includes(
419
+ String(process.env[name] ?? "").trim().toLowerCase()
420
+ );
421
+ }
422
+ function normalizeAgentRuntime(value) {
423
+ const explicit = value?.trim().toLowerCase().replace(/-/g, "_");
424
+ if (!explicit) return null;
425
+ if (explicit === "gemini_cli") return "gemini";
426
+ return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
427
+ }
428
+ function isCoworkLikeSandbox() {
429
+ const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
430
+ const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
431
+ const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
432
+ const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
433
+ const home = process.env.HOME?.trim() || homedir2();
434
+ const sessionHome = home.startsWith("/sessions/");
435
+ return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
436
+ }
437
+ function detectAgentRuntime(options = {}) {
438
+ const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
439
+ if (explicit) return explicit;
440
+ if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
441
+ if (options.detectCowork !== false && isCoworkLikeSandbox()) {
442
+ return "claude_cowork";
443
+ }
444
+ if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
445
+ if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
446
+ if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
447
+ return "cursor";
448
+ }
449
+ if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
450
+ return "windsurf";
451
+ }
452
+ if (process.env.ANTIGRAVITY?.trim() || process.env.ANTIGRAVITY_CLI?.trim() || process.env.ANTIGRAVITY_AGENT?.trim() || process.env.ANTIGRAVITY_WORKSPACE?.trim()) {
453
+ return "antigravity";
454
+ }
455
+ if (process.env.GEMINI_CLI?.trim() || process.env.GEMINI_CLI_VERSION?.trim() || process.env.GEMINI_SANDBOX?.trim() || process.env.GEMINI_CONFIG_DIR?.trim()) {
456
+ return "gemini";
457
+ }
458
+ return options.defaultRuntime ?? "unknown";
459
+ }
460
+
404
461
  // ../shared_libs/play-runtime/coordinator-headers.ts
405
462
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
406
463
  var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
@@ -427,7 +484,7 @@ var HttpClient = class {
427
484
  if (explicit) return explicit;
428
485
  try {
429
486
  const versionPath = join2(
430
- process.env.HOME?.trim() || homedir2(),
487
+ process.env.HOME?.trim() || homedir3(),
431
488
  ".local",
432
489
  "deepline",
433
490
  baseUrlSlug(this.config.baseUrl),
@@ -573,7 +630,7 @@ var HttpClient = class {
573
630
  }
574
631
  const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
575
632
  const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
576
- const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : "API_ERROR";
633
+ const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : typeof parsed === "object" && parsed && typeof parsed.code === "string" ? parsed.code : "API_ERROR";
577
634
  lastError = new DeeplineError(msg, response.status, apiErrorCode, {
578
635
  response: parsed
579
636
  });
@@ -841,32 +898,6 @@ function decodeSseFrame(frame) {
841
898
  function sleep(ms) {
842
899
  return new Promise((resolve16) => setTimeout(resolve16, ms));
843
900
  }
844
- function isTruthyEnv(name) {
845
- const normalized = process.env[name]?.trim().toLowerCase();
846
- return ["1", "true", "yes", "on"].includes(normalized ?? "");
847
- }
848
- function isCoworkLikeSandbox() {
849
- const pluginMode = isTruthyEnv("DEEPLINE_PLUGIN_MODE");
850
- const claudeRemote = isTruthyEnv("CLAUDE_CODE_REMOTE");
851
- const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
852
- const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
853
- const home = process.env.HOME?.trim() ?? "";
854
- const sessionHome = home.startsWith("/sessions/");
855
- return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
856
- }
857
- function detectAgentRuntime() {
858
- if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
859
- if (isCoworkLikeSandbox()) return "claude_cowork";
860
- if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
861
- if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
862
- if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
863
- return "cursor";
864
- }
865
- if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
866
- return "windsurf";
867
- }
868
- return "unknown";
869
- }
870
901
  function withCoworkNetworkHint(message) {
871
902
  if (!isCoworkLikeSandbox() || message.includes(COWORK_NETWORK_HINT)) {
872
903
  return message;
@@ -3440,7 +3471,7 @@ var DeeplineClient = class {
3440
3471
 
3441
3472
  // src/compat.ts
3442
3473
  import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
3443
- import { homedir as homedir3 } from "os";
3474
+ import { homedir as homedir4 } from "os";
3444
3475
  import { dirname as dirname2, join as join3 } from "path";
3445
3476
  var CHECK_TIMEOUT_MS = 2e3;
3446
3477
  var COMPAT_CACHE_TTL_MS = 5 * 60 * 1e3;
@@ -3449,7 +3480,7 @@ function shouldSkipCompatibilityCheck() {
3449
3480
  return value === "1" || value === "true" || value === "yes";
3450
3481
  }
3451
3482
  function compatibilityCachePath() {
3452
- return join3(homedir3(), ".cache", "deepline", "sdk-compat-cache.json");
3483
+ return join3(homedir4(), ".cache", "deepline", "sdk-compat-cache.json");
3453
3484
  }
3454
3485
  function compatibilityCacheKey(baseUrl, command) {
3455
3486
  return JSON.stringify({
@@ -3562,7 +3593,7 @@ import {
3562
3593
  writeFileSync as writeFileSync3
3563
3594
  } from "fs";
3564
3595
  import { mkdir, writeFile } from "fs/promises";
3565
- import { homedir as homedir4 } from "os";
3596
+ import { homedir as homedir5 } from "os";
3566
3597
  import { dirname as dirname3, join as join4, resolve as resolve2 } from "path";
3567
3598
  import * as childProcess from "child_process";
3568
3599
  import { parse } from "csv-parse/sync";
@@ -3581,7 +3612,7 @@ async function writeOutputFile(filename, content) {
3581
3612
  return fullPath;
3582
3613
  }
3583
3614
  function browserOpenStateFile() {
3584
- const homeDir2 = process.env.HOME || homedir4();
3615
+ const homeDir2 = process.env.HOME || homedir5();
3585
3616
  return join4(
3586
3617
  homeDir2,
3587
3618
  ".local",
@@ -3658,7 +3689,7 @@ function readDefaultMacBrowserBundleId(runner = defaultBrowserCommandRunner) {
3658
3689
  "json",
3659
3690
  "-o",
3660
3691
  "-",
3661
- `${homedir4()}/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist`
3692
+ `${homedir5()}/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist`
3662
3693
  ],
3663
3694
  { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] }
3664
3695
  );
@@ -3829,8 +3860,8 @@ function collectLocalEnvInfo() {
3829
3860
  const info = {
3830
3861
  os: `${process.platform} ${process.arch}`,
3831
3862
  node_version: process.version,
3832
- home_dir: homedir4(),
3833
- agent_runtime: detectAgentRuntime2()
3863
+ home_dir: homedir5(),
3864
+ agent_runtime: detectAgentRuntime()
3834
3865
  };
3835
3866
  const env = process.env;
3836
3867
  const optional = {
@@ -3854,26 +3885,6 @@ function collectLocalEnvInfo() {
3854
3885
  }
3855
3886
  return info;
3856
3887
  }
3857
- function detectAgentRuntime2() {
3858
- if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
3859
- const pluginMode = process.env.DEEPLINE_PLUGIN_MODE?.trim().toLowerCase();
3860
- const claudeRemote = process.env.CLAUDE_CODE_REMOTE?.trim().toLowerCase();
3861
- const sessionHome = (process.env.HOME?.trim() || homedir4()).startsWith(
3862
- "/sessions/"
3863
- );
3864
- if (["1", "true", "yes", "on"].includes(pluginMode ?? "") && (["1", "true", "yes", "on"].includes(claudeRemote ?? "") || Boolean(process.env.CLAUDE_PROJECT_DIR?.trim()) || sessionHome)) {
3865
- return "claude_cowork";
3866
- }
3867
- if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
3868
- if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
3869
- if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
3870
- return "cursor";
3871
- }
3872
- if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
3873
- return "windsurf";
3874
- }
3875
- return "unknown";
3876
- }
3877
3888
  function readCsvRows(csvPath) {
3878
3889
  const raw = readFileSync4(resolve2(csvPath), "utf-8");
3879
3890
  return parse(raw, {
@@ -4144,7 +4155,7 @@ async function httpJson(method, url, apiKey, body) {
4144
4155
  "User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
4145
4156
  "X-Deepline-Client-Family": "sdk",
4146
4157
  "X-Deepline-CLI-Family": "sdk",
4147
- "X-Deepline-Agent-Runtime": detectAgentRuntime2(),
4158
+ "X-Deepline-Agent-Runtime": detectAgentRuntime(),
4148
4159
  "X-Deepline-CLI-Version": SDK_VERSION,
4149
4160
  "X-Deepline-SDK-Version": SDK_VERSION,
4150
4161
  "X-Deepline-API-Contract": SDK_API_CONTRACT
@@ -6652,7 +6663,7 @@ import {
6652
6663
  stat as stat3,
6653
6664
  writeFile as writeFile4
6654
6665
  } from "fs/promises";
6655
- import { homedir as homedir5, tmpdir as tmpdir3 } from "os";
6666
+ import { homedir as homedir6, tmpdir as tmpdir3 } from "os";
6656
6667
  import { join as join9, resolve as resolve11 } from "path";
6657
6668
 
6658
6669
  // src/cli/commands/play.ts
@@ -10153,11 +10164,11 @@ function createCliProgress(enabled) {
10153
10164
 
10154
10165
  // src/cli/trace.ts
10155
10166
  var cliTraceStartedAt = Date.now();
10156
- function isTruthyEnv2(value) {
10167
+ function isTruthyEnv(value) {
10157
10168
  return value === "1" || value === "true" || value === "yes";
10158
10169
  }
10159
10170
  function isCliTraceEnabled() {
10160
- return isTruthyEnv2(process.env.DEEPLINE_CLI_TRACE);
10171
+ return isTruthyEnv(process.env.DEEPLINE_CLI_TRACE);
10161
10172
  }
10162
10173
  function recordCliTrace(event) {
10163
10174
  if (!isCliTraceEnabled()) {
@@ -17198,10 +17209,10 @@ function expandAtFilePath(rawPath) {
17198
17209
  (_match, bareName, bracedName) => process.env[bareName ?? bracedName ?? ""] ?? ""
17199
17210
  );
17200
17211
  if (expanded === "~") {
17201
- return homedir5();
17212
+ return homedir6();
17202
17213
  }
17203
17214
  if (expanded.startsWith("~/") || expanded.startsWith("~\\")) {
17204
- return join9(homedir5(), expanded.slice(2));
17215
+ return join9(homedir6(), expanded.slice(2));
17205
17216
  }
17206
17217
  return expanded;
17207
17218
  }
@@ -18062,7 +18073,7 @@ async function persistEnrichFailureReport(input2) {
18062
18073
  if (input2.jobs.length === 0) {
18063
18074
  return null;
18064
18075
  }
18065
- const stateDir = join9(homedir5(), ".local", "deepline", "runtime", "state");
18076
+ const stateDir = join9(homedir6(), ".local", "deepline", "runtime", "state");
18066
18077
  await mkdir4(stateDir, { recursive: true });
18067
18078
  const reportPath = join9(
18068
18079
  stateDir,
@@ -18700,7 +18711,7 @@ import {
18700
18711
  statSync as statSync3,
18701
18712
  writeFileSync as writeFileSync9
18702
18713
  } from "fs";
18703
- import { homedir as homedir6, platform } from "os";
18714
+ import { homedir as homedir7, platform } from "os";
18704
18715
  import { basename as basename4, dirname as dirname10, join as join10, resolve as resolve12 } from "path";
18705
18716
  import { gzipSync } from "zlib";
18706
18717
  import { randomUUID } from "crypto";
@@ -18715,7 +18726,7 @@ var MAX_EVENT_OBJECT_KEYS = 80;
18715
18726
  var TRUNCATION_MARKER = "...[truncated]";
18716
18727
  var NOISE_EVENT_TYPES = /* @__PURE__ */ new Set(["progress", "file-history-snapshot"]);
18717
18728
  function homeDir() {
18718
- return process.env.HOME?.trim() || homedir6();
18729
+ return process.env.HOME?.trim() || homedir7();
18719
18730
  }
18720
18731
  function detectShellContext() {
18721
18732
  const shellPath = process.env.SHELL?.trim() || process.env.ComSpec?.trim() || process.env.COMSPEC?.trim() || "";
@@ -20160,7 +20171,7 @@ Examples:
20160
20171
 
20161
20172
  // src/cli/commands/switch.ts
20162
20173
  import { existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync10 } from "fs";
20163
- import { homedir as homedir7 } from "os";
20174
+ import { homedir as homedir8 } from "os";
20164
20175
  import { dirname as dirname11, join as join11 } from "path";
20165
20176
  function hostSlugFromBaseUrl(baseUrl) {
20166
20177
  try {
@@ -20181,7 +20192,7 @@ function resolveConfigScope() {
20181
20192
  return hostSlugFromBaseUrl(autoDetectBaseUrl());
20182
20193
  }
20183
20194
  function activeFamilyPath() {
20184
- const home = process.env.HOME || process.env.USERPROFILE || homedir7();
20195
+ const home = process.env.HOME || process.env.USERPROFILE || homedir8();
20185
20196
  return join11(
20186
20197
  home,
20187
20198
  ".local",
@@ -20331,7 +20342,7 @@ import { join as join13, resolve as resolve13 } from "path";
20331
20342
 
20332
20343
  // src/tool-output.ts
20333
20344
  import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync11 } from "fs";
20334
- import { homedir as homedir8 } from "os";
20345
+ import { homedir as homedir9 } from "os";
20335
20346
  import { join as join12 } from "path";
20336
20347
  function isPlainObject(value) {
20337
20348
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -20428,7 +20439,7 @@ function tryConvertToList(payload, options) {
20428
20439
  return null;
20429
20440
  }
20430
20441
  function ensureOutputDir() {
20431
- const outputDir = join12(homedir8(), ".local", "share", "deepline", "data");
20442
+ const outputDir = join12(homedir9(), ".local", "share", "deepline", "data");
20432
20443
  mkdirSync7(outputDir, { recursive: true });
20433
20444
  return outputDir;
20434
20445
  }
@@ -22434,7 +22445,7 @@ import {
22434
22445
  rmSync as rmSync3,
22435
22446
  writeFileSync as writeFileSync13
22436
22447
  } from "fs";
22437
- import { homedir as homedir9 } from "os";
22448
+ import { homedir as homedir10 } from "os";
22438
22449
  import { dirname as dirname13, isAbsolute as isAbsolute4, join as join15, relative as relative4, resolve as resolve15 } from "path";
22439
22450
  function posixShellQuote(value) {
22440
22451
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -22515,7 +22526,7 @@ function findRepoBackedSdkRoot(startPath) {
22515
22526
  }
22516
22527
  function resolveUpdatePlan(options = {}) {
22517
22528
  const env = options.env ?? process.env;
22518
- const homeDir2 = options.homeDir ?? homedir9();
22529
+ const homeDir2 = options.homeDir ?? homedir10();
22519
22530
  const entrypoint = options.entrypoint ?? (process.argv[1] ? resolve15(process.argv[1]) : "");
22520
22531
  const sourceRoot = entrypoint ? findRepoBackedSdkRoot(dirname13(entrypoint)) : null;
22521
22532
  if (sourceRoot) {
@@ -22827,7 +22838,13 @@ var command_compatibility_default = {
22827
22838
  var install_commands_default = {
22828
22839
  skills: {
22829
22840
  index_path: "/.well-known/skills/index.json",
22830
- default_agents: ["codex", "claude-code", "cursor"],
22841
+ default_agents: [
22842
+ "codex",
22843
+ "claude-code",
22844
+ "cursor",
22845
+ "gemini-cli",
22846
+ "antigravity"
22847
+ ],
22831
22848
  npx_binary: "npx",
22832
22849
  npx_add_args_template: [
22833
22850
  "--yes",
@@ -23042,7 +23059,7 @@ async function maybeAutoUpdateAndRelaunch(response) {
23042
23059
  // src/cli/skills-sync.ts
23043
23060
  import { spawn as spawn4, spawnSync as spawnSync2 } from "child_process";
23044
23061
  import { existsSync as existsSync13, mkdirSync as mkdirSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync14 } from "fs";
23045
- import { homedir as homedir10 } from "os";
23062
+ import { homedir as homedir11 } from "os";
23046
23063
  import { dirname as dirname14, join as join16 } from "path";
23047
23064
  var CHECK_TIMEOUT_MS2 = 3e3;
23048
23065
  var SDK_PLAY_SKILL_NAME = "deepline-plays";
@@ -23069,7 +23086,7 @@ function readPluginSkillsVersion() {
23069
23086
  }
23070
23087
  }
23071
23088
  function sdkSkillsVersionPath(baseUrl) {
23072
- const home = process.env.HOME?.trim() || homedir10();
23089
+ const home = process.env.HOME?.trim() || homedir11();
23073
23090
  return join16(
23074
23091
  home,
23075
23092
  ".local",
@@ -23285,13 +23302,13 @@ var ASSIGNMENT_SECRET_RE = /\b(access[_-]?token|api[_-]?key|apikey|auth(?:orizat
23285
23302
  var BEARER_SECRET_RE = /\b(bearer)\s+([A-Za-z0-9._-]+)/gi;
23286
23303
  var GENERIC_TOKEN_RE = /\b(?:dlp|sk|ghp|xox[baprs])[-_A-Za-z0-9]{8,}\b/g;
23287
23304
  var SECRET_OPTION_RE = /^--?(?:access[-_]?token|api[-_]?key|apikey|auth(?:orization)?|bearer|password|secret|session|token)$/i;
23288
- function truthyEnv(name) {
23305
+ function truthyEnv2(name) {
23289
23306
  return ["1", "true", "yes", "on"].includes(
23290
23307
  String(process.env[name] ?? "").trim().toLowerCase()
23291
23308
  );
23292
23309
  }
23293
23310
  function isFailureReportingDisabled() {
23294
- return truthyEnv(FAILURE_REPORT_DISABLE_ENV);
23311
+ return truthyEnv2(FAILURE_REPORT_DISABLE_ENV);
23295
23312
  }
23296
23313
  function redactFailureText(value, maxChars = MAX_FAILURE_TEXT_CHARS) {
23297
23314
  const home = process.env.HOME?.trim();
@@ -23372,26 +23389,6 @@ function isNetworkFailure(error) {
23372
23389
  const code = classifyNetworkFailure(error);
23373
23390
  return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
23374
23391
  }
23375
- function detectAgentRuntime3() {
23376
- if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
23377
- const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
23378
- const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
23379
- const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
23380
- const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
23381
- const sessionHome = process.env.HOME?.trim().startsWith("/sessions/") ?? false;
23382
- if ((pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome)) {
23383
- return "claude_cowork";
23384
- }
23385
- if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
23386
- if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
23387
- if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
23388
- return "cursor";
23389
- }
23390
- if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
23391
- return "windsurf";
23392
- }
23393
- return "unknown";
23394
- }
23395
23392
  function buildEnvironmentContext() {
23396
23393
  const context = {
23397
23394
  os: platform2(),
@@ -23400,7 +23397,7 @@ function buildEnvironmentContext() {
23400
23397
  node_version: process.version,
23401
23398
  runtime: "Node.js",
23402
23399
  hostname: hostname2(),
23403
- agent_runtime: detectAgentRuntime3()
23400
+ agent_runtime: detectAgentRuntime()
23404
23401
  };
23405
23402
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
23406
23403
  const normalized = process.env[key]?.trim();
@@ -23515,7 +23512,7 @@ async function maybeReportSdkCliFailure(input2) {
23515
23512
  "User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
23516
23513
  "X-Deepline-Client-Family": "sdk",
23517
23514
  "X-Deepline-CLI-Family": "sdk",
23518
- "X-Deepline-Agent-Runtime": detectAgentRuntime3(),
23515
+ "X-Deepline-Agent-Runtime": detectAgentRuntime(),
23519
23516
  "X-Deepline-CLI-Version": SDK_VERSION,
23520
23517
  "X-Deepline-SDK-Version": SDK_VERSION
23521
23518
  },
package/dist/index.js CHANGED
@@ -252,7 +252,7 @@ function resolveConfig(options) {
252
252
 
253
253
  // src/http.ts
254
254
  var import_node_fs2 = require("fs");
255
- var import_node_os2 = require("os");
255
+ var import_node_os3 = require("os");
256
256
  var import_node_path2 = require("path");
257
257
 
258
258
  // src/release.ts
@@ -274,10 +274,10 @@ var SDK_RELEASE = {
274
274
  // skill on the sdk sync surface, and the people-search-to-email prebuilt.
275
275
  // 0.1.108 ships explicit dataset column/tool recompute policy and removes
276
276
  // the SDK enrich generator's one-second stale policy.
277
- version: "0.1.115",
277
+ version: "0.1.117",
278
278
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
279
279
  supportPolicy: {
280
- latest: "0.1.115",
280
+ latest: "0.1.117",
281
281
  minimumSupported: "0.1.53",
282
282
  deprecatedBelow: "0.1.53",
283
283
  commandMinimumSupported: [
@@ -295,6 +295,63 @@ var SDK_RELEASE = {
295
295
  var SDK_VERSION = SDK_RELEASE.version;
296
296
  var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
297
297
 
298
+ // src/agent-runtime.ts
299
+ var import_node_os2 = require("os");
300
+ var EXPLICIT_AGENT_RUNTIMES = /* @__PURE__ */ new Set([
301
+ "claude_code",
302
+ "claude_cowork",
303
+ "codex",
304
+ "cline",
305
+ "cursor",
306
+ "gemini",
307
+ "antigravity",
308
+ "windsurf",
309
+ "unknown"
310
+ ]);
311
+ function truthyEnv(name) {
312
+ return ["1", "true", "yes", "on"].includes(
313
+ String(process.env[name] ?? "").trim().toLowerCase()
314
+ );
315
+ }
316
+ function normalizeAgentRuntime(value) {
317
+ const explicit = value?.trim().toLowerCase().replace(/-/g, "_");
318
+ if (!explicit) return null;
319
+ if (explicit === "gemini_cli") return "gemini";
320
+ return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
321
+ }
322
+ function isCoworkLikeSandbox() {
323
+ const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
324
+ const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
325
+ const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
326
+ const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
327
+ const home = process.env.HOME?.trim() || (0, import_node_os2.homedir)();
328
+ const sessionHome = home.startsWith("/sessions/");
329
+ return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
330
+ }
331
+ function detectAgentRuntime(options = {}) {
332
+ const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
333
+ if (explicit) return explicit;
334
+ if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
335
+ if (options.detectCowork !== false && isCoworkLikeSandbox()) {
336
+ return "claude_cowork";
337
+ }
338
+ if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
339
+ if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
340
+ if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
341
+ return "cursor";
342
+ }
343
+ if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
344
+ return "windsurf";
345
+ }
346
+ if (process.env.ANTIGRAVITY?.trim() || process.env.ANTIGRAVITY_CLI?.trim() || process.env.ANTIGRAVITY_AGENT?.trim() || process.env.ANTIGRAVITY_WORKSPACE?.trim()) {
347
+ return "antigravity";
348
+ }
349
+ if (process.env.GEMINI_CLI?.trim() || process.env.GEMINI_CLI_VERSION?.trim() || process.env.GEMINI_SANDBOX?.trim() || process.env.GEMINI_CONFIG_DIR?.trim()) {
350
+ return "gemini";
351
+ }
352
+ return options.defaultRuntime ?? "unknown";
353
+ }
354
+
298
355
  // ../shared_libs/play-runtime/coordinator-headers.ts
299
356
  var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
300
357
  var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
@@ -321,7 +378,7 @@ var HttpClient = class {
321
378
  if (explicit) return explicit;
322
379
  try {
323
380
  const versionPath = (0, import_node_path2.join)(
324
- process.env.HOME?.trim() || (0, import_node_os2.homedir)(),
381
+ process.env.HOME?.trim() || (0, import_node_os3.homedir)(),
325
382
  ".local",
326
383
  "deepline",
327
384
  baseUrlSlug(this.config.baseUrl),
@@ -467,7 +524,7 @@ var HttpClient = class {
467
524
  }
468
525
  const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
469
526
  const msg = typeof errorValue === "string" ? errorValue : errorValue && typeof errorValue === "object" && "message" in errorValue && typeof errorValue.message === "string" ? errorValue.message : typeof parsed === "object" && parsed && "message" in parsed && typeof parsed.message === "string" ? parsed.message : `HTTP ${response.status}`;
470
- const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : "API_ERROR";
527
+ const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : typeof parsed === "object" && parsed && typeof parsed.code === "string" ? parsed.code : "API_ERROR";
471
528
  lastError = new DeeplineError(msg, response.status, apiErrorCode, {
472
529
  response: parsed
473
530
  });
@@ -735,32 +792,6 @@ function decodeSseFrame(frame) {
735
792
  function sleep(ms) {
736
793
  return new Promise((resolve2) => setTimeout(resolve2, ms));
737
794
  }
738
- function isTruthyEnv(name) {
739
- const normalized = process.env[name]?.trim().toLowerCase();
740
- return ["1", "true", "yes", "on"].includes(normalized ?? "");
741
- }
742
- function isCoworkLikeSandbox() {
743
- const pluginMode = isTruthyEnv("DEEPLINE_PLUGIN_MODE");
744
- const claudeRemote = isTruthyEnv("CLAUDE_CODE_REMOTE");
745
- const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
746
- const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
747
- const home = process.env.HOME?.trim() ?? "";
748
- const sessionHome = home.startsWith("/sessions/");
749
- return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
750
- }
751
- function detectAgentRuntime() {
752
- if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
753
- if (isCoworkLikeSandbox()) return "claude_cowork";
754
- if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
755
- if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
756
- if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
757
- return "cursor";
758
- }
759
- if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
760
- return "windsurf";
761
- }
762
- return "unknown";
763
- }
764
795
  function withCoworkNetworkHint(message) {
765
796
  if (!isCoworkLikeSandbox() || message.includes(COWORK_NETWORK_HINT)) {
766
797
  return message;
@@ -4675,7 +4706,7 @@ function getDefinedPlayMetadata(value) {
4675
4706
 
4676
4707
  // src/tool-output.ts
4677
4708
  var import_node_fs3 = require("fs");
4678
- var import_node_os3 = require("os");
4709
+ var import_node_os4 = require("os");
4679
4710
  var import_node_path3 = require("path");
4680
4711
  function isPlainObject(value) {
4681
4712
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
@@ -4772,7 +4803,7 @@ function tryConvertToList(payload, options) {
4772
4803
  return null;
4773
4804
  }
4774
4805
  function ensureOutputDir() {
4775
- const outputDir = (0, import_node_path3.join)((0, import_node_os3.homedir)(), ".local", "share", "deepline", "data");
4806
+ const outputDir = (0, import_node_path3.join)((0, import_node_os4.homedir)(), ".local", "share", "deepline", "data");
4776
4807
  (0, import_node_fs3.mkdirSync)(outputDir, { recursive: true });
4777
4808
  return outputDir;
4778
4809
  }