deepline 0.3.503 → 0.3.505
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/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +35 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +144 -7
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/onboarding-unsubscribe.ts +23 -0
- package/dist/cli/{auth-IC4WLSE3.mjs → auth-AHE2EDQA.mjs} +5 -5
- package/dist/cli/auth-SEPKNRHV.js +43 -0
- package/dist/cli/{billing-2VOV64SD.mjs → billing-7CPWTGGI.mjs} +19 -12
- package/dist/cli/{billing-LWQOII22.js → billing-JOIZPHON.js} +92 -85
- package/dist/cli/{chunk-33JUK73X.js → chunk-3YEOOXD4.js} +96 -37
- package/dist/cli/{chunk-FVDTERO2.js → chunk-45XYW477.js} +21 -21
- package/dist/cli/{chunk-5GI6NKOE.mjs → chunk-4OFSAZN6.mjs} +1 -1
- package/dist/cli/{chunk-D27HP3HS.mjs → chunk-52FPW2RD.mjs} +2 -2
- package/dist/cli/chunk-5LUF4LAR.mjs +209 -0
- package/dist/cli/{chunk-VC5B462T.mjs → chunk-5XT4DZQL.mjs} +2 -2
- package/dist/cli/{chunk-26RSSTCF.js → chunk-6FEN6VWZ.js} +26 -26
- package/dist/cli/{chunk-7HEDCIR3.mjs → chunk-6U3AGJWI.mjs} +1 -1
- package/dist/cli/{chunk-KPBBT6OS.mjs → chunk-7AD565DO.mjs} +1 -1
- package/dist/cli/{chunk-FZHOWPSN.js → chunk-7DDACLMX.js} +16 -16
- package/dist/cli/{chunk-ZEQPCEV4.mjs → chunk-7DDKLFOY.mjs} +3 -3
- package/dist/cli/{chunk-WHP3FJ7T.js → chunk-7QLK2GHL.js} +5 -5
- package/dist/cli/{chunk-BI2Q45SY.mjs → chunk-ACI6CUDX.mjs} +11 -401
- package/dist/cli/{chunk-C5RQTTLP.js → chunk-BWAYMJ23.js} +7 -7
- package/dist/cli/{chunk-YXGPMTAK.js → chunk-CA3SYXCS.js} +2 -2
- package/dist/cli/{chunk-J6RBOLK7.mjs → chunk-CSLLQWAB.mjs} +1 -1
- package/dist/cli/{chunk-F73PD2XD.js → chunk-EMUFF6EU.js} +7 -7
- package/dist/cli/chunk-FIQ5UEIF.mjs +405 -0
- package/dist/cli/{chunk-2626LTU3.js → chunk-GAUNJCXQ.js} +96 -96
- package/dist/cli/{chunk-A2C6ONWA.js → chunk-GXMNOUHP.js} +6 -6
- package/dist/cli/{chunk-MJQOG4TZ.js → chunk-HASFFOSU.js} +16 -16
- package/dist/cli/{chunk-TCQYWZFS.js → chunk-IDAE5VDH.js} +5 -5
- package/dist/cli/{chunk-JJVN7OIX.mjs → chunk-IZYOYXG7.mjs} +4 -4
- package/dist/cli/{chunk-FHJ54BHH.mjs → chunk-JA7YBRP4.mjs} +1 -1
- package/dist/cli/{chunk-HRTDCXHI.js → chunk-JSTKLYYD.js} +2 -2
- package/dist/cli/{chunk-5M5WSFRZ.mjs → chunk-JVKEZT7L.mjs} +48 -8
- package/dist/cli/{chunk-4IIYSBEP.js → chunk-K26YOPDO.js} +50 -10
- package/dist/cli/{chunk-2K2QBLYO.js → chunk-LC4FG34E.js} +53 -53
- package/dist/cli/{chunk-XYZZZLN6.mjs → chunk-MAFZ64RN.mjs} +2 -2
- package/dist/cli/{chunk-B3X4YWQ6.js → chunk-MHZAG2ZQ.js} +80 -470
- package/dist/cli/{chunk-DPI5OYVU.mjs → chunk-NARJWXBR.mjs} +2 -2
- package/dist/cli/{chunk-GLZBFBJS.mjs → chunk-OA6U5NVB.mjs} +5 -5
- package/dist/cli/{chunk-URZNSJE2.mjs → chunk-OMEDQ77C.mjs} +93 -34
- package/dist/cli/{chunk-QIEYEY6Z.js → chunk-OORPAQVC.js} +8 -8
- package/dist/cli/{chunk-WS274KID.mjs → chunk-PDLOPF5L.mjs} +1 -1
- package/dist/cli/{chunk-KGLVATEB.mjs → chunk-PZN24YQQ.mjs} +2 -2
- package/dist/cli/{chunk-GIHNEYBG.mjs → chunk-QGNNAZ5M.mjs} +1 -1
- package/dist/cli/chunk-QYGYVCRI.js +405 -0
- package/dist/cli/chunk-R7J7CJPZ.js +209 -0
- package/dist/cli/{chunk-6XTE6C3W.mjs → chunk-RT3HJBIH.mjs} +12 -12
- package/dist/cli/{chunk-L3TZV625.mjs → chunk-SHKRL7CW.mjs} +1 -1
- package/dist/cli/{chunk-FIUTDSJX.js → chunk-SPN7U3MV.js} +4 -4
- package/dist/cli/{chunk-EQ3WMKFY.mjs → chunk-UZ24SF7N.mjs} +5 -5
- package/dist/cli/{chunk-AARF4SOW.js → chunk-VXKWF3AD.js} +9 -9
- package/dist/cli/{chunk-JPDD4Y53.mjs → chunk-W6I4N4JN.mjs} +6 -6
- package/dist/cli/{chunk-PVA3MWCO.js → chunk-WPCF7C6B.js} +3 -3
- package/dist/cli/{chunk-3CXHK4TW.js → chunk-WTQLUULB.js} +6 -6
- package/dist/cli/{chunk-EDMV4JT5.mjs → chunk-WTUC5VKB.mjs} +2 -2
- package/dist/cli/{chunk-IIP46RVC.js → chunk-XHPB6RGY.js} +1 -1
- package/dist/cli/{chunk-RVOBFO7C.js → chunk-Y52XY56V.js} +41 -41
- package/dist/cli/{chunk-K7NFFQFU.mjs → chunk-YBIVVAL7.mjs} +2 -2
- package/dist/cli/{chunk-HS63YBT5.js → chunk-ZLN2B5YA.js} +3 -3
- package/dist/cli/command-docs.d.mts +2 -1
- package/dist/cli/command-docs.d.ts +2 -1
- package/dist/cli/command-docs.js +6 -2
- package/dist/cli/command-docs.mjs +5 -1
- package/dist/cli/{csv-NEWCNOSZ.js → csv-DZHVIW3G.js} +13 -13
- package/dist/cli/{csv-2TXOI3UE.mjs → csv-WTPI6ZON.mjs} +4 -4
- package/dist/cli/{db-J3IJS4OG.js → db-D7LPPNCC.js} +27 -27
- package/dist/cli/{db-PX7EQEIG.mjs → db-NR4PJ6AF.mjs} +6 -6
- package/dist/cli/describe-HVQBTKFM.js +50 -0
- package/dist/cli/{describe-GQHGTZSL.mjs → describe-NCKAJPUG.mjs} +18 -17
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-FFKK24RY.mjs → executions-RQVJ4LAB.mjs} +6 -6
- package/dist/cli/{executions-RO3TJUXL.js → executions-UQG6LWEN.js} +8 -8
- package/dist/cli/{feedback-ZTO56SRL.mjs → feedback-RD4Y3YQR.mjs} +4 -4
- package/dist/cli/{feedback-XRR4HIS6.js → feedback-TCHA67IA.js} +8 -8
- package/dist/cli/git-TUB2ZUEH.js +25 -0
- package/dist/cli/{git-FIPBVFYZ.mjs → git-Z7434B7Y.mjs} +5 -5
- package/dist/cli/index.js +145 -141
- package/dist/cli/index.mjs +51 -47
- package/dist/cli/{legacy-noops-MTBBGM27.js → legacy-noops-23WRA7DH.js} +8 -8
- package/dist/cli/{legacy-noops-AMD2NWHF.mjs → legacy-noops-LQJU4UIV.mjs} +5 -5
- package/dist/cli/{monitors-42PIGLBF.js → monitors-KOWN7M3V.js} +95 -95
- package/dist/cli/{monitors-24LDKDJX.mjs → monitors-Z6VYUZ2W.mjs} +7 -7
- package/dist/cli/{org-GQMCA3MN.js → org-2T5K2VP5.js} +72 -72
- package/dist/cli/{org-4B7SCFRL.mjs → org-UBNRO5XO.mjs} +6 -6
- package/dist/cli/{pages-PD5EGL2R.mjs → pages-GHPJBVV3.mjs} +6 -6
- package/dist/cli/{pages-RL2M62GJ.js → pages-SRXTU7XO.js} +18 -18
- package/dist/cli/{play-FST6ZAHW.js → play-2HMZ57EZ.js} +324 -517
- package/dist/cli/{play-5V54VTUR.mjs → play-HRQKGTXA.mjs} +24 -217
- package/dist/cli/{providers-N5YVCKPL.mjs → providers-JWJRFRR5.mjs} +6 -6
- package/dist/cli/{providers-HBUUPN7J.js → providers-P5O676MZ.js} +9 -9
- package/dist/cli/{quickstart-NJDDVTQR.mjs → quickstart-S7NZUQRO.mjs} +4 -4
- package/dist/cli/{quickstart-4QIQNSHG.js → quickstart-YCY72TAO.js} +6 -6
- package/dist/cli/{run-FGOKCG4J.js → run-MHLLGF4G.js} +41 -40
- package/dist/cli/{run-JHI5MTHD.mjs → run-QWMRIUIU.mjs} +23 -22
- package/dist/cli/{search-EWIZBIY2.mjs → search-4BFTQUEP.mjs} +8 -7
- package/dist/cli/search-QPUHOEIL.js +33 -0
- package/dist/cli/{search-output-TMQTRC2W.js → search-output-62LBVZHN.js} +6 -6
- package/dist/cli/{search-output-NAK3MWBH.mjs → search-output-LIYHDTBP.mjs} +4 -4
- package/dist/cli/{secrets-ONQVW5SR.mjs → secrets-GW27V77E.mjs} +6 -6
- package/dist/cli/{secrets-5TSUEOJB.js → secrets-KKKHVSOO.js} +15 -15
- package/dist/cli/{sessions-BSGE5EET.js → sessions-R3OEINAR.js} +6 -6
- package/dist/cli/{sessions-B7F5O3ZR.mjs → sessions-R75LBGIL.mjs} +5 -5
- package/dist/cli/{settings-SGGFQV5R.mjs → settings-I3AQZSYG.mjs} +12 -11
- package/dist/cli/{settings-47LARBRU.js → settings-MQIHAEZN.js} +79 -78
- package/dist/cli/{setup-ATGNXQUK.mjs → setup-2YA5MYMS.mjs} +10 -9
- package/dist/cli/{setup-BNFZFXO6.js → setup-X3QRJERP.js} +50 -49
- package/dist/cli/{skills-CIMBRM5R.mjs → skills-7252FOOI.mjs} +8 -7
- package/dist/cli/skills-BPZWMZSL.js +37 -0
- package/dist/cli/tools-F7RVQ3IK.js +57 -0
- package/dist/cli/{tools-DTDXAULX.mjs → tools-SKQTSVGE.mjs} +17 -16
- package/dist/cli/{update-EOIJBJCO.mjs → update-GNBBSKTB.mjs} +10 -9
- package/dist/cli/update-TLSY6LC2.js +35 -0
- package/dist/cli/{workflow-IWXUJPWY.mjs → workflow-OJSAL5FO.mjs} +7 -7
- package/dist/cli/{workflow-V5VKPICQ.js → workflow-QB7YYWPP.js} +17 -17
- package/dist/{client-CIwenMFS.d.ts → client-B3GSaSFn.d.ts} +1 -1
- package/dist/{client-DYAfJpaN.d.mts → client-DEJg0CZn.d.mts} +1 -1
- package/dist/{client-core-DlzP8vEs.d.mts → client-core-C404E33V.d.mts} +5 -0
- package/dist/{client-core-CRjtyMAI.d.ts → client-core-GQmy3N8y.d.ts} +5 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +109 -104
- package/dist/plays/bundle-play-file.mjs +4 -4
- 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/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-ZCMSXZO4.js +0 -43
- package/dist/cli/describe-LE7EZCL4.js +0 -49
- package/dist/cli/git-26AH4XIO.js +0 -25
- package/dist/cli/search-CTKSEVSO.js +0 -32
- package/dist/cli/skills-6RD25MVM.js +0 -36
- package/dist/cli/tools-TDZH4XHS.js +0 -56
- package/dist/cli/update-Y32VT4VL.js +0 -34
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
var _chunkD3BCSAN7js = require('./chunk-D3BCSAN7.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkIDAE5VDHjs = require('./chunk-IDAE5VDH.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkQYGYVCRIjs = require('./chunk-QYGYVCRI.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkEMUFF6EUjs = require('./chunk-EMUFF6EU.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkZLN2B5YAjs = require('./chunk-ZLN2B5YA.js');
|
|
14
18
|
|
|
15
19
|
// src/cli/commands/search.ts
|
|
16
20
|
var _commander = require('commander');
|
|
@@ -20,23 +24,33 @@ var _fs = require('fs');
|
|
|
20
24
|
var _path = require('path');
|
|
21
25
|
var SEARCH_REF_TTL_MS = 15 * 6e4;
|
|
22
26
|
function lastSearchPath() {
|
|
23
|
-
return _path.join.call(void 0,
|
|
27
|
+
return _path.join.call(void 0, _chunkZLN2B5YAjs.sdkCliStateDirPath.call(void 0, _chunkZLN2B5YAjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
|
|
24
28
|
}
|
|
25
29
|
function rememberSearchRef(searchRef) {
|
|
30
|
+
writeSearchRefs({ searchRef });
|
|
31
|
+
}
|
|
32
|
+
function rememberSearchRefsByTool(refs) {
|
|
33
|
+
writeSearchRefs({ searchRefsByTool: Object.fromEntries(refs) });
|
|
34
|
+
}
|
|
35
|
+
function writeSearchRefs(refs) {
|
|
26
36
|
try {
|
|
27
37
|
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, lastSearchPath()), { recursive: true });
|
|
28
38
|
_fs.writeFileSync.call(void 0,
|
|
29
39
|
lastSearchPath(),
|
|
30
|
-
JSON.stringify({
|
|
40
|
+
JSON.stringify({ ...refs, at: Date.now() }),
|
|
31
41
|
{ mode: 384 }
|
|
32
42
|
);
|
|
33
43
|
} catch (e) {
|
|
34
44
|
}
|
|
35
45
|
}
|
|
36
|
-
function recentSearchRef() {
|
|
46
|
+
function recentSearchRef(toolId) {
|
|
37
47
|
try {
|
|
38
48
|
const saved = JSON.parse(_fs.readFileSync.call(void 0, lastSearchPath(), "utf8"));
|
|
39
|
-
|
|
49
|
+
if (typeof saved.at !== "number" || Date.now() - saved.at >= SEARCH_REF_TTL_MS) {
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
const ref = toolId ? _nullishCoalesce(_optionalChain([saved, 'access', _ => _.searchRefsByTool, 'optionalAccess', _2 => _2[toolId]]), () => ( saved.searchRef)) : saved.searchRef;
|
|
53
|
+
return typeof ref === "string" ? ref : void 0;
|
|
40
54
|
} catch (e2) {
|
|
41
55
|
return void 0;
|
|
42
56
|
}
|
|
@@ -51,7 +65,7 @@ var SEARCH_TYPES = [
|
|
|
51
65
|
"custom",
|
|
52
66
|
"docs"
|
|
53
67
|
];
|
|
54
|
-
var USAGE = 'Usage: deepline search "<task>" [--type <types>] [--json]';
|
|
68
|
+
var USAGE = 'Usage: deepline search "<task>" ["<task>" ...] [--type <types>] [--json]';
|
|
55
69
|
function parseTypes(flag, raw) {
|
|
56
70
|
const names = (_nullishCoalesce(raw, () => ( ""))).split(",").map((name) => name.trim().toLowerCase()).filter(Boolean);
|
|
57
71
|
const unknown = names.filter(
|
|
@@ -86,8 +100,8 @@ function asRun(command) {
|
|
|
86
100
|
function pointAtDescribe(result) {
|
|
87
101
|
const old = /`deepline (tools|plays) describe [^`]*`/;
|
|
88
102
|
const render = result.render;
|
|
89
|
-
for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess',
|
|
90
|
-
if (!_optionalChain([section, 'access',
|
|
103
|
+
for (const section of _nullishCoalesce(_optionalChain([render, 'optionalAccess', _3 => _3.sections]), () => ( []))) {
|
|
104
|
+
if (!_optionalChain([section, 'access', _4 => _4.lines, 'optionalAccess', _5 => _5.some, 'call', _6 => _6((line) => old.test(line))])) continue;
|
|
91
105
|
section.lines = [
|
|
92
106
|
"Run `deepline describe <id>` before executing a tool or running a play.",
|
|
93
107
|
...section.lines.filter((line) => !old.test(line))
|
|
@@ -107,10 +121,11 @@ function pointAtDescribe(result) {
|
|
|
107
121
|
}
|
|
108
122
|
}
|
|
109
123
|
}
|
|
110
|
-
async function runSearch(
|
|
111
|
-
const
|
|
124
|
+
async function runSearch(queryInputs, options, types, exclude = []) {
|
|
125
|
+
const queries = queryInputs.length > 0 ? queryInputs.map((query) => query.trim()) : [""];
|
|
126
|
+
const multiple = queries.length > 1;
|
|
112
127
|
const searchTerms = _nullishCoalesce(options.searchTerms, () => ( options.search_terms));
|
|
113
|
-
if (!query && !_optionalChain([options, 'access', _7 => _7.categories, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) && !_optionalChain([searchTerms, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()])) {
|
|
128
|
+
if (multiple && queries.some((query) => !query) || !queries[0] && !_optionalChain([options, 'access', _7 => _7.categories, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) && !_optionalChain([searchTerms, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()])) {
|
|
114
129
|
console.error(USAGE);
|
|
115
130
|
return 1;
|
|
116
131
|
}
|
|
@@ -119,26 +134,66 @@ async function runSearch(queryInput, options, types, exclude = []) {
|
|
|
119
134
|
console.error("--summary-width must be an integer of at least 2.");
|
|
120
135
|
return 1;
|
|
121
136
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
const client = new (0, _chunkIDAE5VDHjs.DeeplineClient)();
|
|
138
|
+
const json = options.json === true;
|
|
139
|
+
const renderer = json ? void 0 : await Promise.resolve().then(() => _interopRequireWildcard(require("./search-output-62LBVZHN.js")));
|
|
140
|
+
const searches = [];
|
|
141
|
+
const chunks = [];
|
|
142
|
+
const refs = /* @__PURE__ */ new Map();
|
|
143
|
+
let exitCode = 0;
|
|
144
|
+
for (const query of queries) {
|
|
145
|
+
try {
|
|
146
|
+
const { search_ref: searchRef, ...result } = await client.search({
|
|
147
|
+
query,
|
|
148
|
+
types,
|
|
149
|
+
exclude,
|
|
150
|
+
categories: options.categories,
|
|
151
|
+
searchTerms,
|
|
152
|
+
task: options.task,
|
|
153
|
+
limit: optionalInteger(options.limit),
|
|
154
|
+
offset: optionalInteger(options.offset),
|
|
155
|
+
searchMode: options.searchMode === "v1" || options.searchMode === "v2" ? options.searchMode : void 0,
|
|
156
|
+
includeSearchDebug: Boolean(options.includeSearchDebug)
|
|
157
|
+
});
|
|
158
|
+
pointAtDescribe(result);
|
|
159
|
+
const text = _optionalChain([renderer, 'optionalAccess', _12 => _12.renderSearchResults, 'call', _13 => _13(result, summaryWidth)]);
|
|
160
|
+
if (!multiple) {
|
|
161
|
+
if (searchRef) rememberSearchRef(searchRef);
|
|
162
|
+
_chunkEMUFF6EUjs.printCommandEnvelope.call(void 0, result, { json, text });
|
|
163
|
+
return 0;
|
|
164
|
+
}
|
|
165
|
+
searches.push({ ...result, query });
|
|
166
|
+
if (text !== void 0) chunks.push(`${JSON.stringify(query)}
|
|
167
|
+
${text}`);
|
|
168
|
+
if (searchRef) {
|
|
169
|
+
for (const item of result.results) {
|
|
170
|
+
if (item.kind === "tool" && !refs.has(item.id))
|
|
171
|
+
refs.set(item.id, searchRef);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} catch (error) {
|
|
175
|
+
if (!multiple) throw error;
|
|
176
|
+
const payload = _chunkEMUFF6EUjs.errorToJsonPayload.call(void 0, error);
|
|
177
|
+
const queryExitCode = _nullishCoalesce(payload.exitCode, () => ( _chunkQYGYVCRIjs.resolveSdkCliFailureExitCode.call(void 0, error)));
|
|
178
|
+
searches.push({ ...payload, query, exitCode: queryExitCode });
|
|
179
|
+
if (!json) {
|
|
180
|
+
console.error(`${JSON.stringify(query)}: ${payload.error.message}`);
|
|
181
|
+
chunks.push(`${JSON.stringify(query)}
|
|
182
|
+
Search failed.
|
|
183
|
+
`);
|
|
184
|
+
}
|
|
185
|
+
exitCode ||= queryExitCode;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
rememberSearchRefsByTool(refs);
|
|
189
|
+
_chunkEMUFF6EUjs.printCommandEnvelope.call(void 0,
|
|
190
|
+
{ searches },
|
|
191
|
+
{
|
|
192
|
+
json,
|
|
193
|
+
text: chunks.join("\n")
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
return exitCode;
|
|
142
197
|
}
|
|
143
198
|
function registerDeprecatedSearchCommand(parent, typesFor) {
|
|
144
199
|
const name = `deepline ${parent.name()} search`;
|
|
@@ -159,12 +214,16 @@ Examples:
|
|
|
159
214
|
console.error(
|
|
160
215
|
`${name} is deprecated. Use: deepline search${query ? ` ${JSON.stringify(query)}` : ""} --type ${types.join(",")}`
|
|
161
216
|
);
|
|
162
|
-
process.exitCode = await runSearch(
|
|
217
|
+
process.exitCode = await runSearch(
|
|
218
|
+
query === void 0 ? [] : [query],
|
|
219
|
+
options,
|
|
220
|
+
types
|
|
221
|
+
);
|
|
163
222
|
});
|
|
164
223
|
}
|
|
165
224
|
function registerSearchCommand(program) {
|
|
166
225
|
addSearchOptions(
|
|
167
|
-
program.command("search [task]").description(
|
|
226
|
+
program.command("search [task...]").description(
|
|
168
227
|
"Search tools, monitors, plays, and docs together, ranked by intent."
|
|
169
228
|
).option(
|
|
170
229
|
"--type <types>",
|
|
@@ -175,7 +234,7 @@ function registerSearchCommand(program) {
|
|
|
175
234
|
"Leave these kinds out, comma-separated",
|
|
176
235
|
appendCsv
|
|
177
236
|
)
|
|
178
|
-
).action(async (
|
|
237
|
+
).action(async (queries, options) => {
|
|
179
238
|
let types;
|
|
180
239
|
let exclude;
|
|
181
240
|
try {
|
|
@@ -186,7 +245,7 @@ function registerSearchCommand(program) {
|
|
|
186
245
|
process.exitCode = 1;
|
|
187
246
|
return;
|
|
188
247
|
}
|
|
189
|
-
process.exitCode = await runSearch(
|
|
248
|
+
process.exitCode = await runSearch(queries, options, types, exclude);
|
|
190
249
|
});
|
|
191
250
|
}
|
|
192
251
|
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkHASFFOSUjs = require('./chunk-HASFFOSU.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkMHZAG2ZQjs = require('./chunk-MHZAG2ZQ.js');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkEMUFF6EUjs = require('./chunk-EMUFF6EU.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkZLN2B5YAjs = require('./chunk-ZLN2B5YA.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkSPN7U3MVjs = require('./chunk-SPN7U3MV.js');
|
|
21
21
|
|
|
22
22
|
// src/cli/compatibility-catalog.ts
|
|
23
23
|
var readers = /* @__PURE__ */ new WeakMap();
|
|
@@ -44,7 +44,7 @@ function trustedAutoUpdateRegistryUrl(baseUrl) {
|
|
|
44
44
|
async function reportAutoUpdateEvent(input) {
|
|
45
45
|
let apiKey = "";
|
|
46
46
|
try {
|
|
47
|
-
apiKey =
|
|
47
|
+
apiKey = _chunkZLN2B5YAjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
|
|
48
48
|
} catch (e2) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
@@ -60,15 +60,15 @@ async function reportAutoUpdateEvent(input) {
|
|
|
60
60
|
headers: {
|
|
61
61
|
Authorization: `Bearer ${apiKey}`,
|
|
62
62
|
"Content-Type": "application/json",
|
|
63
|
-
"User-Agent": `deepline-ts-sdk/${
|
|
63
|
+
"User-Agent": `deepline-ts-sdk/${_chunkSPN7U3MVjs.SDK_VERSION}`,
|
|
64
64
|
"X-Deepline-Client-Family": "sdk",
|
|
65
65
|
"X-Deepline-CLI-Family": "sdk",
|
|
66
|
-
"X-Deepline-CLI-Version":
|
|
67
|
-
"X-Deepline-SDK-Version":
|
|
66
|
+
"X-Deepline-CLI-Version": _chunkSPN7U3MVjs.SDK_VERSION,
|
|
67
|
+
"X-Deepline-SDK-Version": _chunkSPN7U3MVjs.SDK_VERSION
|
|
68
68
|
},
|
|
69
69
|
body: JSON.stringify({
|
|
70
70
|
event: input.event,
|
|
71
|
-
current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) ||
|
|
71
|
+
current_version: _optionalChain([input, 'access', _4 => _4.response, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]) || _chunkSPN7U3MVjs.SDK_VERSION,
|
|
72
72
|
target_version: input.response.latest,
|
|
73
73
|
reason: _optionalChain([input, 'access', _8 => _8.response, 'access', _9 => _9.auto_update, 'optionalAccess', _10 => _10.reason]),
|
|
74
74
|
command: _nullishCoalesce(input.response.command, () => ( null)),
|
|
@@ -87,13 +87,13 @@ function envTruthy(name) {
|
|
|
87
87
|
return value === "1" || value === "true" || value === "yes";
|
|
88
88
|
}
|
|
89
89
|
function shouldSkipSelfUpdate(policy) {
|
|
90
|
-
return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !
|
|
90
|
+
return policy === "off" || envTruthy("DEEPLINE_SKIP_SELF_UPDATE") || envTruthy("DEEPLINE_NO_AUTO_UPDATE") || envTruthy("DEEPLINE_SKIP_SDK_AUTO_UPDATE") || envTruthy("DEEPLINE_DISABLE_AUTO_UPDATE") || !_chunkHASFFOSUjs.shouldRunCliAutoUpdate.call(void 0, ) || _chunkMHZAG2ZQjs.isCiEnvironment.call(void 0, );
|
|
91
91
|
}
|
|
92
92
|
function isDowngradeAutoUpdateResponse(response) {
|
|
93
93
|
const target = _optionalChain([response, 'optionalAccess', _17 => _17.latest, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]);
|
|
94
|
-
const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) ||
|
|
94
|
+
const current = _optionalChain([response, 'optionalAccess', _20 => _20.current, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]) || _chunkSPN7U3MVjs.SDK_VERSION;
|
|
95
95
|
if (!target) return false;
|
|
96
|
-
return
|
|
96
|
+
return _chunkHASFFOSUjs.compareUpdateVersions.call(void 0, target, current) < 0;
|
|
97
97
|
}
|
|
98
98
|
function relaunchCurrentCommand(plan, runtime = {}) {
|
|
99
99
|
return new Promise((resolve) => {
|
|
@@ -146,7 +146,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
146
146
|
}
|
|
147
147
|
if (isDowngradeAutoUpdateResponse(response)) {
|
|
148
148
|
const target = response.latest;
|
|
149
|
-
const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) ||
|
|
149
|
+
const current = _optionalChain([response, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || _chunkSPN7U3MVjs.SDK_VERSION;
|
|
150
150
|
process.stderr.write(
|
|
151
151
|
`Deepline SDK/CLI auto-update refused: server advertised older ${target} than current ${current}. Continuing without mutating the CLI.
|
|
152
152
|
`
|
|
@@ -154,21 +154,21 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
154
154
|
return false;
|
|
155
155
|
}
|
|
156
156
|
const packageSpec = response.latest ? `deepline@${response.latest}` : void 0;
|
|
157
|
-
const plan =
|
|
157
|
+
const plan = _chunkHASFFOSUjs.resolveUpdatePlan.call(void 0, {
|
|
158
158
|
packageSpec,
|
|
159
159
|
requireVerifiedNpmOwnership: true,
|
|
160
160
|
npmFallbackRegistryUrl: trustedAutoUpdateRegistryUrl(baseUrl)
|
|
161
161
|
});
|
|
162
|
-
if (!
|
|
162
|
+
if (!_chunkHASFFOSUjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) {
|
|
163
163
|
return false;
|
|
164
164
|
}
|
|
165
165
|
if (!autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
|
|
166
166
|
deferredAutoUpdate = async () => {
|
|
167
167
|
await applyAutoUpdate(response, baseUrl, plan, "next_command");
|
|
168
168
|
};
|
|
169
|
-
if (
|
|
169
|
+
if (_chunkEMUFF6EUjs.isJsonOutputMode.call(void 0, )) {
|
|
170
170
|
const target = _optionalChain([response, 'access', _29 => _29.latest, 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]);
|
|
171
|
-
|
|
171
|
+
_chunkEMUFF6EUjs.addJsonNotice.call(void 0, {
|
|
172
172
|
code: "sdk_update_queued",
|
|
173
173
|
message: `Deepline SDK/CLI update${target ? ` to ${target}` : ""} is queued after this command; the next command will use it if installation succeeds.`
|
|
174
174
|
});
|
|
@@ -181,7 +181,7 @@ async function maybeAutoUpdateAndRelaunch(response, baseUrl, policy = "configure
|
|
|
181
181
|
return true;
|
|
182
182
|
}
|
|
183
183
|
async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
|
|
184
|
-
if (!
|
|
184
|
+
if (!_chunkHASFFOSUjs.canAutomaticallyApplyUpdatePlan.call(void 0, plan)) return false;
|
|
185
185
|
const autoUpdate = response.auto_update;
|
|
186
186
|
const label = _optionalChain([autoUpdate, 'optionalAccess', _32 => _32.reason]) === "rollback_forced" ? "has a server rollback pending and needs the latest rollback-aware CLI" : _optionalChain([autoUpdate, 'optionalAccess', _33 => _33.reason]) === "deprecated" ? "is deprecated and will update automatically" : _optionalChain([autoUpdate, 'optionalAccess', _34 => _34.required]) ? "requires an update" : "has an update available and will update automatically";
|
|
187
187
|
process.stderr.write(
|
|
@@ -194,7 +194,7 @@ async function applyAutoUpdate(response, baseUrl, plan, takesEffect) {
|
|
|
194
194
|
event: "started",
|
|
195
195
|
installKind: plan.kind
|
|
196
196
|
});
|
|
197
|
-
const updateResult = await
|
|
197
|
+
const updateResult = await _chunkHASFFOSUjs.runAutomaticUpdatePlan.call(void 0, plan);
|
|
198
198
|
if (updateResult.status === "skipped_previous_failure") {
|
|
199
199
|
void reportAutoUpdateEvent({
|
|
200
200
|
baseUrl,
|
|
@@ -245,7 +245,7 @@ var _crypto = require('crypto');
|
|
|
245
245
|
var TOOL_EXECUTE_PROGRESS_INTERVAL_MS = 15e3;
|
|
246
246
|
var activeToolExecuteCommand = null;
|
|
247
247
|
function progressLine(line) {
|
|
248
|
-
if (!
|
|
248
|
+
if (!_chunkEMUFF6EUjs.isJsonOutputMode.call(void 0, )) console.error(line);
|
|
249
249
|
}
|
|
250
250
|
function beginToolExecuteCommand() {
|
|
251
251
|
if (activeToolExecuteCommand) return activeToolExecuteCommand.invocationId;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeeplineClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4OFSAZN6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
HttpClient,
|
|
6
6
|
resolveConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SHKRL7CW.mjs";
|
|
8
8
|
|
|
9
9
|
// src/client.ts
|
|
10
10
|
var DeeplineClient2 = class extends DeeplineClient {
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
3
|
+
PLAY_SANDBOX_SIZE_LIMITS,
|
|
4
|
+
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
5
|
+
modalSandboxMemoryLimitGiBForPlay,
|
|
6
|
+
playSandboxSizeForLimits
|
|
7
|
+
} from "./chunk-7I4B6V2S.mjs";
|
|
8
|
+
|
|
9
|
+
// ../play-runtime/worker-api-types.ts
|
|
10
|
+
var DAYTONA_COMPUTE_PRICING_USD = {
|
|
11
|
+
vcpuSecond: 14e-6,
|
|
12
|
+
memoryGiBSecond: 45e-7,
|
|
13
|
+
storageGiBSecond: 3e-8,
|
|
14
|
+
includedStorageGiB: 5
|
|
15
|
+
};
|
|
16
|
+
var MODAL_SANDBOX_COMPUTE_PRICING_USD = {
|
|
17
|
+
physicalCoreSecond: 3942e-8,
|
|
18
|
+
memoryGiBSecond: 667e-8
|
|
19
|
+
};
|
|
20
|
+
var MODAL_SANDBOX_CPU_CORES = 0.5;
|
|
21
|
+
function modalSandboxResourcesForPlay(input) {
|
|
22
|
+
return {
|
|
23
|
+
physicalCpuCores: MODAL_SANDBOX_CPU_CORES * input.cpu,
|
|
24
|
+
memoryMiB: input.memoryGiB * 1024
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function roundUsd(amount) {
|
|
28
|
+
return Number(Math.max(0, amount).toFixed(12));
|
|
29
|
+
}
|
|
30
|
+
function sandboxSizeMetadata(cpu, memoryGiB) {
|
|
31
|
+
const entry = Object.entries(PLAY_SANDBOX_SIZE_LIMITS).find(
|
|
32
|
+
([, limits]) => limits.cpu === cpu && limits.memoryGiB === memoryGiB
|
|
33
|
+
);
|
|
34
|
+
return entry ? { sandboxSize: entry[0] } : {};
|
|
35
|
+
}
|
|
36
|
+
function runtimeLimitMetadata(maxBillingDurationSeconds, observedWallTimeSeconds) {
|
|
37
|
+
if (typeof maxBillingDurationSeconds !== "number" || !Number.isFinite(maxBillingDurationSeconds) || maxBillingDurationSeconds <= 0) {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
maxBillingDurationSeconds,
|
|
42
|
+
...typeof observedWallTimeSeconds === "number" && Number.isFinite(observedWallTimeSeconds) ? { observedWallTimeSeconds: Math.max(0, observedWallTimeSeconds) } : {}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function resolveDaytonaSandboxComputeItem(input) {
|
|
46
|
+
const billableSeconds = Math.max(1, Math.ceil(input.wallTimeSeconds));
|
|
47
|
+
const cpu = Math.max(0, input.cpu);
|
|
48
|
+
const memoryGiB = Math.max(0, input.memoryGiB);
|
|
49
|
+
const billableDiskGiB = Math.max(
|
|
50
|
+
0,
|
|
51
|
+
input.diskGiB - DAYTONA_COMPUTE_PRICING_USD.includedStorageGiB
|
|
52
|
+
);
|
|
53
|
+
const providerCostUsd = roundUsd(
|
|
54
|
+
billableSeconds * (cpu * DAYTONA_COMPUTE_PRICING_USD.vcpuSecond + memoryGiB * DAYTONA_COMPUTE_PRICING_USD.memoryGiBSecond + billableDiskGiB * DAYTONA_COMPUTE_PRICING_USD.storageGiBSecond)
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
itemId: input.itemId,
|
|
58
|
+
source: input.source ?? "daytona",
|
|
59
|
+
unit: "sandbox_second",
|
|
60
|
+
units: billableSeconds,
|
|
61
|
+
providerCostUsd,
|
|
62
|
+
metadata: {
|
|
63
|
+
...sandboxSizeMetadata(cpu, memoryGiB),
|
|
64
|
+
sandboxId: input.sandboxId ?? null,
|
|
65
|
+
cpu,
|
|
66
|
+
memoryGiB,
|
|
67
|
+
diskGiB: Math.max(0, input.diskGiB),
|
|
68
|
+
billableDiskGiB,
|
|
69
|
+
startedAt: input.startedAt,
|
|
70
|
+
endedAt: input.endedAt,
|
|
71
|
+
...runtimeLimitMetadata(
|
|
72
|
+
input.maxBillingDurationSeconds,
|
|
73
|
+
input.observedWallTimeSeconds
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function resolveModalSandboxComputeItem(input) {
|
|
79
|
+
const billableSeconds = Math.max(1, Math.ceil(input.wallTimeSeconds));
|
|
80
|
+
const physicalCpuCores = Math.max(0, input.physicalCpuCores);
|
|
81
|
+
const memoryGiB = Math.max(0, input.memoryGiB);
|
|
82
|
+
const providerCostUsd = roundUsd(
|
|
83
|
+
billableSeconds * (physicalCpuCores * MODAL_SANDBOX_COMPUTE_PRICING_USD.physicalCoreSecond + memoryGiB * MODAL_SANDBOX_COMPUTE_PRICING_USD.memoryGiBSecond)
|
|
84
|
+
);
|
|
85
|
+
return {
|
|
86
|
+
itemId: input.itemId,
|
|
87
|
+
source: "modal",
|
|
88
|
+
unit: "sandbox_second",
|
|
89
|
+
units: billableSeconds,
|
|
90
|
+
providerCostUsd,
|
|
91
|
+
metadata: {
|
|
92
|
+
...sandboxSizeMetadata(
|
|
93
|
+
physicalCpuCores / MODAL_SANDBOX_CPU_CORES,
|
|
94
|
+
memoryGiB
|
|
95
|
+
),
|
|
96
|
+
sandboxId: input.sandboxId ?? null,
|
|
97
|
+
physicalCpuCores,
|
|
98
|
+
memoryGiB,
|
|
99
|
+
...input.memoryLimitGiB === void 0 ? {} : {
|
|
100
|
+
memoryLimitGiB: input.memoryLimitGiB,
|
|
101
|
+
// The Preview evaluation preserves the existing compute price.
|
|
102
|
+
// Sampled burst cost is diagnostic until provider billing can be
|
|
103
|
+
// reconciled; a hard ceiling is never presented as actual usage.
|
|
104
|
+
costBasis: "reserved_resources"
|
|
105
|
+
},
|
|
106
|
+
startedAt: input.startedAt,
|
|
107
|
+
endedAt: input.endedAt,
|
|
108
|
+
...runtimeLimitMetadata(
|
|
109
|
+
input.maxBillingDurationSeconds,
|
|
110
|
+
input.observedWallTimeSeconds
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ../play-runtime/runtime-constants.ts
|
|
117
|
+
var STANDARD_PLAY_RUNTIME_LIMIT_SECONDS = 30 * 60;
|
|
118
|
+
var PLAY_RUNNER_TERMINAL_GRACE_SECONDS = 90;
|
|
119
|
+
var PLAY_RUNNER_STARTUP_GRACE_SECONDS = 4 * 60;
|
|
120
|
+
var SANDBOX_NETWORK_CUT_MAX_MS = 11 * 6e4;
|
|
121
|
+
var RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS = SANDBOX_NETWORK_CUT_MAX_MS + 6e4;
|
|
122
|
+
var PLAY_RUNNER_TIMEOUT_SECONDS = 40 * 60;
|
|
123
|
+
var WORKFLOW_EXECUTOR_TOKEN_TTL_SECONDS = MAX_PLAY_SANDBOX_RUNTIME_LIMITS.timeoutSeconds + (PLAY_RUNNER_TIMEOUT_SECONDS - STANDARD_PLAY_RUNTIME_LIMIT_SECONDS);
|
|
124
|
+
|
|
125
|
+
// ../billing/compute-pricing-contract.ts
|
|
126
|
+
var COMPUTE_BILLING_MARKUP_MULTIPLIER = 5;
|
|
127
|
+
var DEFAULT_USD_PER_CUSTOMER_CREDIT = 0.1;
|
|
128
|
+
var DEFAULT_PROVIDER_MARKUP_MULTIPLIER = 1.4;
|
|
129
|
+
var MAX_SANDBOX_COMPUTE_BILLING_SECONDS = 60 * 60;
|
|
130
|
+
var PLAY_SANDBOX_COMPUTE_RATE_MULTIPLIERS = {
|
|
131
|
+
standard: 1,
|
|
132
|
+
large: 2.5,
|
|
133
|
+
xlarge: 5
|
|
134
|
+
};
|
|
135
|
+
var MAX_SANDBOX_COMPUTE_PROVIDER_COST_USD = Math.max(
|
|
136
|
+
...Object.values(PLAY_SANDBOX_SIZE_LIMITS).flatMap((profile) => {
|
|
137
|
+
const modalResources = modalSandboxResourcesForPlay(profile);
|
|
138
|
+
return [
|
|
139
|
+
resolveDaytonaSandboxComputeItem({
|
|
140
|
+
itemId: "billing-cap",
|
|
141
|
+
wallTimeSeconds: MAX_SANDBOX_COMPUTE_BILLING_SECONDS,
|
|
142
|
+
cpu: profile.cpu,
|
|
143
|
+
memoryGiB: profile.memoryGiB,
|
|
144
|
+
diskGiB: profile.diskGiB
|
|
145
|
+
}).providerCostUsd,
|
|
146
|
+
resolveModalSandboxComputeItem({
|
|
147
|
+
itemId: "billing-cap",
|
|
148
|
+
wallTimeSeconds: MAX_SANDBOX_COMPUTE_BILLING_SECONDS,
|
|
149
|
+
physicalCpuCores: modalResources.physicalCpuCores,
|
|
150
|
+
memoryGiB: profile.memoryGiB
|
|
151
|
+
}).providerCostUsd
|
|
152
|
+
];
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
function roundUpCredits(value) {
|
|
156
|
+
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
157
|
+
return Math.ceil(value * 100) / 100;
|
|
158
|
+
}
|
|
159
|
+
function maximumPlaySandboxBillingSeconds(limits) {
|
|
160
|
+
return Math.min(
|
|
161
|
+
limits.timeoutSeconds + PLAY_RUNNER_TERMINAL_GRACE_SECONDS,
|
|
162
|
+
MAX_SANDBOX_COMPUTE_BILLING_SECONDS
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function estimateDaytonaMaximumComputeCredits(limits) {
|
|
166
|
+
const item = resolveDaytonaSandboxComputeItem({
|
|
167
|
+
itemId: "estimate",
|
|
168
|
+
wallTimeSeconds: maximumPlaySandboxBillingSeconds(limits),
|
|
169
|
+
cpu: limits.cpu,
|
|
170
|
+
memoryGiB: limits.memoryGiB,
|
|
171
|
+
diskGiB: limits.diskGiB
|
|
172
|
+
});
|
|
173
|
+
return roundUpCredits(
|
|
174
|
+
item.providerCostUsd * COMPUTE_BILLING_MARKUP_MULTIPLIER * DEFAULT_PROVIDER_MARKUP_MULTIPLIER / DEFAULT_USD_PER_CUSTOMER_CREDIT
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
function estimateModalMaximumComputeCredits(limits, elasticMemory = false) {
|
|
178
|
+
const resources = modalSandboxResourcesForPlay(limits);
|
|
179
|
+
const item = resolveModalSandboxComputeItem({
|
|
180
|
+
itemId: "estimate",
|
|
181
|
+
wallTimeSeconds: maximumPlaySandboxBillingSeconds(limits),
|
|
182
|
+
physicalCpuCores: resources.physicalCpuCores,
|
|
183
|
+
memoryGiB: elasticMemory ? modalSandboxMemoryLimitGiBForPlay(limits) : limits.memoryGiB
|
|
184
|
+
});
|
|
185
|
+
return roundUpCredits(
|
|
186
|
+
item.providerCostUsd * COMPUTE_BILLING_MARKUP_MULTIPLIER * DEFAULT_PROVIDER_MARKUP_MULTIPLIER / DEFAULT_USD_PER_CUSTOMER_CREDIT
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function estimateMaximumSandboxComputeCredits(limits, elasticMemory = false) {
|
|
190
|
+
return Math.max(
|
|
191
|
+
estimateDaytonaMaximumComputeCredits(limits),
|
|
192
|
+
estimateModalMaximumComputeCredits(limits, elasticMemory)
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
function formatNonStandardSandboxRuntimeWarning(limits) {
|
|
196
|
+
const size = playSandboxSizeForLimits(limits);
|
|
197
|
+
if (!size) return null;
|
|
198
|
+
if (size === "standard" && limits.timeoutSeconds <= STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS.timeoutSeconds) {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
const maximumComputeCredits = estimateMaximumSandboxComputeCredits(limits);
|
|
202
|
+
const quotedTimeout = `${Math.ceil(limits.timeoutSeconds / 60)}m`;
|
|
203
|
+
return `This Play requests the ${size} sandbox for up to ${limits.timeoutSeconds}s (${limits.memoryGiB}GiB memory, ${limits.cpu} CPU, ${limits.diskGiB}GiB disk). Resource-based pricing estimate: ${maximumComputeCredits.toFixed(2)} Deepline credits. Workspace plan pricing can differ. Run deepline billing quote --sandbox-timeout ${quotedTimeout} --sandbox-size ${size} for your workspace's session ceiling.`;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
PLAY_SANDBOX_COMPUTE_RATE_MULTIPLIERS,
|
|
208
|
+
formatNonStandardSandboxRuntimeWarning
|
|
209
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAuthedHttpClient,
|
|
3
3
|
printCommandEnvelope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PZN24YQQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
agentSessionIdFromEnvironment
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7AD565DO.mjs";
|
|
8
8
|
|
|
9
9
|
// src/cli/commands/sessions.ts
|
|
10
10
|
import {
|