deepline 0.1.264 → 0.1.266
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/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +58 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/csv-rename.ts +50 -4
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +6 -0
- package/dist/cli/index.js +131 -257
- package/dist/cli/index.mjs +129 -255
- package/dist/index.d.mts +56 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -718,7 +718,7 @@ var SDK_RELEASE = {
|
|
|
718
718
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
719
719
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
720
720
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
721
|
-
version: "0.1.
|
|
721
|
+
version: "0.1.266",
|
|
722
722
|
apiContract: "2026-07-admin-cli-local-cutover",
|
|
723
723
|
supportPolicy: {
|
|
724
724
|
minimumSupported: "0.1.53",
|
|
@@ -14256,6 +14256,26 @@ function withOrdinaryRunAgainCommand(status, options, resolvedRevisionId) {
|
|
|
14256
14256
|
rerunCommand: buildOrdinaryPlayRunCommand(options, resolvedRevisionId)
|
|
14257
14257
|
} : status;
|
|
14258
14258
|
}
|
|
14259
|
+
function buildBillingRollupTextLines(status) {
|
|
14260
|
+
const billing = status.billing;
|
|
14261
|
+
const rollup = billing?.rollup;
|
|
14262
|
+
if (!rollup) return [];
|
|
14263
|
+
const total = formatCreditAmount(rollup.totalCreditsRollup);
|
|
14264
|
+
if (rollup.childCredits > 0 && rollup.descendantRunCount > 0) {
|
|
14265
|
+
const own = formatCreditAmount(rollup.ownCredits);
|
|
14266
|
+
const child = formatCreditAmount(rollup.childCredits);
|
|
14267
|
+
const suffix = rollup.rollupComplete ? "" : " (incomplete: child billing could not be fully resolved)";
|
|
14268
|
+
return [
|
|
14269
|
+
` cost: ${total} credits total \u2014 ${own} this run + ${child} across ${rollup.descendantRunCount} child run${rollup.descendantRunCount === 1 ? "" : "s"}${suffix}`
|
|
14270
|
+
];
|
|
14271
|
+
}
|
|
14272
|
+
if (!rollup.rollupComplete) {
|
|
14273
|
+
return [
|
|
14274
|
+
` cost: ${total} credits (incomplete: child billing could not be fully resolved${rollup.rollupError ? ` \u2014 ${rollup.rollupError}` : ""})`
|
|
14275
|
+
];
|
|
14276
|
+
}
|
|
14277
|
+
return [` cost: ${total} credits`];
|
|
14278
|
+
}
|
|
14259
14279
|
function writePlayResult(status, jsonOutput, options) {
|
|
14260
14280
|
const packaged = getPlayRunPackage(status);
|
|
14261
14281
|
if (jsonOutput) {
|
|
@@ -14318,6 +14338,7 @@ function writePlayResult(status, jsonOutput, options) {
|
|
|
14318
14338
|
lines.push(...renderedServerView.lines);
|
|
14319
14339
|
}
|
|
14320
14340
|
lines.push(...renderedServerView.actions);
|
|
14341
|
+
lines.push(...buildBillingRollupTextLines(status));
|
|
14321
14342
|
const compact = compactPlayStatus(status);
|
|
14322
14343
|
const payload = options?.fullJson ? status : compact;
|
|
14323
14344
|
printCommandEnvelope(
|
|
@@ -25686,243 +25707,82 @@ Examples:
|
|
|
25686
25707
|
);
|
|
25687
25708
|
}
|
|
25688
25709
|
|
|
25689
|
-
// src/cli/
|
|
25690
|
-
var
|
|
25691
|
-
var
|
|
25692
|
-
|
|
25693
|
-
|
|
25694
|
-
|
|
25695
|
-
|
|
25696
|
-
|
|
25697
|
-
|
|
25698
|
-
|
|
25699
|
-
|
|
25700
|
-
|
|
25701
|
-
|
|
25702
|
-
|
|
25703
|
-
|
|
25704
|
-
|
|
25705
|
-
|
|
25706
|
-
});
|
|
25707
|
-
return result.status === 0;
|
|
25708
|
-
} catch {
|
|
25709
|
-
return false;
|
|
25710
|
+
// src/cli/getting-started.ts
|
|
25711
|
+
var DEEPLINE_GTM_SKILL = "/deepline-gtm";
|
|
25712
|
+
var DEEPLINE_GTM_STARTER_PROMPTS = [
|
|
25713
|
+
{
|
|
25714
|
+
id: "waterfall-email-lookup",
|
|
25715
|
+
title: "Waterfall email lookup",
|
|
25716
|
+
prompt: "/deepline-gtm Find 5 CTOs in NYC and get their verified work emails."
|
|
25717
|
+
},
|
|
25718
|
+
{
|
|
25719
|
+
id: "signal-based-outbound",
|
|
25720
|
+
title: "Signal-based outbound",
|
|
25721
|
+
prompt: "/deepline-gtm Find 5 leads engaging with Gong's competitors on LinkedIn. Score against CMO or VP of Marketing. Waterfall enrich their emails. Build a sequence-ready list with personalized first lines."
|
|
25722
|
+
},
|
|
25723
|
+
{
|
|
25724
|
+
id: "vc-portfolio-scrape",
|
|
25725
|
+
title: "VC portfolio scrape",
|
|
25726
|
+
prompt: "/deepline-gtm Pull 5 companies from Y Combinator W26. Find the Head of Marketing or VP Sales at each one. Waterfall their emails and write a personalized first line."
|
|
25710
25727
|
}
|
|
25728
|
+
];
|
|
25729
|
+
var DEEPLINE_GTM_HANDOFF_QUESTION = "Would you like to try one of these examples, or tell me your own business problem?";
|
|
25730
|
+
function deeplineGtmGettingStartedPayload() {
|
|
25731
|
+
return {
|
|
25732
|
+
skill: DEEPLINE_GTM_SKILL,
|
|
25733
|
+
examples: DEEPLINE_GTM_STARTER_PROMPTS,
|
|
25734
|
+
question: DEEPLINE_GTM_HANDOFF_QUESTION,
|
|
25735
|
+
customProblemBehavior: "Turn the business problem into one exact /deepline-gtm prompt, show that reusable prompt, then execute it without asking the user to paste it again."
|
|
25736
|
+
};
|
|
25711
25737
|
}
|
|
25712
|
-
|
|
25713
|
-
|
|
25714
|
-
const child = (0, import_node_child_process2.spawn)("claude", [prompt], {
|
|
25715
|
-
stdio: "inherit",
|
|
25716
|
-
shell: process.platform === "win32"
|
|
25717
|
-
});
|
|
25718
|
-
child.on("error", () => resolve15(EXIT_SERVER3));
|
|
25719
|
-
child.on("close", (status) => resolve15(status ?? EXIT_OK2));
|
|
25720
|
-
});
|
|
25721
|
-
}
|
|
25722
|
-
function readBody(req) {
|
|
25723
|
-
return new Promise((resolve15, reject) => {
|
|
25724
|
-
let raw = "";
|
|
25725
|
-
req.setEncoding("utf8");
|
|
25726
|
-
req.on("data", (chunk) => {
|
|
25727
|
-
raw += chunk;
|
|
25728
|
-
if (raw.length > MAX_BODY_BYTES) {
|
|
25729
|
-
reject(new Error("Request body too large."));
|
|
25730
|
-
req.destroy();
|
|
25731
|
-
}
|
|
25732
|
-
});
|
|
25733
|
-
req.on("end", () => resolve15(raw));
|
|
25734
|
-
req.on("error", reject);
|
|
25735
|
-
});
|
|
25736
|
-
}
|
|
25737
|
-
function writeJson(res, status, payload) {
|
|
25738
|
-
res.writeHead(status, { "content-type": "application/json" });
|
|
25739
|
-
res.end(JSON.stringify(payload));
|
|
25740
|
-
}
|
|
25741
|
-
function startCallbackServer(input2) {
|
|
25742
|
-
const server = (0, import_node_http.createServer)((req, res) => {
|
|
25743
|
-
res.setHeader("Access-Control-Allow-Origin", req.headers.origin ?? "*");
|
|
25744
|
-
res.setHeader("Vary", "Origin");
|
|
25745
|
-
res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
|
|
25746
|
-
res.setHeader("Access-Control-Allow-Headers", "content-type");
|
|
25747
|
-
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
25748
|
-
res.setHeader("Access-Control-Max-Age", "600");
|
|
25749
|
-
if (req.method === "OPTIONS") {
|
|
25750
|
-
res.writeHead(204);
|
|
25751
|
-
res.end();
|
|
25752
|
-
return;
|
|
25753
|
-
}
|
|
25754
|
-
if (req.method !== "POST" || req.url !== "/submit") {
|
|
25755
|
-
writeJson(res, 404, { error: "Not found." });
|
|
25756
|
-
return;
|
|
25757
|
-
}
|
|
25758
|
-
void readBody(req).then((raw) => {
|
|
25759
|
-
let body = null;
|
|
25760
|
-
try {
|
|
25761
|
-
body = JSON.parse(raw);
|
|
25762
|
-
} catch {
|
|
25763
|
-
body = null;
|
|
25764
|
-
}
|
|
25765
|
-
const state = typeof body?.state === "string" ? body.state : "";
|
|
25766
|
-
const prompt = typeof body?.prompt === "string" ? body.prompt.trim() : "";
|
|
25767
|
-
const workflowId = typeof body?.workflow_id === "string" && body.workflow_id.trim() ? body.workflow_id.trim() : null;
|
|
25768
|
-
if (!state || state !== input2.state) {
|
|
25769
|
-
writeJson(res, 403, { error: "Invalid quickstart state token." });
|
|
25770
|
-
return;
|
|
25771
|
-
}
|
|
25772
|
-
if (!prompt) {
|
|
25773
|
-
writeJson(res, 400, { error: "prompt is required." });
|
|
25774
|
-
return;
|
|
25775
|
-
}
|
|
25776
|
-
if (prompt.length > MAX_PROMPT_LENGTH) {
|
|
25777
|
-
writeJson(res, 400, {
|
|
25778
|
-
error: `prompt exceeds ${MAX_PROMPT_LENGTH} characters.`
|
|
25779
|
-
});
|
|
25780
|
-
return;
|
|
25781
|
-
}
|
|
25782
|
-
writeJson(res, 200, { ok: true });
|
|
25783
|
-
setImmediate(() => input2.onSelection({ prompt, workflowId }));
|
|
25784
|
-
}).catch(() => {
|
|
25785
|
-
writeJson(res, 400, { error: "Invalid request body." });
|
|
25786
|
-
});
|
|
25787
|
-
});
|
|
25788
|
-
return new Promise((resolve15, reject) => {
|
|
25789
|
-
server.once("error", reject);
|
|
25790
|
-
server.listen(0, "127.0.0.1", () => {
|
|
25791
|
-
const address = server.address();
|
|
25792
|
-
if (!address || typeof address === "string") {
|
|
25793
|
-
reject(new Error("Failed to bind quickstart callback server."));
|
|
25794
|
-
return;
|
|
25795
|
-
}
|
|
25796
|
-
resolve15({ server, port: address.port });
|
|
25797
|
-
});
|
|
25798
|
-
});
|
|
25799
|
-
}
|
|
25738
|
+
|
|
25739
|
+
// src/cli/commands/quickstart.ts
|
|
25800
25740
|
async function handleQuickstart(options) {
|
|
25801
25741
|
const jsonOutput = shouldEmitJson(options.json === true);
|
|
25802
|
-
const
|
|
25803
|
-
|
|
25804
|
-
|
|
25805
|
-
|
|
25806
|
-
);
|
|
25807
|
-
let apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
25808
|
-
if (!apiKey) {
|
|
25809
|
-
if (interactive) {
|
|
25810
|
-
console.error("Not connected yet \u2014 registering this device first.");
|
|
25811
|
-
const registerExit = await handleRegister([]);
|
|
25812
|
-
if (registerExit !== EXIT_OK2) return registerExit;
|
|
25813
|
-
apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
25814
|
-
}
|
|
25815
|
-
if (!apiKey) {
|
|
25816
|
-
console.error("Not connected. Run: deepline auth register");
|
|
25817
|
-
return EXIT_AUTH2;
|
|
25818
|
-
}
|
|
25819
|
-
}
|
|
25820
|
-
const state = (0, import_node_crypto6.randomBytes)(32).toString("hex");
|
|
25821
|
-
let resolveSelection;
|
|
25822
|
-
const selectionPromise = new Promise((resolve15) => {
|
|
25823
|
-
resolveSelection = resolve15;
|
|
25824
|
-
});
|
|
25825
|
-
let callback;
|
|
25826
|
-
try {
|
|
25827
|
-
callback = await startCallbackServer({
|
|
25828
|
-
state,
|
|
25829
|
-
onSelection: (selection) => resolveSelection(selection)
|
|
25830
|
-
});
|
|
25831
|
-
} catch (error) {
|
|
25832
|
-
console.error(
|
|
25833
|
-
`Could not start the local quickstart listener: ${error instanceof Error ? error.message : String(error)}`
|
|
25834
|
-
);
|
|
25835
|
-
return EXIT_SERVER3;
|
|
25836
|
-
}
|
|
25837
|
-
const quickstartUrl = `${baseUrl}/cli/quickstart?cb=${callback.port}&state=${state}`;
|
|
25838
|
-
console.error(" Opening the recipe picker in your browser.");
|
|
25839
|
-
console.error(` If it didn't open, cmd+click: ${quickstartUrl}`);
|
|
25840
|
-
if (options.open !== false) {
|
|
25841
|
-
openInBrowser(quickstartUrl);
|
|
25842
|
-
}
|
|
25843
|
-
const timeoutSeconds = Number.parseInt(options.timeout ?? "300", 10);
|
|
25844
|
-
const timeoutMs = (Number.isFinite(timeoutSeconds) && timeoutSeconds > 0 ? timeoutSeconds : 300) * 1e3;
|
|
25845
|
-
const timeoutHandle = setTimeout(
|
|
25846
|
-
() => resolveSelection("timeout"),
|
|
25847
|
-
timeoutMs
|
|
25848
|
-
);
|
|
25849
|
-
const progress = createCliProgress(!jsonOutput);
|
|
25850
|
-
progress.phase("waiting for your pick in the browser (Ctrl+C to skip)");
|
|
25851
|
-
const onSigint = () => resolveSelection("sigint");
|
|
25852
|
-
process.once("SIGINT", onSigint);
|
|
25853
|
-
const outcome = await selectionPromise;
|
|
25854
|
-
clearTimeout(timeoutHandle);
|
|
25855
|
-
process.removeListener("SIGINT", onSigint);
|
|
25856
|
-
callback.server.close();
|
|
25857
|
-
if (outcome === "sigint") {
|
|
25858
|
-
progress.fail();
|
|
25859
|
-
console.error("\nSkipped \u2014 run `deepline quickstart` anytime.");
|
|
25860
|
-
return EXIT_OK2;
|
|
25861
|
-
}
|
|
25862
|
-
if (outcome === "timeout") {
|
|
25863
|
-
progress.fail();
|
|
25864
|
-
console.error(
|
|
25865
|
-
"Timed out waiting for a selection. Run: deepline quickstart"
|
|
25866
|
-
);
|
|
25867
|
-
return EXIT_AUTH2;
|
|
25868
|
-
}
|
|
25869
|
-
progress.complete();
|
|
25870
|
-
const { prompt, workflowId } = outcome;
|
|
25871
|
-
const claudeCommand = `claude ${shellQuote3(prompt)}`;
|
|
25872
|
-
const claudeAvailable = hasClaudeBinary();
|
|
25873
|
-
const willLaunch = options.launch !== false && !jsonOutput && interactive && claudeAvailable;
|
|
25742
|
+
const gettingStarted = {
|
|
25743
|
+
skill: DEEPLINE_GTM_SKILL,
|
|
25744
|
+
examples: DEEPLINE_GTM_STARTER_PROMPTS
|
|
25745
|
+
};
|
|
25874
25746
|
printCommandEnvelope(
|
|
25875
25747
|
{
|
|
25876
|
-
|
|
25877
|
-
|
|
25878
|
-
|
|
25879
|
-
|
|
25880
|
-
|
|
25881
|
-
|
|
25748
|
+
ok: true,
|
|
25749
|
+
status: "deprecated",
|
|
25750
|
+
code: "QUICKSTART_DEPRECATED",
|
|
25751
|
+
exitCode: 0,
|
|
25752
|
+
message: "`deepline quickstart` is deprecated. Start with the installed /deepline-gtm skill in your agent.",
|
|
25753
|
+
deprecatedCommand: "deepline quickstart",
|
|
25754
|
+
replacement: DEEPLINE_GTM_SKILL,
|
|
25755
|
+
gettingStarted,
|
|
25756
|
+
next: DEEPLINE_GTM_SKILL,
|
|
25882
25757
|
render: {
|
|
25883
25758
|
sections: [
|
|
25884
25759
|
{
|
|
25885
|
-
title: "quickstart",
|
|
25760
|
+
title: "quickstart deprecated",
|
|
25886
25761
|
lines: [
|
|
25887
|
-
|
|
25888
|
-
|
|
25762
|
+
`Use ${DEEPLINE_GTM_SKILL} in your agent instead.`,
|
|
25763
|
+
...DEEPLINE_GTM_STARTER_PROMPTS.map(
|
|
25764
|
+
(example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
|
|
25765
|
+
)
|
|
25889
25766
|
]
|
|
25890
25767
|
}
|
|
25891
|
-
]
|
|
25892
|
-
actions: [{ label: "Run", command: claudeCommand }]
|
|
25768
|
+
]
|
|
25893
25769
|
}
|
|
25894
25770
|
},
|
|
25895
25771
|
{ json: jsonOutput }
|
|
25896
25772
|
);
|
|
25897
|
-
|
|
25898
|
-
return launchClaude(prompt);
|
|
25899
|
-
}
|
|
25900
|
-
return EXIT_OK2;
|
|
25773
|
+
return 0;
|
|
25901
25774
|
}
|
|
25902
25775
|
function registerQuickstartCommands(program) {
|
|
25903
25776
|
program.command("quickstart").description(
|
|
25904
|
-
"
|
|
25777
|
+
"Deprecated compatibility command. Use /deepline-gtm in your agent."
|
|
25905
25778
|
).addHelpText(
|
|
25906
25779
|
"after",
|
|
25907
25780
|
`
|
|
25908
|
-
|
|
25909
|
-
|
|
25910
|
-
|
|
25911
|
-
on the same machine as the CLI. Once a recipe arrives, the CLI prints the
|
|
25912
|
-
matching claude command and, when Claude Code is installed and the shell is
|
|
25913
|
-
interactive, launches it directly. Press Ctrl+C while waiting to skip.
|
|
25914
|
-
|
|
25915
|
-
Examples:
|
|
25916
|
-
deepline quickstart
|
|
25917
|
-
deepline quickstart --no-open
|
|
25918
|
-
deepline quickstart --no-launch --json
|
|
25919
|
-
deepline quickstart --timeout 120
|
|
25781
|
+
Deprecated:
|
|
25782
|
+
Use the installed /deepline-gtm skill in your agent. This compatibility
|
|
25783
|
+
command prints three starter prompts and no longer opens a browser.
|
|
25920
25784
|
`
|
|
25921
|
-
).option("--json", "Emit JSON output. Also automatic when stdout is piped").option("--no-open", "
|
|
25922
|
-
"--timeout <seconds>",
|
|
25923
|
-
"Maximum seconds to wait for a selection",
|
|
25924
|
-
"300"
|
|
25925
|
-
).action(async (options) => {
|
|
25785
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").option("--no-open", "Deprecated compatibility option").option("--no-launch", "Deprecated compatibility option").option("--timeout <seconds>", "Deprecated compatibility option").action(async (options) => {
|
|
25926
25786
|
process.exitCode = await handleQuickstart(options);
|
|
25927
25787
|
});
|
|
25928
25788
|
}
|
|
@@ -27883,9 +27743,9 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
27883
27743
|
const getDatasetItemsTool = stringField2(getDatasetItems, "tool");
|
|
27884
27744
|
const getDatasetItemsPayload = recordField2(getDatasetItems, "payload");
|
|
27885
27745
|
return {
|
|
27886
|
-
getActorRun: `deepline tools execute ${getActorRunTool} --input ${
|
|
27746
|
+
getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote3(JSON.stringify(getActorRunPayload))} --json`,
|
|
27887
27747
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
27888
|
-
getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${
|
|
27748
|
+
getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote3(JSON.stringify(getDatasetItemsPayload))} --json`
|
|
27889
27749
|
} : {}
|
|
27890
27750
|
};
|
|
27891
27751
|
}
|
|
@@ -28058,7 +27918,7 @@ function parseExecuteOptions(args) {
|
|
|
28058
27918
|
function safeFileStem(value) {
|
|
28059
27919
|
return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
|
|
28060
27920
|
}
|
|
28061
|
-
function
|
|
27921
|
+
function shellQuote3(value) {
|
|
28062
27922
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
28063
27923
|
}
|
|
28064
27924
|
function powerShellQuote(value) {
|
|
@@ -28128,7 +27988,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
28128
27988
|
path: scriptPath,
|
|
28129
27989
|
sourceCode: script,
|
|
28130
27990
|
projectDir,
|
|
28131
|
-
macCopyCommand: `mkdir -p ${
|
|
27991
|
+
macCopyCommand: `mkdir -p ${shellQuote3(projectDir)} && cp ${shellQuote3(scriptPath)} ${shellQuote3(`${projectDir}/${fileName}`)}`,
|
|
28132
27992
|
windowsCopyCommand: `New-Item -ItemType Directory -Force -Path ${powerShellQuote(projectDir.replace(/\//g, "\\"))} | Out-Null; Copy-Item -LiteralPath ${powerShellQuote(scriptPath)} -Destination ${powerShellQuote(`${projectDir.replace(/\//g, "\\")}\\${fileName}`)}`
|
|
28133
27993
|
};
|
|
28134
27994
|
}
|
|
@@ -28152,7 +28012,7 @@ function buildToolExecuteBaseEnvelope(input2) {
|
|
|
28152
28012
|
envelope,
|
|
28153
28013
|
"output"
|
|
28154
28014
|
);
|
|
28155
|
-
const inspectCommand = `deepline tools execute ${input2.toolId} --input ${
|
|
28015
|
+
const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote3(JSON.stringify(input2.params))} --json`;
|
|
28156
28016
|
const actions = input2.listConversion ? [
|
|
28157
28017
|
{
|
|
28158
28018
|
label: "next",
|
|
@@ -28469,7 +28329,7 @@ var import_promises5 = require("fs/promises");
|
|
|
28469
28329
|
var import_node_path17 = require("path");
|
|
28470
28330
|
|
|
28471
28331
|
// src/cli/workflow-to-play.ts
|
|
28472
|
-
var
|
|
28332
|
+
var import_node_crypto6 = require("crypto");
|
|
28473
28333
|
|
|
28474
28334
|
// ../shared_libs/plays/secret-guardrails.ts
|
|
28475
28335
|
var SECRET_ENV_PATTERN = /\bprocess(?:\.env|\[['"]env['"]\])(?:\.|\[['"])([A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|PRIVATE[_-]?KEY|ACCESS[_-]?KEY)[A-Z0-9_]*)(?:['"]\])?/g;
|
|
@@ -28621,7 +28481,7 @@ function sanitizePlayNameSegment(value) {
|
|
|
28621
28481
|
}
|
|
28622
28482
|
function deriveWorkflowPlayName(workflowName) {
|
|
28623
28483
|
const base = sanitizePlayNameSegment(workflowName) || "workflow";
|
|
28624
|
-
const suffix = (0,
|
|
28484
|
+
const suffix = (0, import_node_crypto6.createHash)("sha256").update(workflowName).digest("hex").slice(0, 8);
|
|
28625
28485
|
const reserved = suffix.length + 1;
|
|
28626
28486
|
const allowedBase = Math.max(1, MAX_PLAY_NAME_LENGTH - reserved);
|
|
28627
28487
|
let name = `${base.slice(0, allowedBase)}_${suffix}`;
|
|
@@ -29006,13 +28866,13 @@ Notes:
|
|
|
29006
28866
|
}
|
|
29007
28867
|
|
|
29008
28868
|
// src/cli/commands/update.ts
|
|
29009
|
-
var
|
|
28869
|
+
var import_node_child_process3 = require("child_process");
|
|
29010
28870
|
var import_node_fs17 = require("fs");
|
|
29011
28871
|
var import_node_os14 = require("os");
|
|
29012
28872
|
var import_node_path19 = require("path");
|
|
29013
28873
|
|
|
29014
28874
|
// src/cli/commands/skills.ts
|
|
29015
|
-
var
|
|
28875
|
+
var import_node_child_process2 = require("child_process");
|
|
29016
28876
|
var import_node_fs16 = require("fs");
|
|
29017
28877
|
var import_node_os13 = require("os");
|
|
29018
28878
|
var import_node_path18 = require("path");
|
|
@@ -29286,7 +29146,7 @@ function readSkillsInstallState(path) {
|
|
|
29286
29146
|
}
|
|
29287
29147
|
function runProcess(command, args, cwd) {
|
|
29288
29148
|
return new Promise((resolve15, reject) => {
|
|
29289
|
-
const child = (0,
|
|
29149
|
+
const child = (0, import_node_child_process2.spawn)(command, args, {
|
|
29290
29150
|
cwd,
|
|
29291
29151
|
env: process.env,
|
|
29292
29152
|
stdio: ["ignore", "ignore", "pipe"],
|
|
@@ -29526,14 +29386,14 @@ function posixShellQuote(value) {
|
|
|
29526
29386
|
function windowsCmdQuote(value) {
|
|
29527
29387
|
return `"${value.replace(/"/g, '""')}"`;
|
|
29528
29388
|
}
|
|
29529
|
-
function
|
|
29389
|
+
function shellQuote4(value) {
|
|
29530
29390
|
if (process.platform === "win32") {
|
|
29531
29391
|
return /^[A-Za-z0-9_./:@%+=,-]+$/.test(value) ? value : windowsCmdQuote(value);
|
|
29532
29392
|
}
|
|
29533
29393
|
return posixShellQuote(value);
|
|
29534
29394
|
}
|
|
29535
29395
|
function buildSourceUpdateCommand(sourceRoot) {
|
|
29536
|
-
const quotedRoot =
|
|
29396
|
+
const quotedRoot = shellQuote4(sourceRoot);
|
|
29537
29397
|
const cdCommand = process.platform === "win32" ? `cd /d ${quotedRoot}` : `cd ${quotedRoot}`;
|
|
29538
29398
|
return `${cdCommand} && git fetch origin main --tags && git merge --ff-only origin/main`;
|
|
29539
29399
|
}
|
|
@@ -29545,7 +29405,7 @@ function buildSidecarProjectConfigCommand(versionDir, nodeBin) {
|
|
|
29545
29405
|
"fs.mkdirSync(dir,{recursive:true});",
|
|
29546
29406
|
`fs.writeFileSync(path.join(dir,'package.json'),${JSON.stringify(NPM_SDK_SIDECAR_PACKAGE_JSON)});`
|
|
29547
29407
|
].join("");
|
|
29548
|
-
return `${
|
|
29408
|
+
return `${shellQuote4(nodeBin)} -e ${shellQuote4(script)} ${shellQuote4(versionDir)}`;
|
|
29549
29409
|
}
|
|
29550
29410
|
function sidecarStateDir(input2) {
|
|
29551
29411
|
const scope = input2.env.DEEPLINE_CONFIG_SCOPE?.trim();
|
|
@@ -29608,7 +29468,7 @@ function resolvePythonSidecarUpdatePlan(options) {
|
|
|
29608
29468
|
const npmCommand = "npm";
|
|
29609
29469
|
const registryUrl = sidecarRegistryUrl(hostUrl);
|
|
29610
29470
|
const versionDir = (0, import_node_path19.join)(stateDir, "versions", "<version>");
|
|
29611
|
-
const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${
|
|
29471
|
+
const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote4(versionDir)} --registry ${shellQuote4(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote4).join(" ")} ${shellQuote4(packageSpec)}`;
|
|
29612
29472
|
return {
|
|
29613
29473
|
kind: "python-sidecar",
|
|
29614
29474
|
stateDir,
|
|
@@ -29692,7 +29552,7 @@ function resolveUpdatePlan(options = {}) {
|
|
|
29692
29552
|
fallbackRegistryUrl: publicNpmFallbackRegistryUrl(
|
|
29693
29553
|
env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
|
|
29694
29554
|
),
|
|
29695
|
-
manualCommand: `${command} ${args.map(
|
|
29555
|
+
manualCommand: `${command} ${args.map(shellQuote4).join(" ")}`
|
|
29696
29556
|
};
|
|
29697
29557
|
}
|
|
29698
29558
|
var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
|
|
@@ -29812,7 +29672,7 @@ function installedPackageVersion(versionDir) {
|
|
|
29812
29672
|
function runCommand(command, args, env = process.env) {
|
|
29813
29673
|
return new Promise((resolveResult) => {
|
|
29814
29674
|
let output2 = "";
|
|
29815
|
-
const child = (0,
|
|
29675
|
+
const child = (0, import_node_child_process3.spawn)(command, args, {
|
|
29816
29676
|
stdio: ["inherit", "pipe", "pipe"],
|
|
29817
29677
|
shell: process.platform === "win32",
|
|
29818
29678
|
env
|
|
@@ -29897,9 +29757,9 @@ function writeSidecarLauncher(input2) {
|
|
|
29897
29757
|
input2.path,
|
|
29898
29758
|
[
|
|
29899
29759
|
"#!/usr/bin/env sh",
|
|
29900
|
-
`export DEEPLINE_HOST_URL=${
|
|
29901
|
-
`export DEEPLINE_CONFIG_SCOPE=${
|
|
29902
|
-
`exec ${
|
|
29760
|
+
`export DEEPLINE_HOST_URL=${shellQuote4(input2.hostUrl)}`,
|
|
29761
|
+
`export DEEPLINE_CONFIG_SCOPE=${shellQuote4(input2.scope)}`,
|
|
29762
|
+
`exec ${shellQuote4(input2.nodeBin)} ${shellQuote4(input2.entryPath)} "$@"`,
|
|
29903
29763
|
""
|
|
29904
29764
|
].join("\n"),
|
|
29905
29765
|
{ encoding: "utf8", mode: 493 }
|
|
@@ -30111,7 +29971,7 @@ Examples:
|
|
|
30111
29971
|
}
|
|
30112
29972
|
|
|
30113
29973
|
// src/cli/commands/setup.ts
|
|
30114
|
-
var
|
|
29974
|
+
var import_node_child_process4 = require("child_process");
|
|
30115
29975
|
var import_node_fs18 = require("fs");
|
|
30116
29976
|
var import_node_os15 = require("os");
|
|
30117
29977
|
var import_node_path20 = require("path");
|
|
@@ -30214,6 +30074,15 @@ function resolveScopeRoot(scope) {
|
|
|
30214
30074
|
function authScopeForSetup(scope) {
|
|
30215
30075
|
return scope === "local" ? "folder" : "global";
|
|
30216
30076
|
}
|
|
30077
|
+
function shouldOpenSetupAuthorization(runtime = detectAgentRuntime()) {
|
|
30078
|
+
return runtime !== "claude_cowork";
|
|
30079
|
+
}
|
|
30080
|
+
function openSetupAuthorization(authorizationUrl, options = {}) {
|
|
30081
|
+
const url = authorizationUrl.trim();
|
|
30082
|
+
if (!url || !shouldOpenSetupAuthorization(options.runtime)) return false;
|
|
30083
|
+
(options.open ?? openInBrowser)(url);
|
|
30084
|
+
return true;
|
|
30085
|
+
}
|
|
30217
30086
|
function setupStatePath(baseUrl, scope, root) {
|
|
30218
30087
|
return scope === "local" && root ? (0, import_node_path20.join)(root, ".deepline", "setup", "state.json") : (0, import_node_path20.join)(sdkCliStateDirPath(baseUrl), "setup.json");
|
|
30219
30088
|
}
|
|
@@ -30296,7 +30165,7 @@ function removeKnownLegacyPaths(baseUrl) {
|
|
|
30296
30165
|
return removed;
|
|
30297
30166
|
}
|
|
30298
30167
|
function resolvePathCommands(command) {
|
|
30299
|
-
const lookup = (0,
|
|
30168
|
+
const lookup = (0, import_node_child_process4.spawnSync)(
|
|
30300
30169
|
process.platform === "win32" ? "where" : "which",
|
|
30301
30170
|
process.platform === "win32" ? [command] : ["-a", command],
|
|
30302
30171
|
{ encoding: "utf8", shell: process.platform === "win32" }
|
|
@@ -30311,7 +30180,7 @@ function resolvePathCommand(command) {
|
|
|
30311
30180
|
return resolvePathCommands(command)[0] ?? null;
|
|
30312
30181
|
}
|
|
30313
30182
|
function resolvePersistentGlobalCommand() {
|
|
30314
|
-
const prefix = (0,
|
|
30183
|
+
const prefix = (0, import_node_child_process4.spawnSync)("npm", ["prefix", "-g"], { encoding: "utf8" });
|
|
30315
30184
|
if (prefix.status !== 0) return null;
|
|
30316
30185
|
const root = String(prefix.stdout ?? "").trim();
|
|
30317
30186
|
if (!root) return null;
|
|
@@ -30403,9 +30272,6 @@ function rollbackCommand(scope, root) {
|
|
|
30403
30272
|
const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify((0, import_node_path20.join)(root, ".deepline", "runtime"))}` : "";
|
|
30404
30273
|
return `npm install -g${prefix} --no-audit --no-fund --include=optional --allow-scripts=esbuild deepline@${SDK_VERSION}`;
|
|
30405
30274
|
}
|
|
30406
|
-
function setupQuickstartCommand(baseUrl) {
|
|
30407
|
-
return baseUrl === "https://code.deepline.com" ? "deepline quickstart" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} deepline quickstart`;
|
|
30408
|
-
}
|
|
30409
30275
|
function setupResumeCommand(baseUrl, scope) {
|
|
30410
30276
|
const hostPrefix = baseUrl === "https://code.deepline.com" ? "" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} `;
|
|
30411
30277
|
return `${hostPrefix}deepline setup --scope ${scope} --json`;
|
|
@@ -30555,7 +30421,7 @@ async function runDoctorCommand(options) {
|
|
|
30555
30421
|
root,
|
|
30556
30422
|
authStatus
|
|
30557
30423
|
});
|
|
30558
|
-
const
|
|
30424
|
+
const gettingStarted = deeplineGtmGettingStartedPayload();
|
|
30559
30425
|
printCommandEnvelope(
|
|
30560
30426
|
{
|
|
30561
30427
|
ok,
|
|
@@ -30563,7 +30429,8 @@ async function runDoctorCommand(options) {
|
|
|
30563
30429
|
code: ok ? "DOCTOR_OK" : "DOCTOR_FAILED",
|
|
30564
30430
|
exitCode: ok ? 0 : 7,
|
|
30565
30431
|
checks,
|
|
30566
|
-
next: ok ?
|
|
30432
|
+
next: ok ? DEEPLINE_GTM_SKILL : "Review failed checks, then rerun: deepline doctor --json",
|
|
30433
|
+
...ok ? { gettingStarted } : {},
|
|
30567
30434
|
render: {
|
|
30568
30435
|
sections: [
|
|
30569
30436
|
{
|
|
@@ -30592,6 +30459,7 @@ function pendingResult(input2) {
|
|
|
30592
30459
|
phases: input2.phases
|
|
30593
30460
|
});
|
|
30594
30461
|
if (input2.authorizationUrl) {
|
|
30462
|
+
openSetupAuthorization(input2.authorizationUrl);
|
|
30595
30463
|
process.stderr.write(`Authorize Deepline: ${input2.authorizationUrl}
|
|
30596
30464
|
`);
|
|
30597
30465
|
}
|
|
@@ -30675,7 +30543,7 @@ async function runSetupCommand(options) {
|
|
|
30675
30543
|
json: options.json,
|
|
30676
30544
|
extra: {
|
|
30677
30545
|
persistentPath: globalCli.persistentPath,
|
|
30678
|
-
fallback: "https://code.deepline.com/
|
|
30546
|
+
fallback: "https://code.deepline.com/SKILL.md"
|
|
30679
30547
|
}
|
|
30680
30548
|
});
|
|
30681
30549
|
}
|
|
@@ -30878,14 +30746,15 @@ async function runSetupCommand(options) {
|
|
|
30878
30746
|
root,
|
|
30879
30747
|
authStatus: auth
|
|
30880
30748
|
});
|
|
30881
|
-
const
|
|
30749
|
+
const gettingStarted = deeplineGtmGettingStartedPayload();
|
|
30882
30750
|
const doctorPayload = {
|
|
30883
30751
|
ok: assessment.ok,
|
|
30884
30752
|
status: assessment.ok ? "complete" : "failed",
|
|
30885
30753
|
code: assessment.ok ? "DOCTOR_OK" : "DOCTOR_FAILED",
|
|
30886
30754
|
exitCode: assessment.ok ? 0 : 7,
|
|
30887
30755
|
checks: assessment.checks,
|
|
30888
|
-
next: assessment.ok ?
|
|
30756
|
+
next: assessment.ok ? DEEPLINE_GTM_SKILL : `deepline doctor --scope ${scope} --json`,
|
|
30757
|
+
...assessment.ok ? { gettingStarted } : {}
|
|
30889
30758
|
};
|
|
30890
30759
|
if (!assessment.ok) {
|
|
30891
30760
|
return reportSetupPhaseFailure({
|
|
@@ -30932,14 +30801,19 @@ async function runSetupCommand(options) {
|
|
|
30932
30801
|
currentPhase: null,
|
|
30933
30802
|
failedPhase: null,
|
|
30934
30803
|
resumed,
|
|
30935
|
-
next:
|
|
30804
|
+
next: DEEPLINE_GTM_SKILL,
|
|
30805
|
+
gettingStarted,
|
|
30936
30806
|
render: {
|
|
30937
30807
|
sections: [
|
|
30938
30808
|
{
|
|
30939
30809
|
title: "setup",
|
|
30940
30810
|
lines: [
|
|
30941
30811
|
"Deepline is installed and connected.",
|
|
30942
|
-
`
|
|
30812
|
+
`Use ${DEEPLINE_GTM_SKILL} in your agent.`,
|
|
30813
|
+
...DEEPLINE_GTM_STARTER_PROMPTS.map(
|
|
30814
|
+
(example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
|
|
30815
|
+
),
|
|
30816
|
+
gettingStarted.question
|
|
30943
30817
|
]
|
|
30944
30818
|
}
|
|
30945
30819
|
]
|
|
@@ -30955,7 +30829,7 @@ function registerSetupCommands(program) {
|
|
|
30955
30829
|
`
|
|
30956
30830
|
Notes:
|
|
30957
30831
|
Setup is idempotent. Bare setup resumes the first incomplete or failed phase.
|
|
30958
|
-
It installs skills before auth and does not run
|
|
30832
|
+
It installs skills before auth and does not run a starter workflow.
|
|
30959
30833
|
JSON output includes phase status and an exact retry command.
|
|
30960
30834
|
|
|
30961
30835
|
Examples:
|
|
@@ -31078,7 +30952,7 @@ function unknownCommandNameFromMessage(message) {
|
|
|
31078
30952
|
}
|
|
31079
30953
|
|
|
31080
30954
|
// src/cli/self-update.ts
|
|
31081
|
-
var
|
|
30955
|
+
var import_node_child_process5 = require("child_process");
|
|
31082
30956
|
function envTruthy(name) {
|
|
31083
30957
|
const value = process.env[name]?.trim().toLowerCase();
|
|
31084
30958
|
return value === "1" || value === "true" || value === "yes";
|
|
@@ -31127,7 +31001,7 @@ function relaunchCurrentCommand(plan) {
|
|
|
31127
31001
|
return new Promise((resolve15) => {
|
|
31128
31002
|
const command = plan.kind === "python-sidecar" ? plan.sidecarPath : process.execPath;
|
|
31129
31003
|
const args = plan.kind === "python-sidecar" ? process.argv.slice(2) : process.argv.slice(1);
|
|
31130
|
-
const child = (0,
|
|
31004
|
+
const child = (0, import_node_child_process5.spawn)(command, args, {
|
|
31131
31005
|
stdio: "inherit",
|
|
31132
31006
|
shell: process.platform === "win32",
|
|
31133
31007
|
env: {
|
|
@@ -31192,7 +31066,7 @@ async function maybeAutoUpdateAndRelaunch(response) {
|
|
|
31192
31066
|
}
|
|
31193
31067
|
|
|
31194
31068
|
// src/cli/skills-sync.ts
|
|
31195
|
-
var
|
|
31069
|
+
var import_node_child_process6 = require("child_process");
|
|
31196
31070
|
var import_node_fs19 = require("fs");
|
|
31197
31071
|
var import_node_path21 = require("path");
|
|
31198
31072
|
var CHECK_TIMEOUT_MS2 = 3e3;
|
|
@@ -31335,13 +31209,13 @@ function buildBunxSkillsInstallArgs(baseUrl, skillNames) {
|
|
|
31335
31209
|
});
|
|
31336
31210
|
}
|
|
31337
31211
|
function hasCommand(command) {
|
|
31338
|
-
const result = (0,
|
|
31212
|
+
const result = (0, import_node_child_process6.spawnSync)(command, ["--version"], {
|
|
31339
31213
|
stdio: "ignore",
|
|
31340
31214
|
shell: process.platform === "win32"
|
|
31341
31215
|
});
|
|
31342
31216
|
return result.status === 0;
|
|
31343
31217
|
}
|
|
31344
|
-
function
|
|
31218
|
+
function shellQuote5(arg) {
|
|
31345
31219
|
return `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
31346
31220
|
}
|
|
31347
31221
|
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES) {
|
|
@@ -31351,7 +31225,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
31351
31225
|
commands.push({
|
|
31352
31226
|
command: "bunx",
|
|
31353
31227
|
args: bunxArgs,
|
|
31354
|
-
manualCommand: `bunx ${bunxArgs.map(
|
|
31228
|
+
manualCommand: `bunx ${bunxArgs.map(shellQuote5).join(" ")}`
|
|
31355
31229
|
});
|
|
31356
31230
|
}
|
|
31357
31231
|
if (hasCommand("npx")) {
|
|
@@ -31359,14 +31233,14 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
31359
31233
|
commands.push({
|
|
31360
31234
|
command: "npx",
|
|
31361
31235
|
args: npxArgs,
|
|
31362
|
-
manualCommand: `npx ${npxArgs.map(
|
|
31236
|
+
manualCommand: `npx ${npxArgs.map(shellQuote5).join(" ")}`
|
|
31363
31237
|
});
|
|
31364
31238
|
}
|
|
31365
31239
|
return commands;
|
|
31366
31240
|
}
|
|
31367
31241
|
function runOneSkillsInstall(install) {
|
|
31368
31242
|
return new Promise((resolve15) => {
|
|
31369
|
-
const child = (0,
|
|
31243
|
+
const child = (0, import_node_child_process6.spawn)(install.command, install.args, {
|
|
31370
31244
|
stdio: ["ignore", "ignore", "pipe"],
|
|
31371
31245
|
env: process.env
|
|
31372
31246
|
});
|
|
@@ -31450,7 +31324,7 @@ function runLegacySkillsCleanup() {
|
|
|
31450
31324
|
}
|
|
31451
31325
|
];
|
|
31452
31326
|
for (const candidate of candidates) {
|
|
31453
|
-
const result = (0,
|
|
31327
|
+
const result = (0, import_node_child_process6.spawnSync)(candidate.command, candidate.args, {
|
|
31454
31328
|
stdio: "ignore",
|
|
31455
31329
|
env: process.env,
|
|
31456
31330
|
shell: process.platform === "win32"
|