deepline 0.1.263 → 0.1.265
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 +4 -0
- package/dist/bundling-sources/sdk/src/release.ts +4 -2
- package/dist/bundling-sources/sdk/src/types.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +9 -0
- package/dist/cli/index.js +195 -462
- package/dist/cli/index.mjs +199 -466
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +2 -2
package/dist/cli/index.mjs
CHANGED
|
@@ -701,8 +701,10 @@ var SDK_RELEASE = {
|
|
|
701
701
|
// Deepline-native radars. Older clients must update before discovering,
|
|
702
702
|
// checking, or deploying an unlaunched monitor integration.
|
|
703
703
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
704
|
-
|
|
705
|
-
|
|
704
|
+
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
705
|
+
// Operators use the checkout-local deepline-admin binary instead.
|
|
706
|
+
version: "0.1.265",
|
|
707
|
+
apiContract: "2026-07-admin-cli-local-cutover",
|
|
706
708
|
supportPolicy: {
|
|
707
709
|
minimumSupported: "0.1.53",
|
|
708
710
|
deprecatedBelow: "0.1.219",
|
|
@@ -2168,10 +2170,10 @@ var OBSERVER_LOG_PAGE_QUERY = "runObservers:getRunLogPageForObserver";
|
|
|
2168
2170
|
function errorText(error) {
|
|
2169
2171
|
return error instanceof Error ? error.message : String(error);
|
|
2170
2172
|
}
|
|
2171
|
-
async function mintRunObserveGrant(
|
|
2173
|
+
async function mintRunObserveGrant(http, runId) {
|
|
2172
2174
|
let response;
|
|
2173
2175
|
try {
|
|
2174
|
-
response = await
|
|
2176
|
+
response = await http.post(
|
|
2175
2177
|
`/api/v2/runs/${encodeURIComponent(runId)}/observe-grant`,
|
|
2176
2178
|
{}
|
|
2177
2179
|
);
|
|
@@ -2235,8 +2237,8 @@ async function backfillLogGap(input2) {
|
|
|
2235
2237
|
return lines;
|
|
2236
2238
|
}
|
|
2237
2239
|
async function* observeRunEvents(options) {
|
|
2238
|
-
const { http
|
|
2239
|
-
let grant = await mintRunObserveGrant(
|
|
2240
|
+
const { http, runId } = options;
|
|
2241
|
+
let grant = await mintRunObserveGrant(http, runId);
|
|
2240
2242
|
let convexBrowser;
|
|
2241
2243
|
let convexServer;
|
|
2242
2244
|
try {
|
|
@@ -2299,7 +2301,7 @@ async function* observeRunEvents(options) {
|
|
|
2299
2301
|
lastForcedRefreshAt = now;
|
|
2300
2302
|
}
|
|
2301
2303
|
try {
|
|
2302
|
-
grant = await mintRunObserveGrant(
|
|
2304
|
+
grant = await mintRunObserveGrant(http, runId);
|
|
2303
2305
|
return grant.token;
|
|
2304
2306
|
} catch (error) {
|
|
2305
2307
|
push({ kind: "error", error });
|
|
@@ -3051,6 +3053,9 @@ var DeeplineClient = class {
|
|
|
3051
3053
|
if (options?.categories?.trim()) {
|
|
3052
3054
|
params.set("categories", options.categories.trim());
|
|
3053
3055
|
}
|
|
3056
|
+
if (options?.tags?.trim()) {
|
|
3057
|
+
params.set("tags", options.tags.trim());
|
|
3058
|
+
}
|
|
3054
3059
|
if (options?.grep?.trim()) {
|
|
3055
3060
|
params.set("grep", options.grep.trim());
|
|
3056
3061
|
params.set("grep_mode", options.grepMode ?? "all");
|
|
@@ -4930,6 +4935,17 @@ function enforceSdkCompatibilityResponse(response) {
|
|
|
4930
4935
|
}
|
|
4931
4936
|
}
|
|
4932
4937
|
|
|
4938
|
+
// src/cli/commands/auth.ts
|
|
4939
|
+
import {
|
|
4940
|
+
existsSync as existsSync5,
|
|
4941
|
+
mkdirSync as mkdirSync4,
|
|
4942
|
+
readFileSync as readFileSync5,
|
|
4943
|
+
rmSync as rmSync2,
|
|
4944
|
+
writeFileSync as writeFileSync4
|
|
4945
|
+
} from "fs";
|
|
4946
|
+
import { hostname } from "os";
|
|
4947
|
+
import { dirname as dirname4, join as join5 } from "path";
|
|
4948
|
+
|
|
4933
4949
|
// src/cli/utils.ts
|
|
4934
4950
|
import { createHash } from "crypto";
|
|
4935
4951
|
import {
|
|
@@ -5534,6 +5550,7 @@ function errorToJsonPayload(error) {
|
|
|
5534
5550
|
const maybeRecord = error && typeof error === "object" ? error : null;
|
|
5535
5551
|
const code = typeof maybeRecord?.code === "string" ? maybeRecord.code : error instanceof SyntaxError ? "INVALID_JSON" : "CLI_ERROR";
|
|
5536
5552
|
const details = {};
|
|
5553
|
+
const exitCode = typeof maybeRecord?.exitCode === "number" ? maybeRecord.exitCode : void 0;
|
|
5537
5554
|
if (typeof maybeRecord?.statusCode === "number") {
|
|
5538
5555
|
details.statusCode = maybeRecord.statusCode;
|
|
5539
5556
|
}
|
|
@@ -5548,6 +5565,7 @@ function errorToJsonPayload(error) {
|
|
|
5548
5565
|
}
|
|
5549
5566
|
return {
|
|
5550
5567
|
ok: false,
|
|
5568
|
+
...exitCode !== void 0 ? { exitCode } : {},
|
|
5551
5569
|
error: {
|
|
5552
5570
|
message,
|
|
5553
5571
|
code,
|
|
@@ -5611,145 +5629,7 @@ function printCommandEnvelope(envelope, options = {}) {
|
|
|
5611
5629
|
process.stdout.write(options.text ?? renderCommandEnvelopeText(envelope));
|
|
5612
5630
|
}
|
|
5613
5631
|
|
|
5614
|
-
// src/cli/commands/admin.ts
|
|
5615
|
-
function laneStatusLine(input2) {
|
|
5616
|
-
if (input2.lane) {
|
|
5617
|
-
return `status: ${input2.lane.status}${input2.lane.active ? " (active)" : ""}`;
|
|
5618
|
-
}
|
|
5619
|
-
return input2.registration ? `status: ${input2.registration.status}` : "status: (not in registry)";
|
|
5620
|
-
}
|
|
5621
|
-
function normalizeEnvironment(value) {
|
|
5622
|
-
const trimmed = value?.trim().toLowerCase();
|
|
5623
|
-
if (!trimmed || trimmed === "production" || trimmed === "prod") {
|
|
5624
|
-
return "production";
|
|
5625
|
-
}
|
|
5626
|
-
if (trimmed === "preview") return "preview";
|
|
5627
|
-
throw new Error(
|
|
5628
|
-
`Invalid --environment "${value}". Expected production or preview.`
|
|
5629
|
-
);
|
|
5630
|
-
}
|
|
5631
|
-
function http() {
|
|
5632
|
-
return new HttpClient(resolveConfig());
|
|
5633
|
-
}
|
|
5634
|
-
function laneLine(lane) {
|
|
5635
|
-
const flag = lane.active ? "* " : " ";
|
|
5636
|
-
const depth = lane.queueDepth.empty ? "empty" : `${lane.queueDepth.queuedTasks} tasks / ${lane.queueDepth.nonTerminalRuns} runs`;
|
|
5637
|
-
return `${flag}${lane.releaseId} [${lane.status}] queue=${lane.queue} depth=${depth}`;
|
|
5638
|
-
}
|
|
5639
|
-
async function handleLanesList(options) {
|
|
5640
|
-
const environment = normalizeEnvironment(options.environment);
|
|
5641
|
-
const payload = await http().get(
|
|
5642
|
-
`/api/v2/admin/runtime/lanes?environment=${environment}`
|
|
5643
|
-
);
|
|
5644
|
-
printCommandEnvelope(
|
|
5645
|
-
{
|
|
5646
|
-
...payload,
|
|
5647
|
-
render: {
|
|
5648
|
-
sections: [
|
|
5649
|
-
{
|
|
5650
|
-
title: `Absurd lanes (${environment}):`,
|
|
5651
|
-
lines: payload.lanes.length > 0 ? payload.lanes.map(laneLine) : ["(no registered lanes)"]
|
|
5652
|
-
}
|
|
5653
|
-
]
|
|
5654
|
-
}
|
|
5655
|
-
},
|
|
5656
|
-
{ json: options.json }
|
|
5657
|
-
);
|
|
5658
|
-
}
|
|
5659
|
-
async function handleLanesShow(releaseId, options) {
|
|
5660
|
-
const environment = normalizeEnvironment(options.environment);
|
|
5661
|
-
const payload = await http().get(
|
|
5662
|
-
`/api/v2/admin/runtime/lanes?environment=${environment}&release=${encodeURIComponent(releaseId)}`
|
|
5663
|
-
);
|
|
5664
|
-
printCommandEnvelope(
|
|
5665
|
-
{
|
|
5666
|
-
...payload,
|
|
5667
|
-
render: {
|
|
5668
|
-
sections: [
|
|
5669
|
-
{
|
|
5670
|
-
title: `Lane ${releaseId} (${environment}):`,
|
|
5671
|
-
lines: [
|
|
5672
|
-
`registered: ${payload.registered}`,
|
|
5673
|
-
laneStatusLine(payload),
|
|
5674
|
-
`queue: ${payload.retireCheck.queue}`,
|
|
5675
|
-
`queued tasks: ${payload.retireCheck.queuedTasks}`,
|
|
5676
|
-
`non-terminal runs: ${payload.retireCheck.nonTerminalRuns}`,
|
|
5677
|
-
`retirable: ${payload.retireCheck.retirable}`
|
|
5678
|
-
]
|
|
5679
|
-
}
|
|
5680
|
-
]
|
|
5681
|
-
}
|
|
5682
|
-
},
|
|
5683
|
-
{ json: options.json }
|
|
5684
|
-
);
|
|
5685
|
-
}
|
|
5686
|
-
async function handleLanesRetireCheck(releaseId, options) {
|
|
5687
|
-
const environment = normalizeEnvironment(options.environment);
|
|
5688
|
-
const payload = await http().get(
|
|
5689
|
-
`/api/v2/admin/runtime/lanes?environment=${environment}&release=${encodeURIComponent(releaseId)}`
|
|
5690
|
-
);
|
|
5691
|
-
printCommandEnvelope(
|
|
5692
|
-
{
|
|
5693
|
-
...payload,
|
|
5694
|
-
render: {
|
|
5695
|
-
sections: [
|
|
5696
|
-
{
|
|
5697
|
-
title: `Retire check ${releaseId} (${environment}):`,
|
|
5698
|
-
lines: [
|
|
5699
|
-
payload.retireCheck.retirable ? "retirable: yes (lane queue empty)" : `retirable: no (${payload.retireCheck.queuedTasks} tasks, ${payload.retireCheck.nonTerminalRuns} runs pending)`
|
|
5700
|
-
]
|
|
5701
|
-
}
|
|
5702
|
-
]
|
|
5703
|
-
}
|
|
5704
|
-
},
|
|
5705
|
-
{ json: options.json }
|
|
5706
|
-
);
|
|
5707
|
-
}
|
|
5708
|
-
async function handleReleasesActivate(releaseId, options) {
|
|
5709
|
-
const environment = normalizeEnvironment(options.environment);
|
|
5710
|
-
const payload = await http().post(
|
|
5711
|
-
"/api/v2/admin/runtime/releases",
|
|
5712
|
-
{
|
|
5713
|
-
releaseId,
|
|
5714
|
-
environment,
|
|
5715
|
-
schedulerBackend: options.schedulerBackend ?? "absurd"
|
|
5716
|
-
}
|
|
5717
|
-
);
|
|
5718
|
-
printCommandEnvelope(
|
|
5719
|
-
{
|
|
5720
|
-
...payload,
|
|
5721
|
-
render: {
|
|
5722
|
-
sections: [
|
|
5723
|
-
{
|
|
5724
|
-
title: `Activated release ${releaseId} (${environment}).`,
|
|
5725
|
-
lines: ["Runtime release pointer flipped to this lane."]
|
|
5726
|
-
}
|
|
5727
|
-
]
|
|
5728
|
-
}
|
|
5729
|
-
},
|
|
5730
|
-
{ json: options.json }
|
|
5731
|
-
);
|
|
5732
|
-
}
|
|
5733
|
-
function registerAdminCommands(program) {
|
|
5734
|
-
const admin = program.command("admin").description("Platform-admin operations (runtime lanes, releases).");
|
|
5735
|
-
const lanes = admin.command("lanes").description("Inspect Absurd runtime release lanes.");
|
|
5736
|
-
lanes.command("list").description("List all registered Absurd lanes with queue depth.").option("--environment <env>", "production (default) or preview").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleLanesList);
|
|
5737
|
-
lanes.command("show <releaseId>").description("Show one lane and its retire-gate depth.").option("--environment <env>", "production (default) or preview").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleLanesShow);
|
|
5738
|
-
lanes.command("retire-check <releaseId>").description("Check whether a lane is safe to retire (queue empty).").option("--environment <env>", "production (default) or preview").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleLanesRetireCheck);
|
|
5739
|
-
const releases = admin.command("releases").description("Manage the active runtime release pointer.");
|
|
5740
|
-
releases.command("activate <releaseId>").description("Activate a prior registered Absurd release lane.").option("--environment <env>", "production (default) or preview").option("--scheduler-backend <backend>", "runtime scheduler (absurd only)").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(handleReleasesActivate);
|
|
5741
|
-
}
|
|
5742
|
-
|
|
5743
5632
|
// src/cli/commands/auth.ts
|
|
5744
|
-
import {
|
|
5745
|
-
existsSync as existsSync5,
|
|
5746
|
-
mkdirSync as mkdirSync4,
|
|
5747
|
-
readFileSync as readFileSync5,
|
|
5748
|
-
rmSync as rmSync2,
|
|
5749
|
-
writeFileSync as writeFileSync4
|
|
5750
|
-
} from "fs";
|
|
5751
|
-
import { hostname } from "os";
|
|
5752
|
-
import { dirname as dirname4, join as join5 } from "path";
|
|
5753
5633
|
var EXIT_OK = 0;
|
|
5754
5634
|
var EXIT_AUTH = 3;
|
|
5755
5635
|
var EXIT_SERVER = 5;
|
|
@@ -6728,8 +6608,8 @@ function defaultLedgerExportPath() {
|
|
|
6728
6608
|
);
|
|
6729
6609
|
}
|
|
6730
6610
|
async function handleBalance(options) {
|
|
6731
|
-
const { http
|
|
6732
|
-
const payload = await
|
|
6611
|
+
const { http } = getAuthedHttpClient();
|
|
6612
|
+
const payload = await http.get(
|
|
6733
6613
|
"/api/v2/billing/balance"
|
|
6734
6614
|
);
|
|
6735
6615
|
const status = String(payload.balance_status || "");
|
|
@@ -6763,13 +6643,13 @@ async function handleBalance(options) {
|
|
|
6763
6643
|
return;
|
|
6764
6644
|
}
|
|
6765
6645
|
async function handleUsage(options) {
|
|
6766
|
-
const { http
|
|
6646
|
+
const { http } = getAuthedHttpClient();
|
|
6767
6647
|
const params = new URLSearchParams();
|
|
6768
6648
|
if (options.limit) params.set("recent_limit", options.limit);
|
|
6769
6649
|
if (options.offset) params.set("recent_offset", options.offset);
|
|
6770
6650
|
if (options.runId) params.set("run_id", options.runId);
|
|
6771
6651
|
const suffix = Array.from(params).length > 0 ? `?${params.toString()}` : "";
|
|
6772
|
-
const payload = await
|
|
6652
|
+
const payload = await http.get(
|
|
6773
6653
|
`/api/v2/billing/usage${suffix}`
|
|
6774
6654
|
);
|
|
6775
6655
|
const usage = payload.usage ?? {};
|
|
@@ -6795,8 +6675,8 @@ async function handleUsage(options) {
|
|
|
6795
6675
|
);
|
|
6796
6676
|
}
|
|
6797
6677
|
async function handleLimit(options) {
|
|
6798
|
-
const { http
|
|
6799
|
-
const payload = await
|
|
6678
|
+
const { http } = getAuthedHttpClient();
|
|
6679
|
+
const payload = await http.get(
|
|
6800
6680
|
"/api/v2/billing/limit"
|
|
6801
6681
|
);
|
|
6802
6682
|
const lines = payload.enabled ? [
|
|
@@ -6812,8 +6692,8 @@ async function handleLimit(options) {
|
|
|
6812
6692
|
);
|
|
6813
6693
|
}
|
|
6814
6694
|
async function handleSetLimit(credits, options) {
|
|
6815
|
-
const { http
|
|
6816
|
-
const payload = await
|
|
6695
|
+
const { http } = getAuthedHttpClient();
|
|
6696
|
+
const payload = await http.request("/api/v2/billing/limit", {
|
|
6817
6697
|
method: "PUT",
|
|
6818
6698
|
body: { monthly_credits_limit: Number.parseInt(credits, 10) }
|
|
6819
6699
|
});
|
|
@@ -6833,8 +6713,8 @@ async function handleSetLimit(credits, options) {
|
|
|
6833
6713
|
);
|
|
6834
6714
|
}
|
|
6835
6715
|
async function handleLimitOff(options) {
|
|
6836
|
-
const { http
|
|
6837
|
-
const payload = await
|
|
6716
|
+
const { http } = getAuthedHttpClient();
|
|
6717
|
+
const payload = await http.request("/api/v2/billing/limit", {
|
|
6838
6718
|
method: "DELETE"
|
|
6839
6719
|
});
|
|
6840
6720
|
printCommandEnvelope(
|
|
@@ -6853,7 +6733,7 @@ async function handleLimitOff(options) {
|
|
|
6853
6733
|
);
|
|
6854
6734
|
}
|
|
6855
6735
|
async function handleHistory(options) {
|
|
6856
|
-
const { http
|
|
6736
|
+
const { http } = getAuthedHttpClient();
|
|
6857
6737
|
const windows = {
|
|
6858
6738
|
"1d": 86400,
|
|
6859
6739
|
"1w": 604800,
|
|
@@ -6869,7 +6749,7 @@ async function handleHistory(options) {
|
|
|
6869
6749
|
limit: String(BILLING_HISTORY_EXPORT_LIMIT - entries.length)
|
|
6870
6750
|
});
|
|
6871
6751
|
if (cursor !== null) params.set("cursor", cursor);
|
|
6872
|
-
const payload = await
|
|
6752
|
+
const payload = await http.get(
|
|
6873
6753
|
`/api/v2/billing/ledger?${params.toString()}`
|
|
6874
6754
|
);
|
|
6875
6755
|
if (Array.isArray(payload.entries)) {
|
|
@@ -6914,7 +6794,7 @@ async function handleHistory(options) {
|
|
|
6914
6794
|
);
|
|
6915
6795
|
}
|
|
6916
6796
|
async function handleLedgerExportAll(options) {
|
|
6917
|
-
const { http
|
|
6797
|
+
const { http } = getAuthedHttpClient();
|
|
6918
6798
|
const outputPath = options.output ? resolve3(String(options.output)) : defaultLedgerExportPath();
|
|
6919
6799
|
let summary = { row_count: 0, net_delta_credits: 0 };
|
|
6920
6800
|
let cursor = null;
|
|
@@ -6923,7 +6803,7 @@ async function handleLedgerExportAll(options) {
|
|
|
6923
6803
|
const params = new URLSearchParams({ limit: "5000" });
|
|
6924
6804
|
if (cursor !== null) params.set("cursor", cursor);
|
|
6925
6805
|
if (options.runId) params.set("run_id", options.runId);
|
|
6926
|
-
const payload = await
|
|
6806
|
+
const payload = await http.get(
|
|
6927
6807
|
`/api/v2/billing/ledger?${params.toString()}`
|
|
6928
6808
|
);
|
|
6929
6809
|
const entries = Array.isArray(payload.entries) ? payload.entries : [];
|
|
@@ -6983,8 +6863,8 @@ function planRolloverText(rollover) {
|
|
|
6983
6863
|
return `rollover ${mode}`;
|
|
6984
6864
|
}
|
|
6985
6865
|
async function handlePlans(options) {
|
|
6986
|
-
const { http
|
|
6987
|
-
const payload = await
|
|
6866
|
+
const { http } = getAuthedHttpClient();
|
|
6867
|
+
const payload = await http.get(
|
|
6988
6868
|
"/api/v2/billing/catalog/current"
|
|
6989
6869
|
);
|
|
6990
6870
|
const activePlan = payload.active_plan ?? {};
|
|
@@ -7016,8 +6896,8 @@ async function handlePlans(options) {
|
|
|
7016
6896
|
);
|
|
7017
6897
|
}
|
|
7018
6898
|
async function handleSubscribe(planVersionId, options) {
|
|
7019
|
-
const { http
|
|
7020
|
-
const payload = await
|
|
6899
|
+
const { http } = getAuthedHttpClient();
|
|
6900
|
+
const payload = await http.request(
|
|
7021
6901
|
"/api/v2/billing/subscription/checkout",
|
|
7022
6902
|
{
|
|
7023
6903
|
method: "POST",
|
|
@@ -7236,8 +7116,8 @@ async function handleInvoices(options) {
|
|
|
7236
7116
|
);
|
|
7237
7117
|
}
|
|
7238
7118
|
async function handleCheckout(options) {
|
|
7239
|
-
const { http
|
|
7240
|
-
const payload = await
|
|
7119
|
+
const { http } = getAuthedHttpClient();
|
|
7120
|
+
const payload = await http.post(
|
|
7241
7121
|
"/api/v2/billing/checkout",
|
|
7242
7122
|
{
|
|
7243
7123
|
...options.tier ? { tierId: options.tier } : {},
|
|
@@ -7356,8 +7236,8 @@ async function handleTopUp(creditsRaw, options) {
|
|
|
7356
7236
|
});
|
|
7357
7237
|
}
|
|
7358
7238
|
async function handleRedeemCode(code, options) {
|
|
7359
|
-
const { http
|
|
7360
|
-
const payload = await
|
|
7239
|
+
const { http } = getAuthedHttpClient();
|
|
7240
|
+
const payload = await http.post(
|
|
7361
7241
|
"/api/v2/billing/checkout",
|
|
7362
7242
|
{
|
|
7363
7243
|
discountCode: code
|
|
@@ -23506,8 +23386,8 @@ function registerEnrichCommand(program) {
|
|
|
23506
23386
|
|
|
23507
23387
|
// src/cli/commands/feedback.ts
|
|
23508
23388
|
async function handleFeedback(text, options) {
|
|
23509
|
-
const { http
|
|
23510
|
-
const response = await
|
|
23389
|
+
const { http } = getAuthedHttpClient();
|
|
23390
|
+
const response = await http.post("/api/v2/cli/feedback", {
|
|
23511
23391
|
text,
|
|
23512
23392
|
environment: collectLocalEnvInfo(),
|
|
23513
23393
|
...options.command ? { command: options.command } : {},
|
|
@@ -23918,8 +23798,8 @@ function buildSessionUploadContent(raw) {
|
|
|
23918
23798
|
return { encodedContent: encoded, needsChunking: true };
|
|
23919
23799
|
}
|
|
23920
23800
|
async function uploadPayload(path, payload) {
|
|
23921
|
-
const { http
|
|
23922
|
-
return await
|
|
23801
|
+
const { http } = getAuthedHttpClient();
|
|
23802
|
+
return await http.post(path, payload);
|
|
23923
23803
|
}
|
|
23924
23804
|
async function uploadChunkedSessions(sessions, options) {
|
|
23925
23805
|
const uploadId = randomUUID3();
|
|
@@ -24705,8 +24585,8 @@ Preview the plan first with:
|
|
|
24705
24585
|
);
|
|
24706
24586
|
}
|
|
24707
24587
|
async function handleMonitorsStatus(options) {
|
|
24708
|
-
const
|
|
24709
|
-
const payload = await
|
|
24588
|
+
const http = buildHttpClient();
|
|
24589
|
+
const payload = await http.request(
|
|
24710
24590
|
"/api/v2/monitors/access",
|
|
24711
24591
|
{ method: "GET" }
|
|
24712
24592
|
);
|
|
@@ -24779,7 +24659,7 @@ async function handleMonitorsAvailable(toolId, options) {
|
|
|
24779
24659
|
}
|
|
24780
24660
|
}
|
|
24781
24661
|
const tool = toolId ?? options.tool;
|
|
24782
|
-
const
|
|
24662
|
+
const http = buildHttpClient();
|
|
24783
24663
|
const params = new URLSearchParams();
|
|
24784
24664
|
if (options.provider) params.set("provider", options.provider);
|
|
24785
24665
|
if (tool) params.set("tool", tool);
|
|
@@ -24788,7 +24668,7 @@ async function handleMonitorsAvailable(toolId, options) {
|
|
|
24788
24668
|
const compactList = !tool && !options.full;
|
|
24789
24669
|
if (compactList || options.compact) params.set("compact", "true");
|
|
24790
24670
|
const query = params.toString();
|
|
24791
|
-
const payload = await
|
|
24671
|
+
const payload = await http.request(
|
|
24792
24672
|
`/api/v2/monitors/tools${query ? `?${query}` : ""}`,
|
|
24793
24673
|
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
24794
24674
|
);
|
|
@@ -24828,13 +24708,13 @@ function renderDeployedListText(payload, requestedStatus) {
|
|
|
24828
24708
|
`;
|
|
24829
24709
|
}
|
|
24830
24710
|
async function handleMonitorsList(options) {
|
|
24831
|
-
const
|
|
24711
|
+
const http = buildHttpClient();
|
|
24832
24712
|
const params = new URLSearchParams();
|
|
24833
24713
|
if (options.status) params.set("status", options.status);
|
|
24834
24714
|
if (options.limit) params.set("limit", options.limit);
|
|
24835
24715
|
if (options.compact) params.set("compact", "true");
|
|
24836
24716
|
const query = params.toString();
|
|
24837
|
-
const payload = await
|
|
24717
|
+
const payload = await http.request(
|
|
24838
24718
|
`/api/v2/monitors/deployed${query ? `?${query}` : ""}`,
|
|
24839
24719
|
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
24840
24720
|
);
|
|
@@ -24844,21 +24724,21 @@ async function handleMonitorsList(options) {
|
|
|
24844
24724
|
});
|
|
24845
24725
|
}
|
|
24846
24726
|
async function handleMonitorsCheck(definition, options) {
|
|
24847
|
-
const
|
|
24727
|
+
const http = buildHttpClient();
|
|
24848
24728
|
const body = resolveMonitorJsonBody({
|
|
24849
24729
|
positional: definition,
|
|
24850
24730
|
file: options.file,
|
|
24851
24731
|
argLabel: "<definition>",
|
|
24852
24732
|
command: "deepline monitors check"
|
|
24853
24733
|
});
|
|
24854
|
-
const payload = await
|
|
24734
|
+
const payload = await http.request(
|
|
24855
24735
|
"/api/v2/monitors/check",
|
|
24856
24736
|
{ method: "POST", body, ...FORBIDDEN_AS_API_ERROR }
|
|
24857
24737
|
);
|
|
24858
24738
|
printCommandEnvelope(payload, { json: options.json });
|
|
24859
24739
|
}
|
|
24860
24740
|
async function handleMonitorsDeploy(definition, options) {
|
|
24861
|
-
const
|
|
24741
|
+
const http = buildHttpClient();
|
|
24862
24742
|
const body = resolveMonitorJsonBody({
|
|
24863
24743
|
positional: definition,
|
|
24864
24744
|
file: options.file,
|
|
@@ -24866,7 +24746,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
24866
24746
|
command: "deepline monitors deploy"
|
|
24867
24747
|
});
|
|
24868
24748
|
if (options.dryRun) {
|
|
24869
|
-
const payload2 = await
|
|
24749
|
+
const payload2 = await http.request(
|
|
24870
24750
|
"/api/v2/monitors/check",
|
|
24871
24751
|
{ method: "POST", body, ...FORBIDDEN_AS_API_ERROR }
|
|
24872
24752
|
);
|
|
@@ -24880,7 +24760,7 @@ async function handleMonitorsDeploy(definition, options) {
|
|
|
24880
24760
|
}
|
|
24881
24761
|
return;
|
|
24882
24762
|
}
|
|
24883
|
-
const payload = await
|
|
24763
|
+
const payload = await http.request(
|
|
24884
24764
|
"/api/v2/monitors/deploy",
|
|
24885
24765
|
{ method: "POST", body, ...FORBIDDEN_AS_API_ERROR }
|
|
24886
24766
|
);
|
|
@@ -24932,12 +24812,12 @@ function renderMonitorGet(payload) {
|
|
|
24932
24812
|
`;
|
|
24933
24813
|
}
|
|
24934
24814
|
async function handleMonitorsGet(key, options) {
|
|
24935
|
-
const
|
|
24936
|
-
const payload = await
|
|
24815
|
+
const http = buildHttpClient();
|
|
24816
|
+
const payload = await http.request(
|
|
24937
24817
|
`/api/v2/monitors/deployed/${encodeKey(key)}`,
|
|
24938
24818
|
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
24939
24819
|
);
|
|
24940
|
-
const dependents = await
|
|
24820
|
+
const dependents = await http.request(
|
|
24941
24821
|
`/api/v2/monitors/deployed/${encodeKey(key)}/dependents`,
|
|
24942
24822
|
{ method: "GET", ...FORBIDDEN_AS_API_ERROR }
|
|
24943
24823
|
);
|
|
@@ -24963,12 +24843,12 @@ async function confirmMonitorDelete(key, options) {
|
|
|
24963
24843
|
}
|
|
24964
24844
|
}
|
|
24965
24845
|
async function handleMonitorsDelete(key, options) {
|
|
24966
|
-
const
|
|
24846
|
+
const http = buildHttpClient();
|
|
24967
24847
|
const params = new URLSearchParams();
|
|
24968
24848
|
if (options.localOnly) params.set("local_only", "true");
|
|
24969
24849
|
if (options.dryRun) {
|
|
24970
24850
|
params.set("dry_run", "true");
|
|
24971
|
-
const payload2 = await
|
|
24851
|
+
const payload2 = await http.request(
|
|
24972
24852
|
`/api/v2/monitors/deployed/${encodeKey(key)}?${params.toString()}`,
|
|
24973
24853
|
{ method: "DELETE", ...FORBIDDEN_AS_API_ERROR }
|
|
24974
24854
|
);
|
|
@@ -25000,30 +24880,30 @@ async function handleMonitorsDelete(key, options) {
|
|
|
25000
24880
|
}
|
|
25001
24881
|
}
|
|
25002
24882
|
const query = params.toString();
|
|
25003
|
-
const payload = await
|
|
24883
|
+
const payload = await http.request(
|
|
25004
24884
|
`/api/v2/monitors/deployed/${encodeKey(key)}${query ? `?${query}` : ""}`,
|
|
25005
24885
|
{ method: "DELETE", ...FORBIDDEN_AS_API_ERROR }
|
|
25006
24886
|
);
|
|
25007
24887
|
printCommandEnvelope(payload, { json: options.json });
|
|
25008
24888
|
}
|
|
25009
24889
|
async function handleMonitorsUpdate(key, patch, options) {
|
|
25010
|
-
const
|
|
24890
|
+
const http = buildHttpClient();
|
|
25011
24891
|
const body = resolveMonitorJsonBody({
|
|
25012
24892
|
positional: patch,
|
|
25013
24893
|
file: options.file,
|
|
25014
24894
|
argLabel: "<patch>",
|
|
25015
24895
|
command: `deepline monitors update ${key}`
|
|
25016
24896
|
});
|
|
25017
|
-
const payload = await
|
|
24897
|
+
const payload = await http.request(
|
|
25018
24898
|
`/api/v2/monitors/deployed/${encodeKey(key)}`,
|
|
25019
24899
|
{ method: "PATCH", body, ...FORBIDDEN_AS_API_ERROR }
|
|
25020
24900
|
);
|
|
25021
24901
|
printCommandEnvelope(payload, { json: options.json });
|
|
25022
24902
|
}
|
|
25023
24903
|
async function handleMonitorsReactivate(key, options) {
|
|
25024
|
-
const
|
|
24904
|
+
const http = buildHttpClient();
|
|
25025
24905
|
if (options.dryRun) {
|
|
25026
|
-
const payload2 = await
|
|
24906
|
+
const payload2 = await http.request(
|
|
25027
24907
|
`/api/v2/monitors/deployed/${encodeKey(key)}/reactivate?dry_run=true`,
|
|
25028
24908
|
{ method: "POST", body: {}, ...FORBIDDEN_AS_API_ERROR }
|
|
25029
24909
|
);
|
|
@@ -25037,7 +24917,7 @@ async function handleMonitorsReactivate(key, options) {
|
|
|
25037
24917
|
});
|
|
25038
24918
|
return;
|
|
25039
24919
|
}
|
|
25040
|
-
const payload = await
|
|
24920
|
+
const payload = await http.request(
|
|
25041
24921
|
`/api/v2/monitors/deployed/${encodeKey(key)}/reactivate`,
|
|
25042
24922
|
{ method: "POST", body: {}, ...FORBIDDEN_AS_API_ERROR }
|
|
25043
24923
|
);
|
|
@@ -25283,8 +25163,8 @@ Examples:
|
|
|
25283
25163
|
}
|
|
25284
25164
|
|
|
25285
25165
|
// src/cli/commands/org.ts
|
|
25286
|
-
async function fetchOrganizations(
|
|
25287
|
-
return
|
|
25166
|
+
async function fetchOrganizations(http, apiKey) {
|
|
25167
|
+
return http.post("/api/v2/auth/cli/organizations", { api_key: apiKey });
|
|
25288
25168
|
}
|
|
25289
25169
|
function normalizeAuthScope2(value) {
|
|
25290
25170
|
if (!value) return "auto";
|
|
@@ -25388,8 +25268,8 @@ function resolveOrgSwitchAuthTarget(scope, config) {
|
|
|
25388
25268
|
}
|
|
25389
25269
|
async function handleOrgList(options) {
|
|
25390
25270
|
const config = resolveConfig();
|
|
25391
|
-
const
|
|
25392
|
-
const payload = await fetchOrganizations(
|
|
25271
|
+
const http = new HttpClient(config);
|
|
25272
|
+
const payload = await fetchOrganizations(http, config.apiKey);
|
|
25393
25273
|
printCommandEnvelope(
|
|
25394
25274
|
{
|
|
25395
25275
|
...payload,
|
|
@@ -25407,8 +25287,8 @@ async function handleOrgList(options) {
|
|
|
25407
25287
|
}
|
|
25408
25288
|
async function handleOrgStatus(options) {
|
|
25409
25289
|
const config = resolveConfig();
|
|
25410
|
-
const
|
|
25411
|
-
const payload = await fetchOrganizations(
|
|
25290
|
+
const http = new HttpClient(config);
|
|
25291
|
+
const payload = await fetchOrganizations(http, config.apiKey);
|
|
25412
25292
|
const current = payload.organizations.find((org) => org.is_current) ?? payload.organizations.find(
|
|
25413
25293
|
(org) => org.org_id === payload.current_org_id
|
|
25414
25294
|
) ?? null;
|
|
@@ -25491,8 +25371,8 @@ async function handleOrgStatus(options) {
|
|
|
25491
25371
|
async function handleOrgSwitch(selection, options) {
|
|
25492
25372
|
const authScope = normalizeAuthScope2(options.authScope);
|
|
25493
25373
|
const config = resolveConfig();
|
|
25494
|
-
const
|
|
25495
|
-
const payload = await fetchOrganizations(
|
|
25374
|
+
const http = new HttpClient(config);
|
|
25375
|
+
const payload = await fetchOrganizations(http, config.apiKey);
|
|
25496
25376
|
if (!selection && !options.orgId) {
|
|
25497
25377
|
printCommandEnvelope(
|
|
25498
25378
|
{
|
|
@@ -25587,7 +25467,7 @@ async function handleOrgSwitch(selection, options) {
|
|
|
25587
25467
|
);
|
|
25588
25468
|
return;
|
|
25589
25469
|
}
|
|
25590
|
-
const switched = await
|
|
25470
|
+
const switched = await http.post("/api/v2/auth/cli/switch", {
|
|
25591
25471
|
api_key: config.apiKey,
|
|
25592
25472
|
org_id: target.org_id
|
|
25593
25473
|
});
|
|
@@ -25655,8 +25535,8 @@ async function handleOrgSwitch(selection, options) {
|
|
|
25655
25535
|
}
|
|
25656
25536
|
async function handleOrgCreate(name, options) {
|
|
25657
25537
|
const config = resolveConfig();
|
|
25658
|
-
const
|
|
25659
|
-
const created = await
|
|
25538
|
+
const http = new HttpClient(config);
|
|
25539
|
+
const created = await http.post("/api/v2/auth/cli/org-create", {
|
|
25660
25540
|
api_key: config.apiKey,
|
|
25661
25541
|
name
|
|
25662
25542
|
});
|
|
@@ -25842,243 +25722,82 @@ Examples:
|
|
|
25842
25722
|
);
|
|
25843
25723
|
}
|
|
25844
25724
|
|
|
25845
|
-
// src/cli/
|
|
25846
|
-
|
|
25847
|
-
|
|
25848
|
-
|
|
25849
|
-
|
|
25850
|
-
|
|
25851
|
-
|
|
25852
|
-
|
|
25853
|
-
|
|
25854
|
-
|
|
25855
|
-
|
|
25856
|
-
|
|
25857
|
-
|
|
25858
|
-
|
|
25859
|
-
|
|
25860
|
-
|
|
25861
|
-
|
|
25862
|
-
});
|
|
25863
|
-
return result.status === 0;
|
|
25864
|
-
} catch {
|
|
25865
|
-
return false;
|
|
25725
|
+
// src/cli/getting-started.ts
|
|
25726
|
+
var DEEPLINE_GTM_SKILL = "/deepline-gtm";
|
|
25727
|
+
var DEEPLINE_GTM_STARTER_PROMPTS = [
|
|
25728
|
+
{
|
|
25729
|
+
id: "waterfall-email-lookup",
|
|
25730
|
+
title: "Waterfall email lookup",
|
|
25731
|
+
prompt: "/deepline-gtm Find 5 CTOs in NYC and get their verified work emails."
|
|
25732
|
+
},
|
|
25733
|
+
{
|
|
25734
|
+
id: "signal-based-outbound",
|
|
25735
|
+
title: "Signal-based outbound",
|
|
25736
|
+
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."
|
|
25737
|
+
},
|
|
25738
|
+
{
|
|
25739
|
+
id: "vc-portfolio-scrape",
|
|
25740
|
+
title: "VC portfolio scrape",
|
|
25741
|
+
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."
|
|
25866
25742
|
}
|
|
25743
|
+
];
|
|
25744
|
+
var DEEPLINE_GTM_HANDOFF_QUESTION = "Would you like to try one of these examples, or tell me your own business problem?";
|
|
25745
|
+
function deeplineGtmGettingStartedPayload() {
|
|
25746
|
+
return {
|
|
25747
|
+
skill: DEEPLINE_GTM_SKILL,
|
|
25748
|
+
examples: DEEPLINE_GTM_STARTER_PROMPTS,
|
|
25749
|
+
question: DEEPLINE_GTM_HANDOFF_QUESTION,
|
|
25750
|
+
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."
|
|
25751
|
+
};
|
|
25867
25752
|
}
|
|
25868
|
-
|
|
25869
|
-
|
|
25870
|
-
const child = spawn2("claude", [prompt], {
|
|
25871
|
-
stdio: "inherit",
|
|
25872
|
-
shell: process.platform === "win32"
|
|
25873
|
-
});
|
|
25874
|
-
child.on("error", () => resolve15(EXIT_SERVER3));
|
|
25875
|
-
child.on("close", (status) => resolve15(status ?? EXIT_OK2));
|
|
25876
|
-
});
|
|
25877
|
-
}
|
|
25878
|
-
function readBody(req) {
|
|
25879
|
-
return new Promise((resolve15, reject) => {
|
|
25880
|
-
let raw = "";
|
|
25881
|
-
req.setEncoding("utf8");
|
|
25882
|
-
req.on("data", (chunk) => {
|
|
25883
|
-
raw += chunk;
|
|
25884
|
-
if (raw.length > MAX_BODY_BYTES) {
|
|
25885
|
-
reject(new Error("Request body too large."));
|
|
25886
|
-
req.destroy();
|
|
25887
|
-
}
|
|
25888
|
-
});
|
|
25889
|
-
req.on("end", () => resolve15(raw));
|
|
25890
|
-
req.on("error", reject);
|
|
25891
|
-
});
|
|
25892
|
-
}
|
|
25893
|
-
function writeJson(res, status, payload) {
|
|
25894
|
-
res.writeHead(status, { "content-type": "application/json" });
|
|
25895
|
-
res.end(JSON.stringify(payload));
|
|
25896
|
-
}
|
|
25897
|
-
function startCallbackServer(input2) {
|
|
25898
|
-
const server = createServer((req, res) => {
|
|
25899
|
-
res.setHeader("Access-Control-Allow-Origin", req.headers.origin ?? "*");
|
|
25900
|
-
res.setHeader("Vary", "Origin");
|
|
25901
|
-
res.setHeader("Access-Control-Allow-Methods", "POST, OPTIONS");
|
|
25902
|
-
res.setHeader("Access-Control-Allow-Headers", "content-type");
|
|
25903
|
-
res.setHeader("Access-Control-Allow-Private-Network", "true");
|
|
25904
|
-
res.setHeader("Access-Control-Max-Age", "600");
|
|
25905
|
-
if (req.method === "OPTIONS") {
|
|
25906
|
-
res.writeHead(204);
|
|
25907
|
-
res.end();
|
|
25908
|
-
return;
|
|
25909
|
-
}
|
|
25910
|
-
if (req.method !== "POST" || req.url !== "/submit") {
|
|
25911
|
-
writeJson(res, 404, { error: "Not found." });
|
|
25912
|
-
return;
|
|
25913
|
-
}
|
|
25914
|
-
void readBody(req).then((raw) => {
|
|
25915
|
-
let body = null;
|
|
25916
|
-
try {
|
|
25917
|
-
body = JSON.parse(raw);
|
|
25918
|
-
} catch {
|
|
25919
|
-
body = null;
|
|
25920
|
-
}
|
|
25921
|
-
const state = typeof body?.state === "string" ? body.state : "";
|
|
25922
|
-
const prompt = typeof body?.prompt === "string" ? body.prompt.trim() : "";
|
|
25923
|
-
const workflowId = typeof body?.workflow_id === "string" && body.workflow_id.trim() ? body.workflow_id.trim() : null;
|
|
25924
|
-
if (!state || state !== input2.state) {
|
|
25925
|
-
writeJson(res, 403, { error: "Invalid quickstart state token." });
|
|
25926
|
-
return;
|
|
25927
|
-
}
|
|
25928
|
-
if (!prompt) {
|
|
25929
|
-
writeJson(res, 400, { error: "prompt is required." });
|
|
25930
|
-
return;
|
|
25931
|
-
}
|
|
25932
|
-
if (prompt.length > MAX_PROMPT_LENGTH) {
|
|
25933
|
-
writeJson(res, 400, {
|
|
25934
|
-
error: `prompt exceeds ${MAX_PROMPT_LENGTH} characters.`
|
|
25935
|
-
});
|
|
25936
|
-
return;
|
|
25937
|
-
}
|
|
25938
|
-
writeJson(res, 200, { ok: true });
|
|
25939
|
-
setImmediate(() => input2.onSelection({ prompt, workflowId }));
|
|
25940
|
-
}).catch(() => {
|
|
25941
|
-
writeJson(res, 400, { error: "Invalid request body." });
|
|
25942
|
-
});
|
|
25943
|
-
});
|
|
25944
|
-
return new Promise((resolve15, reject) => {
|
|
25945
|
-
server.once("error", reject);
|
|
25946
|
-
server.listen(0, "127.0.0.1", () => {
|
|
25947
|
-
const address = server.address();
|
|
25948
|
-
if (!address || typeof address === "string") {
|
|
25949
|
-
reject(new Error("Failed to bind quickstart callback server."));
|
|
25950
|
-
return;
|
|
25951
|
-
}
|
|
25952
|
-
resolve15({ server, port: address.port });
|
|
25953
|
-
});
|
|
25954
|
-
});
|
|
25955
|
-
}
|
|
25753
|
+
|
|
25754
|
+
// src/cli/commands/quickstart.ts
|
|
25956
25755
|
async function handleQuickstart(options) {
|
|
25957
25756
|
const jsonOutput = shouldEmitJson(options.json === true);
|
|
25958
|
-
const
|
|
25959
|
-
|
|
25960
|
-
|
|
25961
|
-
|
|
25962
|
-
);
|
|
25963
|
-
let apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
25964
|
-
if (!apiKey) {
|
|
25965
|
-
if (interactive) {
|
|
25966
|
-
console.error("Not connected yet \u2014 registering this device first.");
|
|
25967
|
-
const registerExit = await handleRegister([]);
|
|
25968
|
-
if (registerExit !== EXIT_OK2) return registerExit;
|
|
25969
|
-
apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
25970
|
-
}
|
|
25971
|
-
if (!apiKey) {
|
|
25972
|
-
console.error("Not connected. Run: deepline auth register");
|
|
25973
|
-
return EXIT_AUTH2;
|
|
25974
|
-
}
|
|
25975
|
-
}
|
|
25976
|
-
const state = randomBytes(32).toString("hex");
|
|
25977
|
-
let resolveSelection;
|
|
25978
|
-
const selectionPromise = new Promise((resolve15) => {
|
|
25979
|
-
resolveSelection = resolve15;
|
|
25980
|
-
});
|
|
25981
|
-
let callback;
|
|
25982
|
-
try {
|
|
25983
|
-
callback = await startCallbackServer({
|
|
25984
|
-
state,
|
|
25985
|
-
onSelection: (selection) => resolveSelection(selection)
|
|
25986
|
-
});
|
|
25987
|
-
} catch (error) {
|
|
25988
|
-
console.error(
|
|
25989
|
-
`Could not start the local quickstart listener: ${error instanceof Error ? error.message : String(error)}`
|
|
25990
|
-
);
|
|
25991
|
-
return EXIT_SERVER3;
|
|
25992
|
-
}
|
|
25993
|
-
const quickstartUrl = `${baseUrl}/cli/quickstart?cb=${callback.port}&state=${state}`;
|
|
25994
|
-
console.error(" Opening the recipe picker in your browser.");
|
|
25995
|
-
console.error(` If it didn't open, cmd+click: ${quickstartUrl}`);
|
|
25996
|
-
if (options.open !== false) {
|
|
25997
|
-
openInBrowser(quickstartUrl);
|
|
25998
|
-
}
|
|
25999
|
-
const timeoutSeconds = Number.parseInt(options.timeout ?? "300", 10);
|
|
26000
|
-
const timeoutMs = (Number.isFinite(timeoutSeconds) && timeoutSeconds > 0 ? timeoutSeconds : 300) * 1e3;
|
|
26001
|
-
const timeoutHandle = setTimeout(
|
|
26002
|
-
() => resolveSelection("timeout"),
|
|
26003
|
-
timeoutMs
|
|
26004
|
-
);
|
|
26005
|
-
const progress = createCliProgress(!jsonOutput);
|
|
26006
|
-
progress.phase("waiting for your pick in the browser (Ctrl+C to skip)");
|
|
26007
|
-
const onSigint = () => resolveSelection("sigint");
|
|
26008
|
-
process.once("SIGINT", onSigint);
|
|
26009
|
-
const outcome = await selectionPromise;
|
|
26010
|
-
clearTimeout(timeoutHandle);
|
|
26011
|
-
process.removeListener("SIGINT", onSigint);
|
|
26012
|
-
callback.server.close();
|
|
26013
|
-
if (outcome === "sigint") {
|
|
26014
|
-
progress.fail();
|
|
26015
|
-
console.error("\nSkipped \u2014 run `deepline quickstart` anytime.");
|
|
26016
|
-
return EXIT_OK2;
|
|
26017
|
-
}
|
|
26018
|
-
if (outcome === "timeout") {
|
|
26019
|
-
progress.fail();
|
|
26020
|
-
console.error(
|
|
26021
|
-
"Timed out waiting for a selection. Run: deepline quickstart"
|
|
26022
|
-
);
|
|
26023
|
-
return EXIT_AUTH2;
|
|
26024
|
-
}
|
|
26025
|
-
progress.complete();
|
|
26026
|
-
const { prompt, workflowId } = outcome;
|
|
26027
|
-
const claudeCommand = `claude ${shellQuote3(prompt)}`;
|
|
26028
|
-
const claudeAvailable = hasClaudeBinary();
|
|
26029
|
-
const willLaunch = options.launch !== false && !jsonOutput && interactive && claudeAvailable;
|
|
25757
|
+
const gettingStarted = {
|
|
25758
|
+
skill: DEEPLINE_GTM_SKILL,
|
|
25759
|
+
examples: DEEPLINE_GTM_STARTER_PROMPTS
|
|
25760
|
+
};
|
|
26030
25761
|
printCommandEnvelope(
|
|
26031
25762
|
{
|
|
26032
|
-
|
|
26033
|
-
|
|
26034
|
-
|
|
26035
|
-
|
|
26036
|
-
|
|
26037
|
-
|
|
25763
|
+
ok: true,
|
|
25764
|
+
status: "deprecated",
|
|
25765
|
+
code: "QUICKSTART_DEPRECATED",
|
|
25766
|
+
exitCode: 0,
|
|
25767
|
+
message: "`deepline quickstart` is deprecated. Start with the installed /deepline-gtm skill in your agent.",
|
|
25768
|
+
deprecatedCommand: "deepline quickstart",
|
|
25769
|
+
replacement: DEEPLINE_GTM_SKILL,
|
|
25770
|
+
gettingStarted,
|
|
25771
|
+
next: DEEPLINE_GTM_SKILL,
|
|
26038
25772
|
render: {
|
|
26039
25773
|
sections: [
|
|
26040
25774
|
{
|
|
26041
|
-
title: "quickstart",
|
|
25775
|
+
title: "quickstart deprecated",
|
|
26042
25776
|
lines: [
|
|
26043
|
-
|
|
26044
|
-
|
|
25777
|
+
`Use ${DEEPLINE_GTM_SKILL} in your agent instead.`,
|
|
25778
|
+
...DEEPLINE_GTM_STARTER_PROMPTS.map(
|
|
25779
|
+
(example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
|
|
25780
|
+
)
|
|
26045
25781
|
]
|
|
26046
25782
|
}
|
|
26047
|
-
]
|
|
26048
|
-
actions: [{ label: "Run", command: claudeCommand }]
|
|
25783
|
+
]
|
|
26049
25784
|
}
|
|
26050
25785
|
},
|
|
26051
25786
|
{ json: jsonOutput }
|
|
26052
25787
|
);
|
|
26053
|
-
|
|
26054
|
-
return launchClaude(prompt);
|
|
26055
|
-
}
|
|
26056
|
-
return EXIT_OK2;
|
|
25788
|
+
return 0;
|
|
26057
25789
|
}
|
|
26058
25790
|
function registerQuickstartCommands(program) {
|
|
26059
25791
|
program.command("quickstart").description(
|
|
26060
|
-
"
|
|
25792
|
+
"Deprecated compatibility command. Use /deepline-gtm in your agent."
|
|
26061
25793
|
).addHelpText(
|
|
26062
25794
|
"after",
|
|
26063
25795
|
`
|
|
26064
|
-
|
|
26065
|
-
|
|
26066
|
-
|
|
26067
|
-
on the same machine as the CLI. Once a recipe arrives, the CLI prints the
|
|
26068
|
-
matching claude command and, when Claude Code is installed and the shell is
|
|
26069
|
-
interactive, launches it directly. Press Ctrl+C while waiting to skip.
|
|
26070
|
-
|
|
26071
|
-
Examples:
|
|
26072
|
-
deepline quickstart
|
|
26073
|
-
deepline quickstart --no-open
|
|
26074
|
-
deepline quickstart --no-launch --json
|
|
26075
|
-
deepline quickstart --timeout 120
|
|
25796
|
+
Deprecated:
|
|
25797
|
+
Use the installed /deepline-gtm skill in your agent. This compatibility
|
|
25798
|
+
command prints three starter prompts and no longer opens a browser.
|
|
26076
25799
|
`
|
|
26077
|
-
).option("--json", "Emit JSON output. Also automatic when stdout is piped").option("--no-open", "
|
|
26078
|
-
"--timeout <seconds>",
|
|
26079
|
-
"Maximum seconds to wait for a selection",
|
|
26080
|
-
"300"
|
|
26081
|
-
).action(async (options) => {
|
|
25800
|
+
).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) => {
|
|
26082
25801
|
process.exitCode = await handleQuickstart(options);
|
|
26083
25802
|
});
|
|
26084
25803
|
}
|
|
@@ -26248,8 +25967,8 @@ async function handleSet(nameInput, forbidden, options) {
|
|
|
26248
25967
|
throw new Error("--play <name> is required when --scope play is used.");
|
|
26249
25968
|
}
|
|
26250
25969
|
const value = await readSecretValue();
|
|
26251
|
-
const { http
|
|
26252
|
-
const response = await
|
|
25970
|
+
const { http } = getAuthedHttpClient();
|
|
25971
|
+
const response = await http.post(
|
|
26253
25972
|
"/api/v2/secrets",
|
|
26254
25973
|
{
|
|
26255
25974
|
name,
|
|
@@ -28051,9 +27770,9 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
28051
27770
|
const getDatasetItemsTool = stringField2(getDatasetItems, "tool");
|
|
28052
27771
|
const getDatasetItemsPayload = recordField2(getDatasetItems, "payload");
|
|
28053
27772
|
return {
|
|
28054
|
-
getActorRun: `deepline tools execute ${getActorRunTool} --input ${
|
|
27773
|
+
getActorRun: `deepline tools execute ${getActorRunTool} --input ${shellQuote3(JSON.stringify(getActorRunPayload))} --json`,
|
|
28055
27774
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
28056
|
-
getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${
|
|
27775
|
+
getDatasetItems: `deepline tools execute ${getDatasetItemsTool} --input ${shellQuote3(JSON.stringify(getDatasetItemsPayload))} --json`
|
|
28057
27776
|
} : {}
|
|
28058
27777
|
};
|
|
28059
27778
|
}
|
|
@@ -28226,7 +27945,7 @@ function parseExecuteOptions(args) {
|
|
|
28226
27945
|
function safeFileStem(value) {
|
|
28227
27946
|
return value.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64) || "tool";
|
|
28228
27947
|
}
|
|
28229
|
-
function
|
|
27948
|
+
function shellQuote3(value) {
|
|
28230
27949
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
28231
27950
|
}
|
|
28232
27951
|
function powerShellQuote(value) {
|
|
@@ -28296,7 +28015,7 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
28296
28015
|
path: scriptPath,
|
|
28297
28016
|
sourceCode: script,
|
|
28298
28017
|
projectDir,
|
|
28299
|
-
macCopyCommand: `mkdir -p ${
|
|
28018
|
+
macCopyCommand: `mkdir -p ${shellQuote3(projectDir)} && cp ${shellQuote3(scriptPath)} ${shellQuote3(`${projectDir}/${fileName}`)}`,
|
|
28300
28019
|
windowsCopyCommand: `New-Item -ItemType Directory -Force -Path ${powerShellQuote(projectDir.replace(/\//g, "\\"))} | Out-Null; Copy-Item -LiteralPath ${powerShellQuote(scriptPath)} -Destination ${powerShellQuote(`${projectDir.replace(/\//g, "\\")}\\${fileName}`)}`
|
|
28301
28020
|
};
|
|
28302
28021
|
}
|
|
@@ -28320,7 +28039,7 @@ function buildToolExecuteBaseEnvelope(input2) {
|
|
|
28320
28039
|
envelope,
|
|
28321
28040
|
"output"
|
|
28322
28041
|
);
|
|
28323
|
-
const inspectCommand = `deepline tools execute ${input2.toolId} --input ${
|
|
28042
|
+
const inspectCommand = `deepline tools execute ${input2.toolId} --input ${shellQuote3(JSON.stringify(input2.params))} --json`;
|
|
28324
28043
|
const actions = input2.listConversion ? [
|
|
28325
28044
|
{
|
|
28326
28045
|
label: "next",
|
|
@@ -29174,7 +28893,7 @@ Notes:
|
|
|
29174
28893
|
}
|
|
29175
28894
|
|
|
29176
28895
|
// src/cli/commands/update.ts
|
|
29177
|
-
import { spawn as
|
|
28896
|
+
import { spawn as spawn3 } from "child_process";
|
|
29178
28897
|
import {
|
|
29179
28898
|
existsSync as existsSync12,
|
|
29180
28899
|
mkdirSync as mkdirSync10,
|
|
@@ -29189,7 +28908,7 @@ import { homedir as homedir12 } from "os";
|
|
|
29189
28908
|
import { dirname as dirname13, isAbsolute as isAbsolute3, join as join15, relative as relative2, resolve as resolve13 } from "path";
|
|
29190
28909
|
|
|
29191
28910
|
// src/cli/commands/skills.ts
|
|
29192
|
-
import { spawn as
|
|
28911
|
+
import { spawn as spawn2 } from "child_process";
|
|
29193
28912
|
import { existsSync as existsSync11, mkdirSync as mkdirSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync14 } from "fs";
|
|
29194
28913
|
import { homedir as homedir11 } from "os";
|
|
29195
28914
|
import { dirname as dirname12, join as join14 } from "path";
|
|
@@ -29463,7 +29182,7 @@ function readSkillsInstallState(path) {
|
|
|
29463
29182
|
}
|
|
29464
29183
|
function runProcess(command, args, cwd) {
|
|
29465
29184
|
return new Promise((resolve15, reject) => {
|
|
29466
|
-
const child =
|
|
29185
|
+
const child = spawn2(command, args, {
|
|
29467
29186
|
cwd,
|
|
29468
29187
|
env: process.env,
|
|
29469
29188
|
stdio: ["ignore", "ignore", "pipe"],
|
|
@@ -29703,14 +29422,14 @@ function posixShellQuote(value) {
|
|
|
29703
29422
|
function windowsCmdQuote(value) {
|
|
29704
29423
|
return `"${value.replace(/"/g, '""')}"`;
|
|
29705
29424
|
}
|
|
29706
|
-
function
|
|
29425
|
+
function shellQuote4(value) {
|
|
29707
29426
|
if (process.platform === "win32") {
|
|
29708
29427
|
return /^[A-Za-z0-9_./:@%+=,-]+$/.test(value) ? value : windowsCmdQuote(value);
|
|
29709
29428
|
}
|
|
29710
29429
|
return posixShellQuote(value);
|
|
29711
29430
|
}
|
|
29712
29431
|
function buildSourceUpdateCommand(sourceRoot) {
|
|
29713
|
-
const quotedRoot =
|
|
29432
|
+
const quotedRoot = shellQuote4(sourceRoot);
|
|
29714
29433
|
const cdCommand = process.platform === "win32" ? `cd /d ${quotedRoot}` : `cd ${quotedRoot}`;
|
|
29715
29434
|
return `${cdCommand} && git fetch origin main --tags && git merge --ff-only origin/main`;
|
|
29716
29435
|
}
|
|
@@ -29722,7 +29441,7 @@ function buildSidecarProjectConfigCommand(versionDir, nodeBin) {
|
|
|
29722
29441
|
"fs.mkdirSync(dir,{recursive:true});",
|
|
29723
29442
|
`fs.writeFileSync(path.join(dir,'package.json'),${JSON.stringify(NPM_SDK_SIDECAR_PACKAGE_JSON)});`
|
|
29724
29443
|
].join("");
|
|
29725
|
-
return `${
|
|
29444
|
+
return `${shellQuote4(nodeBin)} -e ${shellQuote4(script)} ${shellQuote4(versionDir)}`;
|
|
29726
29445
|
}
|
|
29727
29446
|
function sidecarStateDir(input2) {
|
|
29728
29447
|
const scope = input2.env.DEEPLINE_CONFIG_SCOPE?.trim();
|
|
@@ -29785,7 +29504,7 @@ function resolvePythonSidecarUpdatePlan(options) {
|
|
|
29785
29504
|
const npmCommand = "npm";
|
|
29786
29505
|
const registryUrl = sidecarRegistryUrl(hostUrl);
|
|
29787
29506
|
const versionDir = join15(stateDir, "versions", "<version>");
|
|
29788
|
-
const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${
|
|
29507
|
+
const manualCommand = `${buildSidecarProjectConfigCommand(versionDir, nodeBin)} && ${npmCommand} install --prefix ${shellQuote4(versionDir)} --registry ${shellQuote4(registryUrl)} ${NPM_SDK_INSTALL_COMMON_FLAGS.map(shellQuote4).join(" ")} ${shellQuote4(packageSpec)}`;
|
|
29789
29508
|
return {
|
|
29790
29509
|
kind: "python-sidecar",
|
|
29791
29510
|
stateDir,
|
|
@@ -29869,7 +29588,7 @@ function resolveUpdatePlan(options = {}) {
|
|
|
29869
29588
|
fallbackRegistryUrl: publicNpmFallbackRegistryUrl(
|
|
29870
29589
|
env.DEEPLINE_HOST_URL?.trim() || autoDetectBaseUrl()
|
|
29871
29590
|
),
|
|
29872
|
-
manualCommand: `${command} ${args.map(
|
|
29591
|
+
manualCommand: `${command} ${args.map(shellQuote4).join(" ")}`
|
|
29873
29592
|
};
|
|
29874
29593
|
}
|
|
29875
29594
|
var AUTO_UPDATE_FAILURE_FILE = ".auto-update-failure.json";
|
|
@@ -29989,7 +29708,7 @@ function installedPackageVersion(versionDir) {
|
|
|
29989
29708
|
function runCommand(command, args, env = process.env) {
|
|
29990
29709
|
return new Promise((resolveResult) => {
|
|
29991
29710
|
let output2 = "";
|
|
29992
|
-
const child =
|
|
29711
|
+
const child = spawn3(command, args, {
|
|
29993
29712
|
stdio: ["inherit", "pipe", "pipe"],
|
|
29994
29713
|
shell: process.platform === "win32",
|
|
29995
29714
|
env
|
|
@@ -30074,9 +29793,9 @@ function writeSidecarLauncher(input2) {
|
|
|
30074
29793
|
input2.path,
|
|
30075
29794
|
[
|
|
30076
29795
|
"#!/usr/bin/env sh",
|
|
30077
|
-
`export DEEPLINE_HOST_URL=${
|
|
30078
|
-
`export DEEPLINE_CONFIG_SCOPE=${
|
|
30079
|
-
`exec ${
|
|
29796
|
+
`export DEEPLINE_HOST_URL=${shellQuote4(input2.hostUrl)}`,
|
|
29797
|
+
`export DEEPLINE_CONFIG_SCOPE=${shellQuote4(input2.scope)}`,
|
|
29798
|
+
`exec ${shellQuote4(input2.nodeBin)} ${shellQuote4(input2.entryPath)} "$@"`,
|
|
30080
29799
|
""
|
|
30081
29800
|
].join("\n"),
|
|
30082
29801
|
{ encoding: "utf8", mode: 493 }
|
|
@@ -30288,7 +30007,7 @@ Examples:
|
|
|
30288
30007
|
}
|
|
30289
30008
|
|
|
30290
30009
|
// src/cli/commands/setup.ts
|
|
30291
|
-
import { spawnSync
|
|
30010
|
+
import { spawnSync } from "child_process";
|
|
30292
30011
|
import {
|
|
30293
30012
|
existsSync as existsSync13,
|
|
30294
30013
|
lstatSync,
|
|
@@ -30399,6 +30118,15 @@ function resolveScopeRoot(scope) {
|
|
|
30399
30118
|
function authScopeForSetup(scope) {
|
|
30400
30119
|
return scope === "local" ? "folder" : "global";
|
|
30401
30120
|
}
|
|
30121
|
+
function shouldOpenSetupAuthorization(runtime = detectAgentRuntime()) {
|
|
30122
|
+
return runtime !== "claude_cowork";
|
|
30123
|
+
}
|
|
30124
|
+
function openSetupAuthorization(authorizationUrl, options = {}) {
|
|
30125
|
+
const url = authorizationUrl.trim();
|
|
30126
|
+
if (!url || !shouldOpenSetupAuthorization(options.runtime)) return false;
|
|
30127
|
+
(options.open ?? openInBrowser)(url);
|
|
30128
|
+
return true;
|
|
30129
|
+
}
|
|
30402
30130
|
function setupStatePath(baseUrl, scope, root) {
|
|
30403
30131
|
return scope === "local" && root ? join16(root, ".deepline", "setup", "state.json") : join16(sdkCliStateDirPath(baseUrl), "setup.json");
|
|
30404
30132
|
}
|
|
@@ -30481,7 +30209,7 @@ function removeKnownLegacyPaths(baseUrl) {
|
|
|
30481
30209
|
return removed;
|
|
30482
30210
|
}
|
|
30483
30211
|
function resolvePathCommands(command) {
|
|
30484
|
-
const lookup =
|
|
30212
|
+
const lookup = spawnSync(
|
|
30485
30213
|
process.platform === "win32" ? "where" : "which",
|
|
30486
30214
|
process.platform === "win32" ? [command] : ["-a", command],
|
|
30487
30215
|
{ encoding: "utf8", shell: process.platform === "win32" }
|
|
@@ -30496,7 +30224,7 @@ function resolvePathCommand(command) {
|
|
|
30496
30224
|
return resolvePathCommands(command)[0] ?? null;
|
|
30497
30225
|
}
|
|
30498
30226
|
function resolvePersistentGlobalCommand() {
|
|
30499
|
-
const prefix =
|
|
30227
|
+
const prefix = spawnSync("npm", ["prefix", "-g"], { encoding: "utf8" });
|
|
30500
30228
|
if (prefix.status !== 0) return null;
|
|
30501
30229
|
const root = String(prefix.stdout ?? "").trim();
|
|
30502
30230
|
if (!root) return null;
|
|
@@ -30588,9 +30316,6 @@ function rollbackCommand(scope, root) {
|
|
|
30588
30316
|
const prefix = scope === "local" && root ? ` --prefix ${JSON.stringify(join16(root, ".deepline", "runtime"))}` : "";
|
|
30589
30317
|
return `npm install -g${prefix} --no-audit --no-fund --include=optional --allow-scripts=esbuild deepline@${SDK_VERSION}`;
|
|
30590
30318
|
}
|
|
30591
|
-
function setupQuickstartCommand(baseUrl) {
|
|
30592
|
-
return baseUrl === "https://code.deepline.com" ? "deepline quickstart" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} deepline quickstart`;
|
|
30593
|
-
}
|
|
30594
30319
|
function setupResumeCommand(baseUrl, scope) {
|
|
30595
30320
|
const hostPrefix = baseUrl === "https://code.deepline.com" ? "" : `DEEPLINE_HOST_URL=${JSON.stringify(baseUrl)} `;
|
|
30596
30321
|
return `${hostPrefix}deepline setup --scope ${scope} --json`;
|
|
@@ -30740,7 +30465,7 @@ async function runDoctorCommand(options) {
|
|
|
30740
30465
|
root,
|
|
30741
30466
|
authStatus
|
|
30742
30467
|
});
|
|
30743
|
-
const
|
|
30468
|
+
const gettingStarted = deeplineGtmGettingStartedPayload();
|
|
30744
30469
|
printCommandEnvelope(
|
|
30745
30470
|
{
|
|
30746
30471
|
ok,
|
|
@@ -30748,7 +30473,8 @@ async function runDoctorCommand(options) {
|
|
|
30748
30473
|
code: ok ? "DOCTOR_OK" : "DOCTOR_FAILED",
|
|
30749
30474
|
exitCode: ok ? 0 : 7,
|
|
30750
30475
|
checks,
|
|
30751
|
-
next: ok ?
|
|
30476
|
+
next: ok ? DEEPLINE_GTM_SKILL : "Review failed checks, then rerun: deepline doctor --json",
|
|
30477
|
+
...ok ? { gettingStarted } : {},
|
|
30752
30478
|
render: {
|
|
30753
30479
|
sections: [
|
|
30754
30480
|
{
|
|
@@ -30777,6 +30503,7 @@ function pendingResult(input2) {
|
|
|
30777
30503
|
phases: input2.phases
|
|
30778
30504
|
});
|
|
30779
30505
|
if (input2.authorizationUrl) {
|
|
30506
|
+
openSetupAuthorization(input2.authorizationUrl);
|
|
30780
30507
|
process.stderr.write(`Authorize Deepline: ${input2.authorizationUrl}
|
|
30781
30508
|
`);
|
|
30782
30509
|
}
|
|
@@ -30860,7 +30587,7 @@ async function runSetupCommand(options) {
|
|
|
30860
30587
|
json: options.json,
|
|
30861
30588
|
extra: {
|
|
30862
30589
|
persistentPath: globalCli.persistentPath,
|
|
30863
|
-
fallback: "https://code.deepline.com/
|
|
30590
|
+
fallback: "https://code.deepline.com/SKILL.md"
|
|
30864
30591
|
}
|
|
30865
30592
|
});
|
|
30866
30593
|
}
|
|
@@ -31063,14 +30790,15 @@ async function runSetupCommand(options) {
|
|
|
31063
30790
|
root,
|
|
31064
30791
|
authStatus: auth
|
|
31065
30792
|
});
|
|
31066
|
-
const
|
|
30793
|
+
const gettingStarted = deeplineGtmGettingStartedPayload();
|
|
31067
30794
|
const doctorPayload = {
|
|
31068
30795
|
ok: assessment.ok,
|
|
31069
30796
|
status: assessment.ok ? "complete" : "failed",
|
|
31070
30797
|
code: assessment.ok ? "DOCTOR_OK" : "DOCTOR_FAILED",
|
|
31071
30798
|
exitCode: assessment.ok ? 0 : 7,
|
|
31072
30799
|
checks: assessment.checks,
|
|
31073
|
-
next: assessment.ok ?
|
|
30800
|
+
next: assessment.ok ? DEEPLINE_GTM_SKILL : `deepline doctor --scope ${scope} --json`,
|
|
30801
|
+
...assessment.ok ? { gettingStarted } : {}
|
|
31074
30802
|
};
|
|
31075
30803
|
if (!assessment.ok) {
|
|
31076
30804
|
return reportSetupPhaseFailure({
|
|
@@ -31117,14 +30845,19 @@ async function runSetupCommand(options) {
|
|
|
31117
30845
|
currentPhase: null,
|
|
31118
30846
|
failedPhase: null,
|
|
31119
30847
|
resumed,
|
|
31120
|
-
next:
|
|
30848
|
+
next: DEEPLINE_GTM_SKILL,
|
|
30849
|
+
gettingStarted,
|
|
31121
30850
|
render: {
|
|
31122
30851
|
sections: [
|
|
31123
30852
|
{
|
|
31124
30853
|
title: "setup",
|
|
31125
30854
|
lines: [
|
|
31126
30855
|
"Deepline is installed and connected.",
|
|
31127
|
-
`
|
|
30856
|
+
`Use ${DEEPLINE_GTM_SKILL} in your agent.`,
|
|
30857
|
+
...DEEPLINE_GTM_STARTER_PROMPTS.map(
|
|
30858
|
+
(example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
|
|
30859
|
+
),
|
|
30860
|
+
gettingStarted.question
|
|
31128
30861
|
]
|
|
31129
30862
|
}
|
|
31130
30863
|
]
|
|
@@ -31140,7 +30873,7 @@ function registerSetupCommands(program) {
|
|
|
31140
30873
|
`
|
|
31141
30874
|
Notes:
|
|
31142
30875
|
Setup is idempotent. Bare setup resumes the first incomplete or failed phase.
|
|
31143
|
-
It installs skills before auth and does not run
|
|
30876
|
+
It installs skills before auth and does not run a starter workflow.
|
|
31144
30877
|
JSON output includes phase status and an exact retry command.
|
|
31145
30878
|
|
|
31146
30879
|
Examples:
|
|
@@ -31263,7 +30996,7 @@ function unknownCommandNameFromMessage(message) {
|
|
|
31263
30996
|
}
|
|
31264
30997
|
|
|
31265
30998
|
// src/cli/self-update.ts
|
|
31266
|
-
import { spawn as
|
|
30999
|
+
import { spawn as spawn4 } from "child_process";
|
|
31267
31000
|
function envTruthy(name) {
|
|
31268
31001
|
const value = process.env[name]?.trim().toLowerCase();
|
|
31269
31002
|
return value === "1" || value === "true" || value === "yes";
|
|
@@ -31312,7 +31045,7 @@ function relaunchCurrentCommand(plan) {
|
|
|
31312
31045
|
return new Promise((resolve15) => {
|
|
31313
31046
|
const command = plan.kind === "python-sidecar" ? plan.sidecarPath : process.execPath;
|
|
31314
31047
|
const args = plan.kind === "python-sidecar" ? process.argv.slice(2) : process.argv.slice(1);
|
|
31315
|
-
const child =
|
|
31048
|
+
const child = spawn4(command, args, {
|
|
31316
31049
|
stdio: "inherit",
|
|
31317
31050
|
shell: process.platform === "win32",
|
|
31318
31051
|
env: {
|
|
@@ -31377,7 +31110,7 @@ async function maybeAutoUpdateAndRelaunch(response) {
|
|
|
31377
31110
|
}
|
|
31378
31111
|
|
|
31379
31112
|
// src/cli/skills-sync.ts
|
|
31380
|
-
import { spawn as
|
|
31113
|
+
import { spawn as spawn5, spawnSync as spawnSync2 } from "child_process";
|
|
31381
31114
|
import {
|
|
31382
31115
|
existsSync as existsSync14,
|
|
31383
31116
|
mkdirSync as mkdirSync12,
|
|
@@ -31526,13 +31259,13 @@ function buildBunxSkillsInstallArgs(baseUrl, skillNames) {
|
|
|
31526
31259
|
});
|
|
31527
31260
|
}
|
|
31528
31261
|
function hasCommand(command) {
|
|
31529
|
-
const result =
|
|
31262
|
+
const result = spawnSync2(command, ["--version"], {
|
|
31530
31263
|
stdio: "ignore",
|
|
31531
31264
|
shell: process.platform === "win32"
|
|
31532
31265
|
});
|
|
31533
31266
|
return result.status === 0;
|
|
31534
31267
|
}
|
|
31535
|
-
function
|
|
31268
|
+
function shellQuote5(arg) {
|
|
31536
31269
|
return `'${arg.replace(/'/g, `'\\''`)}'`;
|
|
31537
31270
|
}
|
|
31538
31271
|
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES) {
|
|
@@ -31542,7 +31275,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
31542
31275
|
commands.push({
|
|
31543
31276
|
command: "bunx",
|
|
31544
31277
|
args: bunxArgs,
|
|
31545
|
-
manualCommand: `bunx ${bunxArgs.map(
|
|
31278
|
+
manualCommand: `bunx ${bunxArgs.map(shellQuote5).join(" ")}`
|
|
31546
31279
|
});
|
|
31547
31280
|
}
|
|
31548
31281
|
if (hasCommand("npx")) {
|
|
@@ -31550,14 +31283,14 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
|
|
|
31550
31283
|
commands.push({
|
|
31551
31284
|
command: "npx",
|
|
31552
31285
|
args: npxArgs,
|
|
31553
|
-
manualCommand: `npx ${npxArgs.map(
|
|
31286
|
+
manualCommand: `npx ${npxArgs.map(shellQuote5).join(" ")}`
|
|
31554
31287
|
});
|
|
31555
31288
|
}
|
|
31556
31289
|
return commands;
|
|
31557
31290
|
}
|
|
31558
31291
|
function runOneSkillsInstall(install) {
|
|
31559
31292
|
return new Promise((resolve15) => {
|
|
31560
|
-
const child =
|
|
31293
|
+
const child = spawn5(install.command, install.args, {
|
|
31561
31294
|
stdio: ["ignore", "ignore", "pipe"],
|
|
31562
31295
|
env: process.env
|
|
31563
31296
|
});
|
|
@@ -31641,7 +31374,7 @@ function runLegacySkillsCleanup() {
|
|
|
31641
31374
|
}
|
|
31642
31375
|
];
|
|
31643
31376
|
for (const candidate of candidates) {
|
|
31644
|
-
const result =
|
|
31377
|
+
const result = spawnSync2(candidate.command, candidate.args, {
|
|
31645
31378
|
stdio: "ignore",
|
|
31646
31379
|
env: process.env,
|
|
31647
31380
|
shell: process.platform === "win32"
|
|
@@ -32077,7 +31810,7 @@ async function runPreflightCheck() {
|
|
|
32077
31810
|
};
|
|
32078
31811
|
}).catch(() => ({ status: "unreachable", version: null })).finally(() => clearTimeout(healthTimeout));
|
|
32079
31812
|
const apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
32080
|
-
const
|
|
31813
|
+
const http = apiKey ? new HttpClient(
|
|
32081
31814
|
resolveConfig({
|
|
32082
31815
|
baseUrl,
|
|
32083
31816
|
apiKey,
|
|
@@ -32085,8 +31818,8 @@ async function runPreflightCheck() {
|
|
|
32085
31818
|
maxRetries: 0
|
|
32086
31819
|
})
|
|
32087
31820
|
) : null;
|
|
32088
|
-
const [auth, billing] =
|
|
32089
|
-
|
|
31821
|
+
const [auth, billing] = http ? await Promise.all([
|
|
31822
|
+
http.post("/api/v2/auth/cli/status", {
|
|
32090
31823
|
api_key: apiKey,
|
|
32091
31824
|
reveal: false
|
|
32092
31825
|
}).catch((error) => ({
|
|
@@ -32094,7 +31827,7 @@ async function runPreflightCheck() {
|
|
|
32094
31827
|
connected: false,
|
|
32095
31828
|
error: preflightErrorMessage(error)
|
|
32096
31829
|
})),
|
|
32097
|
-
|
|
31830
|
+
http.get("/api/v2/billing/balance").catch((error) => ({
|
|
32098
31831
|
balance: null,
|
|
32099
31832
|
balance_display: "unavailable",
|
|
32100
31833
|
balance_status: "unknown",
|
|
@@ -32277,7 +32010,6 @@ Exit codes:
|
|
|
32277
32010
|
registerBillingCommands(program);
|
|
32278
32011
|
registerMonitorsCommands(program);
|
|
32279
32012
|
registerOrgCommands(program);
|
|
32280
|
-
registerAdminCommands(program);
|
|
32281
32013
|
registerEnrichCommand(program);
|
|
32282
32014
|
registerCsvCommands(program);
|
|
32283
32015
|
registerDbCommands(program);
|
|
@@ -32447,7 +32179,8 @@ Examples:
|
|
|
32447
32179
|
} else {
|
|
32448
32180
|
console.error(`Error: ${String(error)}`);
|
|
32449
32181
|
}
|
|
32450
|
-
const
|
|
32182
|
+
const explicitExitCode = error && typeof error === "object" && typeof error.exitCode === "number" ? error.exitCode : void 0;
|
|
32183
|
+
const failureExitCode = explicitExitCode ?? resolveSdkCliFailureExitCode(error);
|
|
32451
32184
|
process.exitCode = failureExitCode;
|
|
32452
32185
|
await maybeReportSdkCliFailure({
|
|
32453
32186
|
argv: process.argv.slice(2),
|