deepline 0.3.395 → 0.3.397
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/plays/play-description.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
- package/dist/cli/{auth-NMQXZRS7.mjs → auth-AZJFXGKP.mjs} +5 -4
- package/dist/cli/auth-CZJQU7B5.js +40 -0
- package/dist/cli/{billing-Z4JTGUU3.js → billing-MQV5AGDJ.js} +77 -76
- package/dist/cli/{billing-5MVXZRS6.mjs → billing-MZAAUHGH.mjs} +6 -5
- package/dist/cli/{chunk-6D7A2FSL.mjs → chunk-2LDADJNO.mjs} +7 -107
- package/dist/cli/{chunk-UKU6JM3S.js → chunk-3VP34TAU.js} +8 -8
- package/dist/cli/{chunk-7XAM7KDW.mjs → chunk-4D745XZO.mjs} +21 -108
- package/dist/cli/chunk-7DRPTGCK.js +930 -0
- package/dist/cli/{chunk-ZMVJSS6N.js → chunk-BQR6UN3C.js} +62 -78
- package/dist/cli/{chunk-HRWUQJ4K.js → chunk-DQ65ZVHN.js} +6 -6
- package/dist/cli/{chunk-5VCZ3WRH.mjs → chunk-EIMG75BT.mjs} +1 -0
- package/dist/cli/{chunk-EFLQHJZ6.mjs → chunk-F3BUFYKE.mjs} +182 -1031
- package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
- package/dist/cli/{describe-DBRY5BNK.mjs → chunk-HFYQBC2D.mjs} +51 -171
- package/dist/cli/chunk-HGFFYVXN.js +210 -0
- package/dist/cli/{chunk-VB6KECLU.mjs → chunk-IHG7UAHD.mjs} +63 -79
- package/dist/cli/{chunk-TO2MWPGR.js → chunk-IZ74ABSX.js} +1 -1
- package/dist/cli/{chunk-G4IWGRMK.mjs → chunk-J7ABTQQ7.mjs} +5 -3
- package/dist/cli/{chunk-LZLBR2SF.js → chunk-K33MXVXQ.js} +323 -1172
- package/dist/cli/{chunk-DRM3CMHL.js → chunk-KXMNM4AQ.js} +2 -1
- package/dist/cli/chunk-LJ5747UC.mjs +107 -0
- package/dist/cli/{chunk-BON3DRC6.mjs → chunk-MRXMMERY.mjs} +1 -1
- package/dist/cli/{chunk-7MVWUXOD.mjs → chunk-MV7QRALK.mjs} +3 -3
- package/dist/cli/{chunk-WCCKMLHL.mjs → chunk-MYPH2LUU.mjs} +2 -2
- package/dist/cli/{chunk-RDXFGPJU.js → chunk-NA4T3B62.js} +64 -272
- package/dist/cli/{chunk-BLYL3KOC.mjs → chunk-NOX2TCBP.mjs} +1 -1
- package/dist/cli/chunk-OSDXE27V.mjs +88 -0
- package/dist/cli/{chunk-R4XZO6Z5.js → chunk-PSGEDGLT.js} +28 -115
- package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
- package/dist/cli/chunk-RFG3MRAC.js +286 -0
- package/dist/cli/{chunk-47M6HPGP.mjs → chunk-RNSWDKBM.mjs} +1 -1
- package/dist/cli/{chunk-56IFFVIB.js → chunk-RYW4HPSM.js} +21 -121
- package/dist/cli/{chunk-K5T3EN6D.js → chunk-SO7RUVTY.js} +26 -26
- package/dist/cli/{chunk-KZZC33PY.mjs → chunk-TXZVVBQZ.mjs} +63 -271
- package/dist/cli/{chunk-36ML3YKA.js → chunk-UVXBVUZQ.js} +15 -13
- package/dist/cli/{chunk-PZ5BZ76S.js → chunk-VTF4RRWJ.js} +50 -50
- package/dist/cli/{chunk-3TRY7KAC.mjs → chunk-W3HMGKMI.mjs} +2 -2
- package/dist/cli/{chunk-ZWH2TFA7.mjs → chunk-WM2QEHZL.mjs} +2 -2
- package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
- package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
- package/dist/cli/{chunk-UCXK2DS4.js → chunk-YLRME7MK.js} +15 -15
- package/dist/cli/{chunk-MYIBHORT.js → chunk-YSVORIEW.js} +2 -2
- package/dist/cli/{chunk-OCSG6X67.mjs → chunk-YUDKBQUD.mjs} +4 -4
- package/dist/cli/chunk-ZAAKSJAS.js +88 -0
- package/dist/cli/{chunk-VYLJJQ7Y.js → chunk-ZHUMDMOS.js} +65 -65
- package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
- package/dist/cli/{csv-HTS5ZYQ4.js → csv-AQBQ5O3I.js} +13 -12
- package/dist/cli/{csv-SVOD5UBH.mjs → csv-MB7PJMYQ.mjs} +4 -3
- package/dist/cli/{db-7AP4P52N.js → db-JPUYC5RB.js} +31 -30
- package/dist/cli/{db-7QLNI3Q4.mjs → db-L5IEI2AU.mjs} +6 -5
- package/dist/cli/describe-6WT74AOR.js +164 -0
- package/dist/cli/describe-S6BFANVI.mjs +164 -0
- package/dist/cli/describe-core.d.mts +100 -0
- package/dist/cli/describe-core.d.ts +100 -0
- package/dist/cli/describe-core.js +18 -0
- package/dist/cli/describe-core.mjs +18 -0
- package/dist/cli/{executions-GRQXTB2P.js → executions-6TMQTFP4.js} +8 -7
- package/dist/cli/{executions-QNZTPNG4.mjs → executions-L7I2ZW4Z.mjs} +6 -5
- package/dist/cli/{feedback-JMCSR624.mjs → feedback-DSJ63HK6.mjs} +4 -3
- package/dist/cli/{feedback-ZOLA2KY7.js → feedback-XF7CQGMD.js} +8 -7
- package/dist/cli/{git-LJGL2IHS.mjs → git-C3ENM67D.mjs} +5 -4
- package/dist/cli/git-HYDZK2QR.js +24 -0
- package/dist/cli/index.js +96 -94
- package/dist/cli/index.mjs +41 -39
- package/dist/cli/{legacy-noops-YSCIR2SD.js → legacy-noops-B2NHWIVD.js} +8 -7
- package/dist/cli/{legacy-noops-F23PKVBN.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
- package/dist/cli/{monitors-WMZ6HJZX.js → monitors-ORFWOVZB.js} +87 -86
- package/dist/cli/{monitors-S4LOEL7W.mjs → monitors-TCEDBDGY.mjs} +6 -5
- package/dist/cli/{org-U3WA2NQM.mjs → org-45KREIKZ.mjs} +6 -5
- package/dist/cli/{org-PFHM5ZLY.js → org-T74CJESN.js} +66 -65
- package/dist/cli/{chunk-XMAPE2KH.mjs → play-MU7MYBIM.mjs} +78 -131
- package/dist/cli/{chunk-4KLCLLTO.js → play-XHK2LPON.js} +273 -326
- package/dist/cli/{providers-XYMHLKCA.js → providers-4MGQKYFD.js} +9 -8
- package/dist/cli/{providers-QBBRFBOH.mjs → providers-VYCXIJT5.mjs} +6 -5
- package/dist/cli/{quickstart-IYGD6ZY3.js → quickstart-47G3VEOT.js} +6 -5
- package/dist/cli/{quickstart-5JTDGISY.mjs → quickstart-H724EFM2.mjs} +4 -3
- package/dist/cli/search-3356ENLD.js +30 -0
- package/dist/cli/{search-X6W6GRHS.mjs → search-VQHXEFQ4.mjs} +8 -6
- package/dist/cli/{secrets-UHG6OQFD.js → secrets-ALLKCU35.js} +15 -14
- package/dist/cli/{secrets-N55B67H6.mjs → secrets-CPBNGA44.mjs} +6 -5
- package/dist/cli/{sessions-JTRSTDSS.mjs → sessions-7RSQB7IX.mjs} +5 -4
- package/dist/cli/sessions-FKGAY7WQ.js +16 -0
- package/dist/cli/{settings-Q24HRAQI.mjs → settings-UYSGV4IC.mjs} +9 -8
- package/dist/cli/{settings-ATX4U5AS.js → settings-Y5BI42P7.js} +76 -75
- package/dist/cli/{setup-77ZWLVHT.mjs → setup-L3ZBBTS4.mjs} +7 -6
- package/dist/cli/{setup-EJCNOUCE.js → setup-VXQPEU3E.js} +42 -41
- package/dist/cli/skills-DUZQTDTE.js +29 -0
- package/dist/cli/{skills-XIS5AWQI.mjs → skills-QHVDLSFE.mjs} +5 -4
- package/dist/cli/{tools-WCKLYEGQ.mjs → tools-LSCEK4K2.mjs} +16 -19
- package/dist/cli/tools-YWU5QOQ5.js +39 -0
- package/dist/cli/update-5LYQAI55.js +29 -0
- package/dist/cli/{update-UT5WANMV.mjs → update-CU22OTBM.mjs} +7 -6
- package/dist/cli/{workflow-226QYUN2.js → workflow-ERFLTRNX.js} +17 -16
- package/dist/cli/{workflow-ZMX3L4ML.mjs → workflow-KQARK5BZ.mjs} +7 -6
- package/dist/{client-hdFtwhTm.d.mts → client-D0j-_aaa.d.mts} +2 -1
- package/dist/{client-CivP-PAI.d.ts → client-DflfVyj6.d.ts} +2 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -11
- package/dist/index.mjs +19 -15
- package/dist/install-integrity.json +94 -80
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/play-description.js +4 -2
- package/dist/plays/play-description.mjs +3 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +6 -1
- package/dist/cli/auth-UYCOBAL5.js +0 -39
- package/dist/cli/describe-YKOE54ZO.js +0 -406
- package/dist/cli/git-EJQLRK27.js +0 -23
- package/dist/cli/play-AGSECQFN.mjs +0 -159
- package/dist/cli/play-BR2LWGXK.js +0 -159
- package/dist/cli/search-ZVSYH5GY.js +0 -28
- package/dist/cli/sessions-57L5MGHN.js +0 -15
- package/dist/cli/skills-SPXUBLII.js +0 -28
- package/dist/cli/tools-DBHUUZJX.js +0 -42
- package/dist/cli/update-VSNFXRHJ.js +0 -28
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkUVXBVUZQjs = require('./chunk-UVXBVUZQ.js');
|
|
6
7
|
|
|
7
|
-
var _chunkHRWUQJ4Kjs = require('./chunk-HRWUQJ4K.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
var _chunkDQ65ZVHNjs = require('./chunk-DQ65ZVHN.js');
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkRYW4HPSMjs = require('./chunk-RYW4HPSM.js');
|
|
12
15
|
|
|
13
16
|
// src/cli/commands/search.ts
|
|
14
17
|
var _commander = require('commander');
|
|
@@ -18,7 +21,7 @@ var _fs = require('fs');
|
|
|
18
21
|
var _path = require('path');
|
|
19
22
|
var SEARCH_REF_TTL_MS = 15 * 6e4;
|
|
20
23
|
function lastSearchPath() {
|
|
21
|
-
return _path.join.call(void 0,
|
|
24
|
+
return _path.join.call(void 0, _chunkRYW4HPSMjs.sdkCliStateDirPath.call(void 0, _chunkRYW4HPSMjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
|
|
22
25
|
}
|
|
23
26
|
function rememberSearchRef(searchRef) {
|
|
24
27
|
try {
|
|
@@ -63,109 +66,6 @@ function formatTextTable(rows, columns) {
|
|
|
63
66
|
}).split("\n").map((line) => line.trimEnd()).join("\n").trimEnd();
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
// src/cli/tool-description.ts
|
|
67
|
-
function observedMaxText(pricing) {
|
|
68
|
-
const max = recordValue(recordValue(pricing).observedMax);
|
|
69
|
-
return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
|
|
70
|
-
}
|
|
71
|
-
var Capability = class _Capability {
|
|
72
|
-
#catalogEntry;
|
|
73
|
-
constructor(catalogEntry) {
|
|
74
|
-
this.#catalogEntry = catalogEntry;
|
|
75
|
-
}
|
|
76
|
-
static fromCatalogEntry(catalogEntry) {
|
|
77
|
-
return new _Capability(catalogEntry);
|
|
78
|
-
}
|
|
79
|
-
describe() {
|
|
80
|
-
return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var CapabilityDescription = class _CapabilityDescription {
|
|
84
|
-
#catalogEntry;
|
|
85
|
-
constructor(catalogEntry) {
|
|
86
|
-
this.#catalogEntry = catalogEntry;
|
|
87
|
-
}
|
|
88
|
-
static fromCatalogEntry(catalogEntry) {
|
|
89
|
-
return new _CapabilityDescription(catalogEntry);
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* The customer price already resolved by the catalog. This intentionally
|
|
93
|
-
* omits provider-price fields, even when a catalog Adapter carried them.
|
|
94
|
-
*/
|
|
95
|
-
customerCost() {
|
|
96
|
-
const legacyCost = recordValue(this.#catalogEntry.cost);
|
|
97
|
-
const pricing = recordValue(this.#catalogEntry.pricing);
|
|
98
|
-
const unit = stringValue(pricing.unit);
|
|
99
|
-
const legacyPricingModel = stringValue(
|
|
100
|
-
_nullishCoalesce(legacyCost.pricingModel, () => ( legacyCost.pricing_model))
|
|
101
|
-
);
|
|
102
|
-
const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
|
|
103
|
-
const canonicalCredits = pricingNumber(
|
|
104
|
-
pricing,
|
|
105
|
-
"creditsPerUnit",
|
|
106
|
-
"credits_per_unit",
|
|
107
|
-
_nullishCoalesce(this.#catalogEntry.deeplineCreditsPerPricingUnit, () => ( this.#catalogEntry.deepline_credits_per_pricing_unit))
|
|
108
|
-
);
|
|
109
|
-
const canonicalUsd = pricingNumber(
|
|
110
|
-
pricing,
|
|
111
|
-
"usdPerUnit",
|
|
112
|
-
"usd_per_unit",
|
|
113
|
-
_nullishCoalesce(this.#catalogEntry.deeplineUsdPerPricingUnit, () => ( this.#catalogEntry.deepline_usd_per_pricing_unit))
|
|
114
|
-
);
|
|
115
|
-
const billingSource = stringValue(
|
|
116
|
-
_nullishCoalesce(this.#catalogEntry.billingSource, () => ( this.#catalogEntry.billing_source))
|
|
117
|
-
);
|
|
118
|
-
const billingSourceLabel = stringValue(
|
|
119
|
-
_nullishCoalesce(this.#catalogEntry.billingSourceLabel, () => ( this.#catalogEntry.billing_source_label))
|
|
120
|
-
);
|
|
121
|
-
const isFree = billingSource === "free";
|
|
122
|
-
return {
|
|
123
|
-
pricingModel: pricingModel || null,
|
|
124
|
-
unit: unit || null,
|
|
125
|
-
displayText: isFree ? "Free" : stringValue(_nullishCoalesce(pricing.displayText, () => ( pricing.display_text))),
|
|
126
|
-
summary: isFree ? null : stringValue(pricing.summary),
|
|
127
|
-
billingMode: stringValue(
|
|
128
|
-
_nullishCoalesce(legacyCost.billingMode, () => ( legacyCost.billing_mode))
|
|
129
|
-
),
|
|
130
|
-
billingSource,
|
|
131
|
-
billingSourceLabel,
|
|
132
|
-
deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
|
|
133
|
-
deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
|
|
134
|
-
...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
135
|
-
estimatedRange: pricing.estimatedRange,
|
|
136
|
-
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
137
|
-
(value) => typeof value === "string"
|
|
138
|
-
) : []
|
|
139
|
-
} : {},
|
|
140
|
-
...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
141
|
-
observedReference: pricing.observedReference,
|
|
142
|
-
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
143
|
-
(value) => typeof value === "string"
|
|
144
|
-
) : []
|
|
145
|
-
} : {},
|
|
146
|
-
...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
147
|
-
observedMax: pricing.observedMax
|
|
148
|
-
} : {}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
function recordValue(value) {
|
|
153
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
154
|
-
}
|
|
155
|
-
function stringValue(value) {
|
|
156
|
-
return typeof value === "string" && value.trim() ? value : null;
|
|
157
|
-
}
|
|
158
|
-
function numberValue(value) {
|
|
159
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
160
|
-
}
|
|
161
|
-
function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
|
|
162
|
-
for (const key of [canonicalKey, aliasKey]) {
|
|
163
|
-
if (Object.prototype.hasOwnProperty.call(pricing, key))
|
|
164
|
-
return numberValue(pricing[key]);
|
|
165
|
-
}
|
|
166
|
-
return numberValue(legacyValue);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
69
|
// src/cli/search-output.ts
|
|
170
70
|
function clipSummary(value) {
|
|
171
71
|
const characters = Array.from(value.replace(/\s+/gu, " ").trim());
|
|
@@ -238,9 +138,14 @@ function rateLimitDisplay(item) {
|
|
|
238
138
|
);
|
|
239
139
|
return tightest ? `${tightest.requestsPerWindow}/${_nullishCoalesce(RATE_WINDOW_UNITS[tightest.windowMs], () => ( `${tightest.windowMs / 1e3}s`))}` : "\u2014";
|
|
240
140
|
}
|
|
141
|
+
function failureRateDisplay(rate) {
|
|
142
|
+
if (typeof rate !== "number") return "\u2014";
|
|
143
|
+
const percent = Math.round(rate * 100);
|
|
144
|
+
return percent === 0 && rate > 0 ? "<1%" : `${percent}%`;
|
|
145
|
+
}
|
|
241
146
|
function searchRow(item) {
|
|
242
147
|
const { cost, notes } = pricingDisplay(item);
|
|
243
|
-
const observedMax = item.billingSource === "own_provider_credentials" ? "" : observedMaxText(item.pricing);
|
|
148
|
+
const observedMax = item.billingSource === "own_provider_credentials" ? "" : _chunkZM2YPJQJjs.observedMaxText.call(void 0, item.pricing);
|
|
244
149
|
if (observedMax)
|
|
245
150
|
notes.push(`${observedMax[0].toUpperCase()}${observedMax.slice(1)}.`);
|
|
246
151
|
if (item.credentialStatus === "requires_connection") {
|
|
@@ -253,13 +158,16 @@ function searchRow(item) {
|
|
|
253
158
|
kind: item.kind,
|
|
254
159
|
cost,
|
|
255
160
|
rateLimit: rateLimitDisplay(item),
|
|
161
|
+
// Production share of errored or rate-limited calls; absent when too few
|
|
162
|
+
// calls or orgs used the tool to say.
|
|
163
|
+
failureRate: failureRateDisplay(item.failureRate),
|
|
256
164
|
summary: clipSummary(_nullishCoalesce(item.description, () => ( ""))),
|
|
257
165
|
notes
|
|
258
166
|
};
|
|
259
167
|
}
|
|
260
168
|
function renderSearchResults(result) {
|
|
261
169
|
if (result.results.length === 0)
|
|
262
|
-
return
|
|
170
|
+
return _chunkDQ65ZVHNjs.renderCommandEnvelopeText.call(void 0, result);
|
|
263
171
|
const rows = result.results.map(searchRow);
|
|
264
172
|
const kinds = new Set(rows.map((row) => row.kind));
|
|
265
173
|
const onlyTools = kinds.size === 1 && kinds.has("tool");
|
|
@@ -274,6 +182,13 @@ function renderSearchResults(result) {
|
|
|
274
182
|
alignment: "right"
|
|
275
183
|
}
|
|
276
184
|
] : [],
|
|
185
|
+
...rows.some((row) => row.failureRate !== "\u2014") ? [
|
|
186
|
+
{
|
|
187
|
+
header: "FAILURES",
|
|
188
|
+
value: (row) => row.failureRate,
|
|
189
|
+
alignment: "right"
|
|
190
|
+
}
|
|
191
|
+
] : [],
|
|
277
192
|
{ header: "SUMMARY", value: (row) => row.summary }
|
|
278
193
|
];
|
|
279
194
|
const render = result.render;
|
|
@@ -283,7 +198,7 @@ function renderSearchResults(result) {
|
|
|
283
198
|
actions: _optionalChain([render, 'optionalAccess', _11 => _11.actions])
|
|
284
199
|
};
|
|
285
200
|
const followUps = _optionalChain([remaining, 'access', _12 => _12.sections, 'optionalAccess', _13 => _13.length]) || _optionalChain([remaining, 'access', _14 => _14.actions, 'optionalAccess', _15 => _15.length]) ? `
|
|
286
|
-
${
|
|
201
|
+
${_chunkDQ65ZVHNjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
|
|
287
202
|
const notes = rows.flatMap(
|
|
288
203
|
(row) => row.notes.map((note) => ` ${row.id}: ${note}`)
|
|
289
204
|
);
|
|
@@ -360,7 +275,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
|
|
|
360
275
|
console.error(USAGE);
|
|
361
276
|
return 1;
|
|
362
277
|
}
|
|
363
|
-
const { search_ref: searchRef, ...result } = await new (0,
|
|
278
|
+
const { search_ref: searchRef, ...result } = await new (0, _chunkUVXBVUZQjs.DeeplineClient)().search({
|
|
364
279
|
query,
|
|
365
280
|
types,
|
|
366
281
|
exclude,
|
|
@@ -374,7 +289,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
|
|
|
374
289
|
});
|
|
375
290
|
if (searchRef) rememberSearchRef(searchRef);
|
|
376
291
|
pointAtDescribe(result);
|
|
377
|
-
|
|
292
|
+
_chunkDQ65ZVHNjs.printCommandEnvelope.call(void 0, result, {
|
|
378
293
|
json: options.json === true,
|
|
379
294
|
text: renderSearchResults(result)
|
|
380
295
|
});
|
|
@@ -474,6 +389,4 @@ Examples:
|
|
|
474
389
|
|
|
475
390
|
|
|
476
391
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
exports.recentSearchRef = recentSearchRef; exports.observedMaxText = observedMaxText; exports.Capability = Capability; exports.SEARCH_TYPES = SEARCH_TYPES; exports.parseTypes = parseTypes; exports.appendCsv = appendCsv; exports.pointAtDescribe = pointAtDescribe; exports.registerDeprecatedSearchCommand = registerDeprecatedSearchCommand; exports.registerSearchCommand = registerSearchCommand;
|
|
392
|
+
exports.recentSearchRef = recentSearchRef; exports.SEARCH_TYPES = SEARCH_TYPES; exports.parseTypes = parseTypes; exports.appendCsv = appendCsv; exports.pointAtDescribe = pointAtDescribe; exports.registerDeprecatedSearchCommand = registerDeprecatedSearchCommand; exports.registerSearchCommand = registerSearchCommand;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
7
|
+
|
|
8
|
+
// src/errors.ts
|
|
9
|
+
var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
10
|
+
__init() {this.outcome = "unknown"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
constructor(cause, operationKey, options = {}) {
|
|
14
|
+
const recoveryAvailable = operationKey !== void 0 && options.recoveryAvailable !== false;
|
|
15
|
+
super(
|
|
16
|
+
operationKey === void 0 ? "SQL outcome is unknown. The unkeyed request was attempted once; inspect the database before issuing another write. An operation key added afterwards cannot recover this request." : recoveryAvailable ? "SQL outcome is unknown. Recover by submitting the same SQL and options with the original operation key; do not use a new key." : "SQL outcome is unknown. The server did not confirm atomic recovery support. Do not resubmit this write; inspect the database and confirm reader support before recovering with the original operation key.",
|
|
17
|
+
cause.statusCode,
|
|
18
|
+
"CUSTOMER_DB_QUERY_OUTCOME_UNKNOWN",
|
|
19
|
+
{
|
|
20
|
+
outcome: "unknown",
|
|
21
|
+
recovery: recoveryAvailable ? "original_operation_key" : "unavailable",
|
|
22
|
+
causeCode: cause.code
|
|
23
|
+
}
|
|
24
|
+
);_class.prototype.__init.call(this);;
|
|
25
|
+
this.name = "CustomerDbQueryOutcomeUnknownError";
|
|
26
|
+
this.operationKey = operationKey;
|
|
27
|
+
this.retryable = recoveryAvailable;
|
|
28
|
+
Object.defineProperty(this, "cause", { value: cause, configurable: true });
|
|
29
|
+
}
|
|
30
|
+
}, _class);
|
|
31
|
+
var AuthError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
32
|
+
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
33
|
+
constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
|
|
34
|
+
super(message, 401, "AUTH_ERROR");
|
|
35
|
+
this.name = "AuthError";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var RateLimitError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
39
|
+
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
40
|
+
|
|
41
|
+
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
42
|
+
constructor(retryAfterMs = 5e3, message) {
|
|
43
|
+
super(
|
|
44
|
+
_nullishCoalesce(message, () => ( `Rate limited. Retry after ${retryAfterMs}ms.`)),
|
|
45
|
+
429,
|
|
46
|
+
"RATE_LIMIT"
|
|
47
|
+
);
|
|
48
|
+
this.name = "RateLimitError";
|
|
49
|
+
this.retryAfterMs = retryAfterMs;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var ToolRateLimitError = class extends RateLimitError {
|
|
53
|
+
/** Public tool id passed to `tools.execute`. */
|
|
54
|
+
|
|
55
|
+
/** Provider responsible for the operation, or `null`. */
|
|
56
|
+
|
|
57
|
+
/** Provider operation name, or `null`. */
|
|
58
|
+
|
|
59
|
+
/** Stable machine-readable failure code when one exists. */
|
|
60
|
+
|
|
61
|
+
/** Boundary responsible for the failure. */
|
|
62
|
+
|
|
63
|
+
/** Stable reason family for policy and diagnostics. */
|
|
64
|
+
|
|
65
|
+
/** Whether repeating the same semantic call is delivery-safe. */
|
|
66
|
+
|
|
67
|
+
/** Provider or Deepline request id, or `null`. */
|
|
68
|
+
|
|
69
|
+
/** Network failure kind, or `null` for non-network failures. */
|
|
70
|
+
|
|
71
|
+
/** Network boundary that failed, or `null` for non-network failures. */
|
|
72
|
+
|
|
73
|
+
/** Explicitly allowlisted diagnostics safe for SDK callers. */
|
|
74
|
+
|
|
75
|
+
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
76
|
+
constructor(message, options) {
|
|
77
|
+
super(_nullishCoalesce(options.retryAfterMs, () => ( 5e3)), message);
|
|
78
|
+
this.name = "ToolRateLimitError";
|
|
79
|
+
this.statusCode = _nullishCoalesce(options.statusCode, () => ( 429));
|
|
80
|
+
this.code = _nullishCoalesce(options.code, () => ( void 0));
|
|
81
|
+
this.toolId = options.toolId;
|
|
82
|
+
this.provider = options.provider;
|
|
83
|
+
this.operation = options.operation;
|
|
84
|
+
this.origin = options.origin;
|
|
85
|
+
this.category = options.category;
|
|
86
|
+
this.retryable = options.retryable;
|
|
87
|
+
this.requestId = options.requestId;
|
|
88
|
+
this.networkKind = options.networkKind;
|
|
89
|
+
this.networkScope = options.networkScope;
|
|
90
|
+
this.publicDetails = _nullishCoalesce(options.publicDetails, () => ( null));
|
|
91
|
+
this.details = options.details;
|
|
92
|
+
_chunk7P5AA3SNjs.brandAsToolExecutionError.call(void 0, this);
|
|
93
|
+
if (_chunk7P5AA3SNjs.isProviderTransientFailure.call(void 0, this)) {
|
|
94
|
+
_chunk7P5AA3SNjs.brandAsProviderTransientError.call(void 0, this);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var ConfigError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
99
|
+
/** Construct a local SDK configuration failure. */
|
|
100
|
+
constructor(message) {
|
|
101
|
+
super(message, void 0, "CONFIG_ERROR");
|
|
102
|
+
this.name = "ConfigError";
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
exports.CustomerDbQueryOutcomeUnknownError = CustomerDbQueryOutcomeUnknownError; exports.AuthError = AuthError; exports.RateLimitError = RateLimitError; exports.ToolRateLimitError = ToolRateLimitError; exports.ConfigError = ConfigError;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk7DRPTGCKjs = require('./chunk-7DRPTGCK.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkBQR6UN3Cjs = require('./chunk-BQR6UN3C.js');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
20
|
+
|
|
21
|
+
// src/cli/tool-features.ts
|
|
22
|
+
var VIEWS = {
|
|
23
|
+
ai_gateway_model: async (value, _tool, { describeModel }) => {
|
|
24
|
+
if (!value)
|
|
25
|
+
throw new Error("Name a model: --feature model=<provider/model>");
|
|
26
|
+
const model = await describeModel(value);
|
|
27
|
+
const unlisted = model.modelMetadata ? [] : [
|
|
28
|
+
`Warning: ${value} is not in the live AI Gateway catalog; check the id at https://ai-gateway.vercel.sh/v1/models.`
|
|
29
|
+
];
|
|
30
|
+
return {
|
|
31
|
+
details: model,
|
|
32
|
+
lines: [
|
|
33
|
+
...unlisted,
|
|
34
|
+
..._chunk7DRPTGCKjs.formatModelDescription.call(void 0, model).trimEnd().split("\n")
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
byok: async (_value, tool) => ({
|
|
39
|
+
details: _nullishCoalesce(tool.byok, () => ( {})),
|
|
40
|
+
lines: _chunkBQR6UN3Cjs.byokLines.call(void 0, _nullishCoalesce(tool.byok, () => ( {})))
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
var isFeatureView = (value) => typeof value === "string" && Object.hasOwn(VIEWS, value);
|
|
44
|
+
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
45
|
+
function inputProperties(tool) {
|
|
46
|
+
const inputSchema = asRecord(tool.inputSchema);
|
|
47
|
+
const jsonSchema = asRecord(_nullishCoalesce(inputSchema.jsonSchema, () => ( inputSchema)));
|
|
48
|
+
return asRecord(jsonSchema.properties);
|
|
49
|
+
}
|
|
50
|
+
var firstSentence = (text) => typeof text === "string" ? _nullishCoalesce(text.split(/(?<=\.)\s/)[0], () => ( text)) : "";
|
|
51
|
+
function toolFeatures(tool) {
|
|
52
|
+
const inputs = Object.entries(inputProperties(tool)).flatMap(
|
|
53
|
+
([name, value]) => {
|
|
54
|
+
const schema = asRecord(value);
|
|
55
|
+
if (!isFeatureView(schema.feature)) return [];
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
name,
|
|
59
|
+
summary: firstSentence(schema.description),
|
|
60
|
+
view: schema.feature,
|
|
61
|
+
...typeof schema.default === "string" ? { defaultValue: schema.default } : {}
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
const byok = _optionalChain([tool, 'access', _ => _.byok, 'optionalAccess', _2 => _2.supported]) === true ? [
|
|
67
|
+
{
|
|
68
|
+
name: "byok",
|
|
69
|
+
summary: "Run it on your own provider credentials.",
|
|
70
|
+
view: "byok"
|
|
71
|
+
}
|
|
72
|
+
] : [];
|
|
73
|
+
return [...inputs, ...byok];
|
|
74
|
+
}
|
|
75
|
+
function parseFeatureRequest(request) {
|
|
76
|
+
const [name = "", ...rest] = request.split("=");
|
|
77
|
+
const value = rest.join("=");
|
|
78
|
+
return value ? { name, value } : { name };
|
|
79
|
+
}
|
|
80
|
+
async function describeFeature(tool, feature, value, dependencies) {
|
|
81
|
+
return VIEWS[feature.view](_nullishCoalesce(value, () => ( feature.defaultValue)), tool, dependencies);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/cli/describe-core.ts
|
|
85
|
+
var FILTER_OF = {
|
|
86
|
+
tool: "tools",
|
|
87
|
+
monitor_type: "monitors",
|
|
88
|
+
prebuilt_play: "prebuilts",
|
|
89
|
+
custom_play: "custom"
|
|
90
|
+
};
|
|
91
|
+
async function found(lookup) {
|
|
92
|
+
try {
|
|
93
|
+
return await lookup;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (error instanceof _chunk7P5AA3SNjs.DeeplineError && (error.statusCode === 404 || error.code === "PLAY_NOT_FOUND" || error.code === "NOT_FOUND")) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function describeLookupsFor(client) {
|
|
102
|
+
return {
|
|
103
|
+
play: (reference) => found(client.describePlay(reference)),
|
|
104
|
+
tool: (name) => found(client.getTool(name)),
|
|
105
|
+
describeModel: (model) => client.describeModel(model),
|
|
106
|
+
baseUrl: client.baseUrl
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async function describeName(name, options, lookups) {
|
|
110
|
+
const maintainedOnly = options.prebuilt === true || options.tool === true;
|
|
111
|
+
const wants = (filter) => (!options.kinds || options.kinds.includes(filter)) && !(maintainedOnly && filter === "custom");
|
|
112
|
+
const play = async (reference) => {
|
|
113
|
+
const record2 = await lookups.play(reference);
|
|
114
|
+
if (!record2) return null;
|
|
115
|
+
return {
|
|
116
|
+
described: _chunkBQR6UN3Cjs.describedPlay.call(void 0, record2),
|
|
117
|
+
record: { ...record2 },
|
|
118
|
+
schemas: {
|
|
119
|
+
inputSchema: _nullishCoalesce(record2.inputSchema, () => ( null)),
|
|
120
|
+
outputSchema: _nullishCoalesce(record2.outputSchema, () => ( null))
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
const tool = async () => {
|
|
125
|
+
const record2 = await lookups.tool(name);
|
|
126
|
+
if (!record2) return null;
|
|
127
|
+
const { byok } = record2;
|
|
128
|
+
const features = toolFeatures(record2);
|
|
129
|
+
return {
|
|
130
|
+
described: {
|
|
131
|
+
..._chunk7DRPTGCKjs.describedTool.call(void 0, record2, name),
|
|
132
|
+
// Shown when the tool runs only on your own credentials; otherwise
|
|
133
|
+
// it is a feature, described with --feature byok.
|
|
134
|
+
..._optionalChain([byok, 'optionalAccess', _3 => _3.required]) === true ? { byok } : {},
|
|
135
|
+
...features.length ? { features: features.map(({ view: _view, ...feature }) => feature) } : {}
|
|
136
|
+
},
|
|
137
|
+
record: _chunk7DRPTGCKjs.toolMetadataJsonForDescribe.call(void 0,
|
|
138
|
+
record2,
|
|
139
|
+
name,
|
|
140
|
+
lookups.seedStarterScript
|
|
141
|
+
),
|
|
142
|
+
schemas: _chunk7DRPTGCKjs.publicToolSchemas.call(void 0, record2),
|
|
143
|
+
feature: (featureName, value) => {
|
|
144
|
+
const feature = features.find(({ name: name2 }) => name2 === featureName);
|
|
145
|
+
return feature ? describeFeature(record2, feature, value, {
|
|
146
|
+
describeModel: (model) => lookups.describeModel(model)
|
|
147
|
+
}) : null;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
const sources = name.includes("/") ? [{ kinds: ["prebuilts", "custom"], find: () => play(name) }] : [
|
|
152
|
+
{ kinds: ["custom"], find: () => play(name) },
|
|
153
|
+
{ kinds: ["tools", "monitors"], find: tool },
|
|
154
|
+
{ kinds: ["prebuilts"], find: () => play(`prebuilt/${name}`) }
|
|
155
|
+
];
|
|
156
|
+
const matches = await Promise.all(
|
|
157
|
+
sources.filter((source) => source.kinds.some(wants)).map(async ({ kinds, find }) => {
|
|
158
|
+
const match = await find();
|
|
159
|
+
const filter = match && FILTER_OF[match.described.kind];
|
|
160
|
+
return filter && kinds.includes(filter) && wants(filter) ? match : null;
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
const [chosen, shadowed] = matches.filter((match) => match !== null);
|
|
164
|
+
if (!chosen) return { status: "missing" };
|
|
165
|
+
const { described, record } = chosen;
|
|
166
|
+
const shadows = described.kind === "custom_play" && shadowed ? {
|
|
167
|
+
kind: shadowed.described.kind,
|
|
168
|
+
describeCommand: `deepline describe ${name} --prebuilt`
|
|
169
|
+
} : null;
|
|
170
|
+
const note = shadows ? `Showing your workspace play "${name}". It has the same name as a Deepline ${shadows.kind.replace("_", " ")}; see that one with: ${shadows.describeCommand}` : null;
|
|
171
|
+
const verbose = options.verbose === true;
|
|
172
|
+
const isPlay = described.kind === "prebuilt_play" || described.kind === "custom_play";
|
|
173
|
+
const dashboardUrl = isPlay ? _chunkBQR6UN3Cjs.buildPlayDashboardUrl.call(void 0, lookups.baseUrl, described.id) : null;
|
|
174
|
+
if (options.webUrl) {
|
|
175
|
+
if (!dashboardUrl) {
|
|
176
|
+
return {
|
|
177
|
+
status: "refused",
|
|
178
|
+
message: `${described.id} is a ${described.kind.replace("_", " ")}, not a play; only plays have a play page.`,
|
|
179
|
+
exitCode: 1
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
status: "described",
|
|
184
|
+
envelope: { dashboardUrl },
|
|
185
|
+
lines: [dashboardUrl]
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
if (options.feature !== void 0) {
|
|
189
|
+
const { name: featureName, value } = parseFeatureRequest(options.feature);
|
|
190
|
+
const pending = _nullishCoalesce(_optionalChain([chosen, 'access', _4 => _4.feature, 'optionalCall', _5 => _5(featureName, value)]), () => ( null));
|
|
191
|
+
const features = _nullishCoalesce(described.features, () => ( []));
|
|
192
|
+
if (!pending) {
|
|
193
|
+
return {
|
|
194
|
+
status: "refused",
|
|
195
|
+
message: features.length ? `${described.id} has no feature "${featureName}". Its features: ${features.map(({ name: name2 }) => name2).join(", ")}.` : `${described.id} has no features to describe.`,
|
|
196
|
+
exitCode: 2
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const shownValue = _nullishCoalesce(value, () => ( _optionalChain([features, 'access', _6 => _6.find, 'call', _7 => _7(({ name: name2 }) => name2 === featureName), 'optionalAccess', _8 => _8.defaultValue])));
|
|
200
|
+
const { details, lines } = await pending;
|
|
201
|
+
return {
|
|
202
|
+
status: "described",
|
|
203
|
+
envelope: {
|
|
204
|
+
kind: described.kind,
|
|
205
|
+
id: described.id,
|
|
206
|
+
feature: featureName,
|
|
207
|
+
...shownValue ? { value: shownValue } : {},
|
|
208
|
+
details
|
|
209
|
+
},
|
|
210
|
+
lines: [
|
|
211
|
+
`${described.id} --feature ${featureName}${shownValue ? `=${shownValue}` : ""}`,
|
|
212
|
+
...lines
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const fields = (_nullishCoalesce(options.fields, () => ( ""))).split(",").map((name2) => name2.trim()).filter(Boolean);
|
|
217
|
+
const named = options.cliExample === true || options.playExample === true;
|
|
218
|
+
const shown = options.example !== false;
|
|
219
|
+
const {
|
|
220
|
+
runner: _runner,
|
|
221
|
+
inputs,
|
|
222
|
+
outputs,
|
|
223
|
+
rowInputs: _rowInputs,
|
|
224
|
+
rowOutputs: _rowOutputs,
|
|
225
|
+
rowOutputsAddToSource: _rowOutputsAddToSource,
|
|
226
|
+
csvInput: _csvInput,
|
|
227
|
+
...summary
|
|
228
|
+
} = described;
|
|
229
|
+
const view = options.schemaOnly ? {
|
|
230
|
+
envelope: {
|
|
231
|
+
kind: described.kind,
|
|
232
|
+
id: described.id,
|
|
233
|
+
...chosen.schemas
|
|
234
|
+
},
|
|
235
|
+
lines: [
|
|
236
|
+
`${described.id} [${described.kind.replace("_", " ")}]`,
|
|
237
|
+
..._chunkBQR6UN3Cjs.schemaLines.call(void 0, described, {
|
|
238
|
+
full: true,
|
|
239
|
+
secondary: true,
|
|
240
|
+
...fields.length ? { fields } : {}
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
} : {
|
|
244
|
+
envelope: {
|
|
245
|
+
...summary,
|
|
246
|
+
inputs: inputs.map(_chunkBQR6UN3Cjs.topLevelField),
|
|
247
|
+
outputs: outputs.map(_chunkBQR6UN3Cjs.topLevelField),
|
|
248
|
+
...described.rowInputs ? { rowInputs: described.rowInputs.map(_chunkBQR6UN3Cjs.topLevelField) } : {},
|
|
249
|
+
...described.rowOutputs ? { rowOutputs: described.rowOutputs.map(_chunkBQR6UN3Cjs.topLevelField) } : {},
|
|
250
|
+
runExamples: _chunkBQR6UN3Cjs.examples.call(void 0, described, { verbose }),
|
|
251
|
+
...dashboardUrl ? { dashboardUrl } : {},
|
|
252
|
+
...shadows ? { shadows, note } : {}
|
|
253
|
+
},
|
|
254
|
+
lines: [
|
|
255
|
+
...note ? [`Note: ${note}`, ""] : [],
|
|
256
|
+
..._chunkBQR6UN3Cjs.describedLines.call(void 0, described, {
|
|
257
|
+
cli: shown && (!named || options.cliExample === true),
|
|
258
|
+
play: shown && (!named || options.playExample === true),
|
|
259
|
+
explain: named,
|
|
260
|
+
verbose,
|
|
261
|
+
fullSchema: options.fullSchema === true,
|
|
262
|
+
...fields.length ? { fields } : {}
|
|
263
|
+
}),
|
|
264
|
+
...dashboardUrl ? ["", `Play page: ${dashboardUrl}`] : []
|
|
265
|
+
]
|
|
266
|
+
};
|
|
267
|
+
const fullRecord = options.fullRecord === true || options.fullSchema === true;
|
|
268
|
+
const envelope = options.schemaOnly ? view.envelope : fullRecord ? (
|
|
269
|
+
// The shared keys lead; where the kind's own record has the same key,
|
|
270
|
+
// its value stands, so callers of the older commands read what they did.
|
|
271
|
+
{ ...view.envelope, ...record }
|
|
272
|
+
) : {
|
|
273
|
+
..._chunkBQR6UN3Cjs.describedJson.call(void 0, described, {
|
|
274
|
+
secondary: verbose || fields.length > 0,
|
|
275
|
+
verbose
|
|
276
|
+
}),
|
|
277
|
+
...dashboardUrl ? { dashboardUrl } : {},
|
|
278
|
+
...shadows ? { shadows, note } : {}
|
|
279
|
+
};
|
|
280
|
+
return { status: "described", envelope, lines: view.lines };
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
exports.describeLookupsFor = describeLookupsFor; exports.describeName = describeName;
|