deepline 0.1.143 → 0.1.145
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 +2 -2
- package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +36 -4
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +5 -2
- package/dist/bundling-sources/sdk/src/client.ts +5 -0
- package/dist/bundling-sources/sdk/src/config.ts +310 -13
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/shared_libs/temporal/constants.ts +4 -3
- package/dist/cli/index.js +865 -82
- package/dist/cli/index.mjs +889 -98
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +151 -14
- package/dist/index.mjs +160 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1205,6 +1205,7 @@ type RunsNamespace = {
|
|
|
1205
1205
|
runId?: string;
|
|
1206
1206
|
limit?: number;
|
|
1207
1207
|
offset?: number;
|
|
1208
|
+
rowMode?: 'output' | 'all';
|
|
1208
1209
|
}) => Promise<PlaySheetRowsResult>;
|
|
1209
1210
|
/** Stop a running/waiting run. */
|
|
1210
1211
|
stop: (runId: string, options?: {
|
|
@@ -1956,6 +1957,7 @@ declare class DeeplineClient {
|
|
|
1956
1957
|
runId?: string;
|
|
1957
1958
|
limit?: number;
|
|
1958
1959
|
offset?: number;
|
|
1960
|
+
rowMode?: 'output' | 'all';
|
|
1959
1961
|
}): Promise<PlaySheetRowsResult>;
|
|
1960
1962
|
/**
|
|
1961
1963
|
* Stop a run by id using the public runs resource model.
|
package/dist/index.d.ts
CHANGED
|
@@ -1205,6 +1205,7 @@ type RunsNamespace = {
|
|
|
1205
1205
|
runId?: string;
|
|
1206
1206
|
limit?: number;
|
|
1207
1207
|
offset?: number;
|
|
1208
|
+
rowMode?: 'output' | 'all';
|
|
1208
1209
|
}) => Promise<PlaySheetRowsResult>;
|
|
1209
1210
|
/** Stop a running/waiting run. */
|
|
1210
1211
|
stop: (runId: string, options?: {
|
|
@@ -1956,6 +1957,7 @@ declare class DeeplineClient {
|
|
|
1956
1957
|
runId?: string;
|
|
1957
1958
|
limit?: number;
|
|
1958
1959
|
offset?: number;
|
|
1960
|
+
rowMode?: 'output' | 'all';
|
|
1959
1961
|
}): Promise<PlaySheetRowsResult>;
|
|
1960
1962
|
/**
|
|
1961
1963
|
* Stop a run by id using the public runs resource model.
|
package/dist/index.js
CHANGED
|
@@ -127,6 +127,22 @@ var PROD_URL = "https://code.deepline.com";
|
|
|
127
127
|
var DEFAULT_TIMEOUT = 6e4;
|
|
128
128
|
var DEFAULT_MAX_RETRIES = 3;
|
|
129
129
|
var PROJECT_DEEPLINE_ENV_FILE = ".env.deepline";
|
|
130
|
+
var COWORK_IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
131
|
+
".auto-memory",
|
|
132
|
+
".claude",
|
|
133
|
+
".remote-plugins",
|
|
134
|
+
"outputs",
|
|
135
|
+
"plugins",
|
|
136
|
+
"uploads"
|
|
137
|
+
]);
|
|
138
|
+
var COWORK_PROJECT_MARKERS = [
|
|
139
|
+
".deepline",
|
|
140
|
+
".env.deepline",
|
|
141
|
+
".git",
|
|
142
|
+
"AGENTS.md",
|
|
143
|
+
"package.json",
|
|
144
|
+
"pyproject.toml"
|
|
145
|
+
];
|
|
130
146
|
function baseUrlSlug(baseUrl) {
|
|
131
147
|
let url;
|
|
132
148
|
try {
|
|
@@ -172,9 +188,124 @@ function findNearestEnvFile(name, startDir = process.cwd()) {
|
|
|
172
188
|
current = parent;
|
|
173
189
|
}
|
|
174
190
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
|
|
191
|
+
function isDirectory(path) {
|
|
192
|
+
try {
|
|
193
|
+
return (0, import_node_fs.statSync)(path).isDirectory();
|
|
194
|
+
} catch {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function canonicalPath(path) {
|
|
199
|
+
try {
|
|
200
|
+
return (0, import_node_fs.realpathSync)(path);
|
|
201
|
+
} catch {
|
|
202
|
+
return (0, import_node_path.resolve)(path);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function isTruthy(value) {
|
|
206
|
+
return /^(1|true|yes|on)$/i.test(value?.trim() ?? "");
|
|
207
|
+
}
|
|
208
|
+
function sessionRootFromPath(path) {
|
|
209
|
+
const trimmed = path?.trim();
|
|
210
|
+
if (!trimmed) return null;
|
|
211
|
+
const match = /^\/sessions\/[^/]+(?=\/|$)/.exec(trimmed);
|
|
212
|
+
return match?.[0] ?? null;
|
|
213
|
+
}
|
|
214
|
+
function coworkSessionRoot() {
|
|
215
|
+
const home = process.env.HOME?.trim();
|
|
216
|
+
const homeSessionRoot = sessionRootFromPath(home);
|
|
217
|
+
if (homeSessionRoot && isDirectory((0, import_node_path.join)(homeSessionRoot, "mnt"))) {
|
|
218
|
+
return homeSessionRoot;
|
|
219
|
+
}
|
|
220
|
+
const cwdSessionRoot = sessionRootFromPath(process.cwd());
|
|
221
|
+
if (cwdSessionRoot && isDirectory((0, import_node_path.join)(cwdSessionRoot, "mnt"))) {
|
|
222
|
+
return cwdSessionRoot;
|
|
223
|
+
}
|
|
224
|
+
if (isTruthy(process.env.CLAUDE_CODE_REMOTE) && home) {
|
|
225
|
+
const mountedRoot = (0, import_node_path.join)(home, "mnt");
|
|
226
|
+
if (isDirectory(mountedRoot)) return (0, import_node_path.resolve)(home);
|
|
227
|
+
}
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
function isCoworkLikeSandbox() {
|
|
231
|
+
const home = process.env.HOME?.trim();
|
|
232
|
+
return isTruthy(process.env.CLAUDE_CODE_REMOTE) || sessionRootFromPath(home) !== null || sessionRootFromPath(process.cwd()) !== null;
|
|
233
|
+
}
|
|
234
|
+
function coworkProjectScore(path) {
|
|
235
|
+
let score = 0;
|
|
236
|
+
for (const marker of COWORK_PROJECT_MARKERS) {
|
|
237
|
+
if ((0, import_node_fs.existsSync)((0, import_node_path.join)(path, marker))) score += 1;
|
|
238
|
+
}
|
|
239
|
+
return score;
|
|
240
|
+
}
|
|
241
|
+
function listCoworkWorkspaceDirCandidates() {
|
|
242
|
+
if (!isCoworkLikeSandbox()) {
|
|
243
|
+
return [];
|
|
244
|
+
}
|
|
245
|
+
const explicitProjectDir = process.env.CLAUDE_PROJECT_DIR?.trim();
|
|
246
|
+
if (explicitProjectDir && isDirectory(explicitProjectDir)) {
|
|
247
|
+
return [(0, import_node_path.resolve)(explicitProjectDir)];
|
|
248
|
+
}
|
|
249
|
+
const sessionRoot = coworkSessionRoot();
|
|
250
|
+
if (!sessionRoot) return [];
|
|
251
|
+
const mountedRoot = (0, import_node_path.join)(sessionRoot, "mnt");
|
|
252
|
+
if (!isDirectory(mountedRoot)) return [];
|
|
253
|
+
let names;
|
|
254
|
+
try {
|
|
255
|
+
names = (0, import_node_fs.readdirSync)(mountedRoot).sort();
|
|
256
|
+
} catch {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
const candidates = [];
|
|
260
|
+
for (const name of names) {
|
|
261
|
+
if (name.startsWith(".") || COWORK_IGNORED_WORKSPACE_DIRS.has(name)) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
const candidate = (0, import_node_path.join)(mountedRoot, name);
|
|
265
|
+
if (isDirectory(candidate)) candidates.push(candidate);
|
|
266
|
+
}
|
|
267
|
+
if (candidates.length <= 1) return candidates;
|
|
268
|
+
const projectLike = candidates.filter(
|
|
269
|
+
(candidate) => coworkProjectScore(candidate) > 0
|
|
270
|
+
);
|
|
271
|
+
return projectLike.length > 0 ? projectLike : candidates;
|
|
272
|
+
}
|
|
273
|
+
function isInIgnoredCoworkMount(path) {
|
|
274
|
+
const sessionRoot = coworkSessionRoot();
|
|
275
|
+
if (!sessionRoot) return false;
|
|
276
|
+
const mountedRoot = canonicalPath((0, import_node_path.join)(sessionRoot, "mnt"));
|
|
277
|
+
const resolvedPath = canonicalPath(path);
|
|
278
|
+
const prefix = `${mountedRoot}/`;
|
|
279
|
+
if (!resolvedPath.startsWith(prefix)) return false;
|
|
280
|
+
const relativePath = resolvedPath.slice(prefix.length);
|
|
281
|
+
const mountName = relativePath.split("/")[0];
|
|
282
|
+
return mountName.startsWith(".") || COWORK_IGNORED_WORKSPACE_DIRS.has(mountName);
|
|
283
|
+
}
|
|
284
|
+
function detectCoworkWorkspaceDir() {
|
|
285
|
+
const candidates = listCoworkWorkspaceDirCandidates();
|
|
286
|
+
return candidates.length === 1 ? candidates[0] : null;
|
|
287
|
+
}
|
|
288
|
+
function loadProjectEnvCandidates(startDir = process.cwd()) {
|
|
289
|
+
const filePaths = [];
|
|
290
|
+
const sources = /* @__PURE__ */ new Map();
|
|
291
|
+
const nearestFile = findNearestEnvFile(PROJECT_DEEPLINE_ENV_FILE, startDir);
|
|
292
|
+
if (nearestFile && !isInIgnoredCoworkMount(nearestFile)) {
|
|
293
|
+
filePaths.push(nearestFile);
|
|
294
|
+
sources.set((0, import_node_path.resolve)(nearestFile), "nearest");
|
|
295
|
+
}
|
|
296
|
+
const coworkWorkspaceDir = detectCoworkWorkspaceDir();
|
|
297
|
+
if (coworkWorkspaceDir) {
|
|
298
|
+
const coworkFile = (0, import_node_path.join)(coworkWorkspaceDir, PROJECT_DEEPLINE_ENV_FILE);
|
|
299
|
+
if ((0, import_node_fs.existsSync)(coworkFile) && !filePaths.some((filePath) => (0, import_node_path.resolve)(filePath) === (0, import_node_path.resolve)(coworkFile))) {
|
|
300
|
+
filePaths.push(coworkFile);
|
|
301
|
+
sources.set((0, import_node_path.resolve)(coworkFile), "cowork");
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return filePaths.map((filePath) => ({
|
|
305
|
+
filePath,
|
|
306
|
+
env: parseEnvFile(filePath),
|
|
307
|
+
source: sources.get((0, import_node_path.resolve)(filePath)) ?? "nearest"
|
|
308
|
+
}));
|
|
178
309
|
}
|
|
179
310
|
function normalizeBaseUrl(baseUrl) {
|
|
180
311
|
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
@@ -219,20 +350,23 @@ function loadGlobalCliEnv() {
|
|
|
219
350
|
return loadCliEnv(PROD_URL);
|
|
220
351
|
}
|
|
221
352
|
function autoDetectBaseUrl() {
|
|
222
|
-
const
|
|
353
|
+
const projectEnvs = loadProjectEnvCandidates();
|
|
223
354
|
const globalEnv = loadGlobalCliEnv();
|
|
224
|
-
return normalizeBaseUrl(process.env[HOST_URL_ENV] ?? "") ||
|
|
355
|
+
return normalizeBaseUrl(process.env[HOST_URL_ENV] ?? "") || firstNonEmpty(
|
|
356
|
+
...projectEnvs.map(({ env }) => normalizeBaseUrl(env[HOST_URL_ENV]))
|
|
357
|
+
) || normalizeBaseUrl(globalEnv[HOST_URL_ENV] ?? "") || PROD_URL;
|
|
225
358
|
}
|
|
226
359
|
function resolveApiKeyForBaseUrl(baseUrl, explicitApiKey) {
|
|
227
360
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
228
|
-
const
|
|
361
|
+
const projectEnvs = loadProjectEnvCandidates();
|
|
229
362
|
const cliEnv = loadCliEnv(normalizedBaseUrl || baseUrl);
|
|
230
|
-
const projectBaseUrl = normalizeBaseUrl(projectEnv[HOST_URL_ENV] ?? "");
|
|
231
|
-
const projectKeyApplies = projectBaseUrl === normalizedBaseUrl;
|
|
232
363
|
return firstNonEmpty(
|
|
233
364
|
explicitApiKey,
|
|
234
365
|
process.env[API_KEY_ENV],
|
|
235
|
-
|
|
366
|
+
...projectEnvs.map(({ env }) => {
|
|
367
|
+
const projectBaseUrl = normalizeBaseUrl(env[HOST_URL_ENV] ?? "");
|
|
368
|
+
return projectBaseUrl === normalizedBaseUrl ? env[API_KEY_ENV] : "";
|
|
369
|
+
}),
|
|
236
370
|
cliEnv[API_KEY_ENV]
|
|
237
371
|
);
|
|
238
372
|
}
|
|
@@ -284,10 +418,10 @@ var SDK_RELEASE = {
|
|
|
284
418
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
285
419
|
// the SDK enrich generator's one-second stale policy.
|
|
286
420
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
287
|
-
version: "0.1.
|
|
421
|
+
version: "0.1.145",
|
|
288
422
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
289
423
|
supportPolicy: {
|
|
290
|
-
latest: "0.1.
|
|
424
|
+
latest: "0.1.145",
|
|
291
425
|
minimumSupported: "0.1.53",
|
|
292
426
|
deprecatedBelow: "0.1.53",
|
|
293
427
|
commandMinimumSupported: [
|
|
@@ -378,7 +512,7 @@ function normalizeAgentRuntime(value) {
|
|
|
378
512
|
if (explicit === "gemini_cli") return "gemini";
|
|
379
513
|
return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
|
|
380
514
|
}
|
|
381
|
-
function
|
|
515
|
+
function isCoworkLikeSandbox2() {
|
|
382
516
|
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
383
517
|
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
384
518
|
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
@@ -391,7 +525,7 @@ function detectAgentRuntime(options = {}) {
|
|
|
391
525
|
const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
|
|
392
526
|
if (explicit) return explicit;
|
|
393
527
|
if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
|
|
394
|
-
if (options.detectCowork !== false &&
|
|
528
|
+
if (options.detectCowork !== false && isCoworkLikeSandbox2()) {
|
|
395
529
|
return "claude_cowork";
|
|
396
530
|
}
|
|
397
531
|
if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
|
|
@@ -857,7 +991,7 @@ function sleep(ms) {
|
|
|
857
991
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
858
992
|
}
|
|
859
993
|
function withCoworkNetworkHint(message) {
|
|
860
|
-
if (!
|
|
994
|
+
if (!isCoworkLikeSandbox2() || message.includes(COWORK_NETWORK_HINT)) {
|
|
861
995
|
return message;
|
|
862
996
|
}
|
|
863
997
|
return `${message}
|
|
@@ -3164,6 +3298,9 @@ var DeeplineClient = class {
|
|
|
3164
3298
|
if (input.runId?.trim()) {
|
|
3165
3299
|
params.set("runId", input.runId.trim());
|
|
3166
3300
|
}
|
|
3301
|
+
if (input.rowMode === "all") {
|
|
3302
|
+
params.set("rowMode", "all");
|
|
3303
|
+
}
|
|
3167
3304
|
return await this.http.get(
|
|
3168
3305
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
|
|
3169
3306
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// src/config.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
existsSync,
|
|
4
|
+
mkdirSync,
|
|
5
|
+
readdirSync,
|
|
6
|
+
realpathSync,
|
|
7
|
+
readFileSync,
|
|
8
|
+
statSync,
|
|
9
|
+
writeFileSync
|
|
10
|
+
} from "fs";
|
|
3
11
|
import { homedir } from "os";
|
|
4
12
|
import { dirname, join, resolve } from "path";
|
|
5
13
|
|
|
@@ -49,6 +57,22 @@ var PROD_URL = "https://code.deepline.com";
|
|
|
49
57
|
var DEFAULT_TIMEOUT = 6e4;
|
|
50
58
|
var DEFAULT_MAX_RETRIES = 3;
|
|
51
59
|
var PROJECT_DEEPLINE_ENV_FILE = ".env.deepline";
|
|
60
|
+
var COWORK_IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
61
|
+
".auto-memory",
|
|
62
|
+
".claude",
|
|
63
|
+
".remote-plugins",
|
|
64
|
+
"outputs",
|
|
65
|
+
"plugins",
|
|
66
|
+
"uploads"
|
|
67
|
+
]);
|
|
68
|
+
var COWORK_PROJECT_MARKERS = [
|
|
69
|
+
".deepline",
|
|
70
|
+
".env.deepline",
|
|
71
|
+
".git",
|
|
72
|
+
"AGENTS.md",
|
|
73
|
+
"package.json",
|
|
74
|
+
"pyproject.toml"
|
|
75
|
+
];
|
|
52
76
|
function baseUrlSlug(baseUrl) {
|
|
53
77
|
let url;
|
|
54
78
|
try {
|
|
@@ -94,9 +118,124 @@ function findNearestEnvFile(name, startDir = process.cwd()) {
|
|
|
94
118
|
current = parent;
|
|
95
119
|
}
|
|
96
120
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
121
|
+
function isDirectory(path) {
|
|
122
|
+
try {
|
|
123
|
+
return statSync(path).isDirectory();
|
|
124
|
+
} catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function canonicalPath(path) {
|
|
129
|
+
try {
|
|
130
|
+
return realpathSync(path);
|
|
131
|
+
} catch {
|
|
132
|
+
return resolve(path);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function isTruthy(value) {
|
|
136
|
+
return /^(1|true|yes|on)$/i.test(value?.trim() ?? "");
|
|
137
|
+
}
|
|
138
|
+
function sessionRootFromPath(path) {
|
|
139
|
+
const trimmed = path?.trim();
|
|
140
|
+
if (!trimmed) return null;
|
|
141
|
+
const match = /^\/sessions\/[^/]+(?=\/|$)/.exec(trimmed);
|
|
142
|
+
return match?.[0] ?? null;
|
|
143
|
+
}
|
|
144
|
+
function coworkSessionRoot() {
|
|
145
|
+
const home = process.env.HOME?.trim();
|
|
146
|
+
const homeSessionRoot = sessionRootFromPath(home);
|
|
147
|
+
if (homeSessionRoot && isDirectory(join(homeSessionRoot, "mnt"))) {
|
|
148
|
+
return homeSessionRoot;
|
|
149
|
+
}
|
|
150
|
+
const cwdSessionRoot = sessionRootFromPath(process.cwd());
|
|
151
|
+
if (cwdSessionRoot && isDirectory(join(cwdSessionRoot, "mnt"))) {
|
|
152
|
+
return cwdSessionRoot;
|
|
153
|
+
}
|
|
154
|
+
if (isTruthy(process.env.CLAUDE_CODE_REMOTE) && home) {
|
|
155
|
+
const mountedRoot = join(home, "mnt");
|
|
156
|
+
if (isDirectory(mountedRoot)) return resolve(home);
|
|
157
|
+
}
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
function isCoworkLikeSandbox() {
|
|
161
|
+
const home = process.env.HOME?.trim();
|
|
162
|
+
return isTruthy(process.env.CLAUDE_CODE_REMOTE) || sessionRootFromPath(home) !== null || sessionRootFromPath(process.cwd()) !== null;
|
|
163
|
+
}
|
|
164
|
+
function coworkProjectScore(path) {
|
|
165
|
+
let score = 0;
|
|
166
|
+
for (const marker of COWORK_PROJECT_MARKERS) {
|
|
167
|
+
if (existsSync(join(path, marker))) score += 1;
|
|
168
|
+
}
|
|
169
|
+
return score;
|
|
170
|
+
}
|
|
171
|
+
function listCoworkWorkspaceDirCandidates() {
|
|
172
|
+
if (!isCoworkLikeSandbox()) {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
const explicitProjectDir = process.env.CLAUDE_PROJECT_DIR?.trim();
|
|
176
|
+
if (explicitProjectDir && isDirectory(explicitProjectDir)) {
|
|
177
|
+
return [resolve(explicitProjectDir)];
|
|
178
|
+
}
|
|
179
|
+
const sessionRoot = coworkSessionRoot();
|
|
180
|
+
if (!sessionRoot) return [];
|
|
181
|
+
const mountedRoot = join(sessionRoot, "mnt");
|
|
182
|
+
if (!isDirectory(mountedRoot)) return [];
|
|
183
|
+
let names;
|
|
184
|
+
try {
|
|
185
|
+
names = readdirSync(mountedRoot).sort();
|
|
186
|
+
} catch {
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
const candidates = [];
|
|
190
|
+
for (const name of names) {
|
|
191
|
+
if (name.startsWith(".") || COWORK_IGNORED_WORKSPACE_DIRS.has(name)) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const candidate = join(mountedRoot, name);
|
|
195
|
+
if (isDirectory(candidate)) candidates.push(candidate);
|
|
196
|
+
}
|
|
197
|
+
if (candidates.length <= 1) return candidates;
|
|
198
|
+
const projectLike = candidates.filter(
|
|
199
|
+
(candidate) => coworkProjectScore(candidate) > 0
|
|
200
|
+
);
|
|
201
|
+
return projectLike.length > 0 ? projectLike : candidates;
|
|
202
|
+
}
|
|
203
|
+
function isInIgnoredCoworkMount(path) {
|
|
204
|
+
const sessionRoot = coworkSessionRoot();
|
|
205
|
+
if (!sessionRoot) return false;
|
|
206
|
+
const mountedRoot = canonicalPath(join(sessionRoot, "mnt"));
|
|
207
|
+
const resolvedPath = canonicalPath(path);
|
|
208
|
+
const prefix = `${mountedRoot}/`;
|
|
209
|
+
if (!resolvedPath.startsWith(prefix)) return false;
|
|
210
|
+
const relativePath = resolvedPath.slice(prefix.length);
|
|
211
|
+
const mountName = relativePath.split("/")[0];
|
|
212
|
+
return mountName.startsWith(".") || COWORK_IGNORED_WORKSPACE_DIRS.has(mountName);
|
|
213
|
+
}
|
|
214
|
+
function detectCoworkWorkspaceDir() {
|
|
215
|
+
const candidates = listCoworkWorkspaceDirCandidates();
|
|
216
|
+
return candidates.length === 1 ? candidates[0] : null;
|
|
217
|
+
}
|
|
218
|
+
function loadProjectEnvCandidates(startDir = process.cwd()) {
|
|
219
|
+
const filePaths = [];
|
|
220
|
+
const sources = /* @__PURE__ */ new Map();
|
|
221
|
+
const nearestFile = findNearestEnvFile(PROJECT_DEEPLINE_ENV_FILE, startDir);
|
|
222
|
+
if (nearestFile && !isInIgnoredCoworkMount(nearestFile)) {
|
|
223
|
+
filePaths.push(nearestFile);
|
|
224
|
+
sources.set(resolve(nearestFile), "nearest");
|
|
225
|
+
}
|
|
226
|
+
const coworkWorkspaceDir = detectCoworkWorkspaceDir();
|
|
227
|
+
if (coworkWorkspaceDir) {
|
|
228
|
+
const coworkFile = join(coworkWorkspaceDir, PROJECT_DEEPLINE_ENV_FILE);
|
|
229
|
+
if (existsSync(coworkFile) && !filePaths.some((filePath) => resolve(filePath) === resolve(coworkFile))) {
|
|
230
|
+
filePaths.push(coworkFile);
|
|
231
|
+
sources.set(resolve(coworkFile), "cowork");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return filePaths.map((filePath) => ({
|
|
235
|
+
filePath,
|
|
236
|
+
env: parseEnvFile(filePath),
|
|
237
|
+
source: sources.get(resolve(filePath)) ?? "nearest"
|
|
238
|
+
}));
|
|
100
239
|
}
|
|
101
240
|
function normalizeBaseUrl(baseUrl) {
|
|
102
241
|
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
@@ -141,20 +280,23 @@ function loadGlobalCliEnv() {
|
|
|
141
280
|
return loadCliEnv(PROD_URL);
|
|
142
281
|
}
|
|
143
282
|
function autoDetectBaseUrl() {
|
|
144
|
-
const
|
|
283
|
+
const projectEnvs = loadProjectEnvCandidates();
|
|
145
284
|
const globalEnv = loadGlobalCliEnv();
|
|
146
|
-
return normalizeBaseUrl(process.env[HOST_URL_ENV] ?? "") ||
|
|
285
|
+
return normalizeBaseUrl(process.env[HOST_URL_ENV] ?? "") || firstNonEmpty(
|
|
286
|
+
...projectEnvs.map(({ env }) => normalizeBaseUrl(env[HOST_URL_ENV]))
|
|
287
|
+
) || normalizeBaseUrl(globalEnv[HOST_URL_ENV] ?? "") || PROD_URL;
|
|
147
288
|
}
|
|
148
289
|
function resolveApiKeyForBaseUrl(baseUrl, explicitApiKey) {
|
|
149
290
|
const normalizedBaseUrl = normalizeBaseUrl(baseUrl);
|
|
150
|
-
const
|
|
291
|
+
const projectEnvs = loadProjectEnvCandidates();
|
|
151
292
|
const cliEnv = loadCliEnv(normalizedBaseUrl || baseUrl);
|
|
152
|
-
const projectBaseUrl = normalizeBaseUrl(projectEnv[HOST_URL_ENV] ?? "");
|
|
153
|
-
const projectKeyApplies = projectBaseUrl === normalizedBaseUrl;
|
|
154
293
|
return firstNonEmpty(
|
|
155
294
|
explicitApiKey,
|
|
156
295
|
process.env[API_KEY_ENV],
|
|
157
|
-
|
|
296
|
+
...projectEnvs.map(({ env }) => {
|
|
297
|
+
const projectBaseUrl = normalizeBaseUrl(env[HOST_URL_ENV] ?? "");
|
|
298
|
+
return projectBaseUrl === normalizedBaseUrl ? env[API_KEY_ENV] : "";
|
|
299
|
+
}),
|
|
158
300
|
cliEnv[API_KEY_ENV]
|
|
159
301
|
);
|
|
160
302
|
}
|
|
@@ -206,10 +348,10 @@ var SDK_RELEASE = {
|
|
|
206
348
|
// 0.1.108 ships explicit dataset column/tool recompute policy and removes
|
|
207
349
|
// the SDK enrich generator's one-second stale policy.
|
|
208
350
|
// 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
|
|
209
|
-
version: "0.1.
|
|
351
|
+
version: "0.1.145",
|
|
210
352
|
apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
|
|
211
353
|
supportPolicy: {
|
|
212
|
-
latest: "0.1.
|
|
354
|
+
latest: "0.1.145",
|
|
213
355
|
minimumSupported: "0.1.53",
|
|
214
356
|
deprecatedBelow: "0.1.53",
|
|
215
357
|
commandMinimumSupported: [
|
|
@@ -300,7 +442,7 @@ function normalizeAgentRuntime(value) {
|
|
|
300
442
|
if (explicit === "gemini_cli") return "gemini";
|
|
301
443
|
return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
|
|
302
444
|
}
|
|
303
|
-
function
|
|
445
|
+
function isCoworkLikeSandbox2() {
|
|
304
446
|
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
305
447
|
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
306
448
|
const projectDir = Boolean(process.env.CLAUDE_PROJECT_DIR?.trim());
|
|
@@ -313,7 +455,7 @@ function detectAgentRuntime(options = {}) {
|
|
|
313
455
|
const explicit = normalizeAgentRuntime(process.env.DEEPLINE_AGENT_RUNTIME);
|
|
314
456
|
if (explicit) return explicit;
|
|
315
457
|
if (process.env.CODEX_THREAD_ID?.trim()) return "codex";
|
|
316
|
-
if (options.detectCowork !== false &&
|
|
458
|
+
if (options.detectCowork !== false && isCoworkLikeSandbox2()) {
|
|
317
459
|
return "claude_cowork";
|
|
318
460
|
}
|
|
319
461
|
if (process.env.CLAUDECODE?.trim() === "1") return "claude_code";
|
|
@@ -779,7 +921,7 @@ function sleep(ms) {
|
|
|
779
921
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
780
922
|
}
|
|
781
923
|
function withCoworkNetworkHint(message) {
|
|
782
|
-
if (!
|
|
924
|
+
if (!isCoworkLikeSandbox2() || message.includes(COWORK_NETWORK_HINT)) {
|
|
783
925
|
return message;
|
|
784
926
|
}
|
|
785
927
|
return `${message}
|
|
@@ -3086,6 +3228,9 @@ var DeeplineClient = class {
|
|
|
3086
3228
|
if (input.runId?.trim()) {
|
|
3087
3229
|
params.set("runId", input.runId.trim());
|
|
3088
3230
|
}
|
|
3231
|
+
if (input.rowMode === "all") {
|
|
3232
|
+
params.set("rowMode", "all");
|
|
3233
|
+
}
|
|
3089
3234
|
return await this.http.get(
|
|
3090
3235
|
`/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
|
|
3091
3236
|
);
|