deepline 0.1.159 → 0.1.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/dist/bundling-sources/sdk/src/config.ts +0 -49
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/types.ts +4 -2
- package/dist/cli/index.js +73 -65
- package/dist/cli/index.mjs +73 -65
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
|
@@ -58,8 +58,6 @@ const DEFAULT_TIMEOUT = 60_000;
|
|
|
58
58
|
const DEFAULT_MAX_RETRIES = 3;
|
|
59
59
|
|
|
60
60
|
const PROJECT_DEEPLINE_ENV_FILE = '.env.deepline';
|
|
61
|
-
const WORKSPACE_RESTORE_ENV_DIR = '.deepline';
|
|
62
|
-
const WORKSPACE_RESTORE_ENV_FILE = '.env';
|
|
63
61
|
const COWORK_IGNORED_WORKSPACE_DIRS = new Set([
|
|
64
62
|
'.auto-memory',
|
|
65
63
|
'.claude',
|
|
@@ -507,27 +505,6 @@ function ensureProjectEnvIsIgnored(dir: string): void {
|
|
|
507
505
|
writeFileSync(gitignorePath, `${existing}${prefix}${entry}\n`, 'utf-8');
|
|
508
506
|
}
|
|
509
507
|
|
|
510
|
-
function ensureWorkspaceRestoreEnvIsIgnored(workspaceDir: string): void {
|
|
511
|
-
const gitignorePath = join(workspaceDir, '.gitignore');
|
|
512
|
-
const entry = `${WORKSPACE_RESTORE_ENV_DIR}/`;
|
|
513
|
-
const existing = existsSync(gitignorePath)
|
|
514
|
-
? readFileSync(gitignorePath, 'utf-8')
|
|
515
|
-
: '';
|
|
516
|
-
const alreadyIgnored = existing
|
|
517
|
-
.split(/\r?\n/)
|
|
518
|
-
.map((line) => line.trim())
|
|
519
|
-
.some(
|
|
520
|
-
(line) =>
|
|
521
|
-
line === entry ||
|
|
522
|
-
line === `/${entry}` ||
|
|
523
|
-
line === WORKSPACE_RESTORE_ENV_DIR ||
|
|
524
|
-
line === `/${WORKSPACE_RESTORE_ENV_DIR}`,
|
|
525
|
-
);
|
|
526
|
-
if (alreadyIgnored) return;
|
|
527
|
-
const prefix = existing && !existing.endsWith('\n') ? '\n' : '';
|
|
528
|
-
writeFileSync(gitignorePath, `${existing}${prefix}${entry}\n`, 'utf-8');
|
|
529
|
-
}
|
|
530
|
-
|
|
531
508
|
export function saveProjectDeeplineEnvValues(
|
|
532
509
|
values: EnvValues,
|
|
533
510
|
startDir: string = process.cwd(),
|
|
@@ -545,32 +522,6 @@ export function saveProjectDeeplineEnvValues(
|
|
|
545
522
|
return [filePath];
|
|
546
523
|
}
|
|
547
524
|
|
|
548
|
-
export function saveCoworkWorkspaceRestoreEnvValues(
|
|
549
|
-
values: EnvValues,
|
|
550
|
-
startDir: string = process.cwd(),
|
|
551
|
-
): string[] {
|
|
552
|
-
if (!isCoworkLikeSandbox()) return [];
|
|
553
|
-
const target = resolveProjectPinTarget(startDir);
|
|
554
|
-
if (!target.ok || target.source === 'cwd') return [];
|
|
555
|
-
const workspaceDir = target.dir;
|
|
556
|
-
const filePath = join(
|
|
557
|
-
workspaceDir,
|
|
558
|
-
WORKSPACE_RESTORE_ENV_DIR,
|
|
559
|
-
WORKSPACE_RESTORE_ENV_FILE,
|
|
560
|
-
);
|
|
561
|
-
const existing = parseEnvFile(filePath);
|
|
562
|
-
const merged = { ...existing, ...values };
|
|
563
|
-
const dir = dirname(filePath);
|
|
564
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
565
|
-
ensureWorkspaceRestoreEnvIsIgnored(workspaceDir);
|
|
566
|
-
const allowedKeys = new Set([HOST_URL_ENV, API_KEY_ENV]);
|
|
567
|
-
const lines = Object.entries(merged)
|
|
568
|
-
.filter(([key, value]) => allowedKeys.has(key) && value !== '')
|
|
569
|
-
.map(([key, value]) => `${key}=${value}`);
|
|
570
|
-
writeFileSync(filePath, `${lines.join('\n')}\n`, 'utf-8');
|
|
571
|
-
return [filePath];
|
|
572
|
-
}
|
|
573
|
-
|
|
574
525
|
export function resolveProjectPinDir(startDir: string = process.cwd()): string {
|
|
575
526
|
const target = resolveProjectPinTarget(startDir);
|
|
576
527
|
if (!target.ok) {
|
|
@@ -104,10 +104,10 @@ export const SDK_RELEASE = {
|
|
|
104
104
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
105
105
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
106
106
|
// fields shipped in 0.1.153.
|
|
107
|
-
version: '0.1.
|
|
107
|
+
version: '0.1.161',
|
|
108
108
|
apiContract: '2026-06-dataset-handle-results-hard-cutover',
|
|
109
109
|
supportPolicy: {
|
|
110
|
-
latest: '0.1.
|
|
110
|
+
latest: '0.1.161',
|
|
111
111
|
minimumSupported: '0.1.53',
|
|
112
112
|
deprecatedBelow: '0.1.53',
|
|
113
113
|
commandMinimumSupported: [
|
|
@@ -1037,15 +1037,17 @@ export interface DeletePlayResult {
|
|
|
1037
1037
|
/** Owner-facing view of a play's public share page. */
|
|
1038
1038
|
export interface SharePageOwnerView {
|
|
1039
1039
|
shareSlug: string;
|
|
1040
|
+
/** Org URL handle; the public page lives at `/p/{orgSlug}/{playName}`. */
|
|
1041
|
+
orgSlug: string;
|
|
1040
1042
|
publishedRevisionId: string;
|
|
1041
1043
|
publishedVersion: number;
|
|
1042
1044
|
visibility: string;
|
|
1043
1045
|
seoIndexing: 'index' | 'noindex';
|
|
1044
1046
|
showAverageDeeplineCost: boolean;
|
|
1045
1047
|
showAverageLatency: boolean;
|
|
1046
|
-
/** Stable public path, e.g. `/p/{
|
|
1048
|
+
/** Stable public path, e.g. `/p/{orgSlug}/{playName}`. */
|
|
1047
1049
|
publicPath: string;
|
|
1048
|
-
/** Version-pinned canonical path, e.g. `/p/{
|
|
1050
|
+
/** Version-pinned canonical path, e.g. `/p/{orgSlug}/{playName}/v/{version}`. */
|
|
1049
1051
|
canonicalPath: string;
|
|
1050
1052
|
createdAt: number;
|
|
1051
1053
|
updatedAt: number;
|
package/dist/cli/index.js
CHANGED
|
@@ -237,8 +237,6 @@ var PROD_URL = "https://code.deepline.com";
|
|
|
237
237
|
var DEFAULT_TIMEOUT = 6e4;
|
|
238
238
|
var DEFAULT_MAX_RETRIES = 3;
|
|
239
239
|
var PROJECT_DEEPLINE_ENV_FILE = ".env.deepline";
|
|
240
|
-
var WORKSPACE_RESTORE_ENV_DIR = ".deepline";
|
|
241
|
-
var WORKSPACE_RESTORE_ENV_FILE = ".env";
|
|
242
240
|
var COWORK_IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
243
241
|
".auto-memory",
|
|
244
242
|
".claude",
|
|
@@ -553,18 +551,6 @@ function ensureProjectEnvIsIgnored(dir) {
|
|
|
553
551
|
(0, import_node_fs.writeFileSync)(gitignorePath, `${existing}${prefix}${entry}
|
|
554
552
|
`, "utf-8");
|
|
555
553
|
}
|
|
556
|
-
function ensureWorkspaceRestoreEnvIsIgnored(workspaceDir) {
|
|
557
|
-
const gitignorePath = (0, import_node_path.join)(workspaceDir, ".gitignore");
|
|
558
|
-
const entry = `${WORKSPACE_RESTORE_ENV_DIR}/`;
|
|
559
|
-
const existing = (0, import_node_fs.existsSync)(gitignorePath) ? (0, import_node_fs.readFileSync)(gitignorePath, "utf-8") : "";
|
|
560
|
-
const alreadyIgnored = existing.split(/\r?\n/).map((line) => line.trim()).some(
|
|
561
|
-
(line) => line === entry || line === `/${entry}` || line === WORKSPACE_RESTORE_ENV_DIR || line === `/${WORKSPACE_RESTORE_ENV_DIR}`
|
|
562
|
-
);
|
|
563
|
-
if (alreadyIgnored) return;
|
|
564
|
-
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
565
|
-
(0, import_node_fs.writeFileSync)(gitignorePath, `${existing}${prefix}${entry}
|
|
566
|
-
`, "utf-8");
|
|
567
|
-
}
|
|
568
554
|
function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
569
555
|
const target = resolveProjectPinTarget(startDir);
|
|
570
556
|
if (!target.ok) {
|
|
@@ -578,27 +564,6 @@ function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
|
578
564
|
mergeProjectEnvFile(filePath, values);
|
|
579
565
|
return [filePath];
|
|
580
566
|
}
|
|
581
|
-
function saveCoworkWorkspaceRestoreEnvValues(values, startDir = process.cwd()) {
|
|
582
|
-
if (!isCoworkLikeSandbox()) return [];
|
|
583
|
-
const target = resolveProjectPinTarget(startDir);
|
|
584
|
-
if (!target.ok || target.source === "cwd") return [];
|
|
585
|
-
const workspaceDir = target.dir;
|
|
586
|
-
const filePath = (0, import_node_path.join)(
|
|
587
|
-
workspaceDir,
|
|
588
|
-
WORKSPACE_RESTORE_ENV_DIR,
|
|
589
|
-
WORKSPACE_RESTORE_ENV_FILE
|
|
590
|
-
);
|
|
591
|
-
const existing = parseEnvFile(filePath);
|
|
592
|
-
const merged = { ...existing, ...values };
|
|
593
|
-
const dir = (0, import_node_path.dirname)(filePath);
|
|
594
|
-
if (!(0, import_node_fs.existsSync)(dir)) (0, import_node_fs.mkdirSync)(dir, { recursive: true });
|
|
595
|
-
ensureWorkspaceRestoreEnvIsIgnored(workspaceDir);
|
|
596
|
-
const allowedKeys = /* @__PURE__ */ new Set([HOST_URL_ENV, API_KEY_ENV]);
|
|
597
|
-
const lines = Object.entries(merged).filter(([key, value]) => allowedKeys.has(key) && value !== "").map(([key, value]) => `${key}=${value}`);
|
|
598
|
-
(0, import_node_fs.writeFileSync)(filePath, `${lines.join("\n")}
|
|
599
|
-
`, "utf-8");
|
|
600
|
-
return [filePath];
|
|
601
|
-
}
|
|
602
567
|
function resolveProjectPinTarget(startDir = process.cwd()) {
|
|
603
568
|
const nearestFile = findNearestEnvFile(PROJECT_DEEPLINE_ENV_FILE, startDir);
|
|
604
569
|
if (nearestFile && !isInIgnoredCoworkMount(nearestFile)) {
|
|
@@ -657,10 +622,10 @@ var SDK_RELEASE = {
|
|
|
657
622
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
658
623
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
659
624
|
// fields shipped in 0.1.153.
|
|
660
|
-
version: "0.1.
|
|
625
|
+
version: "0.1.161",
|
|
661
626
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
662
627
|
supportPolicy: {
|
|
663
|
-
latest: "0.1.
|
|
628
|
+
latest: "0.1.161",
|
|
664
629
|
minimumSupported: "0.1.53",
|
|
665
630
|
deprecatedBelow: "0.1.53",
|
|
666
631
|
commandMinimumSupported: [
|
|
@@ -4748,9 +4713,6 @@ function saveEnvValues(values, baseUrl) {
|
|
|
4748
4713
|
...values[API_KEY_ENV] ? { [API_KEY_ENV]: values[API_KEY_ENV] } : {}
|
|
4749
4714
|
};
|
|
4750
4715
|
saveHostEnvValues(baseUrl, filtered);
|
|
4751
|
-
if (filtered[API_KEY_ENV]) {
|
|
4752
|
-
saveCoworkWorkspaceRestoreEnvValues(filtered);
|
|
4753
|
-
}
|
|
4754
4716
|
}
|
|
4755
4717
|
async function httpJson(method, url, apiKey, body) {
|
|
4756
4718
|
const headers = {
|
|
@@ -15261,10 +15223,41 @@ Examples:
|
|
|
15261
15223
|
]);
|
|
15262
15224
|
});
|
|
15263
15225
|
}
|
|
15226
|
+
var PUBLIC_PLAY_BASE_URL = "https://deepline.com";
|
|
15264
15227
|
function shareFlagValue(args, flag) {
|
|
15265
15228
|
const i = args.indexOf(flag);
|
|
15266
15229
|
return i >= 0 && i + 1 < args.length ? args[i + 1] : void 0;
|
|
15267
15230
|
}
|
|
15231
|
+
function absolutePublicPlayUrl(path) {
|
|
15232
|
+
if (!path) {
|
|
15233
|
+
return null;
|
|
15234
|
+
}
|
|
15235
|
+
try {
|
|
15236
|
+
return new URL(path, PUBLIC_PLAY_BASE_URL).toString();
|
|
15237
|
+
} catch {
|
|
15238
|
+
return null;
|
|
15239
|
+
}
|
|
15240
|
+
}
|
|
15241
|
+
function shareUrlFields(status) {
|
|
15242
|
+
return {
|
|
15243
|
+
publicUrl: absolutePublicPlayUrl(status.share?.publicPath),
|
|
15244
|
+
canonicalUrl: absolutePublicPlayUrl(status.share?.canonicalPath)
|
|
15245
|
+
};
|
|
15246
|
+
}
|
|
15247
|
+
function shareStatusForOutput(status) {
|
|
15248
|
+
if (!status.share) {
|
|
15249
|
+
return status;
|
|
15250
|
+
}
|
|
15251
|
+
const urls = shareUrlFields(status);
|
|
15252
|
+
return {
|
|
15253
|
+
...status,
|
|
15254
|
+
share: {
|
|
15255
|
+
...status.share,
|
|
15256
|
+
...urls.publicUrl ? { publicUrl: urls.publicUrl } : {},
|
|
15257
|
+
...urls.canonicalUrl ? { canonicalUrl: urls.canonicalUrl } : {}
|
|
15258
|
+
}
|
|
15259
|
+
};
|
|
15260
|
+
}
|
|
15268
15261
|
async function handlePlayShareStatus(args) {
|
|
15269
15262
|
const target = args[0];
|
|
15270
15263
|
if (!target) {
|
|
@@ -15273,25 +15266,30 @@ async function handlePlayShareStatus(args) {
|
|
|
15273
15266
|
}
|
|
15274
15267
|
const name = parseReferencedPlayTarget2(target).playName;
|
|
15275
15268
|
const status = await new DeeplineClient().getSharePage(name);
|
|
15269
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15276
15270
|
if (argsWantJson(args)) {
|
|
15277
|
-
process.stdout.write(`${JSON.stringify(
|
|
15271
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15278
15272
|
`);
|
|
15279
15273
|
return 0;
|
|
15280
15274
|
}
|
|
15281
|
-
if (!
|
|
15282
|
-
console.log(`${
|
|
15275
|
+
if (!outputStatus.share) {
|
|
15276
|
+
console.log(`${outputStatus.playName}: not published.`);
|
|
15283
15277
|
console.log(
|
|
15284
|
-
` Publish: deepline plays share publish ${
|
|
15278
|
+
` Publish: deepline plays share publish ${outputStatus.playName} --yes`
|
|
15285
15279
|
);
|
|
15286
15280
|
return 0;
|
|
15287
15281
|
}
|
|
15282
|
+
const urls = shareUrlFields(outputStatus);
|
|
15288
15283
|
console.log(
|
|
15289
|
-
`${
|
|
15284
|
+
`${outputStatus.playName}: published v${outputStatus.share.publishedVersion}`
|
|
15290
15285
|
);
|
|
15291
|
-
console.log(` url: ${
|
|
15292
|
-
|
|
15286
|
+
console.log(` url: ${urls.publicUrl ?? outputStatus.share.publicPath}`);
|
|
15287
|
+
if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
|
|
15288
|
+
console.log(` version: ${urls.canonicalUrl}`);
|
|
15289
|
+
}
|
|
15290
|
+
console.log(` seo: ${outputStatus.share.seoIndexing}`);
|
|
15293
15291
|
console.log(
|
|
15294
|
-
` show: cost=${
|
|
15292
|
+
` show: cost=${outputStatus.share.showAverageDeeplineCost} latency=${outputStatus.share.showAverageLatency}`
|
|
15295
15293
|
);
|
|
15296
15294
|
return 0;
|
|
15297
15295
|
}
|
|
@@ -15375,16 +15373,21 @@ async function handlePlaySharePublish(args) {
|
|
|
15375
15373
|
return 0;
|
|
15376
15374
|
}
|
|
15377
15375
|
const status = await client2.publishSharePage(name, request);
|
|
15376
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15378
15377
|
if (argsWantJson(args)) {
|
|
15379
|
-
process.stdout.write(`${JSON.stringify(
|
|
15378
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15380
15379
|
`);
|
|
15381
15380
|
return 0;
|
|
15382
15381
|
}
|
|
15382
|
+
const urls = shareUrlFields(outputStatus);
|
|
15383
15383
|
console.log(
|
|
15384
|
-
`Published ${name}${
|
|
15384
|
+
`Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${urls.publicUrl ?? outputStatus.share?.publicPath ?? ""}`
|
|
15385
15385
|
);
|
|
15386
|
-
if (
|
|
15387
|
-
console.
|
|
15386
|
+
if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
|
|
15387
|
+
console.log(`Version URL: ${urls.canonicalUrl}`);
|
|
15388
|
+
}
|
|
15389
|
+
if (outputStatus.warning) {
|
|
15390
|
+
console.error(`warning: ${outputStatus.warning}`);
|
|
15388
15391
|
}
|
|
15389
15392
|
return 0;
|
|
15390
15393
|
}
|
|
@@ -15438,12 +15441,17 @@ async function handlePlayShareRegenerate(args) {
|
|
|
15438
15441
|
name,
|
|
15439
15442
|
revisionId ? { revisionId } : {}
|
|
15440
15443
|
);
|
|
15444
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15441
15445
|
if (argsWantJson(args)) {
|
|
15442
|
-
process.stdout.write(`${JSON.stringify(
|
|
15446
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15443
15447
|
`);
|
|
15444
15448
|
return 0;
|
|
15445
15449
|
}
|
|
15446
|
-
|
|
15450
|
+
const urls = shareUrlFields(outputStatus);
|
|
15451
|
+
const regeneratedPublishedRevision = !revisionId || outputStatus.share?.publishedRevisionId === revisionId;
|
|
15452
|
+
console.log(
|
|
15453
|
+
`Regenerated public copy for ${name}${regeneratedPublishedRevision && urls.publicUrl ? `: ${urls.publicUrl}` : "."}`
|
|
15454
|
+
);
|
|
15447
15455
|
return 0;
|
|
15448
15456
|
}
|
|
15449
15457
|
async function handlePlayShareUnpublish(args) {
|
|
@@ -18462,7 +18470,7 @@ function mergeRowsForCsvExport(enrichedRows, options) {
|
|
|
18462
18470
|
const canMergeSparseBySourceIndex = rows.length > 0 && rows.every(
|
|
18463
18471
|
(row) => sourceRowIndexFromEnrichRow(row, start, inclusiveEnd) !== null
|
|
18464
18472
|
);
|
|
18465
|
-
if (rows.length < expectedSelectedRows && !options.allowPartial && !canMergeSparseBySourceIndex) {
|
|
18473
|
+
if (options.inPlace && rows.length < expectedSelectedRows && !options.allowPartial && !canMergeSparseBySourceIndex) {
|
|
18466
18474
|
throw new Error(
|
|
18467
18475
|
`Refusing to write a partial in-place CSV export: the run returned ${rows.length} row(s) for ${expectedSelectedRows} selected source row(s).`
|
|
18468
18476
|
);
|
|
@@ -20456,7 +20464,9 @@ async function handleOrgStatus(options) {
|
|
|
20456
20464
|
const config = resolveConfig();
|
|
20457
20465
|
const http = new HttpClient(config);
|
|
20458
20466
|
const payload = await fetchOrganizations(http, config.apiKey);
|
|
20459
|
-
const current = payload.organizations.find((org) => org.is_current) ?? payload.organizations.find(
|
|
20467
|
+
const current = payload.organizations.find((org) => org.is_current) ?? payload.organizations.find(
|
|
20468
|
+
(org) => org.org_id === payload.current_org_id
|
|
20469
|
+
) ?? null;
|
|
20460
20470
|
const projectCandidate = getActiveProjectAuthSource();
|
|
20461
20471
|
const activeProject = getResolvedProjectAuthSource(
|
|
20462
20472
|
config.baseUrl,
|
|
@@ -20588,15 +20598,14 @@ async function handleOrgSwitch(selection, options) {
|
|
|
20588
20598
|
} else {
|
|
20589
20599
|
saveHostEnvValues(config.baseUrl, authValues2);
|
|
20590
20600
|
}
|
|
20591
|
-
if (authTarget.kind === "folder") {
|
|
20592
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues2);
|
|
20593
|
-
}
|
|
20594
20601
|
const renderLines2 = [`Already on ${target.name}.`];
|
|
20595
20602
|
for (const projectPath of project_env_paths2) {
|
|
20596
20603
|
renderLines2.push(`Saved folder auth in ${projectPath}`);
|
|
20597
20604
|
}
|
|
20598
20605
|
if (authTarget.kind === "global") {
|
|
20599
|
-
renderLines2.push(
|
|
20606
|
+
renderLines2.push(
|
|
20607
|
+
`Saved global auth in ${hostEnvFilePath(config.baseUrl)}`
|
|
20608
|
+
);
|
|
20600
20609
|
}
|
|
20601
20610
|
renderLines2.push(
|
|
20602
20611
|
`Scope: ${authTarget.requested_scope} -> ${authTarget.effective_scope} (${authTarget.reason})`
|
|
@@ -20651,9 +20660,6 @@ async function handleOrgSwitch(selection, options) {
|
|
|
20651
20660
|
DEEPLINE_ACTIVE_ORG_NAME: switched.org_name
|
|
20652
20661
|
});
|
|
20653
20662
|
}
|
|
20654
|
-
if (authTarget.kind === "folder") {
|
|
20655
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues);
|
|
20656
|
-
}
|
|
20657
20663
|
const { api_key: _apiKey, ...publicSwitched } = switched;
|
|
20658
20664
|
const renderLines = [`Switched to ${switched.org_name}.`];
|
|
20659
20665
|
if (authTarget.kind === "folder") {
|
|
@@ -20718,7 +20724,6 @@ async function handleOrgCreate(name, options) {
|
|
|
20718
20724
|
DEEPLINE_ACTIVE_ORG_ID: created.org_id,
|
|
20719
20725
|
DEEPLINE_ACTIVE_ORG_NAME: created.org_name
|
|
20720
20726
|
});
|
|
20721
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues);
|
|
20722
20727
|
const { api_key: _apiKey, ...publicCreated } = created;
|
|
20723
20728
|
printCommandEnvelope(
|
|
20724
20729
|
{
|
|
@@ -20827,7 +20832,10 @@ Examples:
|
|
|
20827
20832
|
"--auth-scope <scope>",
|
|
20828
20833
|
"Where to save auth: auto, folder, or global",
|
|
20829
20834
|
"auto"
|
|
20830
|
-
).option(
|
|
20835
|
+
).option(
|
|
20836
|
+
"--json",
|
|
20837
|
+
"Emit JSON output. Also automatic when stdout is piped"
|
|
20838
|
+
);
|
|
20831
20839
|
addOrgSetOptions(
|
|
20832
20840
|
org.command("set [selection]").description("Set the organization for the selected auth scope.").addHelpText(
|
|
20833
20841
|
"after",
|
package/dist/cli/index.mjs
CHANGED
|
@@ -222,8 +222,6 @@ var PROD_URL = "https://code.deepline.com";
|
|
|
222
222
|
var DEFAULT_TIMEOUT = 6e4;
|
|
223
223
|
var DEFAULT_MAX_RETRIES = 3;
|
|
224
224
|
var PROJECT_DEEPLINE_ENV_FILE = ".env.deepline";
|
|
225
|
-
var WORKSPACE_RESTORE_ENV_DIR = ".deepline";
|
|
226
|
-
var WORKSPACE_RESTORE_ENV_FILE = ".env";
|
|
227
225
|
var COWORK_IGNORED_WORKSPACE_DIRS = /* @__PURE__ */ new Set([
|
|
228
226
|
".auto-memory",
|
|
229
227
|
".claude",
|
|
@@ -538,18 +536,6 @@ function ensureProjectEnvIsIgnored(dir) {
|
|
|
538
536
|
writeFileSync(gitignorePath, `${existing}${prefix}${entry}
|
|
539
537
|
`, "utf-8");
|
|
540
538
|
}
|
|
541
|
-
function ensureWorkspaceRestoreEnvIsIgnored(workspaceDir) {
|
|
542
|
-
const gitignorePath = join(workspaceDir, ".gitignore");
|
|
543
|
-
const entry = `${WORKSPACE_RESTORE_ENV_DIR}/`;
|
|
544
|
-
const existing = existsSync(gitignorePath) ? readFileSync(gitignorePath, "utf-8") : "";
|
|
545
|
-
const alreadyIgnored = existing.split(/\r?\n/).map((line) => line.trim()).some(
|
|
546
|
-
(line) => line === entry || line === `/${entry}` || line === WORKSPACE_RESTORE_ENV_DIR || line === `/${WORKSPACE_RESTORE_ENV_DIR}`
|
|
547
|
-
);
|
|
548
|
-
if (alreadyIgnored) return;
|
|
549
|
-
const prefix = existing && !existing.endsWith("\n") ? "\n" : "";
|
|
550
|
-
writeFileSync(gitignorePath, `${existing}${prefix}${entry}
|
|
551
|
-
`, "utf-8");
|
|
552
|
-
}
|
|
553
539
|
function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
554
540
|
const target = resolveProjectPinTarget(startDir);
|
|
555
541
|
if (!target.ok) {
|
|
@@ -563,27 +549,6 @@ function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
|
563
549
|
mergeProjectEnvFile(filePath, values);
|
|
564
550
|
return [filePath];
|
|
565
551
|
}
|
|
566
|
-
function saveCoworkWorkspaceRestoreEnvValues(values, startDir = process.cwd()) {
|
|
567
|
-
if (!isCoworkLikeSandbox()) return [];
|
|
568
|
-
const target = resolveProjectPinTarget(startDir);
|
|
569
|
-
if (!target.ok || target.source === "cwd") return [];
|
|
570
|
-
const workspaceDir = target.dir;
|
|
571
|
-
const filePath = join(
|
|
572
|
-
workspaceDir,
|
|
573
|
-
WORKSPACE_RESTORE_ENV_DIR,
|
|
574
|
-
WORKSPACE_RESTORE_ENV_FILE
|
|
575
|
-
);
|
|
576
|
-
const existing = parseEnvFile(filePath);
|
|
577
|
-
const merged = { ...existing, ...values };
|
|
578
|
-
const dir = dirname(filePath);
|
|
579
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
580
|
-
ensureWorkspaceRestoreEnvIsIgnored(workspaceDir);
|
|
581
|
-
const allowedKeys = /* @__PURE__ */ new Set([HOST_URL_ENV, API_KEY_ENV]);
|
|
582
|
-
const lines = Object.entries(merged).filter(([key, value]) => allowedKeys.has(key) && value !== "").map(([key, value]) => `${key}=${value}`);
|
|
583
|
-
writeFileSync(filePath, `${lines.join("\n")}
|
|
584
|
-
`, "utf-8");
|
|
585
|
-
return [filePath];
|
|
586
|
-
}
|
|
587
552
|
function resolveProjectPinTarget(startDir = process.cwd()) {
|
|
588
553
|
const nearestFile = findNearestEnvFile(PROJECT_DEEPLINE_ENV_FILE, startDir);
|
|
589
554
|
if (nearestFile && !isInIgnoredCoworkMount(nearestFile)) {
|
|
@@ -642,10 +607,10 @@ var SDK_RELEASE = {
|
|
|
642
607
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
643
608
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
644
609
|
// fields shipped in 0.1.153.
|
|
645
|
-
version: "0.1.
|
|
610
|
+
version: "0.1.161",
|
|
646
611
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
647
612
|
supportPolicy: {
|
|
648
|
-
latest: "0.1.
|
|
613
|
+
latest: "0.1.161",
|
|
649
614
|
minimumSupported: "0.1.53",
|
|
650
615
|
deprecatedBelow: "0.1.53",
|
|
651
616
|
commandMinimumSupported: [
|
|
@@ -4745,9 +4710,6 @@ function saveEnvValues(values, baseUrl) {
|
|
|
4745
4710
|
...values[API_KEY_ENV] ? { [API_KEY_ENV]: values[API_KEY_ENV] } : {}
|
|
4746
4711
|
};
|
|
4747
4712
|
saveHostEnvValues(baseUrl, filtered);
|
|
4748
|
-
if (filtered[API_KEY_ENV]) {
|
|
4749
|
-
saveCoworkWorkspaceRestoreEnvValues(filtered);
|
|
4750
|
-
}
|
|
4751
4713
|
}
|
|
4752
4714
|
async function httpJson(method, url, apiKey, body) {
|
|
4753
4715
|
const headers = {
|
|
@@ -15288,10 +15250,41 @@ Examples:
|
|
|
15288
15250
|
]);
|
|
15289
15251
|
});
|
|
15290
15252
|
}
|
|
15253
|
+
var PUBLIC_PLAY_BASE_URL = "https://deepline.com";
|
|
15291
15254
|
function shareFlagValue(args, flag) {
|
|
15292
15255
|
const i = args.indexOf(flag);
|
|
15293
15256
|
return i >= 0 && i + 1 < args.length ? args[i + 1] : void 0;
|
|
15294
15257
|
}
|
|
15258
|
+
function absolutePublicPlayUrl(path) {
|
|
15259
|
+
if (!path) {
|
|
15260
|
+
return null;
|
|
15261
|
+
}
|
|
15262
|
+
try {
|
|
15263
|
+
return new URL(path, PUBLIC_PLAY_BASE_URL).toString();
|
|
15264
|
+
} catch {
|
|
15265
|
+
return null;
|
|
15266
|
+
}
|
|
15267
|
+
}
|
|
15268
|
+
function shareUrlFields(status) {
|
|
15269
|
+
return {
|
|
15270
|
+
publicUrl: absolutePublicPlayUrl(status.share?.publicPath),
|
|
15271
|
+
canonicalUrl: absolutePublicPlayUrl(status.share?.canonicalPath)
|
|
15272
|
+
};
|
|
15273
|
+
}
|
|
15274
|
+
function shareStatusForOutput(status) {
|
|
15275
|
+
if (!status.share) {
|
|
15276
|
+
return status;
|
|
15277
|
+
}
|
|
15278
|
+
const urls = shareUrlFields(status);
|
|
15279
|
+
return {
|
|
15280
|
+
...status,
|
|
15281
|
+
share: {
|
|
15282
|
+
...status.share,
|
|
15283
|
+
...urls.publicUrl ? { publicUrl: urls.publicUrl } : {},
|
|
15284
|
+
...urls.canonicalUrl ? { canonicalUrl: urls.canonicalUrl } : {}
|
|
15285
|
+
}
|
|
15286
|
+
};
|
|
15287
|
+
}
|
|
15295
15288
|
async function handlePlayShareStatus(args) {
|
|
15296
15289
|
const target = args[0];
|
|
15297
15290
|
if (!target) {
|
|
@@ -15300,25 +15293,30 @@ async function handlePlayShareStatus(args) {
|
|
|
15300
15293
|
}
|
|
15301
15294
|
const name = parseReferencedPlayTarget2(target).playName;
|
|
15302
15295
|
const status = await new DeeplineClient().getSharePage(name);
|
|
15296
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15303
15297
|
if (argsWantJson(args)) {
|
|
15304
|
-
process.stdout.write(`${JSON.stringify(
|
|
15298
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15305
15299
|
`);
|
|
15306
15300
|
return 0;
|
|
15307
15301
|
}
|
|
15308
|
-
if (!
|
|
15309
|
-
console.log(`${
|
|
15302
|
+
if (!outputStatus.share) {
|
|
15303
|
+
console.log(`${outputStatus.playName}: not published.`);
|
|
15310
15304
|
console.log(
|
|
15311
|
-
` Publish: deepline plays share publish ${
|
|
15305
|
+
` Publish: deepline plays share publish ${outputStatus.playName} --yes`
|
|
15312
15306
|
);
|
|
15313
15307
|
return 0;
|
|
15314
15308
|
}
|
|
15309
|
+
const urls = shareUrlFields(outputStatus);
|
|
15315
15310
|
console.log(
|
|
15316
|
-
`${
|
|
15311
|
+
`${outputStatus.playName}: published v${outputStatus.share.publishedVersion}`
|
|
15317
15312
|
);
|
|
15318
|
-
console.log(` url: ${
|
|
15319
|
-
|
|
15313
|
+
console.log(` url: ${urls.publicUrl ?? outputStatus.share.publicPath}`);
|
|
15314
|
+
if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
|
|
15315
|
+
console.log(` version: ${urls.canonicalUrl}`);
|
|
15316
|
+
}
|
|
15317
|
+
console.log(` seo: ${outputStatus.share.seoIndexing}`);
|
|
15320
15318
|
console.log(
|
|
15321
|
-
` show: cost=${
|
|
15319
|
+
` show: cost=${outputStatus.share.showAverageDeeplineCost} latency=${outputStatus.share.showAverageLatency}`
|
|
15322
15320
|
);
|
|
15323
15321
|
return 0;
|
|
15324
15322
|
}
|
|
@@ -15402,16 +15400,21 @@ async function handlePlaySharePublish(args) {
|
|
|
15402
15400
|
return 0;
|
|
15403
15401
|
}
|
|
15404
15402
|
const status = await client2.publishSharePage(name, request);
|
|
15403
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15405
15404
|
if (argsWantJson(args)) {
|
|
15406
|
-
process.stdout.write(`${JSON.stringify(
|
|
15405
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15407
15406
|
`);
|
|
15408
15407
|
return 0;
|
|
15409
15408
|
}
|
|
15409
|
+
const urls = shareUrlFields(outputStatus);
|
|
15410
15410
|
console.log(
|
|
15411
|
-
`Published ${name}${
|
|
15411
|
+
`Published ${name}${outputStatus.share ? ` v${outputStatus.share.publishedVersion}` : ""}: ${urls.publicUrl ?? outputStatus.share?.publicPath ?? ""}`
|
|
15412
15412
|
);
|
|
15413
|
-
if (
|
|
15414
|
-
console.
|
|
15413
|
+
if (urls.canonicalUrl && urls.canonicalUrl !== urls.publicUrl) {
|
|
15414
|
+
console.log(`Version URL: ${urls.canonicalUrl}`);
|
|
15415
|
+
}
|
|
15416
|
+
if (outputStatus.warning) {
|
|
15417
|
+
console.error(`warning: ${outputStatus.warning}`);
|
|
15415
15418
|
}
|
|
15416
15419
|
return 0;
|
|
15417
15420
|
}
|
|
@@ -15465,12 +15468,17 @@ async function handlePlayShareRegenerate(args) {
|
|
|
15465
15468
|
name,
|
|
15466
15469
|
revisionId ? { revisionId } : {}
|
|
15467
15470
|
);
|
|
15471
|
+
const outputStatus = shareStatusForOutput(status);
|
|
15468
15472
|
if (argsWantJson(args)) {
|
|
15469
|
-
process.stdout.write(`${JSON.stringify(
|
|
15473
|
+
process.stdout.write(`${JSON.stringify(outputStatus)}
|
|
15470
15474
|
`);
|
|
15471
15475
|
return 0;
|
|
15472
15476
|
}
|
|
15473
|
-
|
|
15477
|
+
const urls = shareUrlFields(outputStatus);
|
|
15478
|
+
const regeneratedPublishedRevision = !revisionId || outputStatus.share?.publishedRevisionId === revisionId;
|
|
15479
|
+
console.log(
|
|
15480
|
+
`Regenerated public copy for ${name}${regeneratedPublishedRevision && urls.publicUrl ? `: ${urls.publicUrl}` : "."}`
|
|
15481
|
+
);
|
|
15474
15482
|
return 0;
|
|
15475
15483
|
}
|
|
15476
15484
|
async function handlePlayShareUnpublish(args) {
|
|
@@ -18489,7 +18497,7 @@ function mergeRowsForCsvExport(enrichedRows, options) {
|
|
|
18489
18497
|
const canMergeSparseBySourceIndex = rows.length > 0 && rows.every(
|
|
18490
18498
|
(row) => sourceRowIndexFromEnrichRow(row, start, inclusiveEnd) !== null
|
|
18491
18499
|
);
|
|
18492
|
-
if (rows.length < expectedSelectedRows && !options.allowPartial && !canMergeSparseBySourceIndex) {
|
|
18500
|
+
if (options.inPlace && rows.length < expectedSelectedRows && !options.allowPartial && !canMergeSparseBySourceIndex) {
|
|
18493
18501
|
throw new Error(
|
|
18494
18502
|
`Refusing to write a partial in-place CSV export: the run returned ${rows.length} row(s) for ${expectedSelectedRows} selected source row(s).`
|
|
18495
18503
|
);
|
|
@@ -20490,7 +20498,9 @@ async function handleOrgStatus(options) {
|
|
|
20490
20498
|
const config = resolveConfig();
|
|
20491
20499
|
const http = new HttpClient(config);
|
|
20492
20500
|
const payload = await fetchOrganizations(http, config.apiKey);
|
|
20493
|
-
const current = payload.organizations.find((org) => org.is_current) ?? payload.organizations.find(
|
|
20501
|
+
const current = payload.organizations.find((org) => org.is_current) ?? payload.organizations.find(
|
|
20502
|
+
(org) => org.org_id === payload.current_org_id
|
|
20503
|
+
) ?? null;
|
|
20494
20504
|
const projectCandidate = getActiveProjectAuthSource();
|
|
20495
20505
|
const activeProject = getResolvedProjectAuthSource(
|
|
20496
20506
|
config.baseUrl,
|
|
@@ -20622,15 +20632,14 @@ async function handleOrgSwitch(selection, options) {
|
|
|
20622
20632
|
} else {
|
|
20623
20633
|
saveHostEnvValues(config.baseUrl, authValues2);
|
|
20624
20634
|
}
|
|
20625
|
-
if (authTarget.kind === "folder") {
|
|
20626
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues2);
|
|
20627
|
-
}
|
|
20628
20635
|
const renderLines2 = [`Already on ${target.name}.`];
|
|
20629
20636
|
for (const projectPath of project_env_paths2) {
|
|
20630
20637
|
renderLines2.push(`Saved folder auth in ${projectPath}`);
|
|
20631
20638
|
}
|
|
20632
20639
|
if (authTarget.kind === "global") {
|
|
20633
|
-
renderLines2.push(
|
|
20640
|
+
renderLines2.push(
|
|
20641
|
+
`Saved global auth in ${hostEnvFilePath(config.baseUrl)}`
|
|
20642
|
+
);
|
|
20634
20643
|
}
|
|
20635
20644
|
renderLines2.push(
|
|
20636
20645
|
`Scope: ${authTarget.requested_scope} -> ${authTarget.effective_scope} (${authTarget.reason})`
|
|
@@ -20685,9 +20694,6 @@ async function handleOrgSwitch(selection, options) {
|
|
|
20685
20694
|
DEEPLINE_ACTIVE_ORG_NAME: switched.org_name
|
|
20686
20695
|
});
|
|
20687
20696
|
}
|
|
20688
|
-
if (authTarget.kind === "folder") {
|
|
20689
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues);
|
|
20690
|
-
}
|
|
20691
20697
|
const { api_key: _apiKey, ...publicSwitched } = switched;
|
|
20692
20698
|
const renderLines = [`Switched to ${switched.org_name}.`];
|
|
20693
20699
|
if (authTarget.kind === "folder") {
|
|
@@ -20752,7 +20758,6 @@ async function handleOrgCreate(name, options) {
|
|
|
20752
20758
|
DEEPLINE_ACTIVE_ORG_ID: created.org_id,
|
|
20753
20759
|
DEEPLINE_ACTIVE_ORG_NAME: created.org_name
|
|
20754
20760
|
});
|
|
20755
|
-
saveCoworkWorkspaceRestoreEnvValues(authValues);
|
|
20756
20761
|
const { api_key: _apiKey, ...publicCreated } = created;
|
|
20757
20762
|
printCommandEnvelope(
|
|
20758
20763
|
{
|
|
@@ -20861,7 +20866,10 @@ Examples:
|
|
|
20861
20866
|
"--auth-scope <scope>",
|
|
20862
20867
|
"Where to save auth: auto, folder, or global",
|
|
20863
20868
|
"auto"
|
|
20864
|
-
).option(
|
|
20869
|
+
).option(
|
|
20870
|
+
"--json",
|
|
20871
|
+
"Emit JSON output. Also automatic when stdout is piped"
|
|
20872
|
+
);
|
|
20865
20873
|
addOrgSetOptions(
|
|
20866
20874
|
org.command("set [selection]").description("Set the organization for the selected auth scope.").addHelpText(
|
|
20867
20875
|
"after",
|
package/dist/index.d.mts
CHANGED
|
@@ -971,15 +971,17 @@ interface DeletePlayResult {
|
|
|
971
971
|
/** Owner-facing view of a play's public share page. */
|
|
972
972
|
interface SharePageOwnerView {
|
|
973
973
|
shareSlug: string;
|
|
974
|
+
/** Org URL handle; the public page lives at `/p/{orgSlug}/{playName}`. */
|
|
975
|
+
orgSlug: string;
|
|
974
976
|
publishedRevisionId: string;
|
|
975
977
|
publishedVersion: number;
|
|
976
978
|
visibility: string;
|
|
977
979
|
seoIndexing: 'index' | 'noindex';
|
|
978
980
|
showAverageDeeplineCost: boolean;
|
|
979
981
|
showAverageLatency: boolean;
|
|
980
|
-
/** Stable public path, e.g. `/p/{
|
|
982
|
+
/** Stable public path, e.g. `/p/{orgSlug}/{playName}`. */
|
|
981
983
|
publicPath: string;
|
|
982
|
-
/** Version-pinned canonical path, e.g. `/p/{
|
|
984
|
+
/** Version-pinned canonical path, e.g. `/p/{orgSlug}/{playName}/v/{version}`. */
|
|
983
985
|
canonicalPath: string;
|
|
984
986
|
createdAt: number;
|
|
985
987
|
updatedAt: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -971,15 +971,17 @@ interface DeletePlayResult {
|
|
|
971
971
|
/** Owner-facing view of a play's public share page. */
|
|
972
972
|
interface SharePageOwnerView {
|
|
973
973
|
shareSlug: string;
|
|
974
|
+
/** Org URL handle; the public page lives at `/p/{orgSlug}/{playName}`. */
|
|
975
|
+
orgSlug: string;
|
|
974
976
|
publishedRevisionId: string;
|
|
975
977
|
publishedVersion: number;
|
|
976
978
|
visibility: string;
|
|
977
979
|
seoIndexing: 'index' | 'noindex';
|
|
978
980
|
showAverageDeeplineCost: boolean;
|
|
979
981
|
showAverageLatency: boolean;
|
|
980
|
-
/** Stable public path, e.g. `/p/{
|
|
982
|
+
/** Stable public path, e.g. `/p/{orgSlug}/{playName}`. */
|
|
981
983
|
publicPath: string;
|
|
982
|
-
/** Version-pinned canonical path, e.g. `/p/{
|
|
984
|
+
/** Version-pinned canonical path, e.g. `/p/{orgSlug}/{playName}/v/{version}`. */
|
|
983
985
|
canonicalPath: string;
|
|
984
986
|
createdAt: number;
|
|
985
987
|
updatedAt: number;
|
package/dist/index.js
CHANGED
|
@@ -421,10 +421,10 @@ var SDK_RELEASE = {
|
|
|
421
421
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
422
422
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
423
423
|
// fields shipped in 0.1.153.
|
|
424
|
-
version: "0.1.
|
|
424
|
+
version: "0.1.161",
|
|
425
425
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
426
426
|
supportPolicy: {
|
|
427
|
-
latest: "0.1.
|
|
427
|
+
latest: "0.1.161",
|
|
428
428
|
minimumSupported: "0.1.53",
|
|
429
429
|
deprecatedBelow: "0.1.53",
|
|
430
430
|
commandMinimumSupported: [
|
package/dist/index.mjs
CHANGED
|
@@ -351,10 +351,10 @@ var SDK_RELEASE = {
|
|
|
351
351
|
// 0.1.111 ships dataset-native tool list getters and result row datasets.
|
|
352
352
|
// 0.1.154 removes the short-lived generated enrich StepOptions recompute
|
|
353
353
|
// fields shipped in 0.1.153.
|
|
354
|
-
version: "0.1.
|
|
354
|
+
version: "0.1.161",
|
|
355
355
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
356
356
|
supportPolicy: {
|
|
357
|
-
latest: "0.1.
|
|
357
|
+
latest: "0.1.161",
|
|
358
358
|
minimumSupported: "0.1.53",
|
|
359
359
|
deprecatedBelow: "0.1.53",
|
|
360
360
|
commandMinimumSupported: [
|