deepline 0.3.408 → 0.3.410
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 +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +212 -334
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/{auth-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
- package/dist/cli/auth-UG4WOYGL.js +40 -0
- package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
- package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
- package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
- package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
- package/dist/cli/chunk-5TUGWDEB.js +313 -0
- package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
- package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
- package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
- package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
- package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
- package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NTVLGHFM.js +501 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
- package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
- package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
- package/dist/cli/chunk-T44IIOT6.mjs +501 -0
- package/dist/cli/chunk-VK2LZ5IP.js +35 -0
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
- package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
- package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
- package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
- package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
- package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
- package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
- package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
- package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
- package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
- package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
- package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
- package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
- package/dist/cli/git-I6CPBEVG.js +24 -0
- package/dist/cli/index.js +240 -352
- package/dist/cli/index.mjs +163 -275
- package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
- package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
- package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
- package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
- package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
- package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
- package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
- package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
- package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
- package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
- package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
- package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
- package/dist/cli/search-6NCH4HB5.js +30 -0
- package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
- package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
- package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
- package/dist/cli/sessions-235532DR.js +16 -0
- package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
- package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
- package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
- package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
- package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
- package/dist/cli/skills-3IWLYYRL.js +29 -0
- package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
- package/dist/cli/tools-LR66SPYU.js +44 -0
- package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
- package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
- package/dist/cli/update-SP7UEO53.js +31 -0
- package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
- package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
- package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
- package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +120 -104
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +5 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-3GB2K636.js +0 -40
- package/dist/cli/chunk-67RWR34T.mjs +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-HQY2SG3K.js +0 -83
- package/dist/cli/chunk-OSFWFV72.js +0 -155
- package/dist/cli/chunk-Q3LFI3VH.js +0 -392
- package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
- package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-YKUXXJOR.js +0 -24
- package/dist/cli/search-PPPYC5OZ.js +0 -30
- package/dist/cli/sessions-TEHEWW7O.js +0 -16
- package/dist/cli/skills-SYS7VRRK.js +0 -29
- package/dist/cli/tools-KK4BKVQR.js +0 -39
- package/dist/cli/update-2IV5JTX2.js +0 -29
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
|
-
var
|
|
4
|
+
var _chunk27GJKC5Qjs = require('./chunk-27GJKC5Q.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkOZ6E3IRZjs = require('./chunk-OZ6E3IRZ.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -24,7 +24,7 @@ var _chunkQ3LFI3VHjs = require('./chunk-Q3LFI3VH.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkAD47BXN2js = require('./chunk-AD47BXN2.js');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
@@ -34,18 +34,18 @@ var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
|
34
34
|
var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
var _chunkJ33TSWO5js = require('./chunk-J33TSWO5.js');
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunk63S7X326js = require('./chunk-63S7X326.js');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
@@ -54,7 +54,19 @@ var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
var _chunk5TUGWDEBjs = require('./chunk-5TUGWDEB.js');
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var _chunkOBB4QXHAjs = require('./chunk-OBB4QXHA.js');
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
var _chunkLTFL4JRNjs = require('./chunk-LTFL4JRN.js');
|
|
58
70
|
|
|
59
71
|
|
|
60
72
|
|
|
@@ -62,14 +74,15 @@ var _chunkHQY2SG3Kjs = require('./chunk-HQY2SG3K.js');
|
|
|
62
74
|
|
|
63
75
|
|
|
64
76
|
|
|
65
|
-
var
|
|
77
|
+
var _chunkNF4V5DTYjs = require('./chunk-NF4V5DTY.js');
|
|
66
78
|
|
|
67
79
|
|
|
68
80
|
|
|
69
|
-
var _chunkQUAQX3FQjs = require('./chunk-QUAQX3FQ.js');
|
|
70
81
|
|
|
82
|
+
var _chunkFVLNYDI4js = require('./chunk-FVLNYDI4.js');
|
|
71
83
|
|
|
72
|
-
|
|
84
|
+
|
|
85
|
+
var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
|
|
73
86
|
|
|
74
87
|
// src/cli/commands/tools.ts
|
|
75
88
|
var _commander = require('commander');
|
|
@@ -145,10 +158,10 @@ var ToolCallRecovery = class _ToolCallRecovery {
|
|
|
145
158
|
}
|
|
146
159
|
};
|
|
147
160
|
function pendingToolExecutionPath(input) {
|
|
148
|
-
const config =
|
|
161
|
+
const config = _chunkFVLNYDI4js.resolveConfig.call(void 0, );
|
|
149
162
|
const fingerprint = _crypto.createHash.call(void 0, "sha256").update(config.baseUrl).update("\0").update(_crypto.createHash.call(void 0, "sha256").update(config.apiKey).digest("hex")).update("\0").update(input.toolId).update("\0").update(_chunkXDVT3GOMjs.stableStringify.call(void 0, input.params)).update("\0").update(input.responseIntent).digest("hex");
|
|
150
163
|
return _path.join.call(void 0,
|
|
151
|
-
|
|
164
|
+
_chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, config.baseUrl),
|
|
152
165
|
`pending-tool-execution-${fingerprint}.json`
|
|
153
166
|
);
|
|
154
167
|
}
|
|
@@ -251,18 +264,19 @@ function toolConnectionStatusMessage(input) {
|
|
|
251
264
|
}
|
|
252
265
|
|
|
253
266
|
// src/cli/commands/tools.ts
|
|
267
|
+
var TOOL_EXECUTE_PREFLIGHT_TIMEOUT_MS = 750;
|
|
254
268
|
var TOOL_COMMAND_TEMPLATES = {
|
|
255
269
|
describe: "deepline describe <toolId>",
|
|
256
270
|
execute: "deepline tools execute <toolId> --input '{...}'"
|
|
257
271
|
};
|
|
258
272
|
function toListedTool(tool) {
|
|
259
|
-
if (
|
|
273
|
+
if (_chunkAD47BXN2js.isPlayLikeTool.call(void 0, tool)) {
|
|
260
274
|
return {
|
|
261
275
|
...tool,
|
|
262
276
|
description: listedToolDescription(tool),
|
|
263
277
|
id: tool.toolId,
|
|
264
278
|
type: "play",
|
|
265
|
-
executeCommand:
|
|
279
|
+
executeCommand: _chunkAD47BXN2js.playRunCommandForTool.call(void 0, tool, tool.toolId)
|
|
266
280
|
};
|
|
267
281
|
}
|
|
268
282
|
return {
|
|
@@ -363,16 +377,16 @@ function firstSentence(text) {
|
|
|
363
377
|
return (match ? match[0] : clean).trim();
|
|
364
378
|
}
|
|
365
379
|
function requiredInputIds(tool) {
|
|
366
|
-
const inputSchema =
|
|
380
|
+
const inputSchema = _chunkAD47BXN2js.recordField.call(void 0,
|
|
367
381
|
tool,
|
|
368
382
|
"inputSchema",
|
|
369
383
|
"input_schema"
|
|
370
384
|
);
|
|
371
|
-
return
|
|
385
|
+
return _chunkAD47BXN2js.toolInputFieldsForDisplay.call(void 0, inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
|
|
372
386
|
}
|
|
373
387
|
function notConnectedSuffix(tool) {
|
|
374
388
|
const record = tool;
|
|
375
|
-
const status =
|
|
389
|
+
const status = _chunkAD47BXN2js.stringField.call(void 0, record, "credentialStatus", "credential_status");
|
|
376
390
|
const connected = record.connected;
|
|
377
391
|
const message = toolConnectionStatusMessage({
|
|
378
392
|
connected: connected === false ? false : void 0,
|
|
@@ -381,18 +395,18 @@ function notConnectedSuffix(tool) {
|
|
|
381
395
|
return message ? ` - \u26A0 ${message}` : "";
|
|
382
396
|
}
|
|
383
397
|
function shortPricingHint(tool) {
|
|
384
|
-
const pricing =
|
|
398
|
+
const pricing = _chunkAD47BXN2js.recordField.call(void 0,
|
|
385
399
|
tool,
|
|
386
400
|
"pricing"
|
|
387
401
|
);
|
|
388
402
|
const credits = numberField(pricing, "creditsPerUnit", "credits_per_unit");
|
|
389
|
-
const unit =
|
|
403
|
+
const unit = _chunkAD47BXN2js.stringField.call(void 0, pricing, "unit");
|
|
390
404
|
if (credits !== null) {
|
|
391
405
|
return `${formatDecimal(credits)} cr/${unit || "unit"}`;
|
|
392
406
|
}
|
|
393
|
-
const summary =
|
|
407
|
+
const summary = _chunkAD47BXN2js.stringField.call(void 0, pricing, "summary");
|
|
394
408
|
if (summary) return summary;
|
|
395
|
-
const displayText =
|
|
409
|
+
const displayText = _chunkAD47BXN2js.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
396
410
|
return displayText || null;
|
|
397
411
|
}
|
|
398
412
|
function aggregateCategorySummaries(tools) {
|
|
@@ -436,12 +450,23 @@ function categoryEnumerationRender(summaries) {
|
|
|
436
450
|
};
|
|
437
451
|
}
|
|
438
452
|
async function listToolCategories(emitJson, compact) {
|
|
439
|
-
const client = new (0,
|
|
453
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
454
|
+
if (!emitJson) {
|
|
455
|
+
const summaries2 = (await client.listToolCategories()).map((category) => ({
|
|
456
|
+
...category,
|
|
457
|
+
description: describeToolCategory(category.name)
|
|
458
|
+
}));
|
|
459
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
460
|
+
{ categories: summaries2, render: categoryEnumerationRender(summaries2) },
|
|
461
|
+
{ json: false }
|
|
462
|
+
);
|
|
463
|
+
return 0;
|
|
464
|
+
}
|
|
440
465
|
const rawTools = await client.listTools({ compact });
|
|
441
466
|
const items = rawTools.map(toListedTool);
|
|
442
467
|
const summaries = aggregateCategorySummaries(rawTools);
|
|
443
468
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
444
|
-
|
|
469
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
445
470
|
{
|
|
446
471
|
tools: outputItems,
|
|
447
472
|
count: outputItems.length,
|
|
@@ -460,7 +485,7 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
460
485
|
const known = summaries.map((item) => item.name);
|
|
461
486
|
const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
|
|
462
487
|
if (emitJson) {
|
|
463
|
-
|
|
488
|
+
_chunkNF4V5DTYjs.printJson.call(void 0, {
|
|
464
489
|
ok: false,
|
|
465
490
|
exitCode: 4,
|
|
466
491
|
code: "TOOL_CATEGORY_NOT_FOUND",
|
|
@@ -474,19 +499,18 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
474
499
|
const render = categoryEnumerationRender(summaries);
|
|
475
500
|
console.error(message);
|
|
476
501
|
console.error("");
|
|
477
|
-
console.error(
|
|
502
|
+
console.error(_chunkNF4V5DTYjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
|
|
478
503
|
console.error("");
|
|
479
504
|
console.error(`Valid categories: ${known.join(", ")}`);
|
|
480
505
|
return 4;
|
|
481
506
|
}
|
|
482
507
|
async function listToolsInCategory(category, emitJson) {
|
|
483
|
-
const client = new (0,
|
|
484
|
-
const rawTools = await client.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const summaries = aggregateCategorySummaries(allTools);
|
|
508
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
509
|
+
const { tools: rawTools, categories } = await client.listToolsInCategory(category);
|
|
510
|
+
const summaries = categories.map((item) => ({
|
|
511
|
+
...item,
|
|
512
|
+
description: describeToolCategory(item.name)
|
|
513
|
+
}));
|
|
490
514
|
if (!summaries.some((item) => item.name === category)) {
|
|
491
515
|
return unknownCategoryError(category, summaries, emitJson);
|
|
492
516
|
}
|
|
@@ -517,7 +541,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
517
541
|
}
|
|
518
542
|
]
|
|
519
543
|
};
|
|
520
|
-
|
|
544
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
521
545
|
{
|
|
522
546
|
category,
|
|
523
547
|
total: rows.length,
|
|
@@ -530,7 +554,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
530
554
|
return 0;
|
|
531
555
|
}
|
|
532
556
|
async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
|
|
533
|
-
const client = new (0,
|
|
557
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
534
558
|
const items = (await client.listTools({
|
|
535
559
|
categories: requestedCategories.join(","),
|
|
536
560
|
compact
|
|
@@ -559,7 +583,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
559
583
|
]
|
|
560
584
|
};
|
|
561
585
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
562
|
-
|
|
586
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
563
587
|
{
|
|
564
588
|
tools: outputItems,
|
|
565
589
|
count: outputItems.length,
|
|
@@ -578,13 +602,13 @@ async function listTools(category, options = {}) {
|
|
|
578
602
|
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
|
|
579
603
|
const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
|
|
580
604
|
const compact = options.compact !== false;
|
|
581
|
-
const emitJson = options.json === true ||
|
|
605
|
+
const emitJson = options.json === true || _chunkNF4V5DTYjs.shouldEmitJson.call(void 0, );
|
|
582
606
|
if (positional && flagCategories.length > 0) {
|
|
583
607
|
const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
|
|
584
608
|
if (!flagIsSameSingle) {
|
|
585
609
|
const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
|
|
586
610
|
if (emitJson) {
|
|
587
|
-
|
|
611
|
+
_chunkNF4V5DTYjs.printJson.call(void 0, {
|
|
588
612
|
ok: false,
|
|
589
613
|
exitCode: 2,
|
|
590
614
|
code: "TOOL_LIST_CATEGORY_CONFLICT",
|
|
@@ -611,7 +635,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
611
635
|
console.error("Usage: deepline tools grep <query> [--json]");
|
|
612
636
|
return 1;
|
|
613
637
|
}
|
|
614
|
-
const client = new (0,
|
|
638
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
615
639
|
const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
616
640
|
const mode = _nullishCoalesce(options.mode, () => ( "all"));
|
|
617
641
|
const jsonOutput = options.json === true;
|
|
@@ -654,7 +678,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
654
678
|
query,
|
|
655
679
|
mode
|
|
656
680
|
}) : null;
|
|
657
|
-
|
|
681
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
658
682
|
{
|
|
659
683
|
tools: outputTools,
|
|
660
684
|
count: outputTools.length,
|
|
@@ -672,7 +696,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
672
696
|
} : {},
|
|
673
697
|
commandTemplates: TOOL_COMMAND_TEMPLATES
|
|
674
698
|
},
|
|
675
|
-
{ json: options.json ||
|
|
699
|
+
{ json: options.json || _chunkNF4V5DTYjs.shouldEmitJson.call(void 0, ) }
|
|
676
700
|
);
|
|
677
701
|
return 0;
|
|
678
702
|
}
|
|
@@ -713,7 +737,7 @@ async function findPlayForToolId(client, toolId, cliInvocationId) {
|
|
|
713
737
|
return _nullishCoalesce(plays.find((play) => playIdentifiers(play).includes(requested)), () => ( null));
|
|
714
738
|
}
|
|
715
739
|
function isMissingToolMetadataError(error) {
|
|
716
|
-
return error instanceof
|
|
740
|
+
return error instanceof _chunkPPDBRJRWjs.DeeplineError && error.statusCode === 404;
|
|
717
741
|
}
|
|
718
742
|
function playAliasToolErrorMessage(toolId, play) {
|
|
719
743
|
const playName = _nullishCoalesce(play.reference, () => ( play.name));
|
|
@@ -725,17 +749,14 @@ function printPlayAliasToolError(toolId, play) {
|
|
|
725
749
|
console.error(playAliasToolErrorMessage(toolId, play));
|
|
726
750
|
}
|
|
727
751
|
function playLikeToolExecuteErrorMessage(toolId, tool) {
|
|
728
|
-
const playReference = tool ?
|
|
729
|
-
const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${
|
|
752
|
+
const playReference = tool ? _chunkAD47BXN2js.playReferenceForTool.call(void 0, tool) : null;
|
|
753
|
+
const nextStep = playReference ? `Use: deepline plays run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${_chunkAD47BXN2js.playSearchCommandForToolId.call(void 0, toolId)}`;
|
|
730
754
|
return [
|
|
731
755
|
`${toolId} is a workflow/play entry, not an atomic provider tool.`,
|
|
732
756
|
nextStep,
|
|
733
757
|
'Or search provider tools only with: deepline search "<input you have -> result you need>" --type tools'
|
|
734
758
|
].join("\n");
|
|
735
759
|
}
|
|
736
|
-
function printPlayLikeToolExecuteError(toolId, tool) {
|
|
737
|
-
console.error(playLikeToolExecuteErrorMessage(toolId, tool));
|
|
738
|
-
}
|
|
739
760
|
var TOOL_ONLY_VIEWS = [
|
|
740
761
|
"compact",
|
|
741
762
|
"contractJson",
|
|
@@ -790,7 +811,7 @@ Output:
|
|
|
790
811
|
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
791
812
|
);
|
|
792
813
|
}
|
|
793
|
-
const result = await new (0,
|
|
814
|
+
const result = await new (0, _chunk63S7X326js.DeeplineClient)().setIntegrationCredentials(
|
|
794
815
|
provider,
|
|
795
816
|
credentials
|
|
796
817
|
);
|
|
@@ -800,7 +821,7 @@ Output:
|
|
|
800
821
|
);
|
|
801
822
|
}
|
|
802
823
|
const confirmation = { provider, credential_saved: true };
|
|
803
|
-
if (
|
|
824
|
+
if (_chunkNF4V5DTYjs.shouldEmitJson.call(void 0, options.json))
|
|
804
825
|
console.log(JSON.stringify(confirmation));
|
|
805
826
|
else
|
|
806
827
|
console.log(
|
|
@@ -840,7 +861,7 @@ Examples:
|
|
|
840
861
|
json: Boolean(options.json)
|
|
841
862
|
});
|
|
842
863
|
});
|
|
843
|
-
|
|
864
|
+
_chunkOZ6E3IRZjs.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
|
|
844
865
|
tools.command("grep <query>").description(
|
|
845
866
|
"Literal grep over tool ids, descriptions, categories, and input fields."
|
|
846
867
|
).addHelpText(
|
|
@@ -871,7 +892,7 @@ Examples:
|
|
|
871
892
|
});
|
|
872
893
|
const addToolMetadataCommand = (command) => {
|
|
873
894
|
let compatibilityMetadata;
|
|
874
|
-
|
|
895
|
+
_chunk5TUGWDEBjs.registerCompatibilityCatalog.call(void 0, command, () => ({
|
|
875
896
|
toolId: command.args[0],
|
|
876
897
|
acceptMetadata: (metadata) => {
|
|
877
898
|
compatibilityMetadata = metadata;
|
|
@@ -941,7 +962,7 @@ Examples:
|
|
|
941
962
|
process.exitCode = await narrowView();
|
|
942
963
|
return;
|
|
943
964
|
}
|
|
944
|
-
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-
|
|
965
|
+
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-S34JUX5W.js")));
|
|
945
966
|
process.exitCode = await describeAnything(
|
|
946
967
|
toolId,
|
|
947
968
|
{
|
|
@@ -956,7 +977,7 @@ Examples:
|
|
|
956
977
|
});
|
|
957
978
|
};
|
|
958
979
|
addToolMetadataCommand(
|
|
959
|
-
|
|
980
|
+
_chunk27GJKC5Qjs.addDescribeOptions.call(void 0,
|
|
960
981
|
tools.command("describe <toolId>", { hidden: true }).alias("get"),
|
|
961
982
|
{ json: false }
|
|
962
983
|
)
|
|
@@ -1018,16 +1039,66 @@ Examples:
|
|
|
1018
1039
|
).option(
|
|
1019
1040
|
"--recovery-timeout-ms <milliseconds>",
|
|
1020
1041
|
"Maximum wait for a keyed execution to finish (default: 900000)"
|
|
1021
|
-
).action(
|
|
1022
|
-
|
|
1023
|
-
|
|
1042
|
+
).action(
|
|
1043
|
+
async (toolId, options, command) => {
|
|
1044
|
+
process.exitCode = await executeTool(
|
|
1045
|
+
toolId,
|
|
1046
|
+
options,
|
|
1047
|
+
void 0,
|
|
1048
|
+
true,
|
|
1049
|
+
_chunkOBB4QXHAjs.resolveCliMaintenancePolicy.call(void 0, command.optsWithGlobals())
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
1055
|
+
let metadata;
|
|
1056
|
+
const startedAt = performance.now();
|
|
1057
|
+
const baseUrl = _chunkFVLNYDI4js.resolveConfig.call(void 0, ).baseUrl;
|
|
1058
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_compatibility_start" });
|
|
1059
|
+
const result = _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
1060
|
+
"SDK compatibility",
|
|
1061
|
+
() => _chunkLTFL4JRNjs.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
1062
|
+
command: "tools execute",
|
|
1063
|
+
skillsVersion: _chunkFVLNYDI4js.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
1064
|
+
persistCache: false,
|
|
1065
|
+
timeoutMs: TOOL_EXECUTE_PREFLIGHT_TIMEOUT_MS,
|
|
1066
|
+
catalog: {
|
|
1067
|
+
toolId,
|
|
1068
|
+
cliInvocationId,
|
|
1069
|
+
purpose: "execution_warnings",
|
|
1070
|
+
acceptMetadata: (value) => {
|
|
1071
|
+
metadata = value;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
})
|
|
1075
|
+
).then(
|
|
1076
|
+
(compatibility) => {
|
|
1077
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
|
|
1078
|
+
phase: "cli.tool_execute_compatibility_ready",
|
|
1079
|
+
ms: performance.now() - startedAt,
|
|
1080
|
+
ok: compatibility.error === null,
|
|
1081
|
+
hasMetadata: metadata !== void 0
|
|
1082
|
+
});
|
|
1083
|
+
return compatibility;
|
|
1084
|
+
},
|
|
1085
|
+
(error) => {
|
|
1086
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
|
|
1087
|
+
phase: "cli.tool_execute_compatibility_ready",
|
|
1088
|
+
ms: performance.now() - startedAt,
|
|
1089
|
+
ok: false
|
|
1090
|
+
});
|
|
1091
|
+
throw error;
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
return { result, readMetadata: () => metadata };
|
|
1024
1095
|
}
|
|
1025
1096
|
async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
1026
1097
|
if (!toolId) {
|
|
1027
1098
|
console.error("Usage: deepline tools describe <toolId> [--json]");
|
|
1028
1099
|
return 1;
|
|
1029
1100
|
}
|
|
1030
|
-
const client = new (0,
|
|
1101
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
1031
1102
|
let tool;
|
|
1032
1103
|
try {
|
|
1033
1104
|
tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
|
|
@@ -1081,12 +1152,12 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1081
1152
|
const lines = toolPricingOnlyLines(tool, toolId);
|
|
1082
1153
|
if (inferenceQuote)
|
|
1083
1154
|
lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
|
|
1084
|
-
|
|
1155
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0,
|
|
1085
1156
|
{
|
|
1086
1157
|
toolId: String(tool.toolId || toolId),
|
|
1087
1158
|
cost: _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
1088
1159
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1089
|
-
...
|
|
1160
|
+
..._chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool) ? { pricing: _chunkAD47BXN2js.recordField.call(void 0, tool, "pricing") } : {},
|
|
1090
1161
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1091
1162
|
},
|
|
1092
1163
|
{
|
|
@@ -1097,14 +1168,14 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1097
1168
|
);
|
|
1098
1169
|
return 0;
|
|
1099
1170
|
}
|
|
1100
|
-
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !
|
|
1101
|
-
const contract =
|
|
1171
|
+
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !_chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool) && !_chunkAD47BXN2js.isPlayLikeTool.call(void 0, tool) && (options.json || options.contractJson)) {
|
|
1172
|
+
const contract = _chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1102
1173
|
tool,
|
|
1103
1174
|
toolId,
|
|
1104
1175
|
void 0,
|
|
1105
1176
|
seedToolListScript
|
|
1106
1177
|
);
|
|
1107
|
-
|
|
1178
|
+
_chunkNF4V5DTYjs.printCompactJson.call(void 0, {
|
|
1108
1179
|
toolId: contract.toolId,
|
|
1109
1180
|
...options.schemaOnly ? {
|
|
1110
1181
|
inputSchema: contract.inputSchema,
|
|
@@ -1127,8 +1198,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1127
1198
|
return 0;
|
|
1128
1199
|
}
|
|
1129
1200
|
if (options.contractJson) {
|
|
1130
|
-
|
|
1131
|
-
...
|
|
1201
|
+
_chunkNF4V5DTYjs.printCompactJson.call(void 0, {
|
|
1202
|
+
..._chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1132
1203
|
tool,
|
|
1133
1204
|
toolId,
|
|
1134
1205
|
void 0,
|
|
@@ -1141,8 +1212,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1141
1212
|
}
|
|
1142
1213
|
const emitJson = options.json === true;
|
|
1143
1214
|
if (emitJson) {
|
|
1144
|
-
|
|
1145
|
-
...
|
|
1215
|
+
_chunkNF4V5DTYjs.printCompactJson.call(void 0, {
|
|
1216
|
+
..._chunkAD47BXN2js.toolMetadataJsonForDescribe.call(void 0, tool, toolId, seedToolListScript),
|
|
1146
1217
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1147
1218
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1148
1219
|
});
|
|
@@ -1167,7 +1238,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1167
1238
|
printCompactToolContract(tool, toolId);
|
|
1168
1239
|
if (modelDescription) {
|
|
1169
1240
|
process.stdout.write(`
|
|
1170
|
-
${
|
|
1241
|
+
${_chunkAD47BXN2js.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1171
1242
|
}
|
|
1172
1243
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1173
1244
|
return 0;
|
|
@@ -1175,7 +1246,7 @@ ${_chunkFERRDNMOjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
|
1175
1246
|
printCompactToolContract(tool, toolId);
|
|
1176
1247
|
if (modelDescription) {
|
|
1177
1248
|
process.stdout.write(`
|
|
1178
|
-
${
|
|
1249
|
+
${_chunkAD47BXN2js.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1179
1250
|
}
|
|
1180
1251
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1181
1252
|
return 0;
|
|
@@ -1192,10 +1263,10 @@ function printInferenceQuoteSummary(quote) {
|
|
|
1192
1263
|
for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
|
|
1193
1264
|
}
|
|
1194
1265
|
function printMonitorTypeFilters(tool) {
|
|
1195
|
-
const schema =
|
|
1196
|
-
const properties =
|
|
1266
|
+
const schema = _chunkAD47BXN2js.recordField.call(void 0, tool, "payload_schema", "payloadSchema");
|
|
1267
|
+
const properties = _chunkAD47BXN2js.recordField.call(void 0, schema, "properties");
|
|
1197
1268
|
const required = new Set(
|
|
1198
|
-
|
|
1269
|
+
_chunkAD47BXN2js.arrayField.call(void 0, schema, "required").filter(
|
|
1199
1270
|
(v) => typeof v === "string"
|
|
1200
1271
|
)
|
|
1201
1272
|
);
|
|
@@ -1206,24 +1277,24 @@ function printMonitorTypeFilters(tool) {
|
|
|
1206
1277
|
}
|
|
1207
1278
|
console.log("Deploy filters (set in the monitor payload):");
|
|
1208
1279
|
for (const name of names) {
|
|
1209
|
-
const field =
|
|
1280
|
+
const field = _chunkAD47BXN2js.isRecord.call(void 0, properties[name]) ? properties[name] : {};
|
|
1210
1281
|
const star = required.has(name) ? "*" : "";
|
|
1211
|
-
const enumVals =
|
|
1282
|
+
const enumVals = _chunkAD47BXN2js.arrayField.call(void 0, field, "enum").filter(
|
|
1212
1283
|
(v) => typeof v === "string"
|
|
1213
1284
|
);
|
|
1214
|
-
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` :
|
|
1215
|
-
const desc =
|
|
1285
|
+
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : _chunkAD47BXN2js.stringField.call(void 0, field, "type") || "string";
|
|
1286
|
+
const desc = _chunkAD47BXN2js.stringField.call(void 0, field, "description");
|
|
1216
1287
|
console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
|
|
1217
1288
|
}
|
|
1218
1289
|
}
|
|
1219
1290
|
function printMonitorTypeFilterExamples(tool) {
|
|
1220
|
-
const documentation =
|
|
1221
|
-
const fields =
|
|
1291
|
+
const documentation = _chunkAD47BXN2js.recordField.call(void 0, tool, "documentation");
|
|
1292
|
+
const fields = _chunkAD47BXN2js.recordField.call(void 0, documentation, "fields");
|
|
1222
1293
|
const examples = Object.entries(fields).flatMap(([name, rawField]) => {
|
|
1223
|
-
const grammar =
|
|
1224
|
-
const example =
|
|
1294
|
+
const grammar = _chunkAD47BXN2js.recordField.call(void 0, _chunkAD47BXN2js.isRecord.call(void 0, rawField) ? rawField : {}, "grammar");
|
|
1295
|
+
const example = _chunkAD47BXN2js.stringField.call(void 0, grammar, "example");
|
|
1225
1296
|
const values = [
|
|
1226
|
-
...
|
|
1297
|
+
..._chunkAD47BXN2js.arrayField.call(void 0, grammar, "examples").filter(
|
|
1227
1298
|
(value) => typeof value === "string" && Boolean(value)
|
|
1228
1299
|
),
|
|
1229
1300
|
...example ? [example] : []
|
|
@@ -1238,21 +1309,21 @@ function printMonitorTypeFilterExamples(tool) {
|
|
|
1238
1309
|
}
|
|
1239
1310
|
}
|
|
1240
1311
|
function printMonitorTypeStreams(tool) {
|
|
1241
|
-
const streams =
|
|
1242
|
-
|
|
1312
|
+
const streams = _chunkAD47BXN2js.arrayField.call(void 0, tool, "streams", "output_streams").filter(
|
|
1313
|
+
_chunkAD47BXN2js.isRecord
|
|
1243
1314
|
);
|
|
1244
1315
|
if (!streams.length) return;
|
|
1245
1316
|
console.log("");
|
|
1246
1317
|
console.log("Filter columns (a play's sqlListeners.where, per stream):");
|
|
1247
1318
|
for (const stream of streams) {
|
|
1248
|
-
const name =
|
|
1249
|
-
const cols =
|
|
1319
|
+
const name = _chunkAD47BXN2js.stringField.call(void 0, stream, "stream");
|
|
1320
|
+
const cols = _chunkAD47BXN2js.arrayField.call(void 0, stream, "columns").filter(_chunkAD47BXN2js.isRecord).map((col) => _chunkAD47BXN2js.stringField.call(void 0, col, "name")).filter(Boolean);
|
|
1250
1321
|
console.log(`- ${name}: ${cols.join(", ")}`);
|
|
1251
1322
|
}
|
|
1252
1323
|
}
|
|
1253
1324
|
function monitorTypePricingLines(tool) {
|
|
1254
|
-
const pricing =
|
|
1255
|
-
const byType =
|
|
1325
|
+
const pricing = _chunkAD47BXN2js.recordField.call(void 0, tool, "pricing");
|
|
1326
|
+
const byType = _chunkAD47BXN2js.recordField.call(void 0,
|
|
1256
1327
|
pricing,
|
|
1257
1328
|
"pricing_by_radar_type",
|
|
1258
1329
|
"pricingByRadarType"
|
|
@@ -1263,9 +1334,9 @@ function monitorTypePricingLines(tool) {
|
|
|
1263
1334
|
}
|
|
1264
1335
|
const lines = ["Pricing (Deepline credits per accepted event):"];
|
|
1265
1336
|
for (const key of keys) {
|
|
1266
|
-
const entry =
|
|
1337
|
+
const entry = _chunkAD47BXN2js.isRecord.call(void 0, byType[key]) ? byType[key] : {};
|
|
1267
1338
|
const credits = numberField(entry, "deepline_credits", "deeplineCredits");
|
|
1268
|
-
const display =
|
|
1339
|
+
const display = _chunkAD47BXN2js.stringField.call(void 0, entry, "display");
|
|
1269
1340
|
const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "not listed");
|
|
1270
1341
|
lines.push(`- ${key}: ${shown}`);
|
|
1271
1342
|
}
|
|
@@ -1275,20 +1346,20 @@ function printMonitorTypePricing(tool) {
|
|
|
1275
1346
|
for (const line of monitorTypePricingLines(tool)) console.log(line);
|
|
1276
1347
|
}
|
|
1277
1348
|
function printMonitorTypeDeploy(tool) {
|
|
1278
|
-
const deploy =
|
|
1279
|
-
const toolId =
|
|
1280
|
-
const example =
|
|
1349
|
+
const deploy = _chunkAD47BXN2js.recordField.call(void 0, tool, "deploy");
|
|
1350
|
+
const toolId = _chunkAD47BXN2js.stringField.call(void 0, tool, "toolId");
|
|
1351
|
+
const example = _chunkAD47BXN2js.stringField.call(void 0, deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
|
|
1281
1352
|
console.log("Deploy (a monitor type is deployed, not executed):");
|
|
1282
1353
|
console.log(` ${example}`);
|
|
1283
1354
|
}
|
|
1284
1355
|
function printMonitorTypeContract(tool, requestedToolId) {
|
|
1285
|
-
const toolId =
|
|
1356
|
+
const toolId = _chunkAD47BXN2js.stringField.call(void 0, tool, "toolId") || requestedToolId;
|
|
1286
1357
|
console.log(toolId);
|
|
1287
|
-
const displayName =
|
|
1358
|
+
const displayName = _chunkAD47BXN2js.stringField.call(void 0, tool, "displayName");
|
|
1288
1359
|
if (displayName) console.log(`Best for: ${displayName}`);
|
|
1289
|
-
const description =
|
|
1360
|
+
const description = _chunkAD47BXN2js.stringField.call(void 0, tool, "description");
|
|
1290
1361
|
if (description) console.log(`Description: ${description}`);
|
|
1291
|
-
const categories =
|
|
1362
|
+
const categories = _chunkAD47BXN2js.arrayField.call(void 0, tool, "categories").filter(
|
|
1292
1363
|
(v) => typeof v === "string"
|
|
1293
1364
|
);
|
|
1294
1365
|
if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
|
|
@@ -1308,31 +1379,31 @@ function printMonitorTypeContract(tool, requestedToolId) {
|
|
|
1308
1379
|
console.log(`More: deepline describe ${toolId}`);
|
|
1309
1380
|
}
|
|
1310
1381
|
function toolGuidanceLines(guidance) {
|
|
1311
|
-
const record =
|
|
1312
|
-
const toolGuidance =
|
|
1313
|
-
const providerGuidance =
|
|
1382
|
+
const record = _chunkAD47BXN2js.isRecord.call(void 0, guidance) ? guidance : {};
|
|
1383
|
+
const toolGuidance = _chunkAD47BXN2js.stringField.call(void 0, record, "tool");
|
|
1384
|
+
const providerGuidance = _chunkAD47BXN2js.stringField.call(void 0, record, "provider");
|
|
1314
1385
|
return [
|
|
1315
1386
|
...toolGuidance ? [`- This tool: ${toolGuidance}`] : [],
|
|
1316
1387
|
...providerGuidance ? [`- Provider: ${providerGuidance}`] : []
|
|
1317
1388
|
];
|
|
1318
1389
|
}
|
|
1319
1390
|
function printCompactToolContract(tool, requestedToolId) {
|
|
1320
|
-
if (
|
|
1391
|
+
if (_chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool)) {
|
|
1321
1392
|
printMonitorTypeContract(tool, requestedToolId);
|
|
1322
1393
|
return;
|
|
1323
1394
|
}
|
|
1324
|
-
const contract =
|
|
1395
|
+
const contract = _chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1325
1396
|
tool,
|
|
1326
1397
|
requestedToolId,
|
|
1327
1398
|
void 0,
|
|
1328
1399
|
seedToolListScript
|
|
1329
1400
|
);
|
|
1330
|
-
const cost =
|
|
1331
|
-
const getters =
|
|
1401
|
+
const cost = _chunkAD47BXN2js.isRecord.call(void 0, contract.cost) ? contract.cost : {};
|
|
1402
|
+
const getters = _chunkAD47BXN2js.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1332
1403
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1333
1404
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1334
|
-
const inputFields =
|
|
1335
|
-
|
|
1405
|
+
const inputFields = _chunkAD47BXN2js.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1406
|
+
_chunkAD47BXN2js.recordField.call(void 0, contract, "inputSchema")
|
|
1336
1407
|
);
|
|
1337
1408
|
console.log(String(contract.toolId));
|
|
1338
1409
|
if (contract.displayName) console.log(`Best for: ${contract.displayName}`);
|
|
@@ -1349,9 +1420,9 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1349
1420
|
printToolOutputArrayShape(contract);
|
|
1350
1421
|
printToolExecutionHints(contract);
|
|
1351
1422
|
if (contract.deprecated === true) {
|
|
1352
|
-
const deprecation =
|
|
1353
|
-
const message =
|
|
1354
|
-
const replacementToolId =
|
|
1423
|
+
const deprecation = _chunkAD47BXN2js.isRecord.call(void 0, contract.deprecation) ? contract.deprecation : {};
|
|
1424
|
+
const message = _chunkAD47BXN2js.stringField.call(void 0, deprecation, "message");
|
|
1425
|
+
const replacementToolId = _chunkAD47BXN2js.stringField.call(void 0,
|
|
1355
1426
|
deprecation,
|
|
1356
1427
|
"replacementToolId",
|
|
1357
1428
|
"replacement_tool_id"
|
|
@@ -1376,12 +1447,12 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1376
1447
|
console.log("");
|
|
1377
1448
|
console.log("Inputs:");
|
|
1378
1449
|
for (const field of inputFields) {
|
|
1379
|
-
if (!
|
|
1380
|
-
const name =
|
|
1450
|
+
if (!_chunkAD47BXN2js.isRecord.call(void 0, field)) continue;
|
|
1451
|
+
const name = _chunkAD47BXN2js.stringField.call(void 0, field, "name");
|
|
1381
1452
|
if (!name) continue;
|
|
1382
1453
|
const required = field.required ? "*" : "";
|
|
1383
|
-
const type =
|
|
1384
|
-
const description =
|
|
1454
|
+
const type = _chunkAD47BXN2js.stringField.call(void 0, field, "type") || "unknown";
|
|
1455
|
+
const description = _chunkAD47BXN2js.stringField.call(void 0, field, "description");
|
|
1385
1456
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
1386
1457
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
1387
1458
|
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
@@ -1396,8 +1467,8 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1396
1467
|
}
|
|
1397
1468
|
console.log("");
|
|
1398
1469
|
printToolExamplesOnly(tool, requestedToolId);
|
|
1399
|
-
const starterScript =
|
|
1400
|
-
const starterPath =
|
|
1470
|
+
const starterScript = _chunkAD47BXN2js.isRecord.call(void 0, contract.starterScript) ? contract.starterScript : {};
|
|
1471
|
+
const starterPath = _chunkAD47BXN2js.stringField.call(void 0, starterScript, "path");
|
|
1401
1472
|
if (starterPath) {
|
|
1402
1473
|
console.log("");
|
|
1403
1474
|
console.log(`Starter script: ${starterPath}`);
|
|
@@ -1408,16 +1479,16 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1408
1479
|
console.log("Getters:");
|
|
1409
1480
|
if (listGetters.length) console.log(listGetterHeading());
|
|
1410
1481
|
for (const entry of listGetters) {
|
|
1411
|
-
if (
|
|
1482
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, entry))
|
|
1412
1483
|
console.log(
|
|
1413
|
-
`- ${
|
|
1484
|
+
`- ${_chunkAD47BXN2js.stringField.call(void 0, entry, "name")}: ${_chunkAD47BXN2js.playResultExpression.call(void 0, entry)}`
|
|
1414
1485
|
);
|
|
1415
1486
|
}
|
|
1416
1487
|
if (valueGetters.length) console.log("Values:");
|
|
1417
1488
|
for (const entry of valueGetters) {
|
|
1418
|
-
if (
|
|
1489
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, entry))
|
|
1419
1490
|
console.log(
|
|
1420
|
-
`- ${
|
|
1491
|
+
`- ${_chunkAD47BXN2js.stringField.call(void 0, entry, "name")}: ${_chunkAD47BXN2js.playResultExpression.call(void 0, entry)}`
|
|
1421
1492
|
);
|
|
1422
1493
|
}
|
|
1423
1494
|
}
|
|
@@ -1428,19 +1499,19 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1428
1499
|
console.log(`More: deepline describe ${contract.toolId}`);
|
|
1429
1500
|
}
|
|
1430
1501
|
function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
1431
|
-
if (
|
|
1502
|
+
if (_chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool)) {
|
|
1432
1503
|
return monitorTypePricingLines(tool);
|
|
1433
1504
|
}
|
|
1434
1505
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1435
1506
|
const cost = _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1436
|
-
const pricingModel =
|
|
1437
|
-
const billing =
|
|
1438
|
-
const explicitUnit =
|
|
1507
|
+
const pricingModel = _chunkAD47BXN2js.stringField.call(void 0, cost, "pricingModel") || "unknown";
|
|
1508
|
+
const billing = _chunkAD47BXN2js.stringField.call(void 0, cost, "billingSourceLabel") || _chunkAD47BXN2js.stringField.call(void 0, cost, "billingSource") || _chunkAD47BXN2js.stringField.call(void 0, cost, "billingMode") || "unknown";
|
|
1509
|
+
const explicitUnit = _chunkAD47BXN2js.stringField.call(void 0, cost, "unit");
|
|
1439
1510
|
const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
|
|
1440
1511
|
const credits = numberField(cost, "deeplineCreditsPerPricingUnit");
|
|
1441
1512
|
const usd = numberField(cost, "deeplineUsdPerPricingUnit");
|
|
1442
|
-
const displayText =
|
|
1443
|
-
const summary =
|
|
1513
|
+
const displayText = _chunkAD47BXN2js.stringField.call(void 0, cost, "displayText");
|
|
1514
|
+
const summary = _chunkAD47BXN2js.stringField.call(void 0, cost, "summary");
|
|
1444
1515
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1445
1516
|
return [
|
|
1446
1517
|
`${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
|
|
@@ -1457,19 +1528,19 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
|
|
|
1457
1528
|
console.log(line);
|
|
1458
1529
|
}
|
|
1459
1530
|
function printToolSchemaOnly(tool, requestedToolId) {
|
|
1460
|
-
if (
|
|
1531
|
+
if (_chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool)) {
|
|
1461
1532
|
printMonitorTypeFilters(tool);
|
|
1462
1533
|
printMonitorTypeStreams(tool);
|
|
1463
1534
|
return;
|
|
1464
1535
|
}
|
|
1465
|
-
const contract =
|
|
1536
|
+
const contract = _chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1466
1537
|
tool,
|
|
1467
1538
|
requestedToolId,
|
|
1468
1539
|
void 0,
|
|
1469
1540
|
seedToolListScript
|
|
1470
1541
|
);
|
|
1471
|
-
const inputFields =
|
|
1472
|
-
|
|
1542
|
+
const inputFields = _chunkAD47BXN2js.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1543
|
+
_chunkAD47BXN2js.recordField.call(void 0, contract, "inputSchema")
|
|
1473
1544
|
);
|
|
1474
1545
|
console.log(`Schema: ${contract.toolId}`);
|
|
1475
1546
|
if (!inputFields.length) {
|
|
@@ -1496,27 +1567,27 @@ function printToolSchemaOnly(tool, requestedToolId) {
|
|
|
1496
1567
|
}
|
|
1497
1568
|
printToolOutputArrayShape(contract);
|
|
1498
1569
|
const declaredSchema = declaredToolJsonSchema(
|
|
1499
|
-
|
|
1570
|
+
_chunkAD47BXN2js.recordField.call(void 0, contract, "inputSchema")
|
|
1500
1571
|
);
|
|
1501
1572
|
if (declaredSchema) {
|
|
1502
1573
|
console.log("Declared input JSON Schema:");
|
|
1503
1574
|
console.log(JSON.stringify(declaredSchema, null, 2));
|
|
1504
1575
|
}
|
|
1505
|
-
if (
|
|
1576
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, contract.responseSchema)) {
|
|
1506
1577
|
console.log("Deepline execution response JSON Schema:");
|
|
1507
1578
|
console.log(JSON.stringify(contract.responseSchema, null, 2));
|
|
1508
1579
|
}
|
|
1509
1580
|
}
|
|
1510
1581
|
function printToolExamplesOnly(tool, requestedToolId) {
|
|
1511
|
-
if (
|
|
1582
|
+
if (_chunkAD47BXN2js.isMonitorTypeTool.call(void 0, tool)) {
|
|
1512
1583
|
printMonitorTypeDeploy(tool);
|
|
1513
1584
|
return;
|
|
1514
1585
|
}
|
|
1515
|
-
if (
|
|
1586
|
+
if (_chunkAD47BXN2js.isPlayLikeTool.call(void 0, tool)) {
|
|
1516
1587
|
printPlayLikeToolUsage(tool, requestedToolId);
|
|
1517
1588
|
return;
|
|
1518
1589
|
}
|
|
1519
|
-
const contract =
|
|
1590
|
+
const contract = _chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1520
1591
|
tool,
|
|
1521
1592
|
requestedToolId,
|
|
1522
1593
|
void 0,
|
|
@@ -1524,9 +1595,9 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1524
1595
|
);
|
|
1525
1596
|
const toolId = String(contract.toolId);
|
|
1526
1597
|
const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
|
|
1527
|
-
const examples =
|
|
1598
|
+
const examples = _chunkAD47BXN2js.arrayField.call(void 0, tool, "examples").filter(_chunkAD47BXN2js.isRecord);
|
|
1528
1599
|
const firstExample = examples[0];
|
|
1529
|
-
const sampleInput = firstExample &&
|
|
1600
|
+
const sampleInput = firstExample && _chunkAD47BXN2js.isRecord.call(void 0, firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(_chunkAD47BXN2js.recordField.call(void 0, tool, "samples"), "request"), () => ( _chunkAD47BXN2js.samplePayloadForInputFields.call(void 0, inputFields)));
|
|
1530
1601
|
console.log("Example input payload:");
|
|
1531
1602
|
console.log(JSON.stringify(sampleInput, null, 2));
|
|
1532
1603
|
console.log(`Use in a play:`);
|
|
@@ -1540,32 +1611,32 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1540
1611
|
);
|
|
1541
1612
|
console.log("});");
|
|
1542
1613
|
console.log("const response = result.toolResponse.rawV2;");
|
|
1543
|
-
const getters =
|
|
1614
|
+
const getters = _chunkAD47BXN2js.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1544
1615
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1545
1616
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1546
|
-
const firstGetter = valueGetters.find(
|
|
1617
|
+
const firstGetter = valueGetters.find(_chunkAD47BXN2js.isRecord);
|
|
1547
1618
|
if (firstGetter) {
|
|
1548
|
-
const name =
|
|
1549
|
-
const expression =
|
|
1619
|
+
const name = _chunkAD47BXN2js.stringField.call(void 0, firstGetter, "name") || "value";
|
|
1620
|
+
const expression = _chunkAD47BXN2js.stringField.call(void 0, firstGetter, "expression");
|
|
1550
1621
|
if (expression)
|
|
1551
1622
|
console.log(
|
|
1552
1623
|
`const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
|
|
1553
1624
|
);
|
|
1554
1625
|
}
|
|
1555
1626
|
const arrayNames = new Set(
|
|
1556
|
-
|
|
1557
|
-
|
|
1627
|
+
_chunkAD47BXN2js.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1628
|
+
_chunkAD47BXN2js.recordField.call(void 0, tool, "outputSchema", "output_schema")
|
|
1558
1629
|
).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
|
|
1559
1630
|
);
|
|
1560
1631
|
const firstList = _nullishCoalesce(listGetters.find(
|
|
1561
|
-
(entry) =>
|
|
1562
|
-
), () => ( listGetters.find(
|
|
1563
|
-
if (
|
|
1564
|
-
const name = safeIdentifier(
|
|
1565
|
-
if (
|
|
1566
|
-
console.log(`const ${name}_rows = ${
|
|
1632
|
+
(entry) => _chunkAD47BXN2js.isRecord.call(void 0, entry) && arrayNames.has(_chunkAD47BXN2js.stringField.call(void 0, entry, "name"))
|
|
1633
|
+
), () => ( listGetters.find(_chunkAD47BXN2js.isRecord)));
|
|
1634
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, firstList)) {
|
|
1635
|
+
const name = safeIdentifier(_chunkAD47BXN2js.stringField.call(void 0, firstList, "name") || "list");
|
|
1636
|
+
if (_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1637
|
+
console.log(`const ${name}_rows = ${_chunkAD47BXN2js.playResultExpression.call(void 0, firstList)};`);
|
|
1567
1638
|
} else {
|
|
1568
|
-
console.log(`const ${name}_ds = ${
|
|
1639
|
+
console.log(`const ${name}_ds = ${_chunkAD47BXN2js.playResultExpression.call(void 0, firstList)};`);
|
|
1569
1640
|
console.log(
|
|
1570
1641
|
"// Complete small list from this response; throws above the memory cap."
|
|
1571
1642
|
);
|
|
@@ -1575,7 +1646,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1575
1646
|
console.log("```");
|
|
1576
1647
|
if (firstList) printListGetterConsumption();
|
|
1577
1648
|
for (const example of examples) {
|
|
1578
|
-
const description =
|
|
1649
|
+
const description = _chunkAD47BXN2js.stringField.call(void 0, example, "description");
|
|
1579
1650
|
if (description) console.log(description);
|
|
1580
1651
|
console.log("Example Deepline execution response:");
|
|
1581
1652
|
console.log(JSON.stringify(example.response, null, 2));
|
|
@@ -1590,14 +1661,14 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1590
1661
|
}
|
|
1591
1662
|
function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
1592
1663
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1593
|
-
const inputFields =
|
|
1594
|
-
|
|
1664
|
+
const inputFields = _chunkAD47BXN2js.toolInputFieldsForDisplay.call(void 0,
|
|
1665
|
+
_chunkAD47BXN2js.recordField.call(void 0, tool, "inputSchema", "input_schema")
|
|
1595
1666
|
);
|
|
1596
|
-
const sampleInput =
|
|
1597
|
-
const playReference =
|
|
1667
|
+
const sampleInput = _chunkAD47BXN2js.samplePayloadForInputFields.call(void 0, inputFields);
|
|
1668
|
+
const playReference = _chunkAD47BXN2js.playReferenceForTool.call(void 0, tool);
|
|
1598
1669
|
console.log("Run as a play:");
|
|
1599
1670
|
console.log(
|
|
1600
|
-
|
|
1671
|
+
_chunkAD47BXN2js.playRunCommandForTool.call(void 0,
|
|
1601
1672
|
tool,
|
|
1602
1673
|
toolId,
|
|
1603
1674
|
Object.keys(sampleInput).length ? sampleInput : void 0
|
|
@@ -1608,13 +1679,13 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
|
1608
1679
|
}
|
|
1609
1680
|
}
|
|
1610
1681
|
function printToolGettersOnly(tool, requestedToolId) {
|
|
1611
|
-
const contract =
|
|
1682
|
+
const contract = _chunkAD47BXN2js.toolContractJsonForDescribe.call(void 0,
|
|
1612
1683
|
tool,
|
|
1613
1684
|
requestedToolId,
|
|
1614
1685
|
void 0,
|
|
1615
1686
|
seedToolListScript
|
|
1616
1687
|
);
|
|
1617
|
-
const getters =
|
|
1688
|
+
const getters = _chunkAD47BXN2js.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1618
1689
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1619
1690
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1620
1691
|
console.log(`Getters: ${contract.toolId}`);
|
|
@@ -1625,9 +1696,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1625
1696
|
if (listGetters.length) {
|
|
1626
1697
|
console.log(listGetterHeading());
|
|
1627
1698
|
for (const entry of listGetters) {
|
|
1628
|
-
if (
|
|
1699
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, entry))
|
|
1629
1700
|
console.log(
|
|
1630
|
-
`- ${
|
|
1701
|
+
`- ${_chunkAD47BXN2js.stringField.call(void 0, entry, "name")}: ${_chunkAD47BXN2js.playResultExpression.call(void 0, entry)}`
|
|
1631
1702
|
);
|
|
1632
1703
|
}
|
|
1633
1704
|
printListGetterConsumption();
|
|
@@ -1635,15 +1706,15 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1635
1706
|
if (valueGetters.length) {
|
|
1636
1707
|
console.log("Values:");
|
|
1637
1708
|
for (const entry of valueGetters) {
|
|
1638
|
-
if (
|
|
1709
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, entry))
|
|
1639
1710
|
console.log(
|
|
1640
|
-
`- ${
|
|
1711
|
+
`- ${_chunkAD47BXN2js.stringField.call(void 0, entry, "name")}: ${_chunkAD47BXN2js.playResultExpression.call(void 0, entry)}`
|
|
1641
1712
|
);
|
|
1642
1713
|
}
|
|
1643
1714
|
}
|
|
1644
1715
|
}
|
|
1645
1716
|
function printListGetterConsumption() {
|
|
1646
|
-
if (
|
|
1717
|
+
if (_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1647
1718
|
console.log(
|
|
1648
1719
|
"Use the ordinary array directly, or pass it to ctx.dataset to persist row work. No provider pagination is fetched. Lazy or incomplete lists throw; use readList for an explicit dataset read. A missing getter is not an empty list."
|
|
1649
1720
|
);
|
|
@@ -1654,7 +1725,7 @@ function printListGetterConsumption() {
|
|
|
1654
1725
|
);
|
|
1655
1726
|
}
|
|
1656
1727
|
function listGetterHeading() {
|
|
1657
|
-
return
|
|
1728
|
+
return _chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array" ? "Lists (ordinary JavaScript arrays):" : "Lists (PlayDataset, not a JavaScript array):";
|
|
1658
1729
|
}
|
|
1659
1730
|
function stableStepIdForTool(toolId) {
|
|
1660
1731
|
return toolId.replace(/^[a-z0-9]+_/, "").replace(/[^a-z0-9_]+/gi, "_") || "tool_call";
|
|
@@ -1675,22 +1746,22 @@ function listedToolDescription(tool) {
|
|
|
1675
1746
|
}
|
|
1676
1747
|
function formatListedToolCost(tool) {
|
|
1677
1748
|
const record = tool;
|
|
1678
|
-
if (
|
|
1749
|
+
if (_chunkAD47BXN2js.stringField.call(void 0, record, "billingSource", "billing_source") === "free") {
|
|
1679
1750
|
return "Cost: Free";
|
|
1680
1751
|
}
|
|
1681
|
-
const pricing =
|
|
1682
|
-
const displayText =
|
|
1752
|
+
const pricing = _chunkAD47BXN2js.recordField.call(void 0, record, "pricing");
|
|
1753
|
+
const displayText = _chunkAD47BXN2js.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
1683
1754
|
return displayText ? `Cost: ${displayText}` : "";
|
|
1684
1755
|
}
|
|
1685
1756
|
function printToolOutputArrayShape(tool) {
|
|
1686
|
-
const outputFields =
|
|
1687
|
-
|
|
1757
|
+
const outputFields = _chunkAD47BXN2js.toolOutputFieldsForDisplay.call(void 0,
|
|
1758
|
+
_chunkAD47BXN2js.recordField.call(void 0, _chunkAD47BXN2js.isRecord.call(void 0, tool) ? tool : {}, "outputSchema", "output_schema")
|
|
1688
1759
|
);
|
|
1689
1760
|
if (outputFields.length === 0) return;
|
|
1690
1761
|
console.log(" Output array shape (declared schema):");
|
|
1691
1762
|
for (const field of outputFields.slice(0, 60)) {
|
|
1692
1763
|
const name = String(field.name);
|
|
1693
|
-
const type =
|
|
1764
|
+
const type = _chunkAD47BXN2js.stringField.call(void 0, field, "type") || "unknown";
|
|
1694
1765
|
const itemBounds = arrayItemBoundsSuffix(field);
|
|
1695
1766
|
console.log(` - ${name}: ${type}${itemBounds}`);
|
|
1696
1767
|
}
|
|
@@ -1699,14 +1770,14 @@ function printToolOutputArrayShape(tool) {
|
|
|
1699
1770
|
}
|
|
1700
1771
|
}
|
|
1701
1772
|
function declaredToolJsonSchema(inputSchema) {
|
|
1702
|
-
if (
|
|
1773
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, inputSchema.jsonSchema)) {
|
|
1703
1774
|
return inputSchema.jsonSchema;
|
|
1704
1775
|
}
|
|
1705
1776
|
return Array.isArray(inputSchema.fields) ? null : inputSchema;
|
|
1706
1777
|
}
|
|
1707
1778
|
function arrayItemBoundsSuffix(field) {
|
|
1708
|
-
const itemSchema =
|
|
1709
|
-
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type :
|
|
1779
|
+
const itemSchema = _chunkAD47BXN2js.isRecord.call(void 0, field.items) ? field.items : null;
|
|
1780
|
+
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : _chunkAD47BXN2js.isRecord.call(void 0, itemSchema.properties) ? "object" : "unknown" : null;
|
|
1710
1781
|
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _14 => _14.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
|
|
1711
1782
|
const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
|
|
1712
1783
|
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
@@ -1719,21 +1790,21 @@ function arrayItemBoundsSuffix(field) {
|
|
|
1719
1790
|
return itemTypeSuffix;
|
|
1720
1791
|
}
|
|
1721
1792
|
function printToolExecutionHints(value) {
|
|
1722
|
-
const batchCapabilityRecord =
|
|
1723
|
-
|
|
1793
|
+
const batchCapabilityRecord = _chunkAD47BXN2js.recordField.call(void 0,
|
|
1794
|
+
_chunkAD47BXN2js.isRecord.call(void 0, value) ? value : {},
|
|
1724
1795
|
"batchCapability",
|
|
1725
1796
|
"batch_capability"
|
|
1726
1797
|
);
|
|
1727
1798
|
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
1728
|
-
const executionMetadata =
|
|
1729
|
-
|
|
1799
|
+
const executionMetadata = _chunkAD47BXN2js.recordField.call(void 0,
|
|
1800
|
+
_chunkAD47BXN2js.isRecord.call(void 0, value) ? value : {},
|
|
1730
1801
|
"executionMetadata",
|
|
1731
1802
|
"execution_metadata"
|
|
1732
1803
|
);
|
|
1733
1804
|
if (batchCapability) {
|
|
1734
|
-
const status =
|
|
1735
|
-
const surface =
|
|
1736
|
-
const operation =
|
|
1805
|
+
const status = _chunkAD47BXN2js.stringField.call(void 0, batchCapability, "status") || "unknown";
|
|
1806
|
+
const surface = _chunkAD47BXN2js.stringField.call(void 0, batchCapability, "surface");
|
|
1807
|
+
const operation = _chunkAD47BXN2js.stringField.call(void 0,
|
|
1737
1808
|
batchCapability,
|
|
1738
1809
|
"batchOperation",
|
|
1739
1810
|
"batch_operation"
|
|
@@ -1743,7 +1814,7 @@ function printToolExecutionHints(value) {
|
|
|
1743
1814
|
"maxBatchSize",
|
|
1744
1815
|
"max_batch_size"
|
|
1745
1816
|
);
|
|
1746
|
-
const notes =
|
|
1817
|
+
const notes = _chunkAD47BXN2js.stringField.call(void 0, batchCapability, "notes");
|
|
1747
1818
|
console.log("");
|
|
1748
1819
|
console.log("Batching:");
|
|
1749
1820
|
console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
|
|
@@ -1762,11 +1833,11 @@ function printToolExecutionHints(value) {
|
|
|
1762
1833
|
}
|
|
1763
1834
|
if (notes) console.log(`- Details: ${notes}`);
|
|
1764
1835
|
}
|
|
1765
|
-
const configuredRateLimits =
|
|
1836
|
+
const configuredRateLimits = _chunkAD47BXN2js.arrayField.call(void 0,
|
|
1766
1837
|
executionMetadata,
|
|
1767
1838
|
"configuredRateLimits",
|
|
1768
1839
|
"configured_rate_limits"
|
|
1769
|
-
).filter(
|
|
1840
|
+
).filter(_chunkAD47BXN2js.isRecord);
|
|
1770
1841
|
if (configuredRateLimits.length > 0) {
|
|
1771
1842
|
console.log("");
|
|
1772
1843
|
console.log(
|
|
@@ -1776,7 +1847,7 @@ function printToolExecutionHints(value) {
|
|
|
1776
1847
|
const requests = numberField(limit, "requestsPerWindow");
|
|
1777
1848
|
const windowMs = numberField(limit, "windowMs");
|
|
1778
1849
|
if (requests === null || windowMs === null) continue;
|
|
1779
|
-
const usage =
|
|
1850
|
+
const usage = _chunkAD47BXN2js.stringField.call(void 0, limit, "usage") || "unknown";
|
|
1780
1851
|
const usageText = usage === "queue_hint" ? "queue hint" : usage === "enforced" ? "Deepline enforced" : usage === "queue_hint_and_enforced" ? "queue hint and Deepline enforced" : usage === "disabled" ? "disabled" : usage;
|
|
1781
1852
|
const explicitMaxConcurrency = numberField(
|
|
1782
1853
|
limit,
|
|
@@ -1789,7 +1860,7 @@ function printToolExecutionHints(value) {
|
|
|
1789
1860
|
);
|
|
1790
1861
|
}
|
|
1791
1862
|
}
|
|
1792
|
-
const queueHint =
|
|
1863
|
+
const queueHint = _chunkAD47BXN2js.recordField.call(void 0, executionMetadata, "queueHint", "queue_hint");
|
|
1793
1864
|
const requestsPerSecondHint = numberField(
|
|
1794
1865
|
queueHint,
|
|
1795
1866
|
"requestsPerSecondHint",
|
|
@@ -1814,25 +1885,25 @@ function formatRateWindow(windowMs) {
|
|
|
1814
1885
|
}
|
|
1815
1886
|
function samplePayload(samples, key) {
|
|
1816
1887
|
const entry = samples[key];
|
|
1817
|
-
if (!
|
|
1888
|
+
if (!_chunkAD47BXN2js.isRecord.call(void 0, entry)) return void 0;
|
|
1818
1889
|
return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
|
|
1819
1890
|
}
|
|
1820
1891
|
function commandEnvelopeFromRawResponse(rawResponse) {
|
|
1821
|
-
return
|
|
1892
|
+
return _chunkAD47BXN2js.isRecord.call(void 0, rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
|
|
1822
1893
|
}
|
|
1823
1894
|
function toolExecuteExitCode(envelope) {
|
|
1824
1895
|
return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
|
|
1825
1896
|
}
|
|
1826
1897
|
function extractToolExecutionWarningMessages(rawResponse) {
|
|
1827
|
-
if (!
|
|
1898
|
+
if (!_chunkAD47BXN2js.isRecord.call(void 0, rawResponse)) return [];
|
|
1828
1899
|
const candidates = [
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1900
|
+
_chunkAD47BXN2js.recordField.call(void 0, _chunkAD47BXN2js.recordField.call(void 0, rawResponse, "toolResponse"), "meta"),
|
|
1901
|
+
_chunkAD47BXN2js.recordField.call(void 0,
|
|
1902
|
+
_chunkAD47BXN2js.recordField.call(void 0, _chunkAD47BXN2js.recordField.call(void 0, rawResponse, "toolResponse"), "raw"),
|
|
1832
1903
|
"meta"
|
|
1833
1904
|
),
|
|
1834
|
-
|
|
1835
|
-
|
|
1905
|
+
_chunkAD47BXN2js.recordField.call(void 0, rawResponse, "meta"),
|
|
1906
|
+
_chunkAD47BXN2js.recordField.call(void 0, _chunkAD47BXN2js.recordField.call(void 0, rawResponse, "result"), "meta")
|
|
1836
1907
|
];
|
|
1837
1908
|
const messages = [];
|
|
1838
1909
|
for (const candidate of candidates) {
|
|
@@ -1841,8 +1912,8 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1841
1912
|
for (const warning of warnings) {
|
|
1842
1913
|
if (typeof warning === "string" && warning.trim()) {
|
|
1843
1914
|
messages.push(warning.trim());
|
|
1844
|
-
} else if (
|
|
1845
|
-
const message =
|
|
1915
|
+
} else if (_chunkAD47BXN2js.isRecord.call(void 0, warning)) {
|
|
1916
|
+
const message = _chunkAD47BXN2js.stringField.call(void 0, warning, "message");
|
|
1846
1917
|
if (message) messages.push(message);
|
|
1847
1918
|
}
|
|
1848
1919
|
}
|
|
@@ -1850,20 +1921,20 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1850
1921
|
return [...new Set(messages)];
|
|
1851
1922
|
}
|
|
1852
1923
|
function apifySyncRecoveryNext(rawResponse) {
|
|
1853
|
-
if (!
|
|
1854
|
-
const toolResponse =
|
|
1855
|
-
const raw =
|
|
1924
|
+
if (!_chunkAD47BXN2js.isRecord.call(void 0, rawResponse) || rawResponse.status !== "running") return null;
|
|
1925
|
+
const toolResponse = _chunkAD47BXN2js.recordField.call(void 0, rawResponse, "toolResponse");
|
|
1926
|
+
const raw = _chunkAD47BXN2js.recordField.call(void 0, toolResponse, "raw");
|
|
1856
1927
|
if (raw.state !== "awaiting_apify") return null;
|
|
1857
|
-
const next =
|
|
1858
|
-
const getActorRun =
|
|
1859
|
-
const getActorRunTool =
|
|
1860
|
-
const getActorRunPayload =
|
|
1928
|
+
const next = _chunkAD47BXN2js.recordField.call(void 0, raw, "next");
|
|
1929
|
+
const getActorRun = _chunkAD47BXN2js.recordField.call(void 0, next, "getActorRun");
|
|
1930
|
+
const getActorRunTool = _chunkAD47BXN2js.stringField.call(void 0, getActorRun, "tool");
|
|
1931
|
+
const getActorRunPayload = _chunkAD47BXN2js.recordField.call(void 0, getActorRun, "payload");
|
|
1861
1932
|
if (!getActorRunTool || Object.keys(getActorRunPayload).length === 0) {
|
|
1862
1933
|
return null;
|
|
1863
1934
|
}
|
|
1864
|
-
const getDatasetItems =
|
|
1865
|
-
const getDatasetItemsTool =
|
|
1866
|
-
const getDatasetItemsPayload =
|
|
1935
|
+
const getDatasetItems = _chunkAD47BXN2js.recordField.call(void 0, next, "getDatasetItems");
|
|
1936
|
+
const getDatasetItemsTool = _chunkAD47BXN2js.stringField.call(void 0, getDatasetItems, "tool");
|
|
1937
|
+
const getDatasetItemsPayload = _chunkAD47BXN2js.recordField.call(void 0, getDatasetItems, "payload");
|
|
1867
1938
|
return {
|
|
1868
1939
|
getActorRun: `deepline tools execute ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))}`,
|
|
1869
1940
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
@@ -1873,7 +1944,7 @@ function apifySyncRecoveryNext(rawResponse) {
|
|
|
1873
1944
|
}
|
|
1874
1945
|
function listExtractorPathsFromUsageGuidance(tool) {
|
|
1875
1946
|
const toolExecutionResult = _optionalChain([tool, 'access', _16 => _16.usageGuidance, 'optionalAccess', _17 => _17.toolExecutionResult]);
|
|
1876
|
-
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists :
|
|
1947
|
+
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists : _chunkAD47BXN2js.isRecord.call(void 0, _optionalChain([toolExecutionResult, 'optionalAccess', _19 => _19.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
|
|
1877
1948
|
return extractedLists.flatMap((entry) => {
|
|
1878
1949
|
const paths = _nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.candidatePaths]), () => ( _optionalChain([entry, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.rawToolOutputPaths])));
|
|
1879
1950
|
if (!Array.isArray(paths)) return [];
|
|
@@ -1958,7 +2029,7 @@ function parseJsonObjectArgument(raw, flagName) {
|
|
|
1958
2029
|
}
|
|
1959
2030
|
throw invalidJsonError(flagName, message);
|
|
1960
2031
|
}
|
|
1961
|
-
if (!
|
|
2032
|
+
if (!_chunkAD47BXN2js.isRecord.call(void 0, parsed)) {
|
|
1962
2033
|
throw invalidJsonError(flagName, "expected an object.");
|
|
1963
2034
|
}
|
|
1964
2035
|
return parsed;
|
|
@@ -2002,7 +2073,7 @@ function parseExecuteOptions(toolId, options, output) {
|
|
|
2002
2073
|
outputFormat = normalizeOutputFormat(options.outputFormat);
|
|
2003
2074
|
}
|
|
2004
2075
|
if (options.idempotencyKey !== void 0) {
|
|
2005
|
-
|
|
2076
|
+
_chunk63S7X326js.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
|
|
2006
2077
|
}
|
|
2007
2078
|
if (options.recoveryTimeoutMs !== void 0) {
|
|
2008
2079
|
const parsed = Number(options.recoveryTimeoutMs);
|
|
@@ -2076,8 +2147,8 @@ export default definePlay(${JSON.stringify(playName)}, async (ctx) => {
|
|
|
2076
2147
|
const rows = list.get();
|
|
2077
2148
|
// ${sampleRows}
|
|
2078
2149
|
// columns: ${columns}
|
|
2079
|
-
// ${
|
|
2080
|
-
// ${
|
|
2150
|
+
// ${_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array" ? "extractedLists.<name>.get() returns an ordinary array from this response." : "extractedLists.<name>.get() returns a dataset handle for row-shaped list outputs."}
|
|
2151
|
+
// ${_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array" ? "Use array methods directly; pass rows to ctx.dataset to persist row work." : "Pass it to ctx.dataset; use rows.peek/count/materialize only for deliberate bounded inspection."}
|
|
2081
2152
|
// .withColumn('email_waterfall', (row, rowCtx) => rowCtx.runPlay('name_domain_email', 'name-and-domain-to-email', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), domain: String(row.domain ?? '') }, { description: 'Resolve email.' }))
|
|
2082
2153
|
// .withColumn('phone_waterfall', (row, rowCtx) => rowCtx.runPlay('contact_phone', 'contact-to-phone', { first_name: String(row.first_name ?? ''), last_name: String(row.last_name ?? ''), email: String(row.email ?? '') }, { description: 'Resolve phone.' }))
|
|
2083
2154
|
// ctx.dataset is idempotent for completed rows during same-run recovery. New runs follow each call's freshness.
|
|
@@ -2130,7 +2201,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2130
2201
|
kind: summaryEntries.length > 0 ? "object" : "raw",
|
|
2131
2202
|
summary: input.summary
|
|
2132
2203
|
};
|
|
2133
|
-
const envelopeHasCanonicalOutput =
|
|
2204
|
+
const envelopeHasCanonicalOutput = _chunkAD47BXN2js.isRecord.call(void 0, envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
|
|
2134
2205
|
const envelopeHasDeclaredOutput = Object.prototype.hasOwnProperty.call(
|
|
2135
2206
|
envelope,
|
|
2136
2207
|
"output"
|
|
@@ -2158,7 +2229,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2158
2229
|
return {
|
|
2159
2230
|
...envelope,
|
|
2160
2231
|
...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
|
|
2161
|
-
...
|
|
2232
|
+
..._chunkAD47BXN2js.isRecord.call(void 0, input.rawResponse) && _chunkAD47BXN2js.isRecord.call(void 0, input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
|
|
2162
2233
|
...envelopeHasCanonicalOutput || envelopeHasDeclaredOutput ? { output_preview: outputPreview } : { output: outputPreview },
|
|
2163
2234
|
...summaryEntries.length > 0 ? { summary: input.summary } : {},
|
|
2164
2235
|
...warningMessages.length > 0 ? { warnings: warningMessages } : {},
|
|
@@ -2219,7 +2290,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2219
2290
|
void _render;
|
|
2220
2291
|
void _next;
|
|
2221
2292
|
void _local;
|
|
2222
|
-
const billingLookup =
|
|
2293
|
+
const billingLookup = _chunkAD47BXN2js.isRecord.call(void 0, input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
|
|
2223
2294
|
const inspection = toolExecutionInspection(input);
|
|
2224
2295
|
return {
|
|
2225
2296
|
...base,
|
|
@@ -2300,76 +2371,117 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2300
2371
|
}
|
|
2301
2372
|
};
|
|
2302
2373
|
}
|
|
2303
|
-
|
|
2374
|
+
function printToolExecutionWarnings(toolId, params, metadata) {
|
|
2375
|
+
if (_optionalChain([metadata, 'access', _24 => _24.deprecation, 'optionalAccess', _25 => _25.message])) {
|
|
2376
|
+
console.error(
|
|
2377
|
+
`Warning: ${toolId} is deprecated. ${metadata.deprecation.message}`
|
|
2378
|
+
);
|
|
2379
|
+
}
|
|
2380
|
+
const requestWarning = firstMatchingToolRequestWarning(
|
|
2381
|
+
metadata.requestWarnings,
|
|
2382
|
+
params
|
|
2383
|
+
);
|
|
2384
|
+
if (requestWarning) {
|
|
2385
|
+
console.error(`Warning: ${requestWarning.message}`);
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
async function executeTool(toolId, options, compatibilityMetadata, deferCompatibility = false, maintenancePolicy = "configured") {
|
|
2304
2389
|
const output = toolExecuteJsonOption(options.json);
|
|
2305
|
-
const wantsJson =
|
|
2390
|
+
const wantsJson = (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
|
|
2306
2391
|
let parsed;
|
|
2307
2392
|
try {
|
|
2308
2393
|
parsed = parseExecuteOptions(toolId, options, output);
|
|
2309
2394
|
} catch (error) {
|
|
2310
2395
|
if (wantsJson) {
|
|
2311
|
-
|
|
2396
|
+
_chunkNF4V5DTYjs.printJsonError.call(void 0, error);
|
|
2312
2397
|
} else {
|
|
2313
2398
|
console.error(error instanceof Error ? error.message : String(error));
|
|
2314
2399
|
}
|
|
2315
|
-
return error instanceof
|
|
2400
|
+
return error instanceof _chunkPPDBRJRWjs.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
|
|
2401
|
+
}
|
|
2402
|
+
const cliInvocationId = _nullishCoalesce(_chunk5TUGWDEBjs.getToolExecuteInvocationId.call(void 0, ), () => ( _chunk5TUGWDEBjs.beginToolExecuteCommand.call(void 0, )));
|
|
2403
|
+
const deferredCompatibility = deferCompatibility ? beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) : void 0;
|
|
2404
|
+
const tracing = _chunkOBB4QXHAjs.isCliTraceEnabled.call(void 0, );
|
|
2405
|
+
const clientStartedAt = tracing ? performance.now() : void 0;
|
|
2406
|
+
const client = new (0, _chunk63S7X326js.DeeplineClient)();
|
|
2407
|
+
if (clientStartedAt !== void 0) {
|
|
2408
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
|
|
2409
|
+
phase: "cli.tool_execute_client_setup",
|
|
2410
|
+
ms: performance.now() - clientStartedAt
|
|
2411
|
+
});
|
|
2316
2412
|
}
|
|
2317
|
-
|
|
2318
|
-
const
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
);
|
|
2325
|
-
} catch (error) {
|
|
2326
|
-
if (isMissingToolMetadataError(error)) {
|
|
2327
|
-
const play = await _chunkHQY2SG3Kjs.runToolExecuteStage.call(void 0,
|
|
2328
|
-
"play alias lookup",
|
|
2329
|
-
() => findPlayForToolId(client, parsed.toolId, cliInvocationId)
|
|
2413
|
+
let metadata = compatibilityMetadata;
|
|
2414
|
+
const readMetadata = async () => {
|
|
2415
|
+
if (metadata) return metadata;
|
|
2416
|
+
try {
|
|
2417
|
+
metadata = await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2418
|
+
"tool metadata lookup",
|
|
2419
|
+
() => client.getTool(parsed.toolId, { cliInvocationId })
|
|
2330
2420
|
);
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2421
|
+
} catch (error) {
|
|
2422
|
+
if (isMissingToolMetadataError(error)) {
|
|
2423
|
+
const play = await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2424
|
+
"play alias lookup",
|
|
2425
|
+
() => findPlayForToolId(client, parsed.toolId, cliInvocationId)
|
|
2426
|
+
);
|
|
2427
|
+
if (play) {
|
|
2428
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
2429
|
+
playAliasToolErrorMessage(parsed.toolId, play),
|
|
2430
|
+
400,
|
|
2431
|
+
"PLAY_ALIAS_USED_AS_TOOL"
|
|
2335
2432
|
);
|
|
2336
|
-
} else {
|
|
2337
|
-
printPlayAliasToolError(parsed.toolId, play);
|
|
2338
2433
|
}
|
|
2339
|
-
return 2;
|
|
2340
2434
|
}
|
|
2435
|
+
throw error;
|
|
2341
2436
|
}
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
metadata
|
|
2351
|
-
)
|
|
2352
|
-
)
|
|
2353
|
-
);
|
|
2354
|
-
} else {
|
|
2355
|
-
printPlayLikeToolExecuteError(
|
|
2356
|
-
parsed.toolId,
|
|
2357
|
-
metadata
|
|
2437
|
+
if (_chunkAD47BXN2js.isPlayLikeTool.call(void 0, metadata)) {
|
|
2438
|
+
throw new (0, _chunkPPDBRJRWjs.DeeplineError)(
|
|
2439
|
+
playLikeToolExecuteErrorMessage(
|
|
2440
|
+
parsed.toolId,
|
|
2441
|
+
metadata
|
|
2442
|
+
),
|
|
2443
|
+
400,
|
|
2444
|
+
"PLAY_ALIAS_USED_AS_TOOL"
|
|
2358
2445
|
);
|
|
2359
2446
|
}
|
|
2360
|
-
return
|
|
2361
|
-
}
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2447
|
+
return metadata;
|
|
2448
|
+
};
|
|
2449
|
+
let executionWarningsPrinted = false;
|
|
2450
|
+
if (deferredCompatibility) {
|
|
2451
|
+
let preflightCompatibility;
|
|
2452
|
+
try {
|
|
2453
|
+
preflightCompatibility = await deferredCompatibility.result;
|
|
2454
|
+
} catch (e3) {
|
|
2455
|
+
}
|
|
2456
|
+
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2457
|
+
if (!metadata && _optionalChain([preflightCompatibility, 'optionalAccess', _26 => _26.response, 'optionalAccess', _27 => _27.update_required]) !== true) {
|
|
2458
|
+
try {
|
|
2459
|
+
metadata = await readMetadata();
|
|
2460
|
+
} catch (error) {
|
|
2461
|
+
if (error instanceof _chunkPPDBRJRWjs.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2462
|
+
if (wantsJson) _chunkNF4V5DTYjs.printJsonError.call(void 0, error);
|
|
2463
|
+
else console.error(error.message);
|
|
2464
|
+
return 2;
|
|
2465
|
+
}
|
|
2466
|
+
throw error;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
if (metadata) {
|
|
2470
|
+
printToolExecutionWarnings(parsed.toolId, parsed.params, metadata);
|
|
2471
|
+
executionWarningsPrinted = true;
|
|
2472
|
+
}
|
|
2473
|
+
} else {
|
|
2474
|
+
try {
|
|
2475
|
+
metadata = await readMetadata();
|
|
2476
|
+
} catch (error) {
|
|
2477
|
+
if (error instanceof _chunkPPDBRJRWjs.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2478
|
+
if (wantsJson) _chunkNF4V5DTYjs.printJsonError.call(void 0, error);
|
|
2479
|
+
else console.error(error.message);
|
|
2480
|
+
return 2;
|
|
2481
|
+
}
|
|
2482
|
+
throw error;
|
|
2483
|
+
}
|
|
2484
|
+
printToolExecutionWarnings(parsed.toolId, parsed.params, metadata);
|
|
2373
2485
|
}
|
|
2374
2486
|
const responseIntent = parsed.outPath || parsed.outputFormat === "csv" || parsed.outputFormat === "csv_file" ? "row_artifact" : "raw";
|
|
2375
2487
|
const recovery = ToolCallRecovery.open({
|
|
@@ -2383,38 +2495,195 @@ async function executeTool(toolId, options) {
|
|
|
2383
2495
|
if (idempotencyKey) {
|
|
2384
2496
|
console.error(`Tool execution recovery key: ${idempotencyKey}`);
|
|
2385
2497
|
}
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2498
|
+
let submissionStartedAt = 0;
|
|
2499
|
+
const executeOptions = {
|
|
2500
|
+
...parsed.timeoutMs !== void 0 ? { timeout: parsed.timeoutMs } : {},
|
|
2501
|
+
responseIntent,
|
|
2502
|
+
...idempotencyKey ? { idempotencyKey } : {},
|
|
2503
|
+
...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
|
|
2504
|
+
searchRef: _chunkOZ6E3IRZjs.recentSearchRef.call(void 0, ),
|
|
2505
|
+
cliInvocationId,
|
|
2506
|
+
onResponseReceived: _chunk27GJKC5Qjs.recordApiResponse,
|
|
2507
|
+
...tracing ? {
|
|
2508
|
+
onServerTiming: (serverTiming) => _chunkOBB4QXHAjs.recordCliTrace.call(void 0, {
|
|
2509
|
+
phase: "tool_execute_server_timing",
|
|
2510
|
+
cliInvocationId,
|
|
2511
|
+
serverTiming,
|
|
2512
|
+
submissionToHeadersMs: performance.now() - submissionStartedAt
|
|
2513
|
+
})
|
|
2514
|
+
} : {}
|
|
2515
|
+
};
|
|
2516
|
+
let rawResponse;
|
|
2517
|
+
let successfulCompatibilityResponse;
|
|
2518
|
+
try {
|
|
2519
|
+
const executeResult = await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2520
|
+
"execute request",
|
|
2521
|
+
async () => {
|
|
2522
|
+
try {
|
|
2523
|
+
if (tracing) {
|
|
2524
|
+
submissionStartedAt = performance.now();
|
|
2525
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2526
|
+
}
|
|
2527
|
+
return await client.executeTool(parsed.toolId, parsed.params, {
|
|
2528
|
+
...executeOptions,
|
|
2529
|
+
atomicToolOnly: true
|
|
2530
|
+
});
|
|
2531
|
+
} catch (error) {
|
|
2532
|
+
if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError) || error.code !== "ATOMIC_TOOL_EXECUTE_UNSUPPORTED")
|
|
2533
|
+
throw error;
|
|
2534
|
+
const baseUrl = _chunkFVLNYDI4js.resolveConfig.call(void 0, ).baseUrl;
|
|
2535
|
+
if (maintenancePolicy !== "off") {
|
|
2536
|
+
_chunkLTFL4JRNjs.flushDeferredSkillsSyncNotices.call(void 0, baseUrl);
|
|
2537
|
+
}
|
|
2538
|
+
const compatibility = deferredCompatibility ? await deferredCompatibility.result : await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2539
|
+
"SDK compatibility",
|
|
2540
|
+
() => _chunkLTFL4JRNjs.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
2541
|
+
command: "tools execute",
|
|
2542
|
+
skillsVersion: _chunkFVLNYDI4js.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
2543
|
+
persistCache: maintenancePolicy !== "off"
|
|
2544
|
+
})
|
|
2405
2545
|
);
|
|
2546
|
+
if (compatibility.error) throw compatibility.error;
|
|
2547
|
+
metadata = _nullishCoalesce(_optionalChain([deferredCompatibility, 'optionalAccess', _28 => _28.readMetadata, 'call', _29 => _29()]), () => ( metadata));
|
|
2548
|
+
if (maintenancePolicy !== "off" && await _chunk5TUGWDEBjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2549
|
+
compatibility.response,
|
|
2550
|
+
baseUrl,
|
|
2551
|
+
maintenancePolicy
|
|
2552
|
+
)) {
|
|
2553
|
+
return void 0;
|
|
2554
|
+
}
|
|
2555
|
+
_chunkLTFL4JRNjs.enforceSdkCompatibilityResponse.call(void 0, compatibility.response, {
|
|
2556
|
+
quietAdvisory: wantsJson
|
|
2557
|
+
});
|
|
2558
|
+
if (maintenancePolicy !== "off") {
|
|
2559
|
+
await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2560
|
+
"agent skills sync",
|
|
2561
|
+
() => _chunkLTFL4JRNjs.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
|
|
2562
|
+
update: _optionalChain([compatibility, 'access', _30 => _30.response, 'optionalAccess', _31 => _31.skills]),
|
|
2563
|
+
mode: "detached"
|
|
2564
|
+
})
|
|
2565
|
+
);
|
|
2566
|
+
}
|
|
2567
|
+
const legacyMetadata = await readMetadata();
|
|
2568
|
+
if (tracing) {
|
|
2569
|
+
submissionStartedAt = performance.now();
|
|
2570
|
+
_chunkOBB4QXHAjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2571
|
+
}
|
|
2572
|
+
return client.executeTool(parsed.toolId, parsed.params, {
|
|
2573
|
+
...executeOptions,
|
|
2574
|
+
..._optionalChain([legacyMetadata, 'access', _32 => _32.executionMetadata, 'optionalAccess', _33 => _33.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {}
|
|
2575
|
+
});
|
|
2406
2576
|
}
|
|
2407
2577
|
}
|
|
2578
|
+
);
|
|
2579
|
+
if (executeResult === void 0) return 0;
|
|
2580
|
+
rawResponse = executeResult;
|
|
2581
|
+
} catch (error) {
|
|
2582
|
+
if (deferredCompatibility) {
|
|
2583
|
+
let compatibility;
|
|
2584
|
+
try {
|
|
2585
|
+
compatibility = await deferredCompatibility.result;
|
|
2586
|
+
} catch (e4) {
|
|
2587
|
+
}
|
|
2588
|
+
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2589
|
+
const updateRequiredBeforeExecution = error instanceof _chunkPPDBRJRWjs.DeeplineError && error.code === "SDK_UPDATE_REQUIRED";
|
|
2590
|
+
if (updateRequiredBeforeExecution && maintenancePolicy !== "off" && compatibility && !compatibility.error) {
|
|
2591
|
+
const baseUrl = _chunkFVLNYDI4js.resolveConfig.call(void 0, ).baseUrl;
|
|
2592
|
+
if (await _chunk5TUGWDEBjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2593
|
+
compatibility.response,
|
|
2594
|
+
baseUrl,
|
|
2595
|
+
maintenancePolicy
|
|
2596
|
+
)) {
|
|
2597
|
+
return 0;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
if (error instanceof _chunkPPDBRJRWjs.DeeplineError && error.code === "SDK_UPDATE_REQUIRED")
|
|
2408
2602
|
throw error;
|
|
2409
|
-
|
|
2603
|
+
let failure = error;
|
|
2604
|
+
try {
|
|
2605
|
+
await readMetadata();
|
|
2606
|
+
} catch (diagnosticError) {
|
|
2607
|
+
if (diagnosticError instanceof _chunkPPDBRJRWjs.DeeplineError && diagnosticError.code === "PLAY_ALIAS_USED_AS_TOOL")
|
|
2608
|
+
failure = diagnosticError;
|
|
2609
|
+
}
|
|
2610
|
+
if (failure instanceof _chunkPPDBRJRWjs.DeeplineError && failure.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2611
|
+
if (wantsJson) _chunkNF4V5DTYjs.printJsonError.call(void 0, failure);
|
|
2612
|
+
else console.error(failure.message);
|
|
2613
|
+
return 2;
|
|
2614
|
+
}
|
|
2615
|
+
const guidanceLines = toolGuidanceLines(_optionalChain([metadata, 'optionalAccess', _34 => _34.guidance]));
|
|
2616
|
+
if (guidanceLines.length > 0) {
|
|
2617
|
+
if (wantsJson && failure instanceof Error) {
|
|
2618
|
+
Object.assign(failure, { guidance: _optionalChain([metadata, 'optionalAccess', _35 => _35.guidance]) });
|
|
2619
|
+
} else {
|
|
2620
|
+
console.error(
|
|
2621
|
+
[`Guidance for ${parsed.toolId}:`, ...guidanceLines].join("\n")
|
|
2622
|
+
);
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
throw failure;
|
|
2626
|
+
}
|
|
2627
|
+
if (deferredCompatibility) {
|
|
2628
|
+
let compatibility;
|
|
2629
|
+
try {
|
|
2630
|
+
compatibility = await deferredCompatibility.result;
|
|
2631
|
+
} catch (e5) {
|
|
2632
|
+
}
|
|
2633
|
+
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2634
|
+
const compatibilityResponse = _optionalChain([compatibility, 'optionalAccess', _36 => _36.response]);
|
|
2635
|
+
successfulCompatibilityResponse = _nullishCoalesce(compatibilityResponse, () => ( void 0));
|
|
2636
|
+
const autoUpdate = _optionalChain([compatibilityResponse, 'optionalAccess', _37 => _37.auto_update]);
|
|
2637
|
+
if (maintenancePolicy !== "off" && compatibilityResponse && _optionalChain([autoUpdate, 'optionalAccess', _38 => _38.should_auto_update]) && !autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
|
|
2638
|
+
await _chunk5TUGWDEBjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2639
|
+
compatibilityResponse,
|
|
2640
|
+
_chunkFVLNYDI4js.resolveConfig.call(void 0, ).baseUrl,
|
|
2641
|
+
maintenancePolicy
|
|
2642
|
+
);
|
|
2643
|
+
}
|
|
2644
|
+
if (!metadata) {
|
|
2645
|
+
try {
|
|
2646
|
+
metadata = await readMetadata();
|
|
2647
|
+
} catch (e6) {
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
if (metadata && !executionWarningsPrinted) {
|
|
2651
|
+
printToolExecutionWarnings(parsed.toolId, parsed.params, metadata);
|
|
2652
|
+
} else if (!metadata) {
|
|
2653
|
+
console.error(
|
|
2654
|
+
`Warning: execution metadata for ${parsed.toolId} was unavailable; the result is unchanged.`
|
|
2655
|
+
);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
const responseMetadata = _chunkAD47BXN2js.recordField.call(void 0,
|
|
2659
|
+
_chunkAD47BXN2js.recordField.call(void 0, rawResponse, "_metadata"),
|
|
2660
|
+
"tool"
|
|
2410
2661
|
);
|
|
2411
|
-
const
|
|
2662
|
+
const listOutputPaths = responseMetadata.listOutputPaths;
|
|
2663
|
+
let listExtractorPaths;
|
|
2664
|
+
if (Array.isArray(listOutputPaths) && listOutputPaths.every((path) => typeof path === "string")) {
|
|
2665
|
+
listExtractorPaths = listOutputPaths;
|
|
2666
|
+
} else {
|
|
2667
|
+
listExtractorPaths = listExtractorPathsFromUsageGuidance(
|
|
2668
|
+
await readMetadata()
|
|
2669
|
+
);
|
|
2670
|
+
}
|
|
2671
|
+
if (_chunkAD47BXN2js.isRecord.call(void 0, rawResponse)) {
|
|
2672
|
+
const { _metadata, ...execution } = rawResponse;
|
|
2673
|
+
rawResponse = execution;
|
|
2674
|
+
}
|
|
2675
|
+
const { listConversion, summary, baseEnvelope } = await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2412
2676
|
"result formatting",
|
|
2413
|
-
() => {
|
|
2414
|
-
const listExtractorPaths = listExtractorPathsFromUsageGuidance(metadata);
|
|
2677
|
+
async () => {
|
|
2415
2678
|
const listConversion2 = _chunkHGFFYVXNjs.tryConvertToList.call(void 0, rawResponse, {
|
|
2416
2679
|
listExtractorPaths
|
|
2417
2680
|
});
|
|
2681
|
+
if (toolExecuteExitCode(commandEnvelopeFromRawResponse(rawResponse)) !== 0 || listExtractorPaths.length > 0 && !listConversion2) {
|
|
2682
|
+
try {
|
|
2683
|
+
await readMetadata();
|
|
2684
|
+
} catch (e7) {
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2418
2687
|
const summary2 = _chunkHGFFYVXNjs.extractSummaryFields.call(void 0, rawResponse);
|
|
2419
2688
|
const baseEnvelope2 = buildToolExecuteBaseEnvelope({
|
|
2420
2689
|
toolId: parsed.toolId,
|
|
@@ -2423,16 +2692,45 @@ async function executeTool(toolId, options) {
|
|
|
2423
2692
|
rawResponse,
|
|
2424
2693
|
listConversion: listConversion2,
|
|
2425
2694
|
summary: summary2,
|
|
2426
|
-
guidance: metadata.guidance,
|
|
2695
|
+
guidance: _optionalChain([metadata, 'optionalAccess', _39 => _39.guidance]),
|
|
2427
2696
|
listExpected: listExtractorPaths.length > 0
|
|
2428
2697
|
});
|
|
2429
2698
|
return { listConversion: listConversion2, summary: summary2, baseEnvelope: baseEnvelope2 };
|
|
2430
2699
|
}
|
|
2431
2700
|
);
|
|
2432
2701
|
const executeExitCode = toolExecuteExitCode(baseEnvelope);
|
|
2433
|
-
const
|
|
2702
|
+
const deliveredCompatibilityResponse = successfulCompatibilityResponse;
|
|
2703
|
+
let skillsSyncAttempted = false;
|
|
2704
|
+
const syncSkillsForDeliveredOutput = async () => {
|
|
2705
|
+
if (skillsSyncAttempted || maintenancePolicy === "off" || !deliveredCompatibilityResponse) {
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
skillsSyncAttempted = true;
|
|
2709
|
+
try {
|
|
2710
|
+
await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2711
|
+
"agent skills sync",
|
|
2712
|
+
() => _chunkLTFL4JRNjs.syncSdkSkillsIfNeeded.call(void 0, _chunkFVLNYDI4js.resolveConfig.call(void 0, ).baseUrl, {
|
|
2713
|
+
update: deliveredCompatibilityResponse.skills,
|
|
2714
|
+
mode: "detached"
|
|
2715
|
+
})
|
|
2716
|
+
);
|
|
2717
|
+
} catch (error) {
|
|
2718
|
+
console.error(
|
|
2719
|
+
`Warning: automatic skills sync failed; the tool result is unchanged. ${error instanceof Error ? error.message : String(error)}`
|
|
2720
|
+
);
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2723
|
+
const printDeliveredEnvelope = (envelope, options2 = {}) => _chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, envelope, {
|
|
2724
|
+
...options2,
|
|
2725
|
+
json: _nullishCoalesce(options2.json, () => ( wantsJson))
|
|
2726
|
+
});
|
|
2727
|
+
const printDeliveredJsonEnvelope = async (envelope, options2 = {}) => {
|
|
2728
|
+
await syncSkillsForDeliveredOutput();
|
|
2729
|
+
_chunkNF4V5DTYjs.printCommandEnvelope.call(void 0, envelope, { ...options2, json: true });
|
|
2730
|
+
};
|
|
2731
|
+
const delivered = await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0, "output delivery", async () => {
|
|
2434
2732
|
if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
|
|
2435
|
-
|
|
2733
|
+
await printDeliveredJsonEnvelope(baseEnvelope);
|
|
2436
2734
|
return true;
|
|
2437
2735
|
}
|
|
2438
2736
|
if (parsed.outputFormat === "json_file") {
|
|
@@ -2440,16 +2738,13 @@ async function executeTool(toolId, options) {
|
|
|
2440
2738
|
rawResponse,
|
|
2441
2739
|
`payload_${parsed.toolId}`
|
|
2442
2740
|
);
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
local: {
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
},
|
|
2451
|
-
{ json: true }
|
|
2452
|
-
);
|
|
2741
|
+
await printDeliveredJsonEnvelope({
|
|
2742
|
+
...baseEnvelope,
|
|
2743
|
+
local: {
|
|
2744
|
+
..._chunkAD47BXN2js.isRecord.call(void 0, baseEnvelope.local) ? baseEnvelope.local : {},
|
|
2745
|
+
payload_file: jsonPath
|
|
2746
|
+
}
|
|
2747
|
+
});
|
|
2453
2748
|
return true;
|
|
2454
2749
|
}
|
|
2455
2750
|
if (!listConversion) {
|
|
@@ -2462,7 +2757,7 @@ async function executeTool(toolId, options) {
|
|
|
2462
2757
|
`${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
|
|
2463
2758
|
);
|
|
2464
2759
|
if (wantsJson) {
|
|
2465
|
-
|
|
2760
|
+
_chunkNF4V5DTYjs.printJsonError.call(void 0, error);
|
|
2466
2761
|
} else {
|
|
2467
2762
|
console.error(error.message);
|
|
2468
2763
|
}
|
|
@@ -2473,18 +2768,20 @@ async function executeTool(toolId, options) {
|
|
|
2473
2768
|
rawResponse,
|
|
2474
2769
|
`payload_${parsed.toolId}`
|
|
2475
2770
|
);
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2771
|
+
const payloadEnvelope = {
|
|
2772
|
+
...baseEnvelope,
|
|
2773
|
+
local: {
|
|
2774
|
+
payload_file: jsonPath
|
|
2775
|
+
}
|
|
2776
|
+
};
|
|
2777
|
+
if (parsed.outputFormat === "csv_file" || wantsJson) {
|
|
2778
|
+
await printDeliveredJsonEnvelope(payloadEnvelope);
|
|
2779
|
+
} else {
|
|
2780
|
+
printDeliveredEnvelope(payloadEnvelope);
|
|
2781
|
+
}
|
|
2485
2782
|
return true;
|
|
2486
2783
|
}
|
|
2487
|
-
|
|
2784
|
+
await printDeliveredEnvelope(baseEnvelope, { json: false });
|
|
2488
2785
|
return true;
|
|
2489
2786
|
}
|
|
2490
2787
|
const rowOutput = _chunkHGFFYVXNjs.projectRowOutput.call(void 0, listConversion);
|
|
@@ -2508,7 +2805,7 @@ async function executeTool(toolId, options) {
|
|
|
2508
2805
|
seededScript
|
|
2509
2806
|
});
|
|
2510
2807
|
if (parsed.outputFormat === "csv_file") {
|
|
2511
|
-
|
|
2808
|
+
await printDeliveredJsonEnvelope(materializedEnvelope);
|
|
2512
2809
|
return true;
|
|
2513
2810
|
}
|
|
2514
2811
|
if (parsed.outPath) {
|
|
@@ -2516,39 +2813,56 @@ async function executeTool(toolId, options) {
|
|
|
2516
2813
|
toolId: parsed.toolId,
|
|
2517
2814
|
idempotencyKey
|
|
2518
2815
|
});
|
|
2519
|
-
|
|
2520
|
-
json: wantsJson,
|
|
2521
|
-
text: `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
2816
|
+
const outputText = `Wrote ${csv.rowCount} row(s) to ${csv.path}
|
|
2522
2817
|
inspect: ${inspection.inspect}
|
|
2523
|
-
|
|
2524
|
-
|
|
2818
|
+
`;
|
|
2819
|
+
if (wantsJson) {
|
|
2820
|
+
await printDeliveredJsonEnvelope(materializedEnvelope, {
|
|
2821
|
+
text: outputText
|
|
2822
|
+
});
|
|
2823
|
+
} else {
|
|
2824
|
+
printDeliveredEnvelope(materializedEnvelope, { text: outputText });
|
|
2825
|
+
}
|
|
2525
2826
|
return true;
|
|
2526
2827
|
}
|
|
2527
2828
|
if (parsed.noPreview) {
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
local
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2829
|
+
const outputEnvelope = {
|
|
2830
|
+
...materializedEnvelope,
|
|
2831
|
+
local: {
|
|
2832
|
+
..._nullishCoalesce(materializedEnvelope.local, () => ( {})),
|
|
2833
|
+
output_path: csv.path
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2836
|
+
if (wantsJson) {
|
|
2837
|
+
await printDeliveredJsonEnvelope(outputEnvelope, {
|
|
2838
|
+
text: `${csv.path}
|
|
2839
|
+
`
|
|
2840
|
+
});
|
|
2841
|
+
} else {
|
|
2842
|
+
printDeliveredEnvelope(outputEnvelope, { text: `${csv.path}
|
|
2843
|
+
` });
|
|
2844
|
+
}
|
|
2539
2845
|
return true;
|
|
2540
2846
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
}
|
|
2847
|
+
if (wantsJson && parsed.outputFormat !== "csv") {
|
|
2848
|
+
await printDeliveredJsonEnvelope(materializedEnvelope);
|
|
2849
|
+
} else {
|
|
2850
|
+
printDeliveredEnvelope(materializedEnvelope);
|
|
2851
|
+
}
|
|
2544
2852
|
return true;
|
|
2545
2853
|
});
|
|
2546
2854
|
if (delivered) {
|
|
2547
|
-
await
|
|
2855
|
+
await _chunk5TUGWDEBjs.runToolExecuteStage.call(void 0,
|
|
2548
2856
|
"acknowledge delivery",
|
|
2549
2857
|
() => recovery.acknowledgeDelivery()
|
|
2550
2858
|
);
|
|
2551
2859
|
}
|
|
2860
|
+
if (delivered && deliveredCompatibilityResponse && deliveredCompatibilityResponse.update_required !== true) {
|
|
2861
|
+
_chunkLTFL4JRNjs.enforceSdkCompatibilityResponse.call(void 0, deliveredCompatibilityResponse, {
|
|
2862
|
+
quietAdvisory: wantsJson || maintenancePolicy === "off" || _optionalChain([deliveredCompatibilityResponse, 'access', _40 => _40.auto_update, 'optionalAccess', _41 => _41.should_auto_update]) === true
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
if (delivered && !skillsSyncAttempted) await syncSkillsForDeliveredOutput();
|
|
2552
2866
|
return delivered ? executeExitCode : 1;
|
|
2553
2867
|
}
|
|
2554
2868
|
|