deepline 0.1.263 → 0.1.264
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 +86 -206
- package/dist/cli/index.mjs +92 -212
- 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.264",
|
|
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
|
});
|
|
@@ -26248,8 +26128,8 @@ async function handleSet(nameInput, forbidden, options) {
|
|
|
26248
26128
|
throw new Error("--play <name> is required when --scope play is used.");
|
|
26249
26129
|
}
|
|
26250
26130
|
const value = await readSecretValue();
|
|
26251
|
-
const { http
|
|
26252
|
-
const response = await
|
|
26131
|
+
const { http } = getAuthedHttpClient();
|
|
26132
|
+
const response = await http.post(
|
|
26253
26133
|
"/api/v2/secrets",
|
|
26254
26134
|
{
|
|
26255
26135
|
name,
|
|
@@ -32077,7 +31957,7 @@ async function runPreflightCheck() {
|
|
|
32077
31957
|
};
|
|
32078
31958
|
}).catch(() => ({ status: "unreachable", version: null })).finally(() => clearTimeout(healthTimeout));
|
|
32079
31959
|
const apiKey = resolveApiKeyForBaseUrl(baseUrl);
|
|
32080
|
-
const
|
|
31960
|
+
const http = apiKey ? new HttpClient(
|
|
32081
31961
|
resolveConfig({
|
|
32082
31962
|
baseUrl,
|
|
32083
31963
|
apiKey,
|
|
@@ -32085,8 +31965,8 @@ async function runPreflightCheck() {
|
|
|
32085
31965
|
maxRetries: 0
|
|
32086
31966
|
})
|
|
32087
31967
|
) : null;
|
|
32088
|
-
const [auth, billing] =
|
|
32089
|
-
|
|
31968
|
+
const [auth, billing] = http ? await Promise.all([
|
|
31969
|
+
http.post("/api/v2/auth/cli/status", {
|
|
32090
31970
|
api_key: apiKey,
|
|
32091
31971
|
reveal: false
|
|
32092
31972
|
}).catch((error) => ({
|
|
@@ -32094,7 +31974,7 @@ async function runPreflightCheck() {
|
|
|
32094
31974
|
connected: false,
|
|
32095
31975
|
error: preflightErrorMessage(error)
|
|
32096
31976
|
})),
|
|
32097
|
-
|
|
31977
|
+
http.get("/api/v2/billing/balance").catch((error) => ({
|
|
32098
31978
|
balance: null,
|
|
32099
31979
|
balance_display: "unavailable",
|
|
32100
31980
|
balance_status: "unknown",
|
|
@@ -32277,7 +32157,6 @@ Exit codes:
|
|
|
32277
32157
|
registerBillingCommands(program);
|
|
32278
32158
|
registerMonitorsCommands(program);
|
|
32279
32159
|
registerOrgCommands(program);
|
|
32280
|
-
registerAdminCommands(program);
|
|
32281
32160
|
registerEnrichCommand(program);
|
|
32282
32161
|
registerCsvCommands(program);
|
|
32283
32162
|
registerDbCommands(program);
|
|
@@ -32447,7 +32326,8 @@ Examples:
|
|
|
32447
32326
|
} else {
|
|
32448
32327
|
console.error(`Error: ${String(error)}`);
|
|
32449
32328
|
}
|
|
32450
|
-
const
|
|
32329
|
+
const explicitExitCode = error && typeof error === "object" && typeof error.exitCode === "number" ? error.exitCode : void 0;
|
|
32330
|
+
const failureExitCode = explicitExitCode ?? resolveSdkCliFailureExitCode(error);
|
|
32451
32331
|
process.exitCode = failureExitCode;
|
|
32452
32332
|
await maybeReportSdkCliFailure({
|
|
32453
32333
|
argv: process.argv.slice(2),
|
package/dist/index.d.mts
CHANGED
|
@@ -150,6 +150,8 @@ interface ToolDefinition {
|
|
|
150
150
|
description: string;
|
|
151
151
|
/** Categorization tags (e.g. `["people", "enrichment"]`). */
|
|
152
152
|
categories: DeeplineToolCategory[];
|
|
153
|
+
/** Searchable provider and account-signal tags. */
|
|
154
|
+
tags?: string[];
|
|
153
155
|
/** Operation slug within the provider. */
|
|
154
156
|
operation?: string;
|
|
155
157
|
/** Normalized operation identifier. */
|
|
@@ -1795,6 +1797,7 @@ declare class DeeplineClient {
|
|
|
1795
1797
|
*/
|
|
1796
1798
|
listTools(options?: {
|
|
1797
1799
|
categories?: string;
|
|
1800
|
+
tags?: string;
|
|
1798
1801
|
grep?: string;
|
|
1799
1802
|
grepMode?: 'all' | 'any' | 'phrase';
|
|
1800
1803
|
compact?: boolean;
|