deepline 0.3.396 → 0.3.398
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/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +50 -26
- package/dist/cli/auth-3GA2ASQF.js +40 -0
- package/dist/cli/{auth-3LTD62VL.mjs → auth-7ZBPAAZU.mjs} +5 -4
- package/dist/cli/{billing-DP7ZAJBO.mjs → billing-QTWEEL27.mjs} +5 -4
- package/dist/cli/{billing-PA5OXEM5.js → billing-WHP3YMNQ.js} +76 -75
- package/dist/cli/{chunk-I4T4XAA2.mjs → chunk-2QC2T7E3.mjs} +4 -4
- package/dist/cli/{chunk-3T4MCB5R.mjs → chunk-52HHMLRM.mjs} +89 -969
- package/dist/cli/{chunk-ME6XRFLY.js → chunk-6CBU7W56.js} +15 -15
- package/dist/cli/{chunk-LOGGNW4H.mjs → chunk-6DVXLWPB.mjs} +2 -2
- package/dist/cli/{chunk-AUYXWELC.mjs → chunk-6HXULNTW.mjs} +2 -2
- package/dist/cli/chunk-7DRPTGCK.js +930 -0
- package/dist/cli/{chunk-TLQ3FZOC.mjs → chunk-ATDUVJCW.mjs} +3 -3
- package/dist/cli/{chunk-23GAA3YO.mjs → chunk-AWQNG55D.mjs} +1 -1
- package/dist/cli/{chunk-NSOTASOP.js → chunk-BQR6UN3C.js} +1 -83
- package/dist/cli/{chunk-XKZXO7D3.mjs → chunk-CH6EFAJ3.mjs} +1 -1
- package/dist/cli/{chunk-KAEZNPUM.js → chunk-CTZJLQ7A.js} +13 -115
- package/dist/cli/{chunk-AVHLATII.js → chunk-FDAMQFQ7.js} +50 -50
- package/dist/cli/chunk-FIVKWNMT.mjs +210 -0
- package/dist/cli/{chunk-7Z66NHUC.js → chunk-G6BP55EP.js} +26 -26
- package/dist/cli/{chunk-GNN4MY5X.js → chunk-HFDBZXMV.js} +1 -1
- 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-QHGPA362.mjs → chunk-IJU5YQSF.mjs} +6 -108
- package/dist/cli/{chunk-772W2SAU.js → chunk-J4WYPANC.js} +8 -8
- package/dist/cli/{chunk-V7UP2F4U.js → chunk-JU3PF7WM.js} +21 -121
- package/dist/cli/{chunk-MR6XCBQJ.mjs → chunk-LCRQKI7D.mjs} +4 -2
- package/dist/cli/chunk-LJ5747UC.mjs +107 -0
- package/dist/cli/{chunk-LWERJUKN.js → chunk-NA4T3B62.js} +7 -215
- package/dist/cli/{chunk-WQJJNIMQ.js → chunk-NUBIAJI2.js} +11 -9
- package/dist/cli/chunk-OSDXE27V.mjs +88 -0
- package/dist/cli/{chunk-RMTASUAK.js → chunk-OU2RZYVS.js} +65 -65
- package/dist/cli/{chunk-JCN4DHF7.mjs → chunk-OVUFHUMG.mjs} +2 -2
- package/dist/cli/chunk-Q2E4E4FJ.js +112 -0
- package/dist/cli/{chunk-2VOLOWYZ.js → chunk-Q3FNSWJG.js} +293 -1173
- package/dist/cli/{chunk-NHB5YUCS.mjs → chunk-QP2TRM7M.mjs} +1 -1
- package/dist/cli/{describe-EFWNECHI.js → chunk-RFG3MRAC.js} +37 -175
- package/dist/cli/{chunk-RTO5QZWT.js → chunk-S22ZQZMU.js} +6 -6
- package/dist/cli/{chunk-H5KLUGY7.mjs → chunk-TXZVVBQZ.mjs} +1 -209
- package/dist/cli/{chunk-DC6LTULT.js → chunk-U46S43LV.js} +2 -2
- package/dist/cli/chunk-YHPYUZZX.mjs +112 -0
- package/dist/cli/chunk-YHZUZO3U.mjs +930 -0
- package/dist/cli/chunk-ZAAKSJAS.js +88 -0
- package/dist/cli/{chunk-VE3U3SQC.mjs → chunk-ZJ7HLJRF.mjs} +7 -107
- package/dist/cli/chunk-ZM2YPJQJ.js +107 -0
- package/dist/cli/{csv-TF576S77.js → csv-NM25BBX7.js} +13 -12
- package/dist/cli/{csv-RLRR74RQ.mjs → csv-TSBHKVNU.mjs} +4 -3
- package/dist/cli/{db-FDBJUTFO.js → db-GBDNQJF3.js} +30 -29
- package/dist/cli/{db-XORGNBIC.mjs → db-JQN6SYLK.mjs} +5 -4
- package/dist/cli/describe-ETTGW5LT.mjs +164 -0
- package/dist/cli/describe-NVLINP5A.js +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-YPP7WR77.mjs → executions-6S4KIVEY.mjs} +5 -4
- package/dist/cli/{executions-SFYAXPF4.js → executions-IH5JUPIT.js} +7 -6
- package/dist/cli/{feedback-5UZFYMGB.js → feedback-ER375ZCB.js} +8 -7
- package/dist/cli/{feedback-RBGA5ARU.mjs → feedback-PGOZLNXU.mjs} +4 -3
- package/dist/cli/{git-IRSAJEK2.mjs → git-7SBFCM52.mjs} +5 -4
- package/dist/cli/git-W6DBPLZO.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-IOEF2SB7.js} +8 -7
- package/dist/cli/{legacy-noops-NA7N6ZOU.mjs → legacy-noops-Q4UQIOQN.mjs} +5 -4
- package/dist/cli/{monitors-4OMRXCXP.js → monitors-NZ2J4YGD.js} +86 -85
- package/dist/cli/{monitors-ILZ2XHYG.mjs → monitors-RZYBFY3Z.mjs} +5 -4
- package/dist/cli/{org-YGNJDD2X.js → org-ERUOT4B2.js} +65 -64
- package/dist/cli/{org-QDDXAE3J.mjs → org-JLSEM6GG.mjs} +5 -4
- package/dist/cli/{play-L535H26U.js → play-7TUO7YNG.js} +251 -247
- package/dist/cli/{play-VT6OHB2D.mjs → play-Z73VC7YR.mjs} +19 -15
- package/dist/cli/{providers-KG4W5MPK.mjs → providers-7HIII2PW.mjs} +5 -4
- package/dist/cli/{providers-GPZ6PQAL.js → providers-ABKBK2C7.js} +8 -7
- package/dist/cli/{quickstart-UI27S5LO.js → quickstart-JBG5RTFZ.js} +6 -5
- package/dist/cli/{quickstart-2JDGTXIG.mjs → quickstart-QQAOCPCZ.mjs} +4 -3
- package/dist/cli/{search-PW3RAUX7.mjs → search-MT2Q64WC.mjs} +7 -5
- package/dist/cli/search-QMQBC6SV.js +30 -0
- package/dist/cli/{secrets-WFAXOUZE.js → secrets-MEW6LLU5.js} +14 -13
- package/dist/cli/{secrets-HNOMK5A2.mjs → secrets-ZFJPIT6B.mjs} +5 -4
- package/dist/cli/{sessions-XLX3E5UO.mjs → sessions-F2KVVZ2Z.mjs} +5 -4
- package/dist/cli/sessions-TBPU4S6M.js +16 -0
- package/dist/cli/{settings-GADAG2UK.js → settings-6VDZ6G5V.js} +75 -74
- package/dist/cli/{settings-YNZ4YKCH.mjs → settings-LUDDM7HO.mjs} +8 -7
- package/dist/cli/{setup-R5YO7GT6.js → setup-IP2KTFYO.js} +42 -41
- package/dist/cli/{setup-PSEHIUXO.mjs → setup-MCEY473G.mjs} +7 -6
- package/dist/cli/skills-EVIIEX6N.js +29 -0
- package/dist/cli/{skills-LTQBP6CZ.mjs → skills-KMJ3CY4O.mjs} +5 -4
- package/dist/cli/tools-KNLHQ3L6.js +39 -0
- package/dist/cli/{tools-UAXDWU63.mjs → tools-WY3PLUA7.mjs} +13 -8
- package/dist/cli/update-LVADY5YE.js +29 -0
- package/dist/cli/{update-SMNIBIMS.mjs → update-XBV52OFM.mjs} +7 -6
- package/dist/cli/{workflow-IKGMBGF6.mjs → workflow-5N5HMYDY.mjs} +6 -5
- package/dist/cli/{workflow-AOQVZHMD.js → workflow-CO7XWS4D.js} +16 -15
- 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
|
@@ -1,11 +1,14 @@
|
|
|
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; }
|
|
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
|
|
|
3
4
|
|
|
4
|
-
var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
5
5
|
|
|
6
|
+
var _chunkQ2E4E4FJjs = require('./chunk-Q2E4E4FJ.js');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
|
@@ -14,105 +17,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
14
17
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
// src/errors.ts
|
|
20
|
-
var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
21
|
-
__init() {this.outcome = "unknown"}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
constructor(cause, operationKey, options = {}) {
|
|
25
|
-
const recoveryAvailable = operationKey !== void 0 && options.recoveryAvailable !== false;
|
|
26
|
-
super(
|
|
27
|
-
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.",
|
|
28
|
-
cause.statusCode,
|
|
29
|
-
"CUSTOMER_DB_QUERY_OUTCOME_UNKNOWN",
|
|
30
|
-
{
|
|
31
|
-
outcome: "unknown",
|
|
32
|
-
recovery: recoveryAvailable ? "original_operation_key" : "unavailable",
|
|
33
|
-
causeCode: cause.code
|
|
34
|
-
}
|
|
35
|
-
);_class.prototype.__init.call(this);;
|
|
36
|
-
this.name = "CustomerDbQueryOutcomeUnknownError";
|
|
37
|
-
this.operationKey = operationKey;
|
|
38
|
-
this.retryable = recoveryAvailable;
|
|
39
|
-
Object.defineProperty(this, "cause", { value: cause, configurable: true });
|
|
40
|
-
}
|
|
41
|
-
}, _class);
|
|
42
|
-
var AuthError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
43
|
-
/** Constructed by the SDK when Deepline rejects the caller's credentials. */
|
|
44
|
-
constructor(message = "Authentication failed. Check your DEEPLINE_API_KEY.") {
|
|
45
|
-
super(message, 401, "AUTH_ERROR");
|
|
46
|
-
this.name = "AuthError";
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var RateLimitError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
50
|
-
/** Milliseconds to wait before retrying, from the `Retry-After` response header. Defaults to 5000. */
|
|
51
|
-
|
|
52
|
-
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
53
|
-
constructor(retryAfterMs = 5e3, message) {
|
|
54
|
-
super(
|
|
55
|
-
_nullishCoalesce(message, () => ( `Rate limited. Retry after ${retryAfterMs}ms.`)),
|
|
56
|
-
429,
|
|
57
|
-
"RATE_LIMIT"
|
|
58
|
-
);
|
|
59
|
-
this.name = "RateLimitError";
|
|
60
|
-
this.retryAfterMs = retryAfterMs;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var ToolRateLimitError = class extends RateLimitError {
|
|
64
|
-
/** Public tool id passed to `tools.execute`. */
|
|
65
|
-
|
|
66
|
-
/** Provider responsible for the operation, or `null`. */
|
|
67
|
-
|
|
68
|
-
/** Provider operation name, or `null`. */
|
|
69
|
-
|
|
70
|
-
/** Stable machine-readable failure code when one exists. */
|
|
71
|
-
|
|
72
|
-
/** Boundary responsible for the failure. */
|
|
73
|
-
|
|
74
|
-
/** Stable reason family for policy and diagnostics. */
|
|
75
|
-
|
|
76
|
-
/** Whether repeating the same semantic call is delivery-safe. */
|
|
77
|
-
|
|
78
|
-
/** Provider or Deepline request id, or `null`. */
|
|
79
|
-
|
|
80
|
-
/** Network failure kind, or `null` for non-network failures. */
|
|
81
|
-
|
|
82
|
-
/** Network boundary that failed, or `null` for non-network failures. */
|
|
83
|
-
|
|
84
|
-
/** Explicitly allowlisted diagnostics safe for SDK callers. */
|
|
85
|
-
|
|
86
|
-
/** Constructed by the SDK after a structured tool HTTP 429. */
|
|
87
|
-
constructor(message, options) {
|
|
88
|
-
super(_nullishCoalesce(options.retryAfterMs, () => ( 5e3)), message);
|
|
89
|
-
this.name = "ToolRateLimitError";
|
|
90
|
-
this.statusCode = _nullishCoalesce(options.statusCode, () => ( 429));
|
|
91
|
-
this.code = _nullishCoalesce(options.code, () => ( void 0));
|
|
92
|
-
this.toolId = options.toolId;
|
|
93
|
-
this.provider = options.provider;
|
|
94
|
-
this.operation = options.operation;
|
|
95
|
-
this.origin = options.origin;
|
|
96
|
-
this.category = options.category;
|
|
97
|
-
this.retryable = options.retryable;
|
|
98
|
-
this.requestId = options.requestId;
|
|
99
|
-
this.networkKind = options.networkKind;
|
|
100
|
-
this.networkScope = options.networkScope;
|
|
101
|
-
this.publicDetails = _nullishCoalesce(options.publicDetails, () => ( null));
|
|
102
|
-
this.details = options.details;
|
|
103
|
-
_chunk7P5AA3SNjs.brandAsToolExecutionError.call(void 0, this);
|
|
104
|
-
if (_chunk7P5AA3SNjs.isProviderTransientFailure.call(void 0, this)) {
|
|
105
|
-
_chunk7P5AA3SNjs.brandAsProviderTransientError.call(void 0, this);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
var ConfigError = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
110
|
-
/** Construct a local SDK configuration failure. */
|
|
111
|
-
constructor(message) {
|
|
112
|
-
super(message, void 0, "CONFIG_ERROR");
|
|
113
|
-
this.name = "ConfigError";
|
|
114
|
-
}
|
|
115
|
-
};
|
|
20
|
+
var _chunkHFDBZXMVjs = require('./chunk-HFDBZXMV.js');
|
|
116
21
|
|
|
117
22
|
// src/config.ts
|
|
118
23
|
|
|
@@ -473,7 +378,7 @@ function resolveBaseUrlOnly(options) {
|
|
|
473
378
|
_optionalChain([options, 'optionalAccess', _32 => _32.baseUrl, 'optionalAccess', _33 => _33.trim, 'call', _34 => _34()]) || autoDetectBaseUrl()
|
|
474
379
|
);
|
|
475
380
|
if (!baseUrl) {
|
|
476
|
-
throw new ConfigError(
|
|
381
|
+
throw new (0, _chunkQ2E4E4FJjs.ConfigError)(
|
|
477
382
|
`Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
|
|
478
383
|
);
|
|
479
384
|
}
|
|
@@ -484,13 +389,13 @@ function resolveConfig(options) {
|
|
|
484
389
|
_optionalChain([options, 'optionalAccess', _35 => _35.baseUrl, 'optionalAccess', _36 => _36.trim, 'call', _37 => _37()]) || autoDetectBaseUrl()
|
|
485
390
|
);
|
|
486
391
|
if (!baseUrl) {
|
|
487
|
-
throw new ConfigError(
|
|
392
|
+
throw new (0, _chunkQ2E4E4FJjs.ConfigError)(
|
|
488
393
|
`Invalid ${HOST_URL_ENV}. Expected an http(s) URL such as https://code.deepline.com.`
|
|
489
394
|
);
|
|
490
395
|
}
|
|
491
396
|
const apiKey = resolveApiKeyForBaseUrl(baseUrl, _optionalChain([options, 'optionalAccess', _38 => _38.apiKey]));
|
|
492
397
|
if (!apiKey) {
|
|
493
|
-
throw new ConfigError(
|
|
398
|
+
throw new (0, _chunkQ2E4E4FJjs.ConfigError)(
|
|
494
399
|
`No API key found. Set ${API_KEY_ENV}, add it to .env.deepline, or run: deepline auth register`
|
|
495
400
|
);
|
|
496
401
|
}
|
|
@@ -593,7 +498,7 @@ function findNearestGitCommonDir(startDir) {
|
|
|
593
498
|
function saveProjectDeeplineEnvValues(values, startDir = process.cwd()) {
|
|
594
499
|
const target = resolveProjectPinTarget(startDir);
|
|
595
500
|
if (!target.ok) {
|
|
596
|
-
throw new ConfigError(
|
|
501
|
+
throw new (0, _chunkQ2E4E4FJjs.ConfigError)(
|
|
597
502
|
`Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
|
|
598
503
|
", "
|
|
599
504
|
)}. Set CLAUDE_PROJECT_DIR or cd into the intended project folder before running this command.`
|
|
@@ -744,9 +649,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
|
744
649
|
}
|
|
745
650
|
|
|
746
651
|
// src/version.ts
|
|
747
|
-
var SDK_VERSION =
|
|
748
|
-
var SDK_API_MAJOR =
|
|
749
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
652
|
+
var SDK_VERSION = _chunkHFDBZXMVjs.SDK_RELEASE.version;
|
|
653
|
+
var SDK_API_MAJOR = _chunkHFDBZXMVjs.SDK_RELEASE.contracts.api.currentMajor;
|
|
654
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunkHFDBZXMVjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
750
655
|
|
|
751
656
|
// src/agent-runtime.ts
|
|
752
657
|
|
|
@@ -1549,7 +1454,7 @@ var HttpClient = class {
|
|
|
1549
1454
|
if (response.status === 429) {
|
|
1550
1455
|
const retryAfter = parseRetryAfter(response);
|
|
1551
1456
|
const failure = _chunk7P5AA3SNjs.serializeToolExecutionFailure.call(void 0, structuredToolError);
|
|
1552
|
-
lastError = failure === null ? structuredToolError : new ToolRateLimitError(structuredToolError.message, {
|
|
1457
|
+
lastError = failure === null ? structuredToolError : new (0, _chunkQ2E4E4FJjs.ToolRateLimitError)(structuredToolError.message, {
|
|
1553
1458
|
...failure,
|
|
1554
1459
|
retryAfterMs: _nullishCoalesce(failure.retryAfterMs, () => ( Math.max(0, retryAfter)))
|
|
1555
1460
|
});
|
|
@@ -1571,7 +1476,7 @@ var HttpClient = class {
|
|
|
1571
1476
|
);
|
|
1572
1477
|
}
|
|
1573
1478
|
const retryAfter = parseRetryAfter(response);
|
|
1574
|
-
lastError = new RateLimitError(retryAfter);
|
|
1479
|
+
lastError = new (0, _chunkQ2E4E4FJjs.RateLimitError)(retryAfter);
|
|
1575
1480
|
if (attempt < maxRetries) {
|
|
1576
1481
|
retryAfterDelayMs = retryAfter;
|
|
1577
1482
|
break;
|
|
@@ -1579,7 +1484,7 @@ var HttpClient = class {
|
|
|
1579
1484
|
throw lastError;
|
|
1580
1485
|
}
|
|
1581
1486
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1582
|
-
throw new AuthError(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1487
|
+
throw new (0, _chunkQ2E4E4FJjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1583
1488
|
}
|
|
1584
1489
|
if (!response.ok) {
|
|
1585
1490
|
const retryableApiError = _optionalChain([options, 'optionalAccess', _199 => _199.retryApiErrors]) === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1638,10 +1543,10 @@ var HttpClient = class {
|
|
|
1638
1543
|
lastError = requestCancelledError(options.signal);
|
|
1639
1544
|
break requestAttempts;
|
|
1640
1545
|
}
|
|
1641
|
-
if (error instanceof AuthError || error instanceof _chunk7P5AA3SNjs.DeeplineError) {
|
|
1546
|
+
if (error instanceof _chunkQ2E4E4FJjs.AuthError || error instanceof _chunk7P5AA3SNjs.DeeplineError) {
|
|
1642
1547
|
throw error;
|
|
1643
1548
|
}
|
|
1644
|
-
if (error instanceof RateLimitError) {
|
|
1549
|
+
if (error instanceof _chunkQ2E4E4FJjs.RateLimitError) {
|
|
1645
1550
|
lastError = error;
|
|
1646
1551
|
break;
|
|
1647
1552
|
}
|
|
@@ -1752,7 +1657,7 @@ var HttpClient = class {
|
|
|
1752
1657
|
const body = await response.text();
|
|
1753
1658
|
const parsed = parseResponseBody(body);
|
|
1754
1659
|
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1755
|
-
throw new AuthError(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1660
|
+
throw new (0, _chunkQ2E4E4FJjs.AuthError)(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1756
1661
|
}
|
|
1757
1662
|
const htmlError = detectHtmlErrorBody(
|
|
1758
1663
|
body,
|
|
@@ -1783,7 +1688,7 @@ var HttpClient = class {
|
|
|
1783
1688
|
yield* decodeSseStream(response.body);
|
|
1784
1689
|
return;
|
|
1785
1690
|
} catch (error) {
|
|
1786
|
-
if (error instanceof AuthError || error instanceof _chunk7P5AA3SNjs.DeeplineError) {
|
|
1691
|
+
if (error instanceof _chunkQ2E4E4FJjs.AuthError || error instanceof _chunk7P5AA3SNjs.DeeplineError) {
|
|
1787
1692
|
throw error;
|
|
1788
1693
|
}
|
|
1789
1694
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
@@ -2048,9 +1953,4 @@ ${COWORK_NETWORK_HINT}`;
|
|
|
2048
1953
|
|
|
2049
1954
|
|
|
2050
1955
|
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
exports.CustomerDbQueryOutcomeUnknownError = CustomerDbQueryOutcomeUnknownError; exports.AuthError = AuthError; exports.RateLimitError = RateLimitError; exports.ToolRateLimitError = ToolRateLimitError; exports.ConfigError = ConfigError; exports.HOST_URL_ENV = HOST_URL_ENV; exports.API_KEY_ENV = API_KEY_ENV; exports.ACTIVE_ORG_ID_ENV = ACTIVE_ORG_ID_ENV; exports.ACTIVE_ORG_NAME_ENV = ACTIVE_ORG_NAME_ENV; exports.FEATURES_ENV = FEATURES_ENV; exports.PROD_URL = PROD_URL; exports.featureEnvValues = featureEnvValues; exports.storedHostApiKey = storedHostApiKey; exports.storedHostFeatures = storedHostFeatures; exports.baseUrlSlug = baseUrlSlug; exports.sdkCliStateDirPath = sdkCliStateDirPath; exports.hostConfigDirPath = hostConfigDirPath; exports.hostEnvFilePath = hostEnvFilePath; exports.saveHostEnvValues = saveHostEnvValues; exports.autoDetectBaseUrl = autoDetectBaseUrl; exports.resolveApiKeyForBaseUrl = resolveApiKeyForBaseUrl; exports.resolveProjectApiKeyForBaseUrl = resolveProjectApiKeyForBaseUrl; exports.resolveGlobalApiKeyForBaseUrl = resolveGlobalApiKeyForBaseUrl; exports.getResolvedProjectAuthSource = getResolvedProjectAuthSource; exports.resolveBaseUrlOnly = resolveBaseUrlOnly; exports.resolveConfig = resolveConfig; exports.ensureProjectPrivatePathsIgnored = ensureProjectPrivatePathsIgnored; exports.saveProjectDeeplineEnvValues = saveProjectDeeplineEnvValues; exports.resolveProjectPinTarget = resolveProjectPinTarget; exports.getActiveProjectAuthSource = getActiveProjectAuthSource; exports.resolveCliAuthProvenance = resolveCliAuthProvenance; exports.resolveCliCommandContext = resolveCliCommandContext; exports.SDK_VERSION = SDK_VERSION; exports.SDK_API_MAJOR = SDK_API_MAJOR; exports.SDK_API_CONTRACT = SDK_API_CONTRACT; exports.agentSessionIdFromEnvironment = agentSessionIdFromEnvironment; exports.detectAgentRuntime = detectAgentRuntime; exports.hasActivePluginSkills = hasActivePluginSkills; exports.KNOWN_SKILL_AGENTS = KNOWN_SKILL_AGENTS; exports.DEFAULT_SKILL_AGENTS = DEFAULT_SKILL_AGENTS; exports.skillsAgentPathSegment = skillsAgentPathSegment; exports.resolveAutoSyncSkillAgents = resolveAutoSyncSkillAgents; exports.readSdkSkillsLocalVersion = readSdkSkillsLocalVersion; exports.writeSdkSkillsLocalVersion = writeSdkSkillsLocalVersion; exports.deploymentProtectionHeaders = deploymentProtectionHeaders; exports.fetchWithDeploymentProtection = fetchWithDeploymentProtection; exports.COORDINATOR_INTERNAL_TOKEN_HEADER = COORDINATOR_INTERNAL_TOKEN_HEADER; exports.RUNTIME_ENVIRONMENT_TOKEN_HEADER = RUNTIME_ENVIRONMENT_TOKEN_HEADER; exports.RETAINED_PIPELINE_RECEIVERS_HEADER = RETAINED_PIPELINE_RECEIVERS_HEADER; exports.HttpClient = HttpClient;
|
|
1956
|
+
exports.HOST_URL_ENV = HOST_URL_ENV; exports.API_KEY_ENV = API_KEY_ENV; exports.ACTIVE_ORG_ID_ENV = ACTIVE_ORG_ID_ENV; exports.ACTIVE_ORG_NAME_ENV = ACTIVE_ORG_NAME_ENV; exports.FEATURES_ENV = FEATURES_ENV; exports.PROD_URL = PROD_URL; exports.featureEnvValues = featureEnvValues; exports.storedHostApiKey = storedHostApiKey; exports.storedHostFeatures = storedHostFeatures; exports.baseUrlSlug = baseUrlSlug; exports.sdkCliStateDirPath = sdkCliStateDirPath; exports.hostConfigDirPath = hostConfigDirPath; exports.hostEnvFilePath = hostEnvFilePath; exports.saveHostEnvValues = saveHostEnvValues; exports.autoDetectBaseUrl = autoDetectBaseUrl; exports.resolveApiKeyForBaseUrl = resolveApiKeyForBaseUrl; exports.resolveProjectApiKeyForBaseUrl = resolveProjectApiKeyForBaseUrl; exports.resolveGlobalApiKeyForBaseUrl = resolveGlobalApiKeyForBaseUrl; exports.getResolvedProjectAuthSource = getResolvedProjectAuthSource; exports.resolveBaseUrlOnly = resolveBaseUrlOnly; exports.resolveConfig = resolveConfig; exports.ensureProjectPrivatePathsIgnored = ensureProjectPrivatePathsIgnored; exports.saveProjectDeeplineEnvValues = saveProjectDeeplineEnvValues; exports.resolveProjectPinTarget = resolveProjectPinTarget; exports.getActiveProjectAuthSource = getActiveProjectAuthSource; exports.resolveCliAuthProvenance = resolveCliAuthProvenance; exports.resolveCliCommandContext = resolveCliCommandContext; exports.SDK_VERSION = SDK_VERSION; exports.SDK_API_MAJOR = SDK_API_MAJOR; exports.SDK_API_CONTRACT = SDK_API_CONTRACT; exports.agentSessionIdFromEnvironment = agentSessionIdFromEnvironment; exports.detectAgentRuntime = detectAgentRuntime; exports.hasActivePluginSkills = hasActivePluginSkills; exports.KNOWN_SKILL_AGENTS = KNOWN_SKILL_AGENTS; exports.DEFAULT_SKILL_AGENTS = DEFAULT_SKILL_AGENTS; exports.skillsAgentPathSegment = skillsAgentPathSegment; exports.resolveAutoSyncSkillAgents = resolveAutoSyncSkillAgents; exports.readSdkSkillsLocalVersion = readSdkSkillsLocalVersion; exports.writeSdkSkillsLocalVersion = writeSdkSkillsLocalVersion; exports.deploymentProtectionHeaders = deploymentProtectionHeaders; exports.fetchWithDeploymentProtection = fetchWithDeploymentProtection; exports.COORDINATOR_INTERNAL_TOKEN_HEADER = COORDINATOR_INTERNAL_TOKEN_HEADER; exports.RUNTIME_ENVIRONMENT_TOKEN_HEADER = RUNTIME_ENVIRONMENT_TOKEN_HEADER; exports.RETAINED_PIPELINE_RECEIVERS_HEADER = RETAINED_PIPELINE_RECEIVERS_HEADER; exports.HttpClient = HttpClient;
|
|
@@ -20,12 +20,14 @@ import {
|
|
|
20
20
|
} from "./chunk-EIMG75BT.mjs";
|
|
21
21
|
import {
|
|
22
22
|
COORDINATOR_INTERNAL_TOKEN_HEADER,
|
|
23
|
-
CustomerDbQueryOutcomeUnknownError,
|
|
24
23
|
HttpClient,
|
|
25
24
|
RETAINED_PIPELINE_RECEIVERS_HEADER,
|
|
26
25
|
RUNTIME_ENVIRONMENT_TOKEN_HEADER,
|
|
27
26
|
resolveConfig
|
|
28
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZJ7HLJRF.mjs";
|
|
28
|
+
import {
|
|
29
|
+
CustomerDbQueryOutcomeUnknownError
|
|
30
|
+
} from "./chunk-YHPYUZZX.mjs";
|
|
29
31
|
import {
|
|
30
32
|
DeeplineError,
|
|
31
33
|
TOOL_EXECUTION_ERROR_SCHEMA_HEADER,
|
|
@@ -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
|
+
};
|
|
@@ -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;
|