deepline 0.3.390 → 0.3.392
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/agent-runtime.ts +21 -16
- package/dist/bundling-sources/sdk/src/billing-idempotency.ts +1 -1
- package/dist/bundling-sources/sdk/src/cli-invocation-id.ts +1 -1
- package/dist/bundling-sources/sdk/src/client.ts +75 -52
- package/dist/bundling-sources/sdk/src/config.ts +3 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +3 -3
- package/dist/bundling-sources/sdk/src/deployment-protection.ts +7 -5
- package/dist/bundling-sources/sdk/src/http.ts +31 -41
- package/dist/bundling-sources/sdk/src/index.ts +26 -26
- package/dist/bundling-sources/sdk/src/play.ts +5 -5
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
- package/dist/bundling-sources/sdk/src/plays/csv-data-input.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +2 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +1 -1
- package/dist/bundling-sources/sdk/src/skills-version.ts +2 -2
- package/dist/bundling-sources/sdk/src/tool-calls.ts +3 -3
- package/dist/bundling-sources/sdk/src/types.ts +12 -1
- package/dist/bundling-sources/sdk/src/version.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +87 -1
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +57 -0
- package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/run-summary-types.ts +1 -0
- package/dist/cli/auth-67TAELQL.js +39 -0
- package/dist/cli/{auth-THPE72WM.mjs → auth-6JSA2ZCW.mjs} +4 -4
- package/dist/cli/{billing-52KJIWW2.mjs → billing-MRRO643H.mjs} +4 -4
- package/dist/cli/{billing-YRXEPKPB.js → billing-Q5BLQHIU.js} +73 -73
- package/dist/cli/{chunk-B22POC3J.mjs → chunk-24VEN5PQ.mjs} +7 -7
- package/dist/cli/{chunk-T5JMOYB4.js → chunk-2FQG2HU4.js} +8 -8
- package/dist/cli/{chunk-5KD4F7NR.mjs → chunk-2G7DXFHI.mjs} +1 -1
- package/dist/cli/{chunk-DNYNJU5J.mjs → chunk-2GAHHSLB.mjs} +34 -26
- package/dist/cli/{chunk-FKFE3WH3.mjs → chunk-2Q3GEFL4.mjs} +2 -2
- package/dist/cli/{chunk-ICZQGDYM.mjs → chunk-2QLML6G4.mjs} +4 -4
- package/dist/cli/{chunk-Z7LX4WYM.mjs → chunk-3FV4GBRK.mjs} +5 -5
- package/dist/cli/{chunk-UCPH7S5H.js → chunk-4SFPVW7A.js} +26 -26
- package/dist/cli/{chunk-HXENYWVS.js → chunk-4TCT77UF.js} +485 -114
- package/dist/cli/{chunk-L7NEMEUI.js → chunk-6DBOU7UH.js} +48 -48
- package/dist/cli/{chunk-CU7GDBBM.mjs → chunk-A3APGZFP.mjs} +2 -2
- package/dist/cli/{chunk-TLCCVMSB.js → chunk-BB3FNYFY.js} +2 -2
- package/dist/cli/{chunk-KUEYQLM3.js → chunk-CVLM3WMJ.js} +235 -220
- package/dist/cli/{chunk-PMNJLCIA.js → chunk-EY7RFC6A.js} +15 -15
- package/dist/cli/{chunk-5JLQPVNX.js → chunk-GSK6NHVM.js} +1 -0
- package/dist/cli/{chunk-JV7YZMNK.mjs → chunk-HGYBEAQP.mjs} +3 -3
- package/dist/cli/{chunk-EDWJY6T4.mjs → chunk-HQXL5526.mjs} +1 -0
- package/dist/cli/{chunk-QVMRQYSO.js → chunk-JOFPQGXW.js} +50 -50
- package/dist/cli/{chunk-OV567DMC.js → chunk-JSLPHFP7.js} +1 -1
- package/dist/cli/{chunk-653YVNNZ.mjs → chunk-MU6M3URX.mjs} +1 -1
- package/dist/cli/{chunk-HVDBGPDP.mjs → chunk-PQSA443V.mjs} +485 -114
- package/dist/cli/{chunk-RWOX543D.mjs → chunk-R3O2CZ4H.mjs} +2 -2
- package/dist/cli/{chunk-ENJWB4SX.js → chunk-RIV2GS5E.js} +228 -228
- package/dist/cli/{chunk-MI2JQCYZ.js → chunk-RV6ALZIX.js} +6 -6
- package/dist/cli/{chunk-QANTWJXH.js → chunk-T7OKJ2T6.js} +61 -61
- package/dist/cli/{chunk-ZFZ5PICC.js → chunk-UCKJQG25.js} +8 -8
- package/dist/cli/{chunk-CZUGLUQK.js → chunk-WMS5U6YB.js} +99 -91
- package/dist/cli/{chunk-EMJB62SM.mjs → chunk-YAZCDBXX.mjs} +1 -1
- package/dist/cli/{chunk-NQZW72DN.mjs → chunk-YN6YA7ZZ.mjs} +46 -31
- package/dist/cli/{chunk-KZOKUN3N.mjs → chunk-ZTACINO5.mjs} +2 -2
- package/dist/cli/command-docs.d.mts +24 -1
- package/dist/cli/command-docs.d.ts +24 -1
- package/dist/cli/command-docs.js +8 -2
- package/dist/cli/command-docs.mjs +9 -3
- package/dist/cli/{csv-JYDWK56E.js → csv-26U5T24Z.js} +12 -12
- package/dist/cli/{csv-IPUY3W6Z.mjs → csv-E4QGUIGI.mjs} +3 -3
- package/dist/cli/{db-IP5IPYJQ.mjs → db-JTRJIAQW.mjs} +4 -4
- package/dist/cli/{db-DAWM3T76.js → db-QHBFLMVL.js} +29 -29
- package/dist/cli/{describe-3RTUG7EW.mjs → describe-E3DE3ZK3.mjs} +9 -9
- package/dist/cli/{describe-5UWGF33U.js → describe-FDV2V74F.js} +19 -19
- package/dist/cli/{executions-7ZNMR443.mjs → executions-B3GTNPRE.mjs} +4 -4
- package/dist/cli/{executions-OEKC7TL5.js → executions-VZYOGVQY.js} +6 -6
- package/dist/cli/{feedback-IUJV565X.mjs → feedback-4CEBR3OV.mjs} +3 -3
- package/dist/cli/{feedback-5F2NQJP4.js → feedback-CR55FJA2.js} +7 -7
- package/dist/cli/git-I5JTK6YU.js +23 -0
- package/dist/cli/{git-IPV5G2PS.mjs → git-NM2PHHZ4.mjs} +4 -4
- package/dist/cli/index.js +93 -93
- package/dist/cli/index.mjs +33 -33
- package/dist/cli/{legacy-noops-UQOWD66P.mjs → legacy-noops-A7MSW5ND.mjs} +4 -4
- package/dist/cli/{legacy-noops-IZZRWI7V.js → legacy-noops-ZUA4YFIH.js} +7 -7
- package/dist/cli/{monitors-SULGYCTF.mjs → monitors-NVPRQYP3.mjs} +4 -4
- package/dist/cli/{monitors-N6WK7YPE.js → monitors-ZE3TLZ4H.js} +85 -85
- package/dist/cli/{org-EPVTTBDK.mjs → org-KUBILNQV.mjs} +4 -4
- package/dist/cli/{org-COMHSC5H.js → org-U7A6DV5D.js} +64 -64
- package/dist/cli/play-A2V7YDU7.js +157 -0
- package/dist/cli/{play-OCTPASJI.mjs → play-HRDXQ4QE.mjs} +8 -8
- package/dist/cli/{providers-QBVNC5EV.mjs → providers-OHIWI453.mjs} +4 -4
- package/dist/cli/{providers-34D6ATLE.js → providers-VD6YTVQZ.js} +7 -7
- package/dist/cli/{quickstart-3XR45BHI.js → quickstart-ETTCWPA4.js} +5 -5
- package/dist/cli/{quickstart-SYGV5XVH.mjs → quickstart-UBV2FONF.mjs} +3 -3
- package/dist/cli/{search-UUJ7EHBV.mjs → search-F44IZRT7.mjs} +5 -5
- package/dist/cli/search-WWXMBVPH.js +26 -0
- package/dist/cli/{secrets-TIL6DESO.js → secrets-CAEMRORF.js} +13 -13
- package/dist/cli/{secrets-MWRFHNIT.mjs → secrets-R6XOJZKU.mjs} +4 -4
- package/dist/cli/{sessions-2LXC6ZYD.js → sessions-6GC7OFTT.js} +5 -5
- package/dist/cli/{sessions-5TKMBU5P.mjs → sessions-RLN6UQS3.mjs} +4 -4
- package/dist/cli/{settings-II3IQECQ.js → settings-DPNVUAV2.js} +74 -74
- package/dist/cli/{settings-NRIACLPU.mjs → settings-KIPAMRPP.mjs} +7 -7
- package/dist/cli/{setup-AF3UMIIC.js → setup-DTL3L5SG.js} +41 -41
- package/dist/cli/{setup-VIMZ4U73.mjs → setup-TU2F7PU5.mjs} +6 -6
- package/dist/cli/skills-SWOSEZLB.js +28 -0
- package/dist/cli/{skills-5OKAXXWJ.mjs → skills-UV5MYJ46.mjs} +4 -4
- package/dist/cli/tools-IL2YCDQ6.js +40 -0
- package/dist/cli/{tools-5UXNV4YY.mjs → tools-QRRNDCQ7.mjs} +6 -6
- package/dist/cli/{update-Q4HX6CR3.mjs → update-4426TF35.mjs} +6 -6
- package/dist/cli/update-BERDPEYR.js +28 -0
- package/dist/cli/{workflow-NZZ5H4P4.js → workflow-HNLOVISB.js} +15 -15
- package/dist/cli/{workflow-45BLG7GN.mjs → workflow-N4U5VLZ3.mjs} +5 -5
- package/dist/{client-DEKvymBI.d.ts → client-Uxuy-xQ2.d.ts} +23 -0
- package/dist/{client-0avPvYBP.d.mts → client-e6Qh5ZIg.d.mts} +23 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +79 -78
- package/dist/plays/csv-data-input.d.mts +2 -0
- package/dist/plays/csv-data-input.d.ts +2 -0
- package/dist/plays/csv-data-input.js +2 -2
- package/dist/plays/csv-data-input.mjs +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 +1 -1
- package/dist/cli/auth-OVT7BZ5A.js +0 -39
- package/dist/cli/git-ZZ5MD2KG.js +0 -23
- package/dist/cli/play-RWY2JHAP.js +0 -157
- package/dist/cli/search-PTG76HU3.js +0 -26
- package/dist/cli/skills-I6NTZMBZ.js +0 -28
- package/dist/cli/tools-NXD7YFYV.js +0 -40
- package/dist/cli/update-SZ6AMT3M.js +0 -28
|
@@ -14,7 +14,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
|
|
|
14
14
|
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkJSLPHFP7js = require('./chunk-JSLPHFP7.js');
|
|
18
18
|
|
|
19
19
|
// src/errors.ts
|
|
20
20
|
var CustomerDbQueryOutcomeUnknownError = (_class = class extends _chunk7P5AA3SNjs.DeeplineError {
|
|
@@ -501,7 +501,8 @@ function resolveConfig(options) {
|
|
|
501
501
|
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _40 => _40.maxRetries]), () => ( DEFAULT_MAX_RETRIES)),
|
|
502
502
|
// Pass through untouched: the transport owns case-insensitive merging so
|
|
503
503
|
// there is exactly one place that decides which header wins.
|
|
504
|
-
..._optionalChain([options, 'optionalAccess', _41 => _41.headers]) ? { headers: { ...options.headers } } : {}
|
|
504
|
+
..._optionalChain([options, 'optionalAccess', _41 => _41.headers]) ? { headers: { ...options.headers } } : {},
|
|
505
|
+
..._optionalChain([options, 'optionalAccess', _42 => _42.environment]) ? { environment: options.environment } : {}
|
|
505
506
|
};
|
|
506
507
|
}
|
|
507
508
|
function mergeProjectEnvFile(filePath, values) {
|
|
@@ -571,7 +572,7 @@ function findNearestGitCommonDir(startDir) {
|
|
|
571
572
|
const match = _fs.readFileSync.call(void 0, candidate, "utf8").match(
|
|
572
573
|
/^gitdir:\s*(.+)$/m
|
|
573
574
|
);
|
|
574
|
-
const rawGitDir = _optionalChain([match, 'optionalAccess',
|
|
575
|
+
const rawGitDir = _optionalChain([match, 'optionalAccess', _43 => _43[1], 'optionalAccess', _44 => _44.trim, 'call', _45 => _45()]);
|
|
575
576
|
if (rawGitDir) {
|
|
576
577
|
const gitDir = _path.isAbsolute.call(void 0, rawGitDir) ? rawGitDir : _path.resolve.call(void 0, _path.dirname.call(void 0, candidate), rawGitDir);
|
|
577
578
|
const commonDirPath = _path.join.call(void 0, gitDir, "commondir");
|
|
@@ -643,7 +644,7 @@ function findNearestProjectMarkerDir(startDir) {
|
|
|
643
644
|
}
|
|
644
645
|
}
|
|
645
646
|
function resolveCliAuthProvenance(config, startDir = process.cwd()) {
|
|
646
|
-
const envApiKey = _optionalChain([process, 'access',
|
|
647
|
+
const envApiKey = _optionalChain([process, 'access', _46 => _46.env, 'access', _47 => _47[API_KEY_ENV], 'optionalAccess', _48 => _48.trim, 'call', _49 => _49()]);
|
|
647
648
|
const folderAuth = getResolvedProjectAuthSource(
|
|
648
649
|
config.baseUrl,
|
|
649
650
|
config.apiKey,
|
|
@@ -673,13 +674,13 @@ function resolveCliAuthProvenance(config, startDir = process.cwd()) {
|
|
|
673
674
|
return {
|
|
674
675
|
scope: envApiKey ? "env" : folderAuth ? "folder" : "global",
|
|
675
676
|
project,
|
|
676
|
-
folderAuthPath: _nullishCoalesce(_optionalChain([folderAuth, 'optionalAccess',
|
|
677
|
+
folderAuthPath: _nullishCoalesce(_optionalChain([folderAuth, 'optionalAccess', _50 => _50.filePath]), () => ( null))
|
|
677
678
|
};
|
|
678
679
|
}
|
|
679
680
|
function activeOrganizationFromEnv(env) {
|
|
680
|
-
const orgId = _optionalChain([env, 'access',
|
|
681
|
+
const orgId = _optionalChain([env, 'access', _51 => _51[ACTIVE_ORG_ID_ENV], 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]);
|
|
681
682
|
if (!orgId) return null;
|
|
682
|
-
const orgName = _optionalChain([env, 'access',
|
|
683
|
+
const orgName = _optionalChain([env, 'access', _54 => _54[ACTIVE_ORG_NAME_ENV], 'optionalAccess', _55 => _55.trim, 'call', _56 => _56()]) || null;
|
|
683
684
|
return { org_id: orgId, org_name: orgName };
|
|
684
685
|
}
|
|
685
686
|
function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
@@ -697,7 +698,7 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
|
697
698
|
}
|
|
698
699
|
const contextForScope = (scope) => {
|
|
699
700
|
if (scope === "env") {
|
|
700
|
-
const processApiKey = _optionalChain([process, 'access',
|
|
701
|
+
const processApiKey = _optionalChain([process, 'access', _57 => _57.env, 'access', _58 => _58[API_KEY_ENV], 'optionalAccess', _59 => _59.trim, 'call', _60 => _60()]);
|
|
701
702
|
return processApiKey && processApiKey === config.apiKey ? {
|
|
702
703
|
active_organization: activeOrganizationFromEnv(process.env),
|
|
703
704
|
auth_scope: "env",
|
|
@@ -743,9 +744,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
|
|
|
743
744
|
}
|
|
744
745
|
|
|
745
746
|
// src/version.ts
|
|
746
|
-
var SDK_VERSION =
|
|
747
|
-
var SDK_API_MAJOR =
|
|
748
|
-
var SDK_API_CONTRACT = _nullishCoalesce(
|
|
747
|
+
var SDK_VERSION = _chunkJSLPHFP7js.SDK_RELEASE.version;
|
|
748
|
+
var SDK_API_MAJOR = _chunkJSLPHFP7js.SDK_RELEASE.contracts.api.currentMajor;
|
|
749
|
+
var SDK_API_CONTRACT = _nullishCoalesce(_chunkJSLPHFP7js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
|
|
749
750
|
|
|
750
751
|
// src/agent-runtime.ts
|
|
751
752
|
|
|
@@ -766,7 +767,7 @@ function truthyEnv(name) {
|
|
|
766
767
|
);
|
|
767
768
|
}
|
|
768
769
|
function normalizeAgentRuntime(value) {
|
|
769
|
-
const explicit = _optionalChain([value, 'optionalAccess',
|
|
770
|
+
const explicit = _optionalChain([value, 'optionalAccess', _61 => _61.trim, 'call', _62 => _62(), 'access', _63 => _63.toLowerCase, 'call', _64 => _64(), 'access', _65 => _65.replace, 'call', _66 => _66(/-/g, "_")]);
|
|
770
771
|
if (!explicit) return null;
|
|
771
772
|
if (explicit === "gemini_cli") return "gemini";
|
|
772
773
|
return EXPLICIT_AGENT_RUNTIMES.has(explicit) ? explicit : null;
|
|
@@ -778,7 +779,7 @@ var AGENT_SESSION_ID_VARIABLES = [
|
|
|
778
779
|
];
|
|
779
780
|
function agentSessionIdFromEnvironment(env = process.env) {
|
|
780
781
|
for (const variable of AGENT_SESSION_ID_VARIABLES) {
|
|
781
|
-
const sessionId = _optionalChain([env, 'access',
|
|
782
|
+
const sessionId = _optionalChain([env, 'access', _67 => _67[variable], 'optionalAccess', _68 => _68.trim, 'call', _69 => _69()]);
|
|
782
783
|
if (sessionId) return sessionId;
|
|
783
784
|
}
|
|
784
785
|
return null;
|
|
@@ -786,31 +787,32 @@ function agentSessionIdFromEnvironment(env = process.env) {
|
|
|
786
787
|
function isCoworkLikeSandbox2() {
|
|
787
788
|
const pluginMode = truthyEnv("DEEPLINE_PLUGIN_MODE");
|
|
788
789
|
const claudeRemote = truthyEnv("CLAUDE_CODE_REMOTE");
|
|
789
|
-
const projectDir = Boolean(_optionalChain([process, 'access',
|
|
790
|
-
const pluginRoot = Boolean(_optionalChain([process, 'access',
|
|
791
|
-
const home = _optionalChain([process, 'access',
|
|
790
|
+
const projectDir = Boolean(_optionalChain([process, 'access', _70 => _70.env, 'access', _71 => _71.CLAUDE_PROJECT_DIR, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]));
|
|
791
|
+
const pluginRoot = Boolean(_optionalChain([process, 'access', _74 => _74.env, 'access', _75 => _75.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]));
|
|
792
|
+
const home = _optionalChain([process, 'access', _78 => _78.env, 'access', _79 => _79.HOME, 'optionalAccess', _80 => _80.trim, 'call', _81 => _81()]) || _os.homedir.call(void 0, );
|
|
792
793
|
const sessionHome = home === "/sessions" || home.startsWith("/sessions/");
|
|
793
794
|
return claudeRemote || sessionHome || (pluginMode || pluginRoot) && projectDir;
|
|
794
795
|
}
|
|
795
796
|
function detectAgentRuntime(options = {}) {
|
|
796
|
-
const
|
|
797
|
+
const env = _nullishCoalesce(options.env, () => ( process.env));
|
|
798
|
+
const explicit = normalizeAgentRuntime(env.DEEPLINE_AGENT_RUNTIME);
|
|
797
799
|
if (explicit) return explicit;
|
|
798
|
-
if (_optionalChain([
|
|
800
|
+
if (_optionalChain([env, 'access', _82 => _82.CODEX_THREAD_ID, 'optionalAccess', _83 => _83.trim, 'call', _84 => _84()])) return "codex";
|
|
799
801
|
if (options.detectCowork !== false && isCoworkLikeSandbox2()) {
|
|
800
802
|
return "claude_cowork";
|
|
801
803
|
}
|
|
802
|
-
if (_optionalChain([
|
|
803
|
-
if (_optionalChain([
|
|
804
|
-
if (_optionalChain([
|
|
804
|
+
if (_optionalChain([env, 'access', _85 => _85.CLAUDECODE, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87()]) === "1") return "claude_code";
|
|
805
|
+
if (_optionalChain([env, 'access', _88 => _88.CLINE_ACTIVE, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90(), 'access', _91 => _91.toLowerCase, 'call', _92 => _92()]) === "true") return "cline";
|
|
806
|
+
if (_optionalChain([env, 'access', _93 => _93.CURSOR_TRACE_ID, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]) || _optionalChain([env, 'access', _96 => _96.CURSOR_AGENT, 'optionalAccess', _97 => _97.trim, 'call', _98 => _98()])) {
|
|
805
807
|
return "cursor";
|
|
806
808
|
}
|
|
807
|
-
if (_optionalChain([
|
|
809
|
+
if (_optionalChain([env, 'access', _99 => _99.WINDSURF, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]) || _optionalChain([env, 'access', _102 => _102.CASCADE, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104()])) {
|
|
808
810
|
return "windsurf";
|
|
809
811
|
}
|
|
810
|
-
if (_optionalChain([
|
|
812
|
+
if (_optionalChain([env, 'access', _105 => _105.ANTIGRAVITY, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107()]) || _optionalChain([env, 'access', _108 => _108.ANTIGRAVITY_CLI, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]) || _optionalChain([env, 'access', _111 => _111.ANTIGRAVITY_AGENT, 'optionalAccess', _112 => _112.trim, 'call', _113 => _113()]) || _optionalChain([env, 'access', _114 => _114.ANTIGRAVITY_WORKSPACE, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()])) {
|
|
811
813
|
return "antigravity";
|
|
812
814
|
}
|
|
813
|
-
if (_optionalChain([
|
|
815
|
+
if (_optionalChain([env, 'access', _117 => _117.GEMINI_CLI, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]) || _optionalChain([env, 'access', _120 => _120.GEMINI_CLI_VERSION, 'optionalAccess', _121 => _121.trim, 'call', _122 => _122()]) || _optionalChain([env, 'access', _123 => _123.GEMINI_SANDBOX, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]) || _optionalChain([env, 'access', _126 => _126.GEMINI_CONFIG_DIR, 'optionalAccess', _127 => _127.trim, 'call', _128 => _128()])) {
|
|
814
816
|
return "gemini";
|
|
815
817
|
}
|
|
816
818
|
return _nullishCoalesce(options.defaultRuntime, () => ( "unknown"));
|
|
@@ -820,11 +822,11 @@ function detectAgentRuntime(options = {}) {
|
|
|
820
822
|
|
|
821
823
|
|
|
822
824
|
function activePluginSkillsDir() {
|
|
823
|
-
const pluginMode = _optionalChain([process, 'access',
|
|
825
|
+
const pluginMode = _optionalChain([process, 'access', _129 => _129.env, 'access', _130 => _130.DEEPLINE_PLUGIN_MODE, 'optionalAccess', _131 => _131.trim, 'call', _132 => _132(), 'access', _133 => _133.toLowerCase, 'call', _134 => _134()]);
|
|
824
826
|
if (pluginMode !== "true" && pluginMode !== "1" && pluginMode !== "yes" && pluginMode !== "on") {
|
|
825
827
|
return "";
|
|
826
828
|
}
|
|
827
|
-
const dir = _nullishCoalesce(_optionalChain([process, 'access',
|
|
829
|
+
const dir = _nullishCoalesce(_optionalChain([process, 'access', _135 => _135.env, 'access', _136 => _136.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _137 => _137.trim, 'call', _138 => _138()]), () => ( ""));
|
|
828
830
|
return dir && _fs.existsSync.call(void 0, dir) ? dir : "";
|
|
829
831
|
}
|
|
830
832
|
function hasActivePluginSkills() {
|
|
@@ -945,15 +947,15 @@ function writeSdkSkillsLocalVersion(baseUrl, version, agents) {
|
|
|
945
947
|
}
|
|
946
948
|
|
|
947
949
|
// src/deployment-protection.ts
|
|
948
|
-
function deploymentProtectionHeaders() {
|
|
949
|
-
const token =
|
|
950
|
+
function deploymentProtectionHeaders(env = typeof process !== "undefined" ? process.env : {}) {
|
|
951
|
+
const token = env.VERCEL_PROTECTION_BYPASS_TOKEN;
|
|
950
952
|
return token ? { "x-vercel-protection-bypass": token } : {};
|
|
951
953
|
}
|
|
952
954
|
var fetchWithDeploymentProtection = (input, init) => {
|
|
953
955
|
const headers = new Headers(
|
|
954
956
|
input instanceof Request ? input.headers : void 0
|
|
955
957
|
);
|
|
956
|
-
new Headers(_optionalChain([init, 'optionalAccess',
|
|
958
|
+
new Headers(_optionalChain([init, 'optionalAccess', _139 => _139.headers])).forEach((value, name) => headers.set(name, value));
|
|
957
959
|
for (const [name, value] of Object.entries(deploymentProtectionHeaders())) {
|
|
958
960
|
headers.set(name, value);
|
|
959
961
|
}
|
|
@@ -1300,7 +1302,7 @@ function withErrorCause(error, cause) {
|
|
|
1300
1302
|
}
|
|
1301
1303
|
function mapNetworkError(baseUrl, error, targetLabel) {
|
|
1302
1304
|
const tagged = error;
|
|
1303
|
-
const timeoutMs = _optionalChain([tagged, 'optionalAccess',
|
|
1305
|
+
const timeoutMs = _optionalChain([tagged, 'optionalAccess', _140 => _140[REQUEST_TIMEOUT_MARKER]]);
|
|
1304
1306
|
if (typeof timeoutMs === "number") {
|
|
1305
1307
|
return {
|
|
1306
1308
|
message: `Request to ${targetLabel} timed out after ${timeoutMs}ms while waiting for a response.`,
|
|
@@ -1308,14 +1310,14 @@ function mapNetworkError(baseUrl, error, targetLabel) {
|
|
|
1308
1310
|
details: { timeoutMs, target: targetLabel }
|
|
1309
1311
|
};
|
|
1310
1312
|
}
|
|
1311
|
-
if (_optionalChain([tagged, 'optionalAccess',
|
|
1313
|
+
if (_optionalChain([tagged, 'optionalAccess', _141 => _141[REQUEST_ABORT_MARKER]])) {
|
|
1312
1314
|
return {
|
|
1313
1315
|
message: `Request to ${targetLabel} was aborted before it completed.`,
|
|
1314
1316
|
code: "NETWORK_ABORTED"
|
|
1315
1317
|
};
|
|
1316
1318
|
}
|
|
1317
1319
|
return {
|
|
1318
|
-
message: _optionalChain([error, 'optionalAccess',
|
|
1320
|
+
message: _optionalChain([error, 'optionalAccess', _142 => _142.message]) ? `Unable to connect to ${baseUrl}. ${error.message}` : `Unable to connect to ${baseUrl}. Is the computer able to access the url?`,
|
|
1319
1321
|
code: "NETWORK_ERROR"
|
|
1320
1322
|
};
|
|
1321
1323
|
}
|
|
@@ -1353,9 +1355,12 @@ var HttpClient = class {
|
|
|
1353
1355
|
const normalized = String(_nullishCoalesce(value, () => ( ""))).replace(/[\u0000-\u001f\u007f]/g, " ").trim().slice(0, MAX_DIAGNOSTIC_HEADER_LENGTH);
|
|
1354
1356
|
return normalized || null;
|
|
1355
1357
|
}
|
|
1358
|
+
environment() {
|
|
1359
|
+
return _nullishCoalesce(this.config.environment, () => ( (typeof process !== "undefined" ? process.env : {})));
|
|
1360
|
+
}
|
|
1356
1361
|
readSkillsVersionHeader() {
|
|
1357
1362
|
const explicit = this.cleanDiagnosticHeader(
|
|
1358
|
-
|
|
1363
|
+
this.environment().DEEPLINE_SKILLS_VERSION
|
|
1359
1364
|
);
|
|
1360
1365
|
if (explicit) return explicit;
|
|
1361
1366
|
try {
|
|
@@ -1367,65 +1372,68 @@ var HttpClient = class {
|
|
|
1367
1372
|
}
|
|
1368
1373
|
}
|
|
1369
1374
|
authHeaders(extra) {
|
|
1375
|
+
const env = this.environment();
|
|
1370
1376
|
const transportHeaders = {
|
|
1371
1377
|
Authorization: `Bearer ${this.config.apiKey}`,
|
|
1372
1378
|
"User-Agent": `deepline-ts-sdk/${SDK_VERSION}`,
|
|
1373
1379
|
"X-Deepline-Client-Family": "sdk",
|
|
1374
1380
|
"X-Deepline-CLI-Family": "sdk",
|
|
1375
|
-
"X-Deepline-Agent-Runtime": detectAgentRuntime(
|
|
1381
|
+
"X-Deepline-Agent-Runtime": detectAgentRuntime(
|
|
1382
|
+
this.config.environment ? { env, detectCowork: false } : {}
|
|
1383
|
+
),
|
|
1376
1384
|
"X-Deepline-CLI-Version": SDK_VERSION,
|
|
1377
1385
|
"X-Deepline-SDK-Version": SDK_VERSION,
|
|
1378
1386
|
"X-Deepline-API-Contract": SDK_API_CONTRACT,
|
|
1379
1387
|
"X-Deepline-Run-Result-Shape": "canonical"
|
|
1380
1388
|
};
|
|
1381
|
-
const headers = deploymentProtectionHeaders();
|
|
1389
|
+
const headers = deploymentProtectionHeaders(env);
|
|
1382
1390
|
const skillsVersion = this.readSkillsVersionHeader();
|
|
1383
1391
|
if (skillsVersion) {
|
|
1384
1392
|
headers["X-Deepline-Skills-Version"] = skillsVersion;
|
|
1385
1393
|
}
|
|
1386
|
-
const agentSessionId = agentSessionIdFromEnvironment();
|
|
1394
|
+
const agentSessionId = agentSessionIdFromEnvironment(env);
|
|
1387
1395
|
if (agentSessionId) {
|
|
1388
1396
|
headers["X-Deepline-Agent-Session-Id"] = agentSessionId;
|
|
1389
1397
|
}
|
|
1390
|
-
const playArtifactR2Prefix =
|
|
1398
|
+
const playArtifactR2Prefix = env.DEEPLINE_PLAY_ARTIFACT_R2_PREFIX;
|
|
1391
1399
|
if (playArtifactR2Prefix) {
|
|
1392
1400
|
headers["x-deepline-play-artifact-r2-prefix"] = playArtifactR2Prefix;
|
|
1393
1401
|
}
|
|
1394
|
-
const coordinatorUrl =
|
|
1395
|
-
const coordinatorInternalToken =
|
|
1396
|
-
const absurdReleaseOverride =
|
|
1397
|
-
const preferredReceiptGatewayMachineId =
|
|
1398
|
-
if (_optionalChain([coordinatorUrl, 'optionalAccess',
|
|
1402
|
+
const coordinatorUrl = env.DEEPLINE_COORDINATOR_URL;
|
|
1403
|
+
const coordinatorInternalToken = env.DEEPLINE_INTERNAL_TOKEN;
|
|
1404
|
+
const absurdReleaseOverride = env.DEEPLINE_ABSURD_RELEASE;
|
|
1405
|
+
const preferredReceiptGatewayMachineId = env.DEEPLINE_PREFERRED_RECEIPT_GATEWAY_MACHINE_ID;
|
|
1406
|
+
if (_optionalChain([coordinatorUrl, 'optionalAccess', _143 => _143.trim, 'call', _144 => _144()])) {
|
|
1399
1407
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
1400
1408
|
}
|
|
1401
|
-
const workerCallbackUrl =
|
|
1402
|
-
if (_optionalChain([workerCallbackUrl, 'optionalAccess',
|
|
1409
|
+
const workerCallbackUrl = env.DEEPLINE_WORKER_CALLBACK_URL;
|
|
1410
|
+
if (_optionalChain([workerCallbackUrl, 'optionalAccess', _145 => _145.trim, 'call', _146 => _146()])) {
|
|
1403
1411
|
headers[WORKER_CALLBACK_URL_OVERRIDE_HEADER] = workerCallbackUrl.trim();
|
|
1404
1412
|
}
|
|
1405
|
-
const runtimeSchedulerSchema =
|
|
1406
|
-
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess',
|
|
1413
|
+
const runtimeSchedulerSchema = env.DEEPLINE_RUNTIME_SCHEDULER_SCHEMA;
|
|
1414
|
+
if (_optionalChain([runtimeSchedulerSchema, 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()])) {
|
|
1407
1415
|
headers[RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER] = runtimeSchedulerSchema.trim();
|
|
1408
1416
|
}
|
|
1409
|
-
const syntheticRun =
|
|
1417
|
+
const syntheticRun = env.DEEPLINE_SYNTHETIC_RUN;
|
|
1410
1418
|
if (syntheticRun && syntheticRun.trim() && syntheticRun.trim() !== "0") {
|
|
1411
1419
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
1412
1420
|
}
|
|
1413
|
-
const runtimeTestFault =
|
|
1414
|
-
if (_optionalChain([runtimeTestFault, 'optionalAccess',
|
|
1421
|
+
const runtimeTestFault = env.DEEPLINE_TEST_RUNTIME_FAULT;
|
|
1422
|
+
if (_optionalChain([runtimeTestFault, 'optionalAccess', _149 => _149.trim, 'call', _150 => _150()])) {
|
|
1415
1423
|
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
1416
1424
|
}
|
|
1417
|
-
const retainedReceivers =
|
|
1418
|
-
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
1425
|
+
const retainedReceivers = _optionalChain([env, 'access', _151 => _151.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _152 => _152.trim, 'call', _153 => _153()]);
|
|
1426
|
+
if (retainedReceivers && _optionalChain([coordinatorInternalToken, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()])) {
|
|
1419
1427
|
headers[RETAINED_PIPELINE_RECEIVERS_HEADER] = retainedReceivers;
|
|
1420
1428
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1421
1429
|
}
|
|
1422
|
-
if (_optionalChain([absurdReleaseOverride, 'optionalAccess',
|
|
1430
|
+
if (_optionalChain([absurdReleaseOverride, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()])) {
|
|
1423
1431
|
headers[ABSURD_RELEASE_OVERRIDE_HEADER] = absurdReleaseOverride.trim();
|
|
1424
1432
|
}
|
|
1425
|
-
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess',
|
|
1433
|
+
if (_optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()]) && _optionalChain([coordinatorInternalToken, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()])) {
|
|
1426
1434
|
headers[PREFERRED_RECEIPT_GATEWAY_MACHINE_ID_HEADER] = preferredReceiptGatewayMachineId.trim();
|
|
1427
1435
|
}
|
|
1428
|
-
if (_optionalChain([coordinatorInternalToken, 'optionalAccess',
|
|
1436
|
+
if (_optionalChain([coordinatorInternalToken, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()]) && (_optionalChain([coordinatorUrl, 'optionalAccess', _166 => _166.trim, 'call', _167 => _167()]) || _optionalChain([workerCallbackUrl, 'optionalAccess', _168 => _168.trim, 'call', _169 => _169()]) || _optionalChain([runtimeTestFault, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || _optionalChain([absurdReleaseOverride, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]) || _optionalChain([preferredReceiptGatewayMachineId, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()]))) {
|
|
1429
1437
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
1430
1438
|
}
|
|
1431
1439
|
return applyExplicitHeaders(
|
|
@@ -1450,23 +1458,23 @@ var HttpClient = class {
|
|
|
1450
1458
|
async request(path, options) {
|
|
1451
1459
|
const baseUrl = this.config.baseUrl;
|
|
1452
1460
|
const url = `${baseUrl}${path}`;
|
|
1453
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1461
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _176 => _176.method]), () => ( "GET"));
|
|
1454
1462
|
const requestStartedAt = Date.now();
|
|
1455
1463
|
let fetchAttempts = 0;
|
|
1456
1464
|
let lastRequestUrl = url;
|
|
1457
1465
|
let networkFailedAt;
|
|
1458
1466
|
let networkPhase = "before_request";
|
|
1459
|
-
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess',
|
|
1460
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1467
|
+
const headers = this.authHeaders(_optionalChain([options, 'optionalAccess', _177 => _177.headers]));
|
|
1468
|
+
if (_optionalChain([options, 'optionalAccess', _178 => _178.body]) !== void 0) {
|
|
1461
1469
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
1462
1470
|
}
|
|
1463
1471
|
let lastError = null;
|
|
1464
|
-
const candidateUrls = _optionalChain([options, 'optionalAccess',
|
|
1472
|
+
const candidateUrls = _optionalChain([options, 'optionalAccess', _179 => _179.exactUrlOnly]) ? [url] : buildCandidateUrls(url);
|
|
1465
1473
|
let retryAfterDelayMs = null;
|
|
1466
1474
|
let totalRetryWaitMs = 0;
|
|
1467
|
-
const maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1475
|
+
const maxRetries = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _180 => _180.maxRetries]), () => ( this.config.maxRetries));
|
|
1468
1476
|
requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
1469
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1477
|
+
if (_optionalChain([options, 'optionalAccess', _181 => _181.signal, 'optionalAccess', _182 => _182.aborted])) {
|
|
1470
1478
|
lastError = requestCancelledError(options.signal);
|
|
1471
1479
|
networkFailedAt = Date.now();
|
|
1472
1480
|
break;
|
|
@@ -1481,7 +1489,7 @@ var HttpClient = class {
|
|
|
1481
1489
|
totalRetryWaitMs += delayMs;
|
|
1482
1490
|
networkPhase = "retry_wait";
|
|
1483
1491
|
try {
|
|
1484
|
-
await sleep(delayMs, _optionalChain([options, 'optionalAccess',
|
|
1492
|
+
await sleep(delayMs, _optionalChain([options, 'optionalAccess', _183 => _183.signal]));
|
|
1485
1493
|
} catch (error) {
|
|
1486
1494
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
1487
1495
|
networkFailedAt = Date.now();
|
|
@@ -1489,25 +1497,25 @@ var HttpClient = class {
|
|
|
1489
1497
|
}
|
|
1490
1498
|
}
|
|
1491
1499
|
for (const candidateUrl of candidateUrls) {
|
|
1492
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1500
|
+
if (_optionalChain([options, 'optionalAccess', _184 => _184.signal, 'optionalAccess', _185 => _185.aborted])) {
|
|
1493
1501
|
lastError = requestCancelledError(options.signal);
|
|
1494
1502
|
networkFailedAt = Date.now();
|
|
1495
1503
|
break requestAttempts;
|
|
1496
1504
|
}
|
|
1497
1505
|
const controller = new AbortController();
|
|
1498
|
-
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1506
|
+
const timeoutMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _186 => _186.timeout]), () => ( this.config.timeout));
|
|
1499
1507
|
let requestTimedOut = false;
|
|
1500
1508
|
const timeoutId = setTimeout(() => {
|
|
1501
1509
|
requestTimedOut = true;
|
|
1502
1510
|
controller.abort();
|
|
1503
1511
|
}, timeoutMs);
|
|
1504
1512
|
const abortRequest = () => controller.abort();
|
|
1505
|
-
_optionalChain([options, 'optionalAccess',
|
|
1513
|
+
_optionalChain([options, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.addEventListener, 'call', _189 => _189("abort", abortRequest, {
|
|
1506
1514
|
once: true
|
|
1507
1515
|
})]);
|
|
1508
1516
|
networkPhase = "before_request";
|
|
1509
1517
|
try {
|
|
1510
|
-
const requestBody = _optionalChain([options, 'optionalAccess',
|
|
1518
|
+
const requestBody = _optionalChain([options, 'optionalAccess', _190 => _190.formData]) !== void 0 ? typeof options.formData === "function" ? options.formData() : options.formData : _optionalChain([options, 'optionalAccess', _191 => _191.body]) !== void 0 ? JSON.stringify(options.body) : void 0;
|
|
1511
1519
|
fetchAttempts += 1;
|
|
1512
1520
|
lastRequestUrl = candidateUrl;
|
|
1513
1521
|
networkPhase = "awaiting_headers";
|
|
@@ -1518,8 +1526,8 @@ var HttpClient = class {
|
|
|
1518
1526
|
signal: controller.signal
|
|
1519
1527
|
});
|
|
1520
1528
|
networkPhase = "reading_body";
|
|
1521
|
-
_optionalChain([options, 'optionalAccess',
|
|
1522
|
-
if (response.status === 404 && _optionalChain([options, 'optionalAccess',
|
|
1529
|
+
_optionalChain([options, 'optionalAccess', _192 => _192.onResponse, 'optionalCall', _193 => _193(response)]);
|
|
1530
|
+
if (response.status === 404 && _optionalChain([options, 'optionalAccess', _194 => _194.allowNotFound])) {
|
|
1523
1531
|
clearTimeout(timeoutId);
|
|
1524
1532
|
return null;
|
|
1525
1533
|
}
|
|
@@ -1527,12 +1535,12 @@ var HttpClient = class {
|
|
|
1527
1535
|
const receivedAtMs = Date.now();
|
|
1528
1536
|
clearTimeout(timeoutId);
|
|
1529
1537
|
const parsed = parseResponseBody(body);
|
|
1530
|
-
_optionalChain([options, 'optionalAccess',
|
|
1538
|
+
_optionalChain([options, 'optionalAccess', _195 => _195.onResponseBody, 'optionalCall', _196 => _196({
|
|
1531
1539
|
receivedAtMs,
|
|
1532
1540
|
httpStatus: response.status,
|
|
1533
1541
|
body: parsed
|
|
1534
1542
|
})]);
|
|
1535
|
-
const structuredToolError = _optionalChain([options, 'optionalAccess',
|
|
1543
|
+
const structuredToolError = _optionalChain([options, 'optionalAccess', _197 => _197.toolId]) && !response.ok ? _chunk7P5AA3SNjs.deserializeToolExecutionFailure.call(void 0,
|
|
1536
1544
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
1537
1545
|
isRecord(parsed) ? parsed.tool_error : null,
|
|
1538
1546
|
_chunk7P5AA3SNjs.TOOL_EXECUTION_ERROR_SCHEMA_VERSION
|
|
@@ -1554,7 +1562,7 @@ var HttpClient = class {
|
|
|
1554
1562
|
throw structuredToolError;
|
|
1555
1563
|
}
|
|
1556
1564
|
if (response.status === 429) {
|
|
1557
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1565
|
+
if (_optionalChain([options, 'optionalAccess', _198 => _198.preserveRateLimitResponse]) && isMonitorRateLimitEnvelope(parsed)) {
|
|
1558
1566
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
1559
1567
|
_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status),
|
|
1560
1568
|
response.status,
|
|
@@ -1574,7 +1582,7 @@ var HttpClient = class {
|
|
|
1574
1582
|
throw new AuthError(_chunkXNYIZMNQjs.apiErrorMessage.call(void 0, parsed, response.status));
|
|
1575
1583
|
}
|
|
1576
1584
|
if (!response.ok) {
|
|
1577
|
-
const retryableApiError = _optionalChain([options, 'optionalAccess',
|
|
1585
|
+
const retryableApiError = _optionalChain([options, 'optionalAccess', _199 => _199.retryApiErrors]) === true && isRetryableApiErrorResponse(response.status);
|
|
1578
1586
|
const htmlError = detectHtmlErrorBody(
|
|
1579
1587
|
body,
|
|
1580
1588
|
response.headers.get("content-type")
|
|
@@ -1626,7 +1634,7 @@ var HttpClient = class {
|
|
|
1626
1634
|
} catch (error) {
|
|
1627
1635
|
clearTimeout(timeoutId);
|
|
1628
1636
|
networkFailedAt = Date.now();
|
|
1629
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1637
|
+
if (_optionalChain([options, 'optionalAccess', _200 => _200.signal, 'optionalAccess', _201 => _201.aborted])) {
|
|
1630
1638
|
lastError = requestCancelledError(options.signal);
|
|
1631
1639
|
break requestAttempts;
|
|
1632
1640
|
}
|
|
@@ -1643,7 +1651,7 @@ var HttpClient = class {
|
|
|
1643
1651
|
});
|
|
1644
1652
|
} finally {
|
|
1645
1653
|
clearTimeout(timeoutId);
|
|
1646
|
-
_optionalChain([options, 'optionalAccess',
|
|
1654
|
+
_optionalChain([options, 'optionalAccess', _202 => _202.signal, 'optionalAccess', _203 => _203.removeEventListener, 'call', _204 => _204("abort", abortRequest)]);
|
|
1647
1655
|
}
|
|
1648
1656
|
}
|
|
1649
1657
|
if (attempt < maxRetries) continue;
|
|
@@ -1670,7 +1678,7 @@ var HttpClient = class {
|
|
|
1670
1678
|
phase: networkPhase
|
|
1671
1679
|
}
|
|
1672
1680
|
};
|
|
1673
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1681
|
+
if (_optionalChain([options, 'optionalAccess', _205 => _205.toolId])) {
|
|
1674
1682
|
const code = mappedNetworkError.code;
|
|
1675
1683
|
throw withErrorCause(
|
|
1676
1684
|
new (0, _chunk7P5AA3SNjs.ToolExecutionError)(
|
|
@@ -1722,12 +1730,12 @@ var HttpClient = class {
|
|
|
1722
1730
|
}
|
|
1723
1731
|
async *streamSse(path, options) {
|
|
1724
1732
|
const url = `${this.config.baseUrl}${path}`;
|
|
1725
|
-
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1733
|
+
const method = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _206 => _206.method]), () => ( "GET"));
|
|
1726
1734
|
const headers = this.authHeaders({
|
|
1727
1735
|
Accept: "text/event-stream",
|
|
1728
|
-
..._optionalChain([options, 'optionalAccess',
|
|
1736
|
+
..._optionalChain([options, 'optionalAccess', _207 => _207.headers])
|
|
1729
1737
|
});
|
|
1730
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
1738
|
+
if (_optionalChain([options, 'optionalAccess', _208 => _208.body]) !== void 0) {
|
|
1731
1739
|
applyExplicitHeaders(headers, { "Content-Type": "application/json" });
|
|
1732
1740
|
}
|
|
1733
1741
|
let lastError = null;
|
|
@@ -1736,8 +1744,8 @@ var HttpClient = class {
|
|
|
1736
1744
|
const response = await fetch(candidateUrl, {
|
|
1737
1745
|
method,
|
|
1738
1746
|
headers,
|
|
1739
|
-
body: _optionalChain([options, 'optionalAccess',
|
|
1740
|
-
signal: _optionalChain([options, 'optionalAccess',
|
|
1747
|
+
body: _optionalChain([options, 'optionalAccess', _209 => _209.body]) !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
1748
|
+
signal: _optionalChain([options, 'optionalAccess', _210 => _210.signal])
|
|
1741
1749
|
});
|
|
1742
1750
|
if (!response.ok) {
|
|
1743
1751
|
const body = await response.text();
|
|
@@ -1778,7 +1786,7 @@ var HttpClient = class {
|
|
|
1778
1786
|
throw error;
|
|
1779
1787
|
}
|
|
1780
1788
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
1781
|
-
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess',
|
|
1789
|
+
if (isAbortLikeError(normalized) && _optionalChain([options, 'optionalAccess', _211 => _211.signal, 'optionalAccess', _212 => _212.aborted])) {
|
|
1782
1790
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
1783
1791
|
`Stream from ${this.config.baseUrl} was aborted by the caller.`,
|
|
1784
1792
|
void 0,
|
|
@@ -1799,7 +1807,7 @@ var HttpClient = class {
|
|
|
1799
1807
|
}
|
|
1800
1808
|
throw new (0, _chunk7P5AA3SNjs.DeeplineError)(
|
|
1801
1809
|
withCoworkNetworkHint(
|
|
1802
|
-
_optionalChain([lastError, 'optionalAccess',
|
|
1810
|
+
_optionalChain([lastError, 'optionalAccess', _213 => _213.message]) ? `Unable to stream from ${this.config.baseUrl}. ${lastError.message}` : `Unable to stream from ${this.config.baseUrl}.`
|
|
1803
1811
|
)
|
|
1804
1812
|
);
|
|
1805
1813
|
}
|
|
@@ -1861,15 +1869,15 @@ function parseResponseBody(body) {
|
|
|
1861
1869
|
}
|
|
1862
1870
|
function isProviderOriginatedHttpError(parsed) {
|
|
1863
1871
|
const response = asRecord(parsed);
|
|
1864
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1865
|
-
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1866
|
-
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess',
|
|
1872
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _214 => _214.error]));
|
|
1873
|
+
const failureOrigin = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _215 => _215.failure_origin]), () => ( _optionalChain([response, 'optionalAccess', _216 => _216.failure_origin])));
|
|
1874
|
+
const code = _nullishCoalesce(_optionalChain([error, 'optionalAccess', _217 => _217.code]), () => ( _optionalChain([response, 'optionalAccess', _218 => _218.code])));
|
|
1867
1875
|
return failureOrigin === "provider" || code === "UPSTREAM_BLOCKED";
|
|
1868
1876
|
}
|
|
1869
1877
|
function isMonitorRateLimitEnvelope(parsed) {
|
|
1870
1878
|
const response = asRecord(parsed);
|
|
1871
|
-
const error = asRecord(_optionalChain([response, 'optionalAccess',
|
|
1872
|
-
return _optionalChain([error, 'optionalAccess',
|
|
1879
|
+
const error = asRecord(_optionalChain([response, 'optionalAccess', _219 => _219.error]));
|
|
1880
|
+
return _optionalChain([error, 'optionalAccess', _220 => _220.code]) === "monitor_upstream_rate_limited" && typeof error.message === "string";
|
|
1873
1881
|
}
|
|
1874
1882
|
function asRecord(value) {
|
|
1875
1883
|
return typeof value === "object" && value !== null ? value : null;
|
|
@@ -1885,7 +1893,7 @@ function detectHtmlErrorBody(body, contentType) {
|
|
|
1885
1893
|
return null;
|
|
1886
1894
|
}
|
|
1887
1895
|
const titleMatch = trimmed.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
1888
|
-
const title = _optionalChain([titleMatch, 'optionalAccess',
|
|
1896
|
+
const title = _optionalChain([titleMatch, 'optionalAccess', _221 => _221[1], 'optionalAccess', _222 => _222.replace, 'call', _223 => _223(/\s+/g, " "), 'access', _224 => _224.trim, 'call', _225 => _225()]) || void 0;
|
|
1889
1897
|
const workerThrewException = /worker threw exception/i.test(trimmed);
|
|
1890
1898
|
return {
|
|
1891
1899
|
title,
|
|
@@ -1969,20 +1977,20 @@ function decodeSseFrame(frame) {
|
|
|
1969
1977
|
}
|
|
1970
1978
|
function sleep(ms, signal) {
|
|
1971
1979
|
return new Promise((resolve2, reject) => {
|
|
1972
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1980
|
+
if (_optionalChain([signal, 'optionalAccess', _226 => _226.aborted])) {
|
|
1973
1981
|
reject(requestCancelledError(signal));
|
|
1974
1982
|
return;
|
|
1975
1983
|
}
|
|
1976
1984
|
const timeoutId = setTimeout(() => {
|
|
1977
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1985
|
+
_optionalChain([signal, 'optionalAccess', _227 => _227.removeEventListener, 'call', _228 => _228("abort", abort)]);
|
|
1978
1986
|
resolve2();
|
|
1979
1987
|
}, ms);
|
|
1980
1988
|
const abort = () => {
|
|
1981
1989
|
clearTimeout(timeoutId);
|
|
1982
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1990
|
+
_optionalChain([signal, 'optionalAccess', _229 => _229.removeEventListener, 'call', _230 => _230("abort", abort)]);
|
|
1983
1991
|
reject(requestCancelledError(signal));
|
|
1984
1992
|
};
|
|
1985
|
-
_optionalChain([signal, 'optionalAccess',
|
|
1993
|
+
_optionalChain([signal, 'optionalAccess', _231 => _231.addEventListener, 'call', _232 => _232("abort", abort, { once: true })]);
|
|
1986
1994
|
});
|
|
1987
1995
|
}
|
|
1988
1996
|
function withCoworkNetworkHint(message) {
|
|
@@ -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.392",
|
|
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
|