deepline 0.3.67 → 0.3.68
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/client.ts +0 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +0 -2
- package/dist/cli/index.js +136 -198
- package/dist/cli/index.mjs +48 -110
- package/dist/index.d.mts +0 -4
- package/dist/index.d.ts +0 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1214,7 +1214,7 @@ var SDK_RELEASE = {
|
|
|
1214
1214
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1215
1215
|
// getters keep their established compatibility behavior.
|
|
1216
1216
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1217
|
-
version: "0.3.
|
|
1217
|
+
version: "0.3.68",
|
|
1218
1218
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
1219
1219
|
packageCapabilities: {
|
|
1220
1220
|
updatePreferences: 1
|
|
@@ -18154,20 +18154,12 @@ async function publishImportedPlayDependencies(client2, graph) {
|
|
|
18154
18154
|
};
|
|
18155
18155
|
await publishNode(graph.root.filePath, true);
|
|
18156
18156
|
}
|
|
18157
|
-
function timestampDate(value) {
|
|
18158
|
-
if (value === null || value === void 0 || value === "") return null;
|
|
18159
|
-
const normalized = typeof value === "string" && /^\d+$/.test(value.trim()) ? Number(value) : value;
|
|
18160
|
-
const date = new Date(normalized);
|
|
18161
|
-
return Number.isNaN(date.getTime()) ? null : date;
|
|
18162
|
-
}
|
|
18163
18157
|
function formatTimestamp(value) {
|
|
18164
|
-
|
|
18165
|
-
|
|
18158
|
+
if (!value) return "\u2014";
|
|
18159
|
+
const date = typeof value === "number" ? new Date(value) : new Date(value);
|
|
18160
|
+
if (Number.isNaN(date.getTime())) return "\u2014";
|
|
18166
18161
|
return date.toISOString();
|
|
18167
18162
|
}
|
|
18168
|
-
function isoTimestamp(value) {
|
|
18169
|
-
return timestampDate(value)?.toISOString() ?? null;
|
|
18170
|
-
}
|
|
18171
18163
|
function formatRunLine(run) {
|
|
18172
18164
|
const credits = typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014";
|
|
18173
18165
|
return `${run.workflowId} ${run.status} ${formatTimestamp(run.startTime)} ${credits}`;
|
|
@@ -22593,22 +22585,13 @@ async function handleRunsList(args) {
|
|
|
22593
22585
|
...offset !== void 0 ? { offset } : {}
|
|
22594
22586
|
})).map((run) => ({
|
|
22595
22587
|
runId: run.workflowId,
|
|
22596
|
-
// `workflowId` is the legacy SDK name for the same public Deepline run
|
|
22597
|
-
// identity. Keep it during the compatibility window, but never label the
|
|
22598
|
-
// duplicate as a Temporal/runtime id.
|
|
22599
22588
|
workflowId: run.workflowId,
|
|
22600
|
-
|
|
22601
|
-
// stable Deepline run id; `runId` above is the canonical public id.
|
|
22602
|
-
temporalRunId: run.runId ?? null,
|
|
22589
|
+
temporalRunId: run.runId,
|
|
22603
22590
|
parentRunId: run.parentRunId ?? null,
|
|
22604
22591
|
rootRunId: run.rootRunId ?? null,
|
|
22605
22592
|
status: String(run.status ?? "").toLowerCase(),
|
|
22606
|
-
createdAt: run.createdAt ?? null,
|
|
22607
|
-
createdAtIso: isoTimestamp(run.createdAt),
|
|
22608
22593
|
startedAt: run.startTime ?? run.startedAt ?? null,
|
|
22609
|
-
startedAtIso: isoTimestamp(run.startTime ?? run.startedAt ?? null),
|
|
22610
22594
|
finishedAt: run.closeTime ?? run.finishedAt ?? null,
|
|
22611
|
-
finishedAtIso: isoTimestamp(run.closeTime ?? run.finishedAt ?? null),
|
|
22612
22595
|
executionTime: run.executionTime,
|
|
22613
22596
|
billingTotalCredits: run.billingTotalCredits,
|
|
22614
22597
|
billingMaxCreditsPerRun: run.billingMaxCreditsPerRun,
|
|
@@ -22616,19 +22599,9 @@ async function handleRunsList(args) {
|
|
|
22616
22599
|
}));
|
|
22617
22600
|
const lines = runs.length === 0 ? [
|
|
22618
22601
|
playName ? `No runs found for ${playName}.` : `No runs found for status ${statusFilter}.`
|
|
22619
|
-
] : runs.map(
|
|
22620
|
-
|
|
22621
|
-
|
|
22622
|
-
` created: ${formatTimestamp(run.createdAt)}`,
|
|
22623
|
-
` started: ${formatTimestamp(run.startedAt)}`,
|
|
22624
|
-
` finished: ${formatTimestamp(run.finishedAt)}`,
|
|
22625
|
-
` credits: ${typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? formatCreditAmount(run.billingTotalCredits) : "\u2014"}`,
|
|
22626
|
-
` inspect: deepline runs get ${run.runId} --json`
|
|
22627
|
-
];
|
|
22628
|
-
if (run.parentRunId) lines2.push(` parent: ${run.parentRunId}`);
|
|
22629
|
-
if (run.rootRunId) lines2.push(` root: ${run.rootRunId}`);
|
|
22630
|
-
return lines2.join("\n");
|
|
22631
|
-
});
|
|
22602
|
+
] : runs.map(
|
|
22603
|
+
(run) => `${run.runId} ${run.status} ${formatTimestamp(run.startedAt)} ${typeof run.billingTotalCredits === "number" && Number.isFinite(run.billingTotalCredits) ? `${formatCreditAmount(run.billingTotalCredits)} credits` : "\u2014"}${run.parentRunId ? ` parent=${run.parentRunId}` : ""}`
|
|
22604
|
+
);
|
|
22632
22605
|
printCommandEnvelope(
|
|
22633
22606
|
{
|
|
22634
22607
|
runs,
|
|
@@ -30434,12 +30407,10 @@ function registerEnrichCommand(program) {
|
|
|
30434
30407
|
}
|
|
30435
30408
|
|
|
30436
30409
|
// src/cli/commands/feedback.ts
|
|
30437
|
-
var import_node_fs13 = require("fs");
|
|
30438
30410
|
async function handleFeedback(text, options) {
|
|
30439
|
-
const message = resolveFeedbackText(text, options.file);
|
|
30440
30411
|
const { http } = getAuthedHttpClient();
|
|
30441
30412
|
const response = await http.post("/api/v2/cli/feedback", {
|
|
30442
|
-
text
|
|
30413
|
+
text,
|
|
30443
30414
|
requested: options.requested === true,
|
|
30444
30415
|
environment: collectLocalEnvInfo(),
|
|
30445
30416
|
...options.command ? { command: options.command } : {},
|
|
@@ -30457,35 +30428,6 @@ async function handleFeedback(text, options) {
|
|
|
30457
30428
|
{ json: options.json }
|
|
30458
30429
|
);
|
|
30459
30430
|
}
|
|
30460
|
-
function resolveFeedbackText(text, file, readFile6 = (path) => (0, import_node_fs13.readFileSync)(path, "utf8")) {
|
|
30461
|
-
if (text !== void 0 && file !== void 0) {
|
|
30462
|
-
throw new Error(
|
|
30463
|
-
"Pass feedback text positionally or with --file, not both."
|
|
30464
|
-
);
|
|
30465
|
-
}
|
|
30466
|
-
let value;
|
|
30467
|
-
if (file !== void 0) {
|
|
30468
|
-
try {
|
|
30469
|
-
value = readFile6(file === "-" ? 0 : file);
|
|
30470
|
-
} catch (error) {
|
|
30471
|
-
throw new Error(
|
|
30472
|
-
`Could not read feedback ${file === "-" ? "from stdin" : `file ${file}`}: ${error instanceof Error ? error.message : String(error)}`
|
|
30473
|
-
);
|
|
30474
|
-
}
|
|
30475
|
-
} else if (text !== void 0) {
|
|
30476
|
-
value = text;
|
|
30477
|
-
} else if (!process.stdin.isTTY) {
|
|
30478
|
-
value = readFile6(0);
|
|
30479
|
-
} else {
|
|
30480
|
-
throw new Error(
|
|
30481
|
-
"Feedback text is required. Pass it positionally, use --file <path>, or pipe stdin."
|
|
30482
|
-
);
|
|
30483
|
-
}
|
|
30484
|
-
if (!value.trim()) {
|
|
30485
|
-
throw new Error("Feedback text must not be empty.");
|
|
30486
|
-
}
|
|
30487
|
-
return value;
|
|
30488
|
-
}
|
|
30489
30431
|
function registerFeedbackCommands(program) {
|
|
30490
30432
|
const feedback = program.command("feedback").description("Submit CLI feedback to Deepline.").addHelpText(
|
|
30491
30433
|
"after",
|
|
@@ -30505,19 +30447,17 @@ Examples:
|
|
|
30505
30447
|
`
|
|
30506
30448
|
Examples:
|
|
30507
30449
|
deepline feedback send "tools search returned stale results" --json
|
|
30508
|
-
deepline feedback send --file incident.md --requested --json
|
|
30509
|
-
cat incident.md | deepline feedback send --requested --json
|
|
30510
30450
|
deepline feedback send "tools search returned stale results" --requested --json
|
|
30511
30451
|
deepline feedback send "plays run failed after upload" --command "deepline plays run my.play.ts --watch"
|
|
30512
30452
|
`
|
|
30513
|
-
).argument("
|
|
30453
|
+
).argument("<text>", "Feedback text").option("--command <command>", "Command that reproduced the issue").option("--payload <payload>", "JSON or plain-text payload for the repro").option(
|
|
30514
30454
|
"--requested",
|
|
30515
30455
|
"Mark the report as explicitly requested by the user"
|
|
30516
30456
|
).option("--json", "Emit JSON output").action(handleFeedback);
|
|
30517
30457
|
}
|
|
30518
30458
|
|
|
30519
30459
|
// src/cli/commands/sessions.ts
|
|
30520
|
-
var
|
|
30460
|
+
var import_node_fs13 = require("fs");
|
|
30521
30461
|
var import_node_os10 = require("os");
|
|
30522
30462
|
var import_node_path16 = require("path");
|
|
30523
30463
|
var import_node_zlib = require("zlib");
|
|
@@ -30552,7 +30492,7 @@ function codexSessionsRoot() {
|
|
|
30552
30492
|
}
|
|
30553
30493
|
function listClaudeSessionFiles() {
|
|
30554
30494
|
const root = claudeProjectsRoot();
|
|
30555
|
-
if (!(0,
|
|
30495
|
+
if (!(0, import_node_fs13.existsSync)(root)) return [];
|
|
30556
30496
|
const projectDirs = readDirectoryNames(root);
|
|
30557
30497
|
const files = [];
|
|
30558
30498
|
for (const projectDir of projectDirs) {
|
|
@@ -30577,7 +30517,7 @@ function listClaudeSessionFiles() {
|
|
|
30577
30517
|
}
|
|
30578
30518
|
function listCodexSessionFiles() {
|
|
30579
30519
|
const root = codexSessionsRoot();
|
|
30580
|
-
if (!(0,
|
|
30520
|
+
if (!(0, import_node_fs13.existsSync)(root)) return [];
|
|
30581
30521
|
const files = [];
|
|
30582
30522
|
for (const filePath of listJsonlFilesRecursive(root, 5)) {
|
|
30583
30523
|
const stat4 = statIfReadable(filePath);
|
|
@@ -30600,7 +30540,7 @@ function listSessionFiles(agent) {
|
|
|
30600
30540
|
}
|
|
30601
30541
|
function readDirectoryNames(dir) {
|
|
30602
30542
|
try {
|
|
30603
|
-
return (0,
|
|
30543
|
+
return (0, import_node_fs13.readdirSync)(dir);
|
|
30604
30544
|
} catch {
|
|
30605
30545
|
return [];
|
|
30606
30546
|
}
|
|
@@ -30611,7 +30551,7 @@ function listJsonlFilesRecursive(root, maxDepth) {
|
|
|
30611
30551
|
if (depth > maxDepth) return;
|
|
30612
30552
|
let entries;
|
|
30613
30553
|
try {
|
|
30614
|
-
entries = (0,
|
|
30554
|
+
entries = (0, import_node_fs13.readdirSync)(dir, { withFileTypes: true });
|
|
30615
30555
|
} catch {
|
|
30616
30556
|
return;
|
|
30617
30557
|
}
|
|
@@ -30629,7 +30569,7 @@ function listJsonlFilesRecursive(root, maxDepth) {
|
|
|
30629
30569
|
}
|
|
30630
30570
|
function statIfReadable(filePath) {
|
|
30631
30571
|
try {
|
|
30632
|
-
return (0,
|
|
30572
|
+
return (0, import_node_fs13.statSync)(filePath);
|
|
30633
30573
|
} catch {
|
|
30634
30574
|
return null;
|
|
30635
30575
|
}
|
|
@@ -30652,7 +30592,7 @@ function sessionIdFromCodexFilePath(filePath) {
|
|
|
30652
30592
|
}
|
|
30653
30593
|
function readCodexSessionId(filePath) {
|
|
30654
30594
|
try {
|
|
30655
|
-
for (const line of normalizedJsonLines((0,
|
|
30595
|
+
for (const line of normalizedJsonLines((0, import_node_fs13.readFileSync)(filePath)).slice(
|
|
30656
30596
|
0,
|
|
30657
30597
|
20
|
|
30658
30598
|
)) {
|
|
@@ -30967,11 +30907,11 @@ async function uploadChunkedSessions(sessions, options) {
|
|
|
30967
30907
|
async function handleSessionsSend(options) {
|
|
30968
30908
|
if (options.file) {
|
|
30969
30909
|
const filePath = (0, import_node_path16.resolve)(options.file);
|
|
30970
|
-
if (!(0,
|
|
30910
|
+
if (!(0, import_node_fs13.existsSync)(filePath)) {
|
|
30971
30911
|
throw new Error(`File not found: ${options.file}`);
|
|
30972
30912
|
}
|
|
30973
30913
|
const response2 = await uploadPayload("/api/v2/cli/send-session", {
|
|
30974
|
-
file: (0,
|
|
30914
|
+
file: (0, import_node_fs13.readFileSync)(filePath).toString("base64"),
|
|
30975
30915
|
filename: (0, import_node_path16.basename)(filePath)
|
|
30976
30916
|
});
|
|
30977
30917
|
printCommandEnvelope(
|
|
@@ -31001,7 +30941,7 @@ async function handleSessionsSend(options) {
|
|
|
31001
30941
|
agent: options.agent
|
|
31002
30942
|
});
|
|
31003
30943
|
const built = targets.map((target) => {
|
|
31004
|
-
const upload = buildSessionUploadContent((0,
|
|
30944
|
+
const upload = buildSessionUploadContent((0, import_node_fs13.readFileSync)(target.filePath));
|
|
31005
30945
|
return { ...target, ...upload };
|
|
31006
30946
|
});
|
|
31007
30947
|
if (built.some((session) => session.needsChunking)) {
|
|
@@ -31083,10 +31023,10 @@ function loadViewerAssets() {
|
|
|
31083
31023
|
try {
|
|
31084
31024
|
const cssPath = (0, import_node_path16.join)(root, "viewer.css");
|
|
31085
31025
|
const jsPath = (0, import_node_path16.join)(root, "viewer.js");
|
|
31086
|
-
if (!(0,
|
|
31026
|
+
if (!(0, import_node_fs13.existsSync)(cssPath) || !(0, import_node_fs13.existsSync)(jsPath)) continue;
|
|
31087
31027
|
return {
|
|
31088
|
-
css: (0,
|
|
31089
|
-
js: (0,
|
|
31028
|
+
css: (0, import_node_fs13.readFileSync)(cssPath, "utf8"),
|
|
31029
|
+
js: (0, import_node_fs13.readFileSync)(jsPath, "utf8")
|
|
31090
31030
|
};
|
|
31091
31031
|
} catch {
|
|
31092
31032
|
continue;
|
|
@@ -31113,18 +31053,18 @@ async function handleSessionsRender(options) {
|
|
|
31113
31053
|
let outputPath = options.output ? (0, import_node_path16.resolve)(options.output) : "";
|
|
31114
31054
|
if (!outputPath) {
|
|
31115
31055
|
const outputDir = (0, import_node_path16.join)(process.cwd(), "deepline", "data");
|
|
31116
|
-
(0,
|
|
31056
|
+
(0, import_node_fs13.mkdirSync)(outputDir, { recursive: true });
|
|
31117
31057
|
outputPath = (0, import_node_path16.join)(
|
|
31118
31058
|
outputDir,
|
|
31119
31059
|
targets.length > 1 ? "session-viewer.html" : `session-${targets[0]?.sessionId}.html`
|
|
31120
31060
|
);
|
|
31121
31061
|
} else {
|
|
31122
|
-
(0,
|
|
31062
|
+
(0, import_node_fs13.mkdirSync)((0, import_node_path16.dirname)(outputPath), { recursive: true });
|
|
31123
31063
|
}
|
|
31124
31064
|
const sessions = targets.map((target) => ({
|
|
31125
31065
|
label: target.label,
|
|
31126
31066
|
events: parsePreparedEvents(
|
|
31127
|
-
prepareSessionBuffer((0,
|
|
31067
|
+
prepareSessionBuffer((0, import_node_fs13.readFileSync)(target.filePath))
|
|
31128
31068
|
)
|
|
31129
31069
|
}));
|
|
31130
31070
|
const { css, js } = loadViewerAssets();
|
|
@@ -31149,7 +31089,7 @@ ${refreshMeta}
|
|
|
31149
31089
|
<script>${js}</script>
|
|
31150
31090
|
</body>
|
|
31151
31091
|
</html>`;
|
|
31152
|
-
(0,
|
|
31092
|
+
(0, import_node_fs13.writeFileSync)(outputPath, html, "utf8");
|
|
31153
31093
|
printCommandEnvelope(
|
|
31154
31094
|
{
|
|
31155
31095
|
ok: true,
|
|
@@ -31358,7 +31298,7 @@ Examples:
|
|
|
31358
31298
|
|
|
31359
31299
|
// src/cli/commands/monitors.ts
|
|
31360
31300
|
var import_node_crypto8 = require("crypto");
|
|
31361
|
-
var
|
|
31301
|
+
var import_node_fs14 = require("fs");
|
|
31362
31302
|
var import_node_path17 = require("path");
|
|
31363
31303
|
var import_promises8 = require("readline/promises");
|
|
31364
31304
|
|
|
@@ -31798,8 +31738,8 @@ function parseJsonObjectArg(raw, argLabel) {
|
|
|
31798
31738
|
return parsed;
|
|
31799
31739
|
}
|
|
31800
31740
|
function resolveMonitorJsonBody(input2) {
|
|
31801
|
-
const readFile6 = input2.readFile ?? ((path) => (0,
|
|
31802
|
-
const readStdin = input2.readStdin ?? (() => (0,
|
|
31741
|
+
const readFile6 = input2.readFile ?? ((path) => (0, import_node_fs14.readFileSync)(path, "utf-8"));
|
|
31742
|
+
const readStdin = input2.readStdin ?? (() => (0, import_node_fs14.readFileSync)(0, "utf-8"));
|
|
31803
31743
|
if (input2.positional !== void 0 && input2.file !== void 0) {
|
|
31804
31744
|
throw new MonitorsUsageError(
|
|
31805
31745
|
`Pass exactly one source for ${input2.argLabel}: the positional JSON or --file, not both.`
|
|
@@ -32196,7 +32136,6 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
32196
32136
|
if (!entry || !key) continue;
|
|
32197
32137
|
const status = asString(entry.status);
|
|
32198
32138
|
const tool = asString(entry.tool);
|
|
32199
|
-
const monitorType = asString(entry.type);
|
|
32200
32139
|
const name = asString(entry.name);
|
|
32201
32140
|
const outputTable = asString(entry.output_table);
|
|
32202
32141
|
const webhookState = asString(entry.webhook_state);
|
|
@@ -32207,11 +32146,10 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
32207
32146
|
lines.push(
|
|
32208
32147
|
` ${key}${status ? ` ${status}` : ""}${tool ? ` ${tool}` : ""}${name ? ` (${name})` : ""}`
|
|
32209
32148
|
);
|
|
32210
|
-
if (outputTable ||
|
|
32149
|
+
if (outputTable || webhookState || executionType || boundPlays !== void 0) {
|
|
32211
32150
|
lines.push(
|
|
32212
32151
|
` ${[
|
|
32213
32152
|
outputTable ? `table: ${outputTable}` : null,
|
|
32214
|
-
monitorType ? `type: ${monitorType}` : null,
|
|
32215
32153
|
webhookState ? `webhook: ${webhookState}` : null,
|
|
32216
32154
|
executionType ? `execution: ${executionType}` : null,
|
|
32217
32155
|
boundPlays !== void 0 ? `bound Plays: ${boundPlays}` : null
|
|
@@ -32704,7 +32642,7 @@ async function handleMonitorFleetsInit(fleetId, options) {
|
|
|
32704
32642
|
};
|
|
32705
32643
|
const definition = requireCompiledFleetDefinition(authoredDefinition);
|
|
32706
32644
|
const file = (0, import_node_path17.resolve)(out);
|
|
32707
|
-
(0,
|
|
32645
|
+
(0, import_node_fs14.writeFileSync)(file, `${JSON.stringify(definition, null, 2)}
|
|
32708
32646
|
`, "utf8");
|
|
32709
32647
|
const next = `deepline monitors fleets sync --file ${fleetShellArg(file)} --dry-run --json`;
|
|
32710
32648
|
printCommandEnvelope(
|
|
@@ -33036,7 +32974,6 @@ function renderMonitorGet(payload) {
|
|
|
33036
32974
|
const tool = asString(payload.tool);
|
|
33037
32975
|
if (!key || !tool) return void 0;
|
|
33038
32976
|
const status = asString(payload.status);
|
|
33039
|
-
const monitorType = asString(payload.type);
|
|
33040
32977
|
const hasLastReceivedEvent = "last_received_event" in payload;
|
|
33041
32978
|
const lastReceivedEvent = asString(payload.last_received_event);
|
|
33042
32979
|
const definition = asRecord2(payload.definition);
|
|
@@ -33054,9 +32991,8 @@ function renderMonitorGet(payload) {
|
|
|
33054
32991
|
const lines = [
|
|
33055
32992
|
`Monitor: ${key}`,
|
|
33056
32993
|
`Tool: ${tool}`,
|
|
33057
|
-
...monitorType ? [`Type: ${monitorType}`] : [],
|
|
33058
32994
|
...status ? [`Status: ${status}`] : [],
|
|
33059
|
-
...hasLastReceivedEvent ? [`
|
|
32995
|
+
...hasLastReceivedEvent ? [`Last received: ${lastReceivedEvent ?? "never"}`] : [],
|
|
33060
32996
|
...pricingLine ? [`Pricing: ${pricingLine}`] : [],
|
|
33061
32997
|
...nextRenewalAt ? [`Next renewal: ${nextRenewalAt}`] : []
|
|
33062
32998
|
];
|
|
@@ -33122,15 +33058,17 @@ function renderMonitorGet(payload) {
|
|
|
33122
33058
|
const name = asString(play.name) ?? "unnamed Play";
|
|
33123
33059
|
const listener = asString(play.listener_key);
|
|
33124
33060
|
const health = asRecord2(play.consumer_health);
|
|
33125
|
-
const
|
|
33061
|
+
const status2 = asString(health?.last_run_status) ?? "no delivery yet";
|
|
33126
33062
|
const lastDelivery = asFiniteNumber(health?.last_delivery_at);
|
|
33127
|
-
const runId = asString(health?.last_run_id);
|
|
33128
33063
|
const error = asString(health?.last_error);
|
|
33129
|
-
lines.push(` ${name}${listener ? ` (listener: ${listener})` : ""}:`);
|
|
33130
33064
|
lines.push(
|
|
33131
|
-
`
|
|
33132
|
-
` Latest consumer run: ${runId ?? "never"}${runStatus ? ` (${runStatus})` : ""}`
|
|
33065
|
+
` ${name}${listener ? ` (listener: ${listener})` : ""}: ${status2}`
|
|
33133
33066
|
);
|
|
33067
|
+
if (lastDelivery !== void 0) {
|
|
33068
|
+
lines.push(
|
|
33069
|
+
` last delivery: ${new Date(lastDelivery).toISOString()}`
|
|
33070
|
+
);
|
|
33071
|
+
}
|
|
33134
33072
|
if (error) lines.push(` error: ${error}`);
|
|
33135
33073
|
}
|
|
33136
33074
|
}
|
|
@@ -34784,38 +34722,38 @@ Examples:
|
|
|
34784
34722
|
|
|
34785
34723
|
// src/cli/commands/setup.ts
|
|
34786
34724
|
var import_node_child_process4 = require("child_process");
|
|
34787
|
-
var
|
|
34725
|
+
var import_node_fs18 = require("fs");
|
|
34788
34726
|
var import_node_os13 = require("os");
|
|
34789
34727
|
var import_node_path21 = require("path");
|
|
34790
34728
|
|
|
34791
34729
|
// src/cli/installation-lifecycle.ts
|
|
34792
|
-
var
|
|
34730
|
+
var import_node_fs15 = require("fs");
|
|
34793
34731
|
var import_node_path18 = require("path");
|
|
34794
34732
|
var nodeFileSystem = {
|
|
34795
|
-
exists:
|
|
34733
|
+
exists: import_node_fs15.existsSync,
|
|
34796
34734
|
isSymbolicLink(path) {
|
|
34797
34735
|
try {
|
|
34798
|
-
return (0,
|
|
34736
|
+
return (0, import_node_fs15.lstatSync)(path).isSymbolicLink();
|
|
34799
34737
|
} catch {
|
|
34800
34738
|
return false;
|
|
34801
34739
|
}
|
|
34802
34740
|
},
|
|
34803
34741
|
read(path) {
|
|
34804
34742
|
try {
|
|
34805
|
-
return (0,
|
|
34743
|
+
return (0, import_node_fs15.readFileSync)(path, "utf8");
|
|
34806
34744
|
} catch {
|
|
34807
34745
|
return "";
|
|
34808
34746
|
}
|
|
34809
34747
|
},
|
|
34810
34748
|
realpath(path) {
|
|
34811
34749
|
try {
|
|
34812
|
-
return (0,
|
|
34750
|
+
return (0, import_node_fs15.realpathSync)(path);
|
|
34813
34751
|
} catch {
|
|
34814
34752
|
return null;
|
|
34815
34753
|
}
|
|
34816
34754
|
},
|
|
34817
34755
|
remove(path) {
|
|
34818
|
-
(0,
|
|
34756
|
+
(0, import_node_fs15.rmSync)(path, { force: true });
|
|
34819
34757
|
}
|
|
34820
34758
|
};
|
|
34821
34759
|
function inspectLauncher(path, fileSystem = nodeFileSystem) {
|
|
@@ -34912,7 +34850,7 @@ function isOwnedInstallerCommandPath(input2) {
|
|
|
34912
34850
|
|
|
34913
34851
|
// src/cli/commands/skills.ts
|
|
34914
34852
|
var import_node_child_process3 = require("child_process");
|
|
34915
|
-
var
|
|
34853
|
+
var import_node_fs17 = require("fs");
|
|
34916
34854
|
var import_node_os12 = require("os");
|
|
34917
34855
|
var import_node_path20 = require("path");
|
|
34918
34856
|
|
|
@@ -35024,7 +34962,7 @@ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
|
35024
34962
|
|
|
35025
34963
|
// src/cli/skills-sync.ts
|
|
35026
34964
|
var import_node_child_process2 = require("child_process");
|
|
35027
|
-
var
|
|
34965
|
+
var import_node_fs16 = require("fs");
|
|
35028
34966
|
var import_node_path19 = require("path");
|
|
35029
34967
|
|
|
35030
34968
|
// src/cli/windows-arg-escape.ts
|
|
@@ -35385,15 +35323,15 @@ function hasMarkedSkillsSyncVersion(path, version) {
|
|
|
35385
35323
|
}
|
|
35386
35324
|
function readMarkedSkillsSyncVersion(path) {
|
|
35387
35325
|
try {
|
|
35388
|
-
return (0,
|
|
35326
|
+
return (0, import_node_fs16.existsSync)(path) ? (0, import_node_fs16.readFileSync)(path, "utf-8").trim() : "";
|
|
35389
35327
|
} catch {
|
|
35390
35328
|
return "";
|
|
35391
35329
|
}
|
|
35392
35330
|
}
|
|
35393
35331
|
function writeMarkedSkillsSyncVersion(path, version) {
|
|
35394
35332
|
try {
|
|
35395
|
-
(0,
|
|
35396
|
-
(0,
|
|
35333
|
+
(0, import_node_fs16.mkdirSync)((0, import_node_path19.dirname)(path), { recursive: true });
|
|
35334
|
+
(0, import_node_fs16.writeFileSync)(path, `${version}
|
|
35397
35335
|
`, "utf-8");
|
|
35398
35336
|
return true;
|
|
35399
35337
|
} catch {
|
|
@@ -35412,7 +35350,7 @@ ${manualCommand}`
|
|
|
35412
35350
|
}
|
|
35413
35351
|
function clearUnavailableSkillsNotice(baseUrl) {
|
|
35414
35352
|
try {
|
|
35415
|
-
(0,
|
|
35353
|
+
(0, import_node_fs16.unlinkSync)(unavailableSkillsNoticePath(baseUrl));
|
|
35416
35354
|
} catch {
|
|
35417
35355
|
}
|
|
35418
35356
|
}
|
|
@@ -35423,7 +35361,7 @@ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
|
35423
35361
|
);
|
|
35424
35362
|
}
|
|
35425
35363
|
function hasFailedAutomaticSkillsSync(baseUrl, agents) {
|
|
35426
|
-
return (0,
|
|
35364
|
+
return (0, import_node_fs16.existsSync)(failedSkillsSyncPath(baseUrl, agents));
|
|
35427
35365
|
}
|
|
35428
35366
|
function markFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
35429
35367
|
return writeMarkedSkillsSyncVersion(
|
|
@@ -35433,7 +35371,7 @@ function markFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
|
35433
35371
|
}
|
|
35434
35372
|
function clearFailedSkillsSync(baseUrl, agents) {
|
|
35435
35373
|
try {
|
|
35436
|
-
(0,
|
|
35374
|
+
(0, import_node_fs16.unlinkSync)(failedSkillsSyncPath(baseUrl, agents));
|
|
35437
35375
|
} catch {
|
|
35438
35376
|
}
|
|
35439
35377
|
}
|
|
@@ -35800,7 +35738,7 @@ function detectSkillsAgents(input2) {
|
|
|
35800
35738
|
];
|
|
35801
35739
|
const detected = AGENT_MARKERS.filter(
|
|
35802
35740
|
(marker) => roots.some(
|
|
35803
|
-
(root) => marker.paths.some((path) => (0,
|
|
35741
|
+
(root) => marker.paths.some((path) => (0, import_node_fs17.existsSync)((0, import_node_path20.join)(root, path)))
|
|
35804
35742
|
)
|
|
35805
35743
|
).map((marker) => marker.agent);
|
|
35806
35744
|
return detected.length > 0 ? detected : ["*"];
|
|
@@ -35873,7 +35811,7 @@ function isSkillsPlanCurrent(plan, state) {
|
|
|
35873
35811
|
}
|
|
35874
35812
|
function readSkillsInstallState(path) {
|
|
35875
35813
|
try {
|
|
35876
|
-
const parsed = JSON.parse((0,
|
|
35814
|
+
const parsed = JSON.parse((0, import_node_fs17.readFileSync)(path, "utf8"));
|
|
35877
35815
|
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
35878
35816
|
} catch {
|
|
35879
35817
|
return null;
|
|
@@ -36026,8 +35964,8 @@ async function runSkillsCommand(options, dependencies = {}) {
|
|
|
36026
35964
|
`
|
|
36027
35965
|
);
|
|
36028
35966
|
}
|
|
36029
|
-
(0,
|
|
36030
|
-
(0,
|
|
35967
|
+
(0, import_node_fs17.mkdirSync)((0, import_node_path20.dirname)(plan.statePath), { recursive: true });
|
|
35968
|
+
(0, import_node_fs17.writeFileSync)(
|
|
36031
35969
|
plan.statePath,
|
|
36032
35970
|
`${JSON.stringify(
|
|
36033
35971
|
{
|
|
@@ -36165,7 +36103,7 @@ function phasesFromLegacyStatus(status) {
|
|
|
36165
36103
|
function readSetupState(input2) {
|
|
36166
36104
|
try {
|
|
36167
36105
|
const parsed = JSON.parse(
|
|
36168
|
-
(0,
|
|
36106
|
+
(0, import_node_fs18.readFileSync)(
|
|
36169
36107
|
setupStatePath(input2.baseUrl, input2.scope, input2.root),
|
|
36170
36108
|
"utf8"
|
|
36171
36109
|
)
|
|
@@ -36270,7 +36208,7 @@ function asRecord3(value) {
|
|
|
36270
36208
|
}
|
|
36271
36209
|
function safeRead(path) {
|
|
36272
36210
|
try {
|
|
36273
|
-
return (0,
|
|
36211
|
+
return (0, import_node_fs18.readFileSync)(path, "utf8");
|
|
36274
36212
|
} catch {
|
|
36275
36213
|
return "";
|
|
36276
36214
|
}
|
|
@@ -36299,7 +36237,7 @@ function resolvePathCommand(command) {
|
|
|
36299
36237
|
function isHomebrewFormulaCommand(path) {
|
|
36300
36238
|
let resolvedPath = path;
|
|
36301
36239
|
try {
|
|
36302
|
-
resolvedPath = (0,
|
|
36240
|
+
resolvedPath = (0, import_node_fs18.realpathSync)(path);
|
|
36303
36241
|
} catch {
|
|
36304
36242
|
return false;
|
|
36305
36243
|
}
|
|
@@ -36310,7 +36248,7 @@ function isHomebrewFormulaCommand(path) {
|
|
|
36310
36248
|
function resolvePersistentGlobalCommand(dependencies = {}) {
|
|
36311
36249
|
const platform3 = dependencies.platform ?? process.platform;
|
|
36312
36250
|
const run = dependencies.spawn ?? import_node_child_process4.spawnSync;
|
|
36313
|
-
const pathExists = dependencies.exists ??
|
|
36251
|
+
const pathExists = dependencies.exists ?? import_node_fs18.existsSync;
|
|
36314
36252
|
const pathClis = dependencies.pathClis ?? resolvePathCommands("deepline");
|
|
36315
36253
|
const homebrewCommand = pathClis.find(isHomebrewFormulaCommand);
|
|
36316
36254
|
if (homebrewCommand) return homebrewCommand;
|
|
@@ -36335,7 +36273,7 @@ function inspectGlobalCliAvailability(input2) {
|
|
|
36335
36273
|
}
|
|
36336
36274
|
function pathsResolveToSameFile(left, right) {
|
|
36337
36275
|
try {
|
|
36338
|
-
return (0,
|
|
36276
|
+
return (0, import_node_fs18.realpathSync)(left) === (0, import_node_fs18.realpathSync)(right);
|
|
36339
36277
|
} catch {
|
|
36340
36278
|
return (0, import_node_path21.resolve)(left) === (0, import_node_path21.resolve)(right);
|
|
36341
36279
|
}
|
|
@@ -36344,7 +36282,7 @@ function isKnownDeeplineCommand(path) {
|
|
|
36344
36282
|
const entrypoint = process.argv[1] ? (0, import_node_path21.resolve)(process.argv[1]) : "";
|
|
36345
36283
|
let resolvedPath = path;
|
|
36346
36284
|
try {
|
|
36347
|
-
resolvedPath = (0,
|
|
36285
|
+
resolvedPath = (0, import_node_fs18.realpathSync)(path);
|
|
36348
36286
|
} catch {
|
|
36349
36287
|
}
|
|
36350
36288
|
if (entrypoint && resolvedPath === entrypoint) return true;
|
|
@@ -36356,8 +36294,8 @@ function inspectPathConflict() {
|
|
|
36356
36294
|
const commandPath = resolvePathCommand("deepline");
|
|
36357
36295
|
if (!commandPath || isKnownDeeplineCommand(commandPath)) return null;
|
|
36358
36296
|
try {
|
|
36359
|
-
if ((0,
|
|
36360
|
-
const target = (0,
|
|
36297
|
+
if ((0, import_node_fs18.lstatSync)(commandPath).isSymbolicLink()) {
|
|
36298
|
+
const target = (0, import_node_fs18.realpathSync)(commandPath);
|
|
36361
36299
|
if (target.includes(`${(0, import_node_path21.join)("node_modules", "deepline")}`)) return null;
|
|
36362
36300
|
}
|
|
36363
36301
|
} catch {
|
|
@@ -36366,8 +36304,8 @@ function inspectPathConflict() {
|
|
|
36366
36304
|
}
|
|
36367
36305
|
function writeSetupState(input2) {
|
|
36368
36306
|
const path = setupStatePath(input2.baseUrl, input2.scope, input2.root);
|
|
36369
|
-
(0,
|
|
36370
|
-
(0,
|
|
36307
|
+
(0, import_node_fs18.mkdirSync)((0, import_node_path21.dirname)(path), { recursive: true });
|
|
36308
|
+
(0, import_node_fs18.writeFileSync)(
|
|
36371
36309
|
path,
|
|
36372
36310
|
`${JSON.stringify(
|
|
36373
36311
|
{
|
|
@@ -37031,7 +36969,7 @@ Examples:
|
|
|
37031
36969
|
}
|
|
37032
36970
|
|
|
37033
36971
|
// src/cli/update-preferences.ts
|
|
37034
|
-
var
|
|
36972
|
+
var import_node_fs19 = require("fs");
|
|
37035
36973
|
var import_node_os14 = require("os");
|
|
37036
36974
|
var import_node_path22 = require("path");
|
|
37037
36975
|
var UPDATE_PREFERENCES_SCHEMA_VERSION = 1;
|
|
@@ -37072,9 +37010,9 @@ function cliUpdatePreferencesPath(homeDir2 = (0, import_node_os14.homedir)()) {
|
|
|
37072
37010
|
}
|
|
37073
37011
|
function readCliUpdatePreferences(homeDir2 = (0, import_node_os14.homedir)()) {
|
|
37074
37012
|
const path = cliUpdatePreferencesPath(homeDir2);
|
|
37075
|
-
if (!(0,
|
|
37013
|
+
if (!(0, import_node_fs19.existsSync)(path)) return defaultPreferences();
|
|
37076
37014
|
try {
|
|
37077
|
-
const parsed = JSON.parse((0,
|
|
37015
|
+
const parsed = JSON.parse((0, import_node_fs19.readFileSync)(path, "utf8"));
|
|
37078
37016
|
return {
|
|
37079
37017
|
schemaVersion: UPDATE_PREFERENCES_SCHEMA_VERSION,
|
|
37080
37018
|
autoUpdateEnabled: typeof parsed.autoUpdateEnabled === "boolean" ? parsed.autoUpdateEnabled : true,
|
|
@@ -37090,16 +37028,16 @@ function readCliUpdatePreferences(homeDir2 = (0, import_node_os14.homedir)()) {
|
|
|
37090
37028
|
function writeCliUpdatePreferences(preferences, homeDir2 = (0, import_node_os14.homedir)()) {
|
|
37091
37029
|
const path = cliUpdatePreferencesPath(homeDir2);
|
|
37092
37030
|
const tempPath = `${path}.${process.pid}.tmp`;
|
|
37093
|
-
(0,
|
|
37031
|
+
(0, import_node_fs19.mkdirSync)((0, import_node_path22.dirname)(path), { recursive: true });
|
|
37094
37032
|
try {
|
|
37095
|
-
(0,
|
|
37033
|
+
(0, import_node_fs19.writeFileSync)(tempPath, `${JSON.stringify(preferences, null, 2)}
|
|
37096
37034
|
`, {
|
|
37097
37035
|
encoding: "utf8",
|
|
37098
37036
|
mode: 384
|
|
37099
37037
|
});
|
|
37100
|
-
(0,
|
|
37038
|
+
(0, import_node_fs19.renameSync)(tempPath, path);
|
|
37101
37039
|
} finally {
|
|
37102
|
-
(0,
|
|
37040
|
+
(0, import_node_fs19.rmSync)(tempPath, { force: true });
|
|
37103
37041
|
}
|
|
37104
37042
|
}
|
|
37105
37043
|
function setCliAutoUpdateEnabled(enabled, homeDir2 = (0, import_node_os14.homedir)()) {
|
|
@@ -37149,13 +37087,13 @@ function consumePendingCliUpdateMessages(homeDir2 = (0, import_node_os14.homedir
|
|
|
37149
37087
|
|
|
37150
37088
|
// src/cli/commands/update.ts
|
|
37151
37089
|
var import_node_child_process5 = require("child_process");
|
|
37152
|
-
var
|
|
37090
|
+
var import_node_fs21 = require("fs");
|
|
37153
37091
|
var import_node_os15 = require("os");
|
|
37154
37092
|
var import_node_path24 = require("path");
|
|
37155
37093
|
|
|
37156
37094
|
// src/cli/install-integrity.ts
|
|
37157
37095
|
var import_node_module2 = require("module");
|
|
37158
|
-
var
|
|
37096
|
+
var import_node_fs20 = require("fs");
|
|
37159
37097
|
var import_node_path23 = require("path");
|
|
37160
37098
|
var SDK_SIDECAR_CRITICAL_PACKAGE_FILES = [
|
|
37161
37099
|
"dist/cli/index.mjs",
|
|
@@ -37189,11 +37127,11 @@ function resolveContainedPath(root, value) {
|
|
|
37189
37127
|
return target;
|
|
37190
37128
|
}
|
|
37191
37129
|
function parseJson(path) {
|
|
37192
|
-
return JSON.parse((0,
|
|
37130
|
+
return JSON.parse((0, import_node_fs20.readFileSync)(path, "utf8"));
|
|
37193
37131
|
}
|
|
37194
37132
|
function isFile(path) {
|
|
37195
37133
|
try {
|
|
37196
|
-
return (0,
|
|
37134
|
+
return (0, import_node_fs20.statSync)(path).isFile();
|
|
37197
37135
|
} catch {
|
|
37198
37136
|
return false;
|
|
37199
37137
|
}
|
|
@@ -37207,7 +37145,7 @@ function readManifest(packageRoot) {
|
|
|
37207
37145
|
return {
|
|
37208
37146
|
mode: "manifest",
|
|
37209
37147
|
invalidReason: `invalid Deepline package metadata: ${error.message}`,
|
|
37210
|
-
missing: (0,
|
|
37148
|
+
missing: (0, import_node_fs20.existsSync)(packageJsonPath) ? [] : ["deepline/package.json"]
|
|
37211
37149
|
};
|
|
37212
37150
|
}
|
|
37213
37151
|
if (!packageJson || typeof packageJson !== "object" || Array.isArray(packageJson)) {
|
|
@@ -37399,7 +37337,7 @@ function publicNpmFallbackRegistryUrl(hostUrl) {
|
|
|
37399
37337
|
}
|
|
37400
37338
|
function readOptionalText(path) {
|
|
37401
37339
|
try {
|
|
37402
|
-
return (0,
|
|
37340
|
+
return (0, import_node_fs21.readFileSync)(path, "utf8").trim();
|
|
37403
37341
|
} catch {
|
|
37404
37342
|
return "";
|
|
37405
37343
|
}
|
|
@@ -37445,11 +37383,11 @@ function resolvePythonSidecarUpdatePlan(options) {
|
|
|
37445
37383
|
function findRepoBackedSdkRoot(startPath) {
|
|
37446
37384
|
let current = (0, import_node_path24.resolve)(startPath);
|
|
37447
37385
|
while (true) {
|
|
37448
|
-
if ((0,
|
|
37386
|
+
if ((0, import_node_fs21.existsSync)((0, import_node_path24.join)(current, "package.json")) && (0, import_node_fs21.existsSync)((0, import_node_path24.join)(current, "bin", "deepline-dev.ts"))) {
|
|
37449
37387
|
const parent2 = (0, import_node_path24.dirname)(current);
|
|
37450
37388
|
return (0, import_node_path24.basename)(parent2) === "packages" && (0, import_node_path24.basename)(current) === "sdk" ? (0, import_node_path24.dirname)(parent2) : parent2;
|
|
37451
37389
|
}
|
|
37452
|
-
if ((0,
|
|
37390
|
+
if ((0, import_node_fs21.existsSync)((0, import_node_path24.join)(current, "sdk", "package.json")) && (0, import_node_fs21.existsSync)((0, import_node_path24.join)(current, "sdk", "bin", "deepline-dev.ts"))) {
|
|
37453
37391
|
return current;
|
|
37454
37392
|
}
|
|
37455
37393
|
const parent = (0, import_node_path24.dirname)(current);
|
|
@@ -37460,7 +37398,7 @@ function findRepoBackedSdkRoot(startPath) {
|
|
|
37460
37398
|
function inferNpmGlobalPrefixFromEntrypoint(entrypoint, env) {
|
|
37461
37399
|
const normalized = (() => {
|
|
37462
37400
|
try {
|
|
37463
|
-
return (0,
|
|
37401
|
+
return (0, import_node_fs21.realpathSync)(entrypoint);
|
|
37464
37402
|
} catch {
|
|
37465
37403
|
return (0, import_node_path24.resolve)(entrypoint);
|
|
37466
37404
|
}
|
|
@@ -37493,7 +37431,7 @@ function normalizedNpmPrefix(value) {
|
|
|
37493
37431
|
if (!trimmed) return null;
|
|
37494
37432
|
const normalized = (() => {
|
|
37495
37433
|
try {
|
|
37496
|
-
return (0,
|
|
37434
|
+
return (0, import_node_fs21.realpathSync)((0, import_node_path24.resolve)(trimmed));
|
|
37497
37435
|
} catch {
|
|
37498
37436
|
return (0, import_node_path24.resolve)(trimmed);
|
|
37499
37437
|
}
|
|
@@ -37518,7 +37456,7 @@ function resolveNpmGlobalPrefix(env) {
|
|
|
37518
37456
|
function isHomebrewFormulaEntrypoint(entrypoint) {
|
|
37519
37457
|
const normalized = (() => {
|
|
37520
37458
|
try {
|
|
37521
|
-
return (0,
|
|
37459
|
+
return (0, import_node_fs21.realpathSync)(entrypoint);
|
|
37522
37460
|
} catch {
|
|
37523
37461
|
return (0, import_node_path24.resolve)(entrypoint);
|
|
37524
37462
|
}
|
|
@@ -37602,7 +37540,7 @@ function readAutoUpdateFailure(plan) {
|
|
|
37602
37540
|
if (!path) return null;
|
|
37603
37541
|
try {
|
|
37604
37542
|
const parsed = JSON.parse(
|
|
37605
|
-
(0,
|
|
37543
|
+
(0, import_node_fs21.readFileSync)(path, "utf8")
|
|
37606
37544
|
);
|
|
37607
37545
|
if ((parsed.kind === "npm-global" || parsed.kind === "python-sidecar") && typeof parsed.packageSpec === "string" && typeof parsed.failedAt === "string" && typeof parsed.exitCode === "number" && typeof parsed.manualCommand === "string") {
|
|
37608
37546
|
return parsed;
|
|
@@ -37623,8 +37561,8 @@ function writeAutoUpdateFailure(plan, exitCode) {
|
|
|
37623
37561
|
manualCommand: plan.manualCommand
|
|
37624
37562
|
};
|
|
37625
37563
|
try {
|
|
37626
|
-
(0,
|
|
37627
|
-
(0,
|
|
37564
|
+
(0, import_node_fs21.mkdirSync)((0, import_node_path24.dirname)(path), { recursive: true });
|
|
37565
|
+
(0, import_node_fs21.writeFileSync)(path, `${JSON.stringify(marker, null, 2)}
|
|
37628
37566
|
`, "utf8");
|
|
37629
37567
|
} catch {
|
|
37630
37568
|
}
|
|
@@ -37633,7 +37571,7 @@ function clearAutoUpdateFailure(plan) {
|
|
|
37633
37571
|
const path = autoUpdateFailurePath(plan);
|
|
37634
37572
|
if (!path) return;
|
|
37635
37573
|
try {
|
|
37636
|
-
(0,
|
|
37574
|
+
(0, import_node_fs21.unlinkSync)(path);
|
|
37637
37575
|
} catch {
|
|
37638
37576
|
}
|
|
37639
37577
|
}
|
|
@@ -37688,7 +37626,7 @@ function installedPackageVersion(versionDir) {
|
|
|
37688
37626
|
"package.json"
|
|
37689
37627
|
);
|
|
37690
37628
|
try {
|
|
37691
|
-
const parsed = JSON.parse((0,
|
|
37629
|
+
const parsed = JSON.parse((0, import_node_fs21.readFileSync)(packageJsonPath, "utf8"));
|
|
37692
37630
|
return typeof parsed.version === "string" ? safeVersionSegment(parsed.version) : "";
|
|
37693
37631
|
} catch {
|
|
37694
37632
|
return "";
|
|
@@ -37803,7 +37741,7 @@ async function runNpmInstallWithRegistryFallback(input2) {
|
|
|
37803
37741
|
return first.exitCode;
|
|
37804
37742
|
}
|
|
37805
37743
|
function writeSidecarLauncher(input2) {
|
|
37806
|
-
(0,
|
|
37744
|
+
(0, import_node_fs21.mkdirSync)((0, import_node_path24.dirname)(input2.path), { recursive: true });
|
|
37807
37745
|
const packageRoot = (0, import_node_path24.dirname)((0, import_node_path24.dirname)((0, import_node_path24.dirname)(input2.entryPath)));
|
|
37808
37746
|
const versionDir = (0, import_node_path24.dirname)((0, import_node_path24.dirname)(packageRoot));
|
|
37809
37747
|
const esbuildProbe = "const {createRequire}=require('node:module');const path=require('node:path');const req=createRequire(path.join(process.argv[1],'package.json'));const result=req('esbuild').transformSync('const value: number = 1;',{loader:'ts'});if(!result||typeof result.code!=='string')process.exit(3);";
|
|
@@ -37816,7 +37754,7 @@ function writeSidecarLauncher(input2) {
|
|
|
37816
37754
|
)
|
|
37817
37755
|
];
|
|
37818
37756
|
if (process.platform === "win32") {
|
|
37819
|
-
(0,
|
|
37757
|
+
(0, import_node_fs21.writeFileSync)(
|
|
37820
37758
|
input2.path,
|
|
37821
37759
|
[
|
|
37822
37760
|
`@set DEEPLINE_HOST_URL=${input2.hostUrl.replace(/\r?\n/g, "")}`,
|
|
@@ -37839,7 +37777,7 @@ function writeSidecarLauncher(input2) {
|
|
|
37839
37777
|
);
|
|
37840
37778
|
return;
|
|
37841
37779
|
}
|
|
37842
|
-
(0,
|
|
37780
|
+
(0, import_node_fs21.writeFileSync)(
|
|
37843
37781
|
input2.path,
|
|
37844
37782
|
[
|
|
37845
37783
|
"#!/usr/bin/env sh",
|
|
@@ -37871,9 +37809,9 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37871
37809
|
versionsDir,
|
|
37872
37810
|
`.tmp-sdk-update-${process.pid}-${Date.now()}`
|
|
37873
37811
|
);
|
|
37874
|
-
(0,
|
|
37875
|
-
(0,
|
|
37876
|
-
(0,
|
|
37812
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37813
|
+
(0, import_node_fs21.mkdirSync)(tempDir, { recursive: true });
|
|
37814
|
+
(0, import_node_fs21.writeFileSync)((0, import_node_path24.join)(tempDir, "package.json"), NPM_SDK_SIDECAR_PACKAGE_JSON);
|
|
37877
37815
|
const env = {
|
|
37878
37816
|
...process.env,
|
|
37879
37817
|
PATH: `${(0, import_node_path24.dirname)(plan.nodeBin)}${process.platform === "win32" ? ";" : ":"}${process.env.PATH ?? ""}`
|
|
@@ -37893,7 +37831,7 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37893
37831
|
);
|
|
37894
37832
|
const installExitCode = installResult.exitCode;
|
|
37895
37833
|
if (installExitCode !== 0) {
|
|
37896
|
-
(0,
|
|
37834
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37897
37835
|
return installExitCode;
|
|
37898
37836
|
}
|
|
37899
37837
|
const installedVersion = installedPackageVersion(tempDir);
|
|
@@ -37901,7 +37839,7 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37901
37839
|
process.stderr.write(
|
|
37902
37840
|
"Updated Deepline SDK package did not report a version.\n"
|
|
37903
37841
|
);
|
|
37904
|
-
(0,
|
|
37842
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37905
37843
|
return 1;
|
|
37906
37844
|
}
|
|
37907
37845
|
const stagedFailure = sidecarInstallFailure(tempDir);
|
|
@@ -37910,7 +37848,7 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37910
37848
|
`Updated Deepline SDK package is incomplete: ${stagedFailure}.
|
|
37911
37849
|
`
|
|
37912
37850
|
);
|
|
37913
|
-
(0,
|
|
37851
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37914
37852
|
return 1;
|
|
37915
37853
|
}
|
|
37916
37854
|
const finalDir = (0, import_node_path24.join)(versionsDir, installedVersion);
|
|
@@ -37918,24 +37856,24 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37918
37856
|
const finalFailure = sidecarInstallFailure(finalDir);
|
|
37919
37857
|
let backupDir = null;
|
|
37920
37858
|
if (!finalFailure) {
|
|
37921
|
-
(0,
|
|
37859
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37922
37860
|
} else {
|
|
37923
37861
|
let shouldPublishTemp = true;
|
|
37924
|
-
if ((0,
|
|
37862
|
+
if ((0, import_node_fs21.existsSync)(finalDir)) {
|
|
37925
37863
|
backupDir = (0, import_node_path24.join)(
|
|
37926
37864
|
versionsDir,
|
|
37927
37865
|
`.backup-${installedVersion}-${process.pid}-${Date.now()}`
|
|
37928
37866
|
);
|
|
37929
37867
|
try {
|
|
37930
|
-
(0,
|
|
37868
|
+
(0, import_node_fs21.renameSync)(finalDir, backupDir);
|
|
37931
37869
|
} catch (error) {
|
|
37932
37870
|
const concurrentlyPublishedFailure = sidecarInstallFailure(finalDir);
|
|
37933
37871
|
if (!concurrentlyPublishedFailure) {
|
|
37934
|
-
(0,
|
|
37872
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37935
37873
|
backupDir = null;
|
|
37936
37874
|
shouldPublishTemp = false;
|
|
37937
37875
|
} else {
|
|
37938
|
-
(0,
|
|
37876
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37939
37877
|
process.stderr.write(
|
|
37940
37878
|
`Failed to preserve the incomplete Deepline SDK sidecar before repair: ${error.message}.
|
|
37941
37879
|
`
|
|
@@ -37946,18 +37884,18 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37946
37884
|
}
|
|
37947
37885
|
if (shouldPublishTemp) {
|
|
37948
37886
|
try {
|
|
37949
|
-
(0,
|
|
37887
|
+
(0, import_node_fs21.renameSync)(tempDir, finalDir);
|
|
37950
37888
|
} catch (error) {
|
|
37951
|
-
(0,
|
|
37889
|
+
(0, import_node_fs21.rmSync)(tempDir, { recursive: true, force: true });
|
|
37952
37890
|
const concurrentlyPublishedFailure = sidecarInstallFailure(finalDir);
|
|
37953
37891
|
if (!concurrentlyPublishedFailure) {
|
|
37954
|
-
if (backupDir) (0,
|
|
37892
|
+
if (backupDir) (0, import_node_fs21.rmSync)(backupDir, { recursive: true, force: true });
|
|
37955
37893
|
backupDir = null;
|
|
37956
37894
|
} else {
|
|
37957
37895
|
let restoreFailure = "";
|
|
37958
|
-
if (backupDir && (0,
|
|
37896
|
+
if (backupDir && (0, import_node_fs21.existsSync)(backupDir) && !(0, import_node_fs21.existsSync)(finalDir)) {
|
|
37959
37897
|
try {
|
|
37960
|
-
(0,
|
|
37898
|
+
(0, import_node_fs21.renameSync)(backupDir, finalDir);
|
|
37961
37899
|
backupDir = null;
|
|
37962
37900
|
} catch (restoreError) {
|
|
37963
37901
|
restoreFailure = `; failed to restore previous install: ${restoreError.message}`;
|
|
@@ -37974,10 +37912,10 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37974
37912
|
}
|
|
37975
37913
|
const publishedFailure = sidecarStructureFailure(finalDir);
|
|
37976
37914
|
if (publishedFailure) {
|
|
37977
|
-
if (backupDir && (0,
|
|
37978
|
-
(0,
|
|
37915
|
+
if (backupDir && (0, import_node_fs21.existsSync)(backupDir)) {
|
|
37916
|
+
(0, import_node_fs21.rmSync)(finalDir, { recursive: true, force: true });
|
|
37979
37917
|
try {
|
|
37980
|
-
(0,
|
|
37918
|
+
(0, import_node_fs21.renameSync)(backupDir, finalDir);
|
|
37981
37919
|
backupDir = null;
|
|
37982
37920
|
} catch {
|
|
37983
37921
|
}
|
|
@@ -37988,7 +37926,7 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37988
37926
|
);
|
|
37989
37927
|
return 1;
|
|
37990
37928
|
}
|
|
37991
|
-
if (backupDir) (0,
|
|
37929
|
+
if (backupDir) (0, import_node_fs21.rmSync)(backupDir, { recursive: true, force: true });
|
|
37992
37930
|
writeSidecarLauncher({
|
|
37993
37931
|
path: plan.sidecarPath,
|
|
37994
37932
|
hostUrl: plan.hostUrl,
|
|
@@ -37996,27 +37934,27 @@ async function runPythonSidecarUpdatePlan(plan) {
|
|
|
37996
37934
|
nodeBin: plan.nodeBin,
|
|
37997
37935
|
entryPath: finalEntryPath
|
|
37998
37936
|
});
|
|
37999
|
-
(0,
|
|
37937
|
+
(0, import_node_fs21.writeFileSync)(
|
|
38000
37938
|
(0, import_node_path24.join)(plan.stateDir, ".version"),
|
|
38001
37939
|
`${installedVersion}
|
|
38002
37940
|
`,
|
|
38003
37941
|
"utf8"
|
|
38004
37942
|
);
|
|
38005
|
-
(0,
|
|
37943
|
+
(0, import_node_fs21.writeFileSync)(
|
|
38006
37944
|
(0, import_node_path24.join)(plan.stateDir, ".install-method"),
|
|
38007
37945
|
"python-sidecar\n",
|
|
38008
37946
|
"utf8"
|
|
38009
37947
|
);
|
|
38010
|
-
(0,
|
|
37948
|
+
(0, import_node_fs21.writeFileSync)(
|
|
38011
37949
|
(0, import_node_path24.join)(plan.stateDir, ".command-path"),
|
|
38012
37950
|
`${plan.sidecarPath}
|
|
38013
37951
|
`,
|
|
38014
37952
|
"utf8"
|
|
38015
37953
|
);
|
|
38016
|
-
(0,
|
|
38017
|
-
(0,
|
|
37954
|
+
(0, import_node_fs21.writeFileSync)((0, import_node_path24.join)(plan.stateDir, ".runner"), "node\n", "utf8");
|
|
37955
|
+
(0, import_node_fs21.writeFileSync)((0, import_node_path24.join)(plan.stateDir, ".node-bin"), `${plan.nodeBin}
|
|
38018
37956
|
`, "utf8");
|
|
38019
|
-
(0,
|
|
37957
|
+
(0, import_node_fs21.writeFileSync)(
|
|
38020
37958
|
(0, import_node_path24.join)(plan.stateDir, ".entry-path"),
|
|
38021
37959
|
`${finalEntryPath}
|
|
38022
37960
|
`,
|
|
@@ -38944,12 +38882,12 @@ chooses the connected Slack channel or member and the events it receives.
|
|
|
38944
38882
|
|
|
38945
38883
|
// src/cli/commands/tools.ts
|
|
38946
38884
|
var import_commander3 = require("commander");
|
|
38947
|
-
var
|
|
38885
|
+
var import_node_fs23 = require("fs");
|
|
38948
38886
|
var import_node_os17 = require("os");
|
|
38949
38887
|
var import_node_path26 = require("path");
|
|
38950
38888
|
|
|
38951
38889
|
// src/tool-output.ts
|
|
38952
|
-
var
|
|
38890
|
+
var import_node_fs22 = require("fs");
|
|
38953
38891
|
var import_node_os16 = require("os");
|
|
38954
38892
|
var import_node_path25 = require("path");
|
|
38955
38893
|
function isPlainObject(value) {
|
|
@@ -39079,18 +39017,18 @@ function projectRowOutput(conversion) {
|
|
|
39079
39017
|
}
|
|
39080
39018
|
function ensureOutputDir() {
|
|
39081
39019
|
const outputDir = (0, import_node_path25.join)((0, import_node_os16.homedir)(), ".local", "share", "deepline", "data");
|
|
39082
|
-
(0,
|
|
39020
|
+
(0, import_node_fs22.mkdirSync)(outputDir, { recursive: true });
|
|
39083
39021
|
return outputDir;
|
|
39084
39022
|
}
|
|
39085
39023
|
function writeJsonOutputFile(payload, stem) {
|
|
39086
39024
|
const outputDir = ensureOutputDir();
|
|
39087
39025
|
const outputPath = (0, import_node_path25.join)(outputDir, `${stem}_${Date.now()}.json`);
|
|
39088
|
-
(0,
|
|
39026
|
+
(0, import_node_fs22.writeFileSync)(outputPath, JSON.stringify(payload, null, 2), "utf-8");
|
|
39089
39027
|
return outputPath;
|
|
39090
39028
|
}
|
|
39091
39029
|
function writeCsvOutputFile(rows, stem, options) {
|
|
39092
39030
|
const outputPath = options?.outPath ? options.outPath : (0, import_node_path25.join)(ensureOutputDir(), `${stem}_${Date.now()}.csv`);
|
|
39093
|
-
(0,
|
|
39031
|
+
(0, import_node_fs22.mkdirSync)((0, import_node_path25.dirname)(outputPath), { recursive: true });
|
|
39094
39032
|
const columns = columnsForRows(rows);
|
|
39095
39033
|
const escapeCell = (value) => {
|
|
39096
39034
|
const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
@@ -39099,19 +39037,19 @@ function writeCsvOutputFile(rows, stem, options) {
|
|
|
39099
39037
|
}
|
|
39100
39038
|
return normalized;
|
|
39101
39039
|
};
|
|
39102
|
-
const fd = (0,
|
|
39040
|
+
const fd = (0, import_node_fs22.openSync)(outputPath, "w");
|
|
39103
39041
|
try {
|
|
39104
|
-
(0,
|
|
39042
|
+
(0, import_node_fs22.writeSync)(fd, `${columns.map(escapeCell).join(",")}
|
|
39105
39043
|
`);
|
|
39106
39044
|
for (const row of rows) {
|
|
39107
|
-
(0,
|
|
39045
|
+
(0, import_node_fs22.writeSync)(
|
|
39108
39046
|
fd,
|
|
39109
39047
|
`${columns.map((column) => escapeCell(row[column])).join(",")}
|
|
39110
39048
|
`
|
|
39111
39049
|
);
|
|
39112
39050
|
}
|
|
39113
39051
|
} finally {
|
|
39114
|
-
(0,
|
|
39052
|
+
(0, import_node_fs22.closeSync)(fd);
|
|
39115
39053
|
}
|
|
39116
39054
|
const previewRows = rows.slice(0, 5);
|
|
39117
39055
|
const previewColumns = columns.slice(0, 5);
|
|
@@ -41051,10 +40989,10 @@ function normalizeOutputFormat(raw) {
|
|
|
41051
40989
|
function resolveAtFilePath(rawPath) {
|
|
41052
40990
|
const trimmed = rawPath.trim();
|
|
41053
40991
|
const resolved = (0, import_node_path26.resolve)(trimmed);
|
|
41054
|
-
if ((0,
|
|
40992
|
+
if ((0, import_node_fs23.existsSync)(resolved)) return resolved;
|
|
41055
40993
|
if (process.platform !== "win32" && trimmed.includes("\\")) {
|
|
41056
40994
|
const normalized = (0, import_node_path26.resolve)(trimmed.replace(/\\/g, "/"));
|
|
41057
|
-
if ((0,
|
|
40995
|
+
if ((0, import_node_fs23.existsSync)(normalized)) return normalized;
|
|
41058
40996
|
}
|
|
41059
40997
|
return resolved;
|
|
41060
40998
|
}
|
|
@@ -41065,7 +41003,7 @@ function readJsonArgument(raw, flagName) {
|
|
|
41065
41003
|
throw new Error(`Invalid ${flagName} value: empty @file path.`);
|
|
41066
41004
|
}
|
|
41067
41005
|
try {
|
|
41068
|
-
return (0,
|
|
41006
|
+
return (0, import_node_fs23.readFileSync)(resolveAtFilePath(filePath), "utf8").replace(
|
|
41069
41007
|
/^\uFEFF/,
|
|
41070
41008
|
""
|
|
41071
41009
|
);
|
|
@@ -41172,8 +41110,8 @@ function starterScriptJson(script) {
|
|
|
41172
41110
|
function seedToolListScript(input2) {
|
|
41173
41111
|
const stem = safeFileStem(input2.toolId);
|
|
41174
41112
|
const fileName = `${stem}-workflow-seed-${Date.now()}.play.ts`;
|
|
41175
|
-
const scriptDir = (0,
|
|
41176
|
-
(0,
|
|
41113
|
+
const scriptDir = (0, import_node_fs23.mkdtempSync)((0, import_node_path26.join)((0, import_node_os17.tmpdir)(), "deepline-workflow-seed-"));
|
|
41114
|
+
(0, import_node_fs23.chmodSync)(scriptDir, 448);
|
|
41177
41115
|
const scriptPath = (0, import_node_path26.join)(scriptDir, fileName);
|
|
41178
41116
|
const projectDir = `deepline/projects/${stem}-workflow`;
|
|
41179
41117
|
const playName = `${stem}-workflow`;
|
|
@@ -41217,7 +41155,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
41217
41155
|
description: ${JSON.stringify(`Seed ${input2.toolId} rows into a Deepline workflow-ready dataset.`)},
|
|
41218
41156
|
});
|
|
41219
41157
|
`;
|
|
41220
|
-
(0,
|
|
41158
|
+
(0, import_node_fs23.writeFileSync)(scriptPath, script, { encoding: "utf-8", mode: 384 });
|
|
41221
41159
|
return {
|
|
41222
41160
|
path: scriptPath,
|
|
41223
41161
|
sourceCode: script,
|