deepline 0.3.396 → 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/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +2 -2
- package/dist/cli/{auth-3LTD62VL.mjs → auth-AZJFXGKP.mjs} +5 -4
- package/dist/cli/auth-CZJQU7B5.js +40 -0
- package/dist/cli/{billing-PA5OXEM5.js → billing-MQV5AGDJ.js} +76 -75
- package/dist/cli/{billing-DP7ZAJBO.mjs → billing-MZAAUHGH.mjs} +5 -4
- package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-2LDADJNO.mjs} +7 -107
- package/dist/cli/{chunk-772W2SAU.js → chunk-3VP34TAU.js} +8 -8
- package/dist/cli/{chunk-QHGPA362.mjs → chunk-4D745XZO.mjs} +6 -108
- package/dist/cli/chunk-7DRPTGCK.js +930 -0
- package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
- package/dist/cli/{chunk-RTO5QZWT.js → chunk-DQ65ZVHN.js} +6 -6
- package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-F3BUFYKE.mjs} +89 -969
- package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
- package/dist/cli/{describe-6O2ENKTP.mjs → chunk-HFYQBC2D.mjs} +22 -160
- package/dist/cli/chunk-HGFFYVXN.js +210 -0
- package/dist/cli/{chunk-5WNJF2T3.mjs → chunk-IHG7UAHD.mjs} +1 -83
- package/dist/cli/{chunk-GNN4MY5X.js → chunk-IZ74ABSX.js} +1 -1
- package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-J7ABTQQ7.mjs} +4 -2
- package/dist/cli/{chunk-2VOLOWYZ.js → chunk-K33MXVXQ.js} +293 -1173
- package/dist/cli/chunk-LJ5747UC.mjs +107 -0
- package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-MRXMMERY.mjs} +1 -1
- package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-MV7QRALK.mjs} +3 -3
- package/dist/cli/{chunk-AUYXWELC.mjs → chunk-MYPH2LUU.mjs} +2 -2
- package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
- package/dist/cli/{chunk-23GAA3YO.mjs → chunk-NOX2TCBP.mjs} +1 -1
- package/dist/cli/chunk-OSDXE27V.mjs +88 -0
- package/dist/cli/{chunk-KAEZNPUM.js → chunk-PSGEDGLT.js} +13 -115
- package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
- package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
- package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-RNSWDKBM.mjs} +1 -1
- package/dist/cli/{chunk-V7UP2F4U.js → chunk-RYW4HPSM.js} +21 -121
- package/dist/cli/{chunk-7Z66NHUC.js → chunk-SO7RUVTY.js} +26 -26
- package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
- package/dist/cli/{chunk-WQJJNIMQ.js → chunk-UVXBVUZQ.js} +11 -9
- package/dist/cli/{chunk-AVHLATII.js → chunk-VTF4RRWJ.js} +50 -50
- package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-W3HMGKMI.mjs} +2 -2
- package/dist/cli/{chunk-JCN4DHF7.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-ME6XRFLY.js → chunk-YLRME7MK.js} +15 -15
- package/dist/cli/{chunk-DC6LTULT.js → chunk-YSVORIEW.js} +2 -2
- package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-YUDKBQUD.mjs} +4 -4
- package/dist/cli/chunk-ZAAKSJAS.js +88 -0
- package/dist/cli/{chunk-RMTASUAK.js → chunk-ZHUMDMOS.js} +65 -65
- package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
- package/dist/cli/{csv-TF576S77.js → csv-AQBQ5O3I.js} +13 -12
- package/dist/cli/{csv-RLRR74RQ.mjs → csv-MB7PJMYQ.mjs} +4 -3
- package/dist/cli/{db-FDBJUTFO.js → db-JPUYC5RB.js} +30 -29
- package/dist/cli/{db-XORGNBIC.mjs → db-L5IEI2AU.mjs} +5 -4
- 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-SFYAXPF4.js → executions-6TMQTFP4.js} +7 -6
- package/dist/cli/{executions-YPP7WR77.mjs → executions-L7I2ZW4Z.mjs} +5 -4
- package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-DSJ63HK6.mjs} +4 -3
- package/dist/cli/{feedback-5UZFYMGB.js → feedback-XF7CQGMD.js} +8 -7
- package/dist/cli/{git-IRSAJEK2.mjs → git-C3ENM67D.mjs} +5 -4
- package/dist/cli/git-HYDZK2QR.js +24 -0
- package/dist/cli/index.js +93 -91
- package/dist/cli/index.mjs +35 -33
- package/dist/cli/{legacy-noops-CVAOQY2F.js → legacy-noops-B2NHWIVD.js} +8 -7
- package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-VFG2K6HK.mjs} +5 -4
- package/dist/cli/{monitors-4OMRXCXP.js → monitors-ORFWOVZB.js} +86 -85
- package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-TCEDBDGY.mjs} +5 -4
- package/dist/cli/{org-QDDXAE3J.mjs → org-45KREIKZ.mjs} +5 -4
- package/dist/cli/{org-YGNJDD2X.js → org-T74CJESN.js} +65 -64
- package/dist/cli/{play-VT6OHB2D.mjs → play-MU7MYBIM.mjs} +19 -15
- package/dist/cli/{play-L535H26U.js → play-XHK2LPON.js} +251 -247
- package/dist/cli/{providers-GPZ6PQAL.js → providers-4MGQKYFD.js} +8 -7
- package/dist/cli/{providers-KG4W5MPK.mjs → providers-VYCXIJT5.mjs} +5 -4
- package/dist/cli/{quickstart-UI27S5LO.js → quickstart-47G3VEOT.js} +6 -5
- package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-H724EFM2.mjs} +4 -3
- package/dist/cli/search-3356ENLD.js +30 -0
- package/dist/cli/{search-PW3RAUX7.mjs → search-VQHXEFQ4.mjs} +7 -5
- package/dist/cli/{secrets-WFAXOUZE.js → secrets-ALLKCU35.js} +14 -13
- package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-CPBNGA44.mjs} +5 -4
- package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-7RSQB7IX.mjs} +5 -4
- package/dist/cli/sessions-FKGAY7WQ.js +16 -0
- package/dist/cli/{settings-YNZ4YKCH.mjs → settings-UYSGV4IC.mjs} +8 -7
- package/dist/cli/{settings-GADAG2UK.js → settings-Y5BI42P7.js} +75 -74
- package/dist/cli/{setup-PSEHIUXO.mjs → setup-L3ZBBTS4.mjs} +7 -6
- package/dist/cli/{setup-R5YO7GT6.js → setup-VXQPEU3E.js} +42 -41
- package/dist/cli/skills-DUZQTDTE.js +29 -0
- package/dist/cli/{skills-LTQBP6CZ.mjs → skills-QHVDLSFE.mjs} +5 -4
- package/dist/cli/{tools-UAXDWU63.mjs → tools-LSCEK4K2.mjs} +13 -8
- package/dist/cli/tools-YWU5QOQ5.js +39 -0
- package/dist/cli/update-5LYQAI55.js +29 -0
- package/dist/cli/{update-SMNIBIMS.mjs → update-CU22OTBM.mjs} +7 -6
- package/dist/cli/{workflow-AOQVZHMD.js → workflow-ERFLTRNX.js} +16 -15
- package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-KQARK5BZ.mjs} +6 -5
- package/dist/{client-DiGl8ska.d.mts → client-D0j-_aaa.d.mts} +1 -1
- package/dist/{client-Bgis7F6-.d.ts → client-DflfVyj6.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -10
- package/dist/index.mjs +19 -15
- package/dist/install-integrity.json +92 -76
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -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-562JPKOM.js +0 -39
- package/dist/cli/git-5LDY5ZID.js +0 -23
- package/dist/cli/search-MGWROZ33.js +0 -28
- package/dist/cli/sessions-366KROUA.js +0 -15
- package/dist/cli/skills-JF2LPEGM.js +0 -28
- package/dist/cli/tools-CP2PEFRN.js +0 -34
- package/dist/cli/update-HZHZOU6C.js +0 -28
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/cli/tool-description.ts
|
|
2
|
+
function observedMaxText(pricing) {
|
|
3
|
+
const max = recordValue(recordValue(pricing).observedMax);
|
|
4
|
+
return typeof max.creditsPerCall === "number" && max.creditsPerCall > 0 ? `max observed ${max.creditsPerCall} credits/call (last ${String(max.windowDays)} days)` : "";
|
|
5
|
+
}
|
|
6
|
+
var Capability = class _Capability {
|
|
7
|
+
#catalogEntry;
|
|
8
|
+
constructor(catalogEntry) {
|
|
9
|
+
this.#catalogEntry = catalogEntry;
|
|
10
|
+
}
|
|
11
|
+
static fromCatalogEntry(catalogEntry) {
|
|
12
|
+
return new _Capability(catalogEntry);
|
|
13
|
+
}
|
|
14
|
+
describe() {
|
|
15
|
+
return CapabilityDescription.fromCatalogEntry(this.#catalogEntry);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var CapabilityDescription = class _CapabilityDescription {
|
|
19
|
+
#catalogEntry;
|
|
20
|
+
constructor(catalogEntry) {
|
|
21
|
+
this.#catalogEntry = catalogEntry;
|
|
22
|
+
}
|
|
23
|
+
static fromCatalogEntry(catalogEntry) {
|
|
24
|
+
return new _CapabilityDescription(catalogEntry);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The customer price already resolved by the catalog. This intentionally
|
|
28
|
+
* omits provider-price fields, even when a catalog Adapter carried them.
|
|
29
|
+
*/
|
|
30
|
+
customerCost() {
|
|
31
|
+
const legacyCost = recordValue(this.#catalogEntry.cost);
|
|
32
|
+
const pricing = recordValue(this.#catalogEntry.pricing);
|
|
33
|
+
const unit = stringValue(pricing.unit);
|
|
34
|
+
const legacyPricingModel = stringValue(
|
|
35
|
+
legacyCost.pricingModel ?? legacyCost.pricing_model
|
|
36
|
+
);
|
|
37
|
+
const pricingModel = unit === "call" ? "fixed" : unit === "result" || unit === "page" ? `per_${unit}` : unit === "usage" ? "provider_usage" : legacyPricingModel;
|
|
38
|
+
const canonicalCredits = pricingNumber(
|
|
39
|
+
pricing,
|
|
40
|
+
"creditsPerUnit",
|
|
41
|
+
"credits_per_unit",
|
|
42
|
+
this.#catalogEntry.deeplineCreditsPerPricingUnit ?? this.#catalogEntry.deepline_credits_per_pricing_unit
|
|
43
|
+
);
|
|
44
|
+
const canonicalUsd = pricingNumber(
|
|
45
|
+
pricing,
|
|
46
|
+
"usdPerUnit",
|
|
47
|
+
"usd_per_unit",
|
|
48
|
+
this.#catalogEntry.deeplineUsdPerPricingUnit ?? this.#catalogEntry.deepline_usd_per_pricing_unit
|
|
49
|
+
);
|
|
50
|
+
const billingSource = stringValue(
|
|
51
|
+
this.#catalogEntry.billingSource ?? this.#catalogEntry.billing_source
|
|
52
|
+
);
|
|
53
|
+
const billingSourceLabel = stringValue(
|
|
54
|
+
this.#catalogEntry.billingSourceLabel ?? this.#catalogEntry.billing_source_label
|
|
55
|
+
);
|
|
56
|
+
const isFree = billingSource === "free";
|
|
57
|
+
return {
|
|
58
|
+
pricingModel: pricingModel || null,
|
|
59
|
+
unit: unit || null,
|
|
60
|
+
displayText: isFree ? "Free" : stringValue(pricing.displayText ?? pricing.display_text),
|
|
61
|
+
summary: isFree ? null : stringValue(pricing.summary),
|
|
62
|
+
billingMode: stringValue(
|
|
63
|
+
legacyCost.billingMode ?? legacyCost.billing_mode
|
|
64
|
+
),
|
|
65
|
+
billingSource,
|
|
66
|
+
billingSourceLabel,
|
|
67
|
+
deeplineCreditsPerPricingUnit: isFree ? 0 : canonicalCredits,
|
|
68
|
+
deeplineUsdPerPricingUnit: isFree ? 0 : canonicalUsd,
|
|
69
|
+
...pricing.estimatedRange && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
70
|
+
estimatedRange: pricing.estimatedRange,
|
|
71
|
+
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
72
|
+
(value) => typeof value === "string"
|
|
73
|
+
) : []
|
|
74
|
+
} : {},
|
|
75
|
+
...pricing.observedReference && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
76
|
+
observedReference: pricing.observedReference,
|
|
77
|
+
details: Array.isArray(pricing.details) ? pricing.details.filter(
|
|
78
|
+
(value) => typeof value === "string"
|
|
79
|
+
) : []
|
|
80
|
+
} : {},
|
|
81
|
+
...pricing.observedMax && !isFree && billingSource !== "own_provider_credentials" ? {
|
|
82
|
+
observedMax: pricing.observedMax
|
|
83
|
+
} : {}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
function recordValue(value) {
|
|
88
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
89
|
+
}
|
|
90
|
+
function stringValue(value) {
|
|
91
|
+
return typeof value === "string" && value.trim() ? value : null;
|
|
92
|
+
}
|
|
93
|
+
function numberValue(value) {
|
|
94
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
95
|
+
}
|
|
96
|
+
function pricingNumber(pricing, canonicalKey, aliasKey, legacyValue) {
|
|
97
|
+
for (const key of [canonicalKey, aliasKey]) {
|
|
98
|
+
if (Object.prototype.hasOwnProperty.call(pricing, key))
|
|
99
|
+
return numberValue(pricing[key]);
|
|
100
|
+
}
|
|
101
|
+
return numberValue(legacyValue);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
observedMaxText,
|
|
106
|
+
Capability
|
|
107
|
+
};
|
|
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
|
|
|
49
49
|
// getters keep their established compatibility behavior.
|
|
50
50
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
51
51
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
52
|
-
version: "0.3.
|
|
52
|
+
version: "0.3.397",
|
|
53
53
|
updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
|
|
54
54
|
packageCapabilities: {
|
|
55
55
|
updatePreferences: 1,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-GAMFK2ZP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
printCommandEnvelope
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RNSWDKBM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
DEFAULT_SKILL_AGENTS,
|
|
9
9
|
KNOWN_SKILL_AGENTS,
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
sdkCliStateDirPath,
|
|
23
23
|
skillsAgentPathSegment,
|
|
24
24
|
writeSdkSkillsLocalVersion
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2LDADJNO.mjs";
|
|
26
26
|
import {
|
|
27
27
|
DeeplineError
|
|
28
28
|
} from "./chunk-NXGCO4JB.mjs";
|
|
29
29
|
import {
|
|
30
30
|
SDK_RELEASE
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MRXMMERY.mjs";
|
|
32
32
|
|
|
33
33
|
// src/cli/commands/skills.ts
|
|
34
34
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
printCommandEnvelope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RNSWDKBM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
agentSessionIdFromEnvironment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2LDADJNO.mjs";
|
|
8
8
|
|
|
9
9
|
// src/cli/commands/sessions.ts
|
|
10
10
|
import {
|
|
@@ -60,209 +60,6 @@ function isDeeplineExtractorTarget(value) {
|
|
|
60
60
|
return value in DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// src/tool-output.ts
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var _fs = require('fs');
|
|
71
|
-
var _os = require('os');
|
|
72
|
-
var _path = require('path');
|
|
73
|
-
function isPlainObject(value) {
|
|
74
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
75
|
-
}
|
|
76
|
-
function getByDottedPath(root, dottedPath) {
|
|
77
|
-
let current = root;
|
|
78
|
-
for (const segment of String(dottedPath || "").split(".").filter(Boolean)) {
|
|
79
|
-
if (!isPlainObject(current) || !(segment in current)) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
current = current[segment];
|
|
83
|
-
}
|
|
84
|
-
return current;
|
|
85
|
-
}
|
|
86
|
-
function normalizeRows(value) {
|
|
87
|
-
if (!Array.isArray(value)) return null;
|
|
88
|
-
return value.map((entry) => {
|
|
89
|
-
if (isPlainObject(entry)) return entry;
|
|
90
|
-
return { value: entry };
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function columnsForRows(rows) {
|
|
94
|
-
const seen = /* @__PURE__ */ new Set();
|
|
95
|
-
const columns = [];
|
|
96
|
-
for (const row of rows) {
|
|
97
|
-
for (const key of Object.keys(row)) {
|
|
98
|
-
if (!seen.has(key)) {
|
|
99
|
-
seen.add(key);
|
|
100
|
-
columns.push(key);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return columns;
|
|
105
|
-
}
|
|
106
|
-
function candidateRoots(payload) {
|
|
107
|
-
const roots = [
|
|
108
|
-
{ path: null, value: payload }
|
|
109
|
-
];
|
|
110
|
-
if (isPlainObject(payload) && isPlainObject(payload.toolResponse)) {
|
|
111
|
-
roots.push({ path: "toolResponse", value: payload.toolResponse });
|
|
112
|
-
if (Object.prototype.hasOwnProperty.call(payload.toolResponse, "raw")) {
|
|
113
|
-
roots.push({
|
|
114
|
-
path: "toolResponse.raw",
|
|
115
|
-
value: payload.toolResponse.raw
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (isPlainObject(payload) && isPlainObject(payload.output)) {
|
|
120
|
-
roots.push({ path: "output", value: payload.output });
|
|
121
|
-
if (Object.prototype.hasOwnProperty.call(payload.output, "body")) {
|
|
122
|
-
roots.push({ path: "output.body", value: payload.output.body });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (isPlainObject(payload) && isPlainObject(payload.result)) {
|
|
126
|
-
roots.push({ path: "result", value: payload.result });
|
|
127
|
-
if (isPlainObject(payload.result.data)) {
|
|
128
|
-
roots.push({ path: "result.data", value: payload.result.data });
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return roots;
|
|
132
|
-
}
|
|
133
|
-
function findBestArrayCandidate(value, pathPrefix = "", depth = 0) {
|
|
134
|
-
if (depth > 5) return null;
|
|
135
|
-
const directRows = normalizeRows(value);
|
|
136
|
-
const hasObjectRow = _nullishCoalesce(_optionalChain([directRows, 'optionalAccess', _ => _.some, 'call', _2 => _2(
|
|
137
|
-
(row) => Object.keys(row).some((key) => key !== "value")
|
|
138
|
-
)]), () => ( false));
|
|
139
|
-
let best = directRows && directRows.length > 0 && hasObjectRow ? { path: pathPrefix, rows: directRows } : null;
|
|
140
|
-
if (!isPlainObject(value)) {
|
|
141
|
-
return best;
|
|
142
|
-
}
|
|
143
|
-
for (const [key, child] of Object.entries(value)) {
|
|
144
|
-
const childPath = pathPrefix ? `${pathPrefix}.${key}` : key;
|
|
145
|
-
const candidate = findBestArrayCandidate(child, childPath, depth + 1);
|
|
146
|
-
if (!candidate) continue;
|
|
147
|
-
if (!best || candidate.rows.length > best.rows.length) {
|
|
148
|
-
best = candidate;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return best;
|
|
152
|
-
}
|
|
153
|
-
function tryConvertToList(payload, options) {
|
|
154
|
-
const listExtractorPaths = Array.isArray(_optionalChain([options, 'optionalAccess', _3 => _3.listExtractorPaths])) ? _optionalChain([options, 'optionalAccess', _4 => _4.listExtractorPaths, 'access', _5 => _5.filter, 'call', _6 => _6(
|
|
155
|
-
(entry) => typeof entry === "string" && entry.trim().length > 0
|
|
156
|
-
)]) : [];
|
|
157
|
-
if (listExtractorPaths.length > 0) {
|
|
158
|
-
let emptyMatch = null;
|
|
159
|
-
for (const root of candidateRoots(payload)) {
|
|
160
|
-
for (const extractorPath of listExtractorPaths) {
|
|
161
|
-
const resolved = getByDottedPath(root.value, extractorPath);
|
|
162
|
-
const rows = normalizeRows(resolved);
|
|
163
|
-
if (!rows) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
const sourcePath = root.path ? `${root.path}.${extractorPath}` : extractorPath;
|
|
167
|
-
if (rows.length > 0) {
|
|
168
|
-
return { rows, strategy: "configured_paths", sourcePath };
|
|
169
|
-
}
|
|
170
|
-
emptyMatch ??= { rows, strategy: "configured_paths", sourcePath };
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (emptyMatch) {
|
|
174
|
-
return emptyMatch;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
const roots = candidateRoots(payload);
|
|
178
|
-
const v2Raw = roots.find((root) => root.path === "toolResponse.raw");
|
|
179
|
-
for (const root of v2Raw ? [v2Raw] : roots) {
|
|
180
|
-
const candidate = findBestArrayCandidate(root.value, _nullishCoalesce(root.path, () => ( "")));
|
|
181
|
-
if (!candidate || candidate.rows.length === 0) continue;
|
|
182
|
-
return {
|
|
183
|
-
rows: candidate.rows,
|
|
184
|
-
strategy: "auto_detected",
|
|
185
|
-
sourcePath: candidate.path || root.path
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
function projectRowOutput(conversion) {
|
|
191
|
-
return {
|
|
192
|
-
rows: conversion.rows,
|
|
193
|
-
rowCount: conversion.rows.length,
|
|
194
|
-
columns: columnsForRows(conversion.rows),
|
|
195
|
-
previewRows: conversion.rows.slice(0, 5),
|
|
196
|
-
strategy: conversion.strategy,
|
|
197
|
-
sourcePath: conversion.sourcePath
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function ensureOutputDir() {
|
|
201
|
-
const outputDir = _path.join.call(void 0, _os.homedir.call(void 0, ), ".local", "share", "deepline", "data");
|
|
202
|
-
_fs.mkdirSync.call(void 0, outputDir, { recursive: true });
|
|
203
|
-
return outputDir;
|
|
204
|
-
}
|
|
205
|
-
function writeJsonOutputFile(payload, stem) {
|
|
206
|
-
const outputDir = ensureOutputDir();
|
|
207
|
-
const outputPath = _path.join.call(void 0, outputDir, `${stem}_${Date.now()}.json`);
|
|
208
|
-
_fs.writeFileSync.call(void 0, outputPath, JSON.stringify(payload, null, 2), "utf-8");
|
|
209
|
-
return outputPath;
|
|
210
|
-
}
|
|
211
|
-
function writeCsvOutputFile(rows, stem, options) {
|
|
212
|
-
const outputPath = _optionalChain([options, 'optionalAccess', _7 => _7.outPath]) ? options.outPath : _path.join.call(void 0, ensureOutputDir(), `${stem}_${Date.now()}.csv`);
|
|
213
|
-
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, outputPath), { recursive: true });
|
|
214
|
-
const columns = columnsForRows(rows);
|
|
215
|
-
const escapeCell = (value) => {
|
|
216
|
-
const normalized = value == null ? "" : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value);
|
|
217
|
-
if (/[",\n]/.test(normalized)) {
|
|
218
|
-
return `"${normalized.replace(/"/g, '""')}"`;
|
|
219
|
-
}
|
|
220
|
-
return normalized;
|
|
221
|
-
};
|
|
222
|
-
const fd = _fs.openSync.call(void 0, outputPath, "w");
|
|
223
|
-
try {
|
|
224
|
-
_fs.writeSync.call(void 0, fd, `${columns.map(escapeCell).join(",")}
|
|
225
|
-
`);
|
|
226
|
-
for (const row of rows) {
|
|
227
|
-
_fs.writeSync.call(void 0,
|
|
228
|
-
fd,
|
|
229
|
-
`${columns.map((column) => escapeCell(row[column])).join(",")}
|
|
230
|
-
`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
} finally {
|
|
234
|
-
_fs.closeSync.call(void 0, fd);
|
|
235
|
-
}
|
|
236
|
-
const previewRows = rows.slice(0, 5);
|
|
237
|
-
const previewColumns = columns.slice(0, 5);
|
|
238
|
-
const preview = [
|
|
239
|
-
previewColumns.join(","),
|
|
240
|
-
...previewRows.map(
|
|
241
|
-
(row) => previewColumns.map((column) => escapeCell(row[column])).join(",")
|
|
242
|
-
)
|
|
243
|
-
].join("\n");
|
|
244
|
-
return {
|
|
245
|
-
path: outputPath,
|
|
246
|
-
rowCount: rows.length,
|
|
247
|
-
columns,
|
|
248
|
-
preview
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
function extractSummaryFields(payload) {
|
|
252
|
-
const candidates = candidateRoots(payload);
|
|
253
|
-
for (const candidate of candidates) {
|
|
254
|
-
if (!isPlainObject(candidate.value)) continue;
|
|
255
|
-
const summaryEntries = Object.entries(candidate.value).filter(
|
|
256
|
-
([, value]) => {
|
|
257
|
-
return value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
258
|
-
}
|
|
259
|
-
);
|
|
260
|
-
if (summaryEntries.length === 0) continue;
|
|
261
|
-
return Object.fromEntries(summaryEntries);
|
|
262
|
-
}
|
|
263
|
-
return {};
|
|
264
|
-
}
|
|
265
|
-
|
|
266
63
|
// ../plays/email-status.ts
|
|
267
64
|
var nullable = (type) => ({ type: [type, "null"] });
|
|
268
65
|
var oneOf = (values) => ({ type: "string", enum: values });
|
|
@@ -407,7 +204,7 @@ function mxClass(mxProvider, mxRecord) {
|
|
|
407
204
|
}
|
|
408
205
|
function entryForStatus(key, map) {
|
|
409
206
|
if (!key) return null;
|
|
410
|
-
return _nullishCoalesce(_optionalChain([map, 'optionalAccess',
|
|
207
|
+
return _nullishCoalesce(_optionalChain([map, 'optionalAccess', _ => _[key]]), () => ( null));
|
|
411
208
|
}
|
|
412
209
|
function read(values, name) {
|
|
413
210
|
return values[name];
|
|
@@ -437,13 +234,13 @@ function buildEmailStatus({
|
|
|
437
234
|
const spamtrap = boolish(read(values, "spamtrap"));
|
|
438
235
|
const suspect = boolish(read(values, "suspect"));
|
|
439
236
|
const rawKey = normalizeKey(rawStatus);
|
|
440
|
-
const mapped = _nullishCoalesce(_nullishCoalesce(_optionalChain([config, 'access',
|
|
441
|
-
const status = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
237
|
+
const mapped = _nullishCoalesce(_nullishCoalesce(_optionalChain([config, 'access', _2 => _2.rules, 'optionalAccess', _3 => _3.find, 'call', _4 => _4((rule) => matchesRule(rule, values))]), () => ( entryForStatus(rawKey, config.statusMap))), () => ( entryForStatus(valid == null ? null : String(valid), config.statusMap)));
|
|
238
|
+
const status = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _5 => _5.status]), () => ( (disposable ? "disposable" : abuse ? "abuse" : spamtrap ? "spamtrap" : catchAll ? "catch_all" : valid === true ? "valid" : valid === false ? "invalid" : "unknown")));
|
|
442
239
|
const defaultVerdict = status === "valid" ? "send" : status === "valid_catch_all" ? "send_with_caution" : status === "catch_all" ? "verify_next" : status === "unknown" ? "hold" : "drop";
|
|
443
|
-
const verdict = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
444
|
-
const verified = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess',
|
|
240
|
+
const verdict = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _6 => _6.verdict]), () => ( defaultVerdict));
|
|
241
|
+
const verified = _nullishCoalesce(_optionalChain([mapped, 'optionalAccess', _7 => _7.verified]), () => ( (status === "valid" || status === "valid_catch_all" || verdict === "send")));
|
|
445
242
|
const reasons = [
|
|
446
|
-
_optionalChain([mapped, 'optionalAccess',
|
|
243
|
+
_optionalChain([mapped, 'optionalAccess', _8 => _8.reason]),
|
|
447
244
|
catchAll ? "catch_all_domain" : null,
|
|
448
245
|
mxClass(read(values, "mxProvider"), read(values, "mxRecord")) === "security_gateway" ? "security_gateway_mx" : null,
|
|
449
246
|
suspect ? "provider_marked_suspect" : null
|
|
@@ -486,9 +283,4 @@ function buildEmailStatus({
|
|
|
486
283
|
|
|
487
284
|
|
|
488
285
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
exports.EMAIL_STATUS_JSON_SCHEMA = EMAIL_STATUS_JSON_SCHEMA; exports.buildEmailStatus = buildEmailStatus; exports.JOB_CHANGE_STATUS_VALUES = JOB_CHANGE_STATUS_VALUES; exports.JOB_CHANGE_JSON_SCHEMA = JOB_CHANGE_JSON_SCHEMA; exports.PHONE_STATUS_VALUES = PHONE_STATUS_VALUES; exports.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS; exports.DEEPLINE_EXTRACTOR_TARGETS = DEEPLINE_EXTRACTOR_TARGETS; exports.isDeeplineExtractorTarget = isDeeplineExtractorTarget; exports.tryConvertToList = tryConvertToList; exports.projectRowOutput = projectRowOutput; exports.writeJsonOutputFile = writeJsonOutputFile; exports.writeCsvOutputFile = writeCsvOutputFile; exports.extractSummaryFields = extractSummaryFields;
|
|
286
|
+
exports.EMAIL_STATUS_JSON_SCHEMA = EMAIL_STATUS_JSON_SCHEMA; exports.buildEmailStatus = buildEmailStatus; exports.JOB_CHANGE_STATUS_VALUES = JOB_CHANGE_STATUS_VALUES; exports.JOB_CHANGE_JSON_SCHEMA = JOB_CHANGE_JSON_SCHEMA; exports.PHONE_STATUS_VALUES = PHONE_STATUS_VALUES; exports.DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS = DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS; exports.DEEPLINE_EXTRACTOR_TARGETS = DEEPLINE_EXTRACTOR_TARGETS; exports.isDeeplineExtractorTarget = isDeeplineExtractorTarget;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SCHEMA_LINE_LIMIT
|
|
3
|
+
} from "./chunk-IHG7UAHD.mjs";
|
|
4
|
+
|
|
5
|
+
// src/cli/describe-options.ts
|
|
6
|
+
function addDescribeOptions(command, options = {}) {
|
|
7
|
+
command.option(
|
|
8
|
+
"--prebuilt",
|
|
9
|
+
"Show the Deepline tool or play, not a play your workspace created under the same name"
|
|
10
|
+
).option("--tool", "Same as --prebuilt").option(
|
|
11
|
+
"--verbose",
|
|
12
|
+
"Show secondary fields, and fill in every input and read every output in the examples"
|
|
13
|
+
).option(
|
|
14
|
+
"--cli-example",
|
|
15
|
+
"Show only the CLI example, and explain how it takes inputs and returns outputs"
|
|
16
|
+
).option(
|
|
17
|
+
"--play-example",
|
|
18
|
+
"Show only the in-play example, and explain how it takes inputs and returns outputs"
|
|
19
|
+
).option("--no-example", "Hide the run examples").option(
|
|
20
|
+
"--full-schema",
|
|
21
|
+
`Print every field: a long schema unfolded (over ${SCHEMA_LINE_LIMIT} lines), list rows, and a tool's raw response`
|
|
22
|
+
).option(
|
|
23
|
+
"--fields <names>",
|
|
24
|
+
"Show only these fields, comma-separated, plus every required input"
|
|
25
|
+
).option(
|
|
26
|
+
"--feature <name[=value]>",
|
|
27
|
+
"Describe one feature of a tool, such as a model: --feature model=openai/gpt-5.6-luna. A tool lists its features."
|
|
28
|
+
).option(
|
|
29
|
+
"-o, --out <path>",
|
|
30
|
+
"Save the output to this file instead of printing it"
|
|
31
|
+
);
|
|
32
|
+
if (options.schemaOnly !== false) {
|
|
33
|
+
command.option(
|
|
34
|
+
"--schema-only",
|
|
35
|
+
"Print only the schema, with every field, and nothing else"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (options.json !== false) {
|
|
39
|
+
command.option(
|
|
40
|
+
"--json",
|
|
41
|
+
"Print JSON instead of text; with --schema-only, only the input and output JSON Schemas"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
return command;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// src/cli/execution-observation.ts
|
|
48
|
+
import { writeFileSync, renameSync } from "fs";
|
|
49
|
+
function writeObservation(observation) {
|
|
50
|
+
const path = process.env.DEEPLINE_EXECUTION_OBSERVATION_PATH;
|
|
51
|
+
const invocationId = process.env.DEEPLINE_EXECUTION_OBSERVATION_ID;
|
|
52
|
+
if (!path || !invocationId) return;
|
|
53
|
+
const pending = `${path}.pending`;
|
|
54
|
+
writeFileSync(
|
|
55
|
+
pending,
|
|
56
|
+
JSON.stringify({
|
|
57
|
+
schema_version: 1,
|
|
58
|
+
invocation_id: invocationId,
|
|
59
|
+
...observation
|
|
60
|
+
}),
|
|
61
|
+
{ mode: 384 }
|
|
62
|
+
);
|
|
63
|
+
renameSync(pending, path);
|
|
64
|
+
}
|
|
65
|
+
function recordApiResponse(observation) {
|
|
66
|
+
writeObservation({
|
|
67
|
+
kind: "api_response",
|
|
68
|
+
received_at_ms: observation.receivedAtMs,
|
|
69
|
+
state: observation.state,
|
|
70
|
+
http_status: observation.httpStatus
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function recordPlayTermination(run) {
|
|
74
|
+
if (typeof run.id !== "string" || !["completed", "failed", "cancelled", "canceled"].includes(
|
|
75
|
+
String(run.status)
|
|
76
|
+
) || typeof run.finishedAt !== "number" || !Number.isSafeInteger(run.finishedAt) || run.finishedAt <= 0)
|
|
77
|
+
return;
|
|
78
|
+
writeObservation({
|
|
79
|
+
kind: "play_terminal",
|
|
80
|
+
run: { id: run.id, status: run.status, finishedAt: run.finishedAt }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
addDescribeOptions,
|
|
86
|
+
recordApiResponse,
|
|
87
|
+
recordPlayTermination
|
|
88
|
+
};
|