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.
- package/dist/cli/index.js +114 -117
- package/dist/cli/index.mjs +97 -100
- package/dist/index.js +64 -33
- package/dist/index.mjs +64 -33
- package/dist/repo/sdk/src/agent-runtime.ts +78 -0
- package/dist/repo/sdk/src/http.ts +6 -32
- package/dist/repo/sdk/src/release.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -174,7 +174,7 @@ function resolveConfig(options) {
|
|
|
174
174
|
|
|
175
175
|
// src/http.ts
|
|
176
176
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
177
|
-
import { homedir as
|
|
177
|
+
import { homedir as homedir3 } from "os";
|
|
178
178
|
import { join as join2 } from "path";
|
|
179
179
|
|
|
180
180
|
// src/release.ts
|
|
@@ -196,10 +196,10 @@ var SDK_RELEASE = {
|
|
|
196
196
|
// skill on the sdk sync surface, and the people-search-to-email prebuilt.
|
|
197
197
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
198
198
|
// the SDK enrich generator's one-second stale policy.
|
|
199
|
-
version: "0.1.
|
|
199
|
+
version: "0.1.117",
|
|
200
200
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
201
201
|
supportPolicy: {
|
|
202
|
-
latest: "0.1.
|
|
202
|
+
latest: "0.1.117",
|
|
203
203
|
minimumSupported: "0.1.53",
|
|
204
204
|
deprecatedBelow: "0.1.53",
|
|
205
205
|
commandMinimumSupported: [
|
|
@@ -217,6 +217,63 @@ var SDK_RELEASE = {
|
|
|
217
217
|
var SDK_VERSION = SDK_RELEASE.version;
|
|
218
218
|
var SDK_API_CONTRACT = SDK_RELEASE.apiContract;
|
|
219
219
|
|
|
220
|
+
// src/agent-runtime.ts
|
|
221
|
+
import { homedir as homedir2 } from "os";
|
|
222
|
+
var EXPLICIT_AGENT_RUNTIMES = /* @__PURE__ */ new Set([
|
|
223
|
+
"claude_code",
|
|
224
|
+
"claude_cowork",
|
|
225
|
+
"codex",
|
|
226
|
+
"cline",
|
|
227
|
+
"cursor",
|
|
228
|
+
"gemini",
|
|
229
|
+
"antigravity",
|
|
230
|
+
"windsurf",
|
|
231
|
+
"unknown"
|
|
232
|
+
]);
|
|
233
|
+
function truthyEnv(name) {
|
|
234
|
+
return ["1", "true", "yes", "on"].includes(
|
|
235
|
+
String(process.env[name] ?? "").trim().toLowerCase()
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function normalizeAgentRuntime(value) {
|
|
239
|
+
const explicit = value?.trim().toLowerCase().replace(/-/g, "_");
|
|
240
|
+
if (!explicit) return null;
|
|
241
|
+
if (explicit === "gemini_cli") return "gemini";
|
|
242
|
+
return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
|
|
243
|
+
}
|
|
244
|
+
function isCoworkLikeSandbox() {
|
|
245
|
+
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
246
|
+
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
247
|
+
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
248
|
+
const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
|
|
249
|
+
const home = process.env.HOME?.trim() || homedir2();
|
|
250
|
+
const sessionHome = home.startsWith("/sessions/");
|
|
251
|
+
return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
|
|
252
|
+
}
|
|
253
|
+
function detectAgentRuntime(options = {}) {
|
|
254
|
+
const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
|
|
255
|
+
if (explicit) return explicit;
|
|
256
|
+
if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
|
|
257
|
+
if (options.detectCowork !== false && isCoworkLikeSandbox()) {
|
|
258
|
+
return "claude_cowork";
|
|
259
|
+
}
|
|
260
|
+
if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
|
|
261
|
+
if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
|
|
262
|
+
if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
|
|
263
|
+
return "cursor";
|
|
264
|
+
}
|
|
265
|
+
if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
|
|
266
|
+
return "windsurf";
|
|
267
|
+
}
|
|
268
|
+
if (process.env.ANTIGRAVITY?.trim() || process.env.ANTIGRAVITY_CLI?.trim() || process.env.ANTIGRAVITY_AGENT?.trim() || process.env.ANTIGRAVITY_WORKSPACE?.trim()) {
|
|
269
|
+
return "antigravity";
|
|
270
|
+
}
|
|
271
|
+
if (process.env.GEMINI_CLI?.trim() || process.env.GEMINI_CLI_VERSION?.trim() || process.env.GEMINI_SANDBOX?.trim() || process.env.GEMINI_CONFIG_DIR?.trim()) {
|
|
272
|
+
return "gemini";
|
|
273
|
+
}
|
|
274
|
+
return options.defaultRuntime ?? "unknown";
|
|
275
|
+
}
|
|
276
|
+
|
|
220
277
|
// ../shared_libs/play-runtime/coordinator-headers.ts
|
|
221
278
|
var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
|
|
222
279
|
var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
|
|
@@ -243,7 +300,7 @@ var HttpClient = class {
|
|
|
243
300
|
if (explicit) return explicit;
|
|
244
301
|
try {
|
|
245
302
|
const versionPath = join2(
|
|
246
|
-
process.env.HOME?.trim() ||
|
|
303
|
+
process.env.HOME?.trim() || homedir3(),
|
|
247
304
|
".local",
|
|
248
305
|
"deepline",
|
|
249
306
|
baseUrlSlug(this.config.baseUrl),
|
|
@@ -389,7 +446,7 @@ var HttpClient = class {
|
|
|
389
446
|
}
|
|
390
447
|
const errorValue = typeof parsed === "object" && parsed && "error" in parsed ? parsed.error : void 0;
|
|
391
448
|
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}`;
|
|
392
|
-
const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : "API_ERROR";
|
|
449
|
+
const apiErrorCode = errorValue && typeof errorValue === "object" && typeof errorValue.code === "string" ? errorValue.code : typeof parsed === "object" && parsed && typeof parsed.code === "string" ? parsed.code : "API_ERROR";
|
|
393
450
|
lastError = new DeeplineError(msg, response.status, apiErrorCode, {
|
|
394
451
|
response: parsed
|
|
395
452
|
});
|
|
@@ -657,32 +714,6 @@ function decodeSseFrame(frame) {
|
|
|
657
714
|
function sleep(ms) {
|
|
658
715
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
659
716
|
}
|
|
660
|
-
function isTruthyEnv(name) {
|
|
661
|
-
const normalized = process.env[name]?.trim().toLowerCase();
|
|
662
|
-
return ["1", "true", "yes", "on"].includes(normalized ?? "");
|
|
663
|
-
}
|
|
664
|
-
function isCoworkLikeSandbox() {
|
|
665
|
-
const pluginMode = isTruthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
666
|
-
const claudeRemote = isTruthyEnv("CLAUDE_CODE_REMOTE");
|
|
667
|
-
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
668
|
-
const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
|
|
669
|
-
const home = process.env.HOME?.trim() ?? "";
|
|
670
|
-
const sessionHome = home.startsWith("/sessions/");
|
|
671
|
-
return (pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome);
|
|
672
|
-
}
|
|
673
|
-
function detectAgentRuntime() {
|
|
674
|
-
if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
|
|
675
|
-
if (isCoworkLikeSandbox()) return "claude_cowork";
|
|
676
|
-
if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
|
|
677
|
-
if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === "true") return "cline";
|
|
678
|
-
if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
|
|
679
|
-
return "cursor";
|
|
680
|
-
}
|
|
681
|
-
if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
|
|
682
|
-
return "windsurf";
|
|
683
|
-
}
|
|
684
|
-
return "unknown";
|
|
685
|
-
}
|
|
686
717
|
function withCoworkNetworkHint(message) {
|
|
687
718
|
if (!isCoworkLikeSandbox() || message.includes(COWORK_NETWORK_HINT)) {
|
|
688
719
|
return message;
|
|
@@ -4597,7 +4628,7 @@ function getDefinedPlayMetadata(value) {
|
|
|
4597
4628
|
|
|
4598
4629
|
// src/tool-output.ts
|
|
4599
4630
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
4600
|
-
import { homedir as
|
|
4631
|
+
import { homedir as homedir4 } from "os";
|
|
4601
4632
|
import { join as join3 } from "path";
|
|
4602
4633
|
function isPlainObject(value) {
|
|
4603
4634
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -4694,7 +4725,7 @@ function tryConvertToList(payload, options) {
|
|
|
4694
4725
|
return null;
|
|
4695
4726
|
}
|
|
4696
4727
|
function ensureOutputDir() {
|
|
4697
|
-
const outputDir = join3(
|
|
4728
|
+
const outputDir = join3(homedir4(), ".local", "share", "deepline", "data");
|
|
4698
4729
|
mkdirSync2(outputDir, { recursive: true });
|
|
4699
4730
|
return outputDir;
|
|
4700
4731
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
|
|
3
|
+
const EXPLICIT_AGENT_RUNTIMES = new Set([
|
|
4
|
+
'claude_code',
|
|
5
|
+
'claude_cowork',
|
|
6
|
+
'codex',
|
|
7
|
+
'cline',
|
|
8
|
+
'cursor',
|
|
9
|
+
'gemini',
|
|
10
|
+
'antigravity',
|
|
11
|
+
'windsurf',
|
|
12
|
+
'unknown',
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function truthyEnv(name: string): boolean {
|
|
16
|
+
return ['1', 'true', 'yes', 'on'].includes(
|
|
17
|
+
String(process.env[name] ?? '')
|
|
18
|
+
.trim()
|
|
19
|
+
.toLowerCase(),
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function normalizeAgentRuntime(
|
|
24
|
+
value: string | undefined,
|
|
25
|
+
): string | null {
|
|
26
|
+
const explicit = value?.trim().toLowerCase().replace(/-/g, '_');
|
|
27
|
+
if (!explicit) return null;
|
|
28
|
+
if (explicit === 'gemini_cli') return 'gemini';
|
|
29
|
+
return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isCoworkLikeSandbox(): boolean {
|
|
33
|
+
const pluginMode = truthyEnv('DEEPLINE_PLUGIN_MODE');
|
|
34
|
+
const claudeRemote = truthyEnv('CLAUDE_CODE_REMOTE');
|
|
35
|
+
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
36
|
+
const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
|
|
37
|
+
const home = process.env.HOME?.trim() || homedir();
|
|
38
|
+
const sessionHome = home.startsWith('/sessions/');
|
|
39
|
+
return (
|
|
40
|
+
(pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function detectAgentRuntime(
|
|
45
|
+
options: { defaultRuntime?: string; detectCowork?: boolean } = {},
|
|
46
|
+
): string {
|
|
47
|
+
const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
|
|
48
|
+
if (explicit) return explicit;
|
|
49
|
+
if (process.env.CODEX_THREAD_ID?.trim()) return 'codex';
|
|
50
|
+
if (options.detectCowork !== false && isCoworkLikeSandbox()) {
|
|
51
|
+
return 'claude_cowork';
|
|
52
|
+
}
|
|
53
|
+
if (process.env.CLAUDECODE?.trim() === '1') return 'claude_code';
|
|
54
|
+
if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === 'true') return 'cline';
|
|
55
|
+
if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
|
|
56
|
+
return 'cursor';
|
|
57
|
+
}
|
|
58
|
+
if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
|
|
59
|
+
return 'windsurf';
|
|
60
|
+
}
|
|
61
|
+
if (
|
|
62
|
+
process.env.ANTIGRAVITY?.trim() ||
|
|
63
|
+
process.env.ANTIGRAVITY_CLI?.trim() ||
|
|
64
|
+
process.env.ANTIGRAVITY_AGENT?.trim() ||
|
|
65
|
+
process.env.ANTIGRAVITY_WORKSPACE?.trim()
|
|
66
|
+
) {
|
|
67
|
+
return 'antigravity';
|
|
68
|
+
}
|
|
69
|
+
if (
|
|
70
|
+
process.env.GEMINI_CLI?.trim() ||
|
|
71
|
+
process.env.GEMINI_CLI_VERSION?.trim() ||
|
|
72
|
+
process.env.GEMINI_SANDBOX?.trim() ||
|
|
73
|
+
process.env.GEMINI_CONFIG_DIR?.trim()
|
|
74
|
+
) {
|
|
75
|
+
return 'gemini';
|
|
76
|
+
}
|
|
77
|
+
return options.defaultRuntime ?? 'unknown';
|
|
78
|
+
}
|
|
@@ -26,6 +26,7 @@ import { AuthError, DeeplineError, RateLimitError } from './errors.js';
|
|
|
26
26
|
import { SDK_API_CONTRACT, SDK_VERSION } from './version.js';
|
|
27
27
|
import type { LiveEventEnvelope } from './types.js';
|
|
28
28
|
import { baseUrlSlug } from './config.js';
|
|
29
|
+
import { detectAgentRuntime, isCoworkLikeSandbox } from './agent-runtime.js';
|
|
29
30
|
import {
|
|
30
31
|
COORDINATOR_INTERNAL_TOKEN_HEADER,
|
|
31
32
|
COORDINATOR_URL_OVERRIDE_HEADER,
|
|
@@ -334,7 +335,11 @@ export class HttpClient {
|
|
|
334
335
|
typeof errorValue === 'object' &&
|
|
335
336
|
typeof (errorValue as Record<string, unknown>).code === 'string'
|
|
336
337
|
? (errorValue as Record<string, string>).code
|
|
337
|
-
: '
|
|
338
|
+
: typeof parsed === 'object' &&
|
|
339
|
+
parsed &&
|
|
340
|
+
typeof (parsed as Record<string, unknown>).code === 'string'
|
|
341
|
+
? (parsed as Record<string, string>).code
|
|
342
|
+
: 'API_ERROR';
|
|
338
343
|
lastError = new DeeplineError(msg, response.status, apiErrorCode, {
|
|
339
344
|
response: parsed,
|
|
340
345
|
});
|
|
@@ -713,37 +718,6 @@ function sleep(ms: number): Promise<void> {
|
|
|
713
718
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
714
719
|
}
|
|
715
720
|
|
|
716
|
-
function isTruthyEnv(name: string): boolean {
|
|
717
|
-
const normalized = process.env[name]?.trim().toLowerCase();
|
|
718
|
-
return ['1', 'true', 'yes', 'on'].includes(normalized ?? '');
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
function isCoworkLikeSandbox(): boolean {
|
|
722
|
-
const pluginMode = isTruthyEnv('DEEPLINE_PLUGIN_MODE');
|
|
723
|
-
const claudeRemote = isTruthyEnv('CLAUDE_CODE_REMOTE');
|
|
724
|
-
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
725
|
-
const pluginRoot = Boolean(process.env.DEEPLINE_PLUGIN_ROOT?.trim());
|
|
726
|
-
const home = process.env.HOME?.trim() ?? '';
|
|
727
|
-
const sessionHome = home.startsWith('/sessions/');
|
|
728
|
-
return (
|
|
729
|
-
(pluginMode || pluginRoot) && (claudeRemote || projectDir || sessionHome)
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
function detectAgentRuntime(): string {
|
|
734
|
-
if (process.env.CODEX_THREAD_ID?.trim()) return 'codex';
|
|
735
|
-
if (isCoworkLikeSandbox()) return 'claude_cowork';
|
|
736
|
-
if (process.env.CLAUDECODE?.trim() === '1') return 'claude_code';
|
|
737
|
-
if (process.env.CLINE_ACTIVE?.trim().toLowerCase() === 'true') return 'cline';
|
|
738
|
-
if (process.env.CURSOR_TRACE_ID?.trim() || process.env.CURSOR_AGENT?.trim()) {
|
|
739
|
-
return 'cursor';
|
|
740
|
-
}
|
|
741
|
-
if (process.env.WINDSURF?.trim() || process.env.CASCADE?.trim()) {
|
|
742
|
-
return 'windsurf';
|
|
743
|
-
}
|
|
744
|
-
return 'unknown';
|
|
745
|
-
}
|
|
746
|
-
|
|
747
721
|
function withCoworkNetworkHint(message: string): string {
|
|
748
722
|
if (!isCoworkLikeSandbox() || message.includes(COWORK_NETWORK_HINT)) {
|
|
749
723
|
return message;
|
|
@@ -99,10 +99,10 @@ export const SDK_RELEASE = {
|
|
|
99
99
|
// skill on the sdk sync surface, and the people-search-to-email prebuilt.
|
|
100
100
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
101
101
|
// the SDK enrich generator's one-second stale policy.
|
|
102
|
-
version: '0.1.
|
|
102
|
+
version: '0.1.117',
|
|
103
103
|
apiContract: '2026-06-dataset-column-cell-stale-hard-cutover',
|
|
104
104
|
supportPolicy: {
|
|
105
|
-
latest: '0.1.
|
|
105
|
+
latest: '0.1.117',
|
|
106
106
|
minimumSupported: '0.1.53',
|
|
107
107
|
deprecatedBelow: '0.1.53',
|
|
108
108
|
commandMinimumSupported: [
|