deepline 0.3.461 → 0.3.462
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/client-core.ts +7593 -0
- package/dist/bundling-sources/sdk/src/client.ts +8 -7366
- package/dist/bundling-sources/sdk/src/http-core.ts +1239 -0
- package/dist/bundling-sources/sdk/src/http.ts +6 -1231
- package/dist/bundling-sources/sdk/src/index.ts +4 -1
- package/dist/bundling-sources/sdk/src/play.ts +5 -5
- package/dist/bundling-sources/sdk/src/plays/client-core.ts +437 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +4 -421
- package/dist/bundling-sources/sdk/src/plays/input-example.ts +3 -4
- package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/server.ts +43 -0
- package/dist/bundling-sources/sdk/src/types.ts +15 -5
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +15 -0
- package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +0 -307
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +3 -2
- package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +94 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +11 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-failure-codes.ts +24 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +32 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +57 -3
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +66 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +36 -7
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +250 -11
- package/dist/bundling-sources/shared_libs/play-runtime/array-input-store.ts +319 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +991 -359
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +110 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +155 -6
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +110 -6
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +127 -13
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +14 -1
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +57 -1
- package/dist/bundling-sources/shared_libs/play-runtime/free-company-lookup-batching.ts +218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +42 -5
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-budget-state-backend.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +92 -31
- package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +69 -14
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +93 -23
- package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +15 -4
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +22 -18
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +190 -14
- package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +131 -0
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +77 -2
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +271 -2
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +27 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/provider-text-for-log.ts +63 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-event-transport.ts +112 -16
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +104 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +265 -151
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +35 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-labels.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +136 -70
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +237 -36
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +148 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +285 -32
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +251 -56
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +29 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +22 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1397 -382
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +920 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +38 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-flow.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +30 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +14 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +31 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +20 -7
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1496 -320
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +31 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1389 -129
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +36 -0
- 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 +162 -23
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +499 -115
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +377 -9
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +117 -8
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/terminal-runtime-performance.ts +391 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +40 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/mapped-calls.ts +171 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/receipt-cohort.ts +16 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +26 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +16 -2
- package/dist/bundling-sources/shared_libs/play-runtime/transport-error-diagnostics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +55 -5
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +41 -1
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +9 -3
- package/dist/bundling-sources/shared_libs/plays/deploy/manifest-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +3 -2
- package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +2 -2
- package/dist/bundling-sources/shared_libs/plays/run-output-summary.ts +66 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +1 -1
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +43 -1
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +9 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +91 -13
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +3 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +41 -24
- package/dist/bundling-sources/shared_libs/security/attested-client-ip.ts +91 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +0 -11
- package/dist/cli/{auth-6HJXNWUG.mjs → auth-JDLEY7VU.mjs} +5 -4
- package/dist/cli/auth-UXKY6TCC.js +41 -0
- package/dist/cli/{billing-6P5HO6QG.js → billing-HXAXB3XZ.js} +152 -78
- package/dist/cli/{billing-MJ42N7YF.mjs → billing-SDHLBLMV.mjs} +84 -10
- package/dist/cli/{chunk-5MDIZX7M.js → chunk-3ACMRZRV.js} +8 -6
- package/dist/cli/{chunk-FGLKOWSC.mjs → chunk-3KZCFOZ6.mjs} +1 -1
- package/dist/cli/chunk-4KQ6SIBC.mjs +1038 -0
- package/dist/cli/{chunk-Z2GUFYT6.js → chunk-5LEAXRHV.js} +11 -11
- package/dist/cli/{chunk-MEAIOXJL.mjs → chunk-6NNVJDVR.mjs} +7 -5
- package/dist/cli/{chunk-NMJ4D2WO.js → chunk-6PMCRYDA.js} +216 -91
- package/dist/cli/{chunk-RY4IVOU3.mjs → chunk-6RNQGWFD.mjs} +16 -806
- package/dist/cli/{chunk-EBU7LQ64.js → chunk-6V7KVRR5.js} +3 -3
- package/dist/cli/{chunk-OZBWRICM.js → chunk-7LFIMWMW.js} +2 -2
- package/dist/cli/chunk-7MJ6VI2T.mjs +19 -0
- package/dist/cli/chunk-7SWNPNML.js +1039 -0
- package/dist/cli/{chunk-IHHLTHE7.mjs → chunk-7U3XNPOA.mjs} +267 -38
- package/dist/cli/{chunk-5FDKJQZE.js → chunk-7VZHXVOQ.js} +1 -1
- package/dist/cli/{chunk-R64BGGRQ.mjs → chunk-AT636LLU.mjs} +2 -2
- package/dist/cli/{chunk-MDJPEGVN.js → chunk-BGTPIMSM.js} +392 -261
- package/dist/cli/{chunk-KVJ5VHW5.mjs → chunk-CKSOY47X.mjs} +2 -2
- package/dist/cli/{chunk-7DH2FD7Y.mjs → chunk-D464JW3N.mjs} +5 -85
- package/dist/cli/chunk-D6DXOUTO.mjs +827 -0
- package/dist/cli/{describe-2WQY7ZCY.js → chunk-EM4TXCCI.js} +27 -44
- package/dist/cli/chunk-F6QV42MC.mjs +91 -0
- package/dist/cli/chunk-FKVYR3QA.mjs +1039 -0
- package/dist/cli/{chunk-FGMX4HUZ.js → chunk-GEGW5HPZ.js} +29 -27
- package/dist/cli/{chunk-TNMBPMMC.js → chunk-HUB3CCM2.js} +13 -4
- package/dist/cli/{chunk-ACCR7POB.js → chunk-I6VHOU5O.js} +27 -27
- package/dist/cli/{chunk-Z2XUZC34.js → chunk-IAYSWZDJ.js} +188 -76
- package/dist/cli/chunk-JF3TLIMQ.js +19 -0
- package/dist/cli/{chunk-HDFRJ4IT.mjs → chunk-JVHOS3K3.mjs} +177 -65
- package/dist/cli/{chunk-V7REJRDZ.mjs → chunk-LFXLQEZN.mjs} +1 -1
- package/dist/cli/{chunk-CRYOUPEB.js → chunk-LROWFPGN.js} +16 -16
- package/dist/cli/{chunk-SLEUWLJE.mjs → chunk-MSY22NQW.mjs} +5 -5
- package/dist/cli/{chunk-BGY2PLP7.mjs → chunk-MUUQZIOF.mjs} +23 -49
- package/dist/cli/{chunk-FCAZQ7WV.js → chunk-NBLSCHKK.js} +52 -50
- package/dist/cli/{chunk-QAJAJPKK.mjs → chunk-NHRWZPWZ.mjs} +4 -2
- package/dist/cli/{chunk-KXMNM4AQ.js → chunk-NMU3VR5U.js} +4 -5
- package/dist/cli/{chunk-QIW7TVV6.mjs → chunk-O2RX5A66.mjs} +14 -12
- package/dist/cli/{chunk-SAZFZQRI.js → chunk-OMQ23IXL.js} +2 -2
- package/dist/cli/{chunk-5IYOUBFZ.js → chunk-OPJAJBD4.js} +28 -54
- package/dist/cli/{chunk-FJZILBL7.mjs → chunk-PHSEINNH.mjs} +5 -5
- package/dist/cli/{chunk-3DNKFH2G.mjs → chunk-PKHVSIJG.mjs} +19 -1
- package/dist/cli/{chunk-WIYWSYDS.mjs → chunk-Q2EIZKVX.mjs} +3 -3
- package/dist/cli/{chunk-5FY72YOV.js → chunk-QJZ6WNWD.js} +8 -8
- package/dist/cli/{chunk-EIMG75BT.mjs → chunk-S3A4IXBQ.mjs} +4 -5
- package/dist/cli/{chunk-3BMLICF7.mjs → chunk-S42YIQNE.mjs} +13 -8
- package/dist/cli/{chunk-RFONC4WJ.mjs → chunk-S6UAJR6V.mjs} +3 -3
- package/dist/cli/{chunk-G7L27KZB.mjs → chunk-TKAQR3IB.mjs} +31 -21
- package/dist/cli/{chunk-QWRHGGUH.js → chunk-UAJFWWZE.js} +20 -2
- package/dist/cli/{chunk-VZBCEA5S.mjs → chunk-UDRPEZ5F.mjs} +223 -92
- package/dist/cli/{chunk-KCCOQ5G5.js → chunk-ULK7JGGI.js} +511 -282
- package/dist/cli/chunk-V335HGX5.js +1038 -0
- package/dist/cli/{chunk-MGXEUZHL.mjs → chunk-V3MEA7NB.mjs} +7 -5
- package/dist/cli/{chunk-O6QOMHCH.js → chunk-VFGVXXZP.js} +37 -35
- package/dist/cli/chunk-VLEVVDWG.js +91 -0
- package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-VPHN2HAL.mjs} +216 -91
- package/dist/cli/{chunk-CFUTOWE4.js → chunk-WG3KGAII.js} +8 -88
- package/dist/cli/{describe-FRAVCY5F.mjs → chunk-WIY6U6GD.mjs} +19 -36
- package/dist/cli/{chunk-PNATXKLP.js → chunk-XANRM3QA.js} +6 -6
- package/dist/cli/{chunk-KGQNIA37.js → chunk-XQCTG5OO.js} +44 -34
- package/dist/cli/{chunk-T3MVIPHG.mjs → chunk-XZAFIOUQ.mjs} +1 -1
- package/dist/cli/chunk-Y4DPU4OM.js +827 -0
- package/dist/cli/chunk-YT5EODJO.js +920 -0
- package/dist/cli/{chunk-SCIR5JXW.js → chunk-ZGQSFYD2.js} +56 -51
- package/dist/cli/{chunk-QEYHTIV4.mjs → chunk-ZUK6LIJB.mjs} +10 -1
- package/dist/cli/command-docs.d.mts +5 -0
- package/dist/cli/command-docs.d.ts +5 -0
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-NX7NO3O6.js → csv-C56GSCEU.js} +13 -12
- package/dist/cli/{csv-DQ6GW5B5.mjs → csv-L54JS7TF.mjs} +4 -3
- package/dist/cli/{db-R72DFMP6.js → db-MOGRMZTA.js} +30 -27
- package/dist/cli/{db-2YP33M4K.mjs → db-YVBUW2DX.mjs} +10 -7
- package/dist/cli/describe-KYEULWPG.js +48 -0
- package/dist/cli/describe-NLZKKT7C.mjs +48 -0
- package/dist/cli/describe-core.d.mts +153 -5
- package/dist/cli/describe-core.d.ts +153 -5
- package/dist/cli/describe-core.js +9 -5
- package/dist/cli/describe-core.mjs +10 -6
- package/dist/cli/{executions-ZLHD4QIT.js → executions-A7L4ULPP.js} +9 -7
- package/dist/cli/{executions-WFBU7L2Q.mjs → executions-ZBGSTT37.mjs} +7 -5
- package/dist/cli/{feedback-CN3HJFVF.mjs → feedback-G6GU37FD.mjs} +6 -5
- package/dist/cli/{feedback-NDV6TPHG.js → feedback-OHLY7RYD.js} +10 -9
- package/dist/cli/getting-started.d.mts +6 -6
- package/dist/cli/getting-started.d.ts +6 -6
- package/dist/cli/getting-started.js +2 -2
- package/dist/cli/getting-started.mjs +1 -1
- package/dist/cli/git-P76N4NDQ.js +25 -0
- package/dist/cli/{git-QAD6E3HW.mjs → git-PKZW3QD5.mjs} +5 -4
- package/dist/cli/index.js +152 -142
- package/dist/cli/index.mjs +56 -46
- package/dist/cli/{legacy-noops-KVC5QJ74.js → legacy-noops-5LM3D724.js} +8 -7
- package/dist/cli/{legacy-noops-TPTKNBI2.mjs → legacy-noops-LJJYG6YA.mjs} +5 -4
- package/dist/cli/{monitors-SV57JFLO.mjs → monitors-72QV4ALO.mjs} +19 -6
- package/dist/cli/{monitors-KCROV6PJ.js → monitors-UX3H5DC2.js} +103 -90
- package/dist/cli/{org-KX6QIR7A.mjs → org-6RRRKOCP.mjs} +9 -6
- package/dist/cli/{org-NJYX5743.js → org-IF7ISUVB.js} +70 -67
- package/dist/cli/pages-3SU3HKL7.js +252 -0
- package/dist/cli/pages-DXDYYKEK.mjs +252 -0
- package/dist/cli/{play-IQQ57L7Z.mjs → play-AHASKRLA.mjs} +512 -1508
- package/dist/cli/{play-32L7EQN4.js → play-EUIUVLUH.js} +1090 -2086
- package/dist/cli/{providers-4WEC2EQN.mjs → providers-GWGE3WY3.mjs} +7 -5
- package/dist/cli/{providers-ZQV6QLVQ.js → providers-V5WU4VXJ.js} +10 -8
- package/dist/cli/{quickstart-RQ76RIUE.mjs → quickstart-OXKQ5ZST.mjs} +5 -4
- package/dist/cli/{quickstart-HKUSFADF.js → quickstart-QP65I5PF.js} +13 -12
- package/dist/cli/run-6MM72IGL.mjs +443 -0
- package/dist/cli/run-F3FTYS56.js +443 -0
- package/dist/cli/search-OYKOOI7A.js +32 -0
- package/dist/cli/{search-ZRAVFBZC.mjs → search-ZMEBVJZB.mjs} +8 -6
- package/dist/cli/{secrets-J3G5Y43U.js → secrets-ACND5N6A.js} +16 -14
- package/dist/cli/{secrets-CMJOVNVH.mjs → secrets-XRCJFF3L.mjs} +7 -5
- package/dist/cli/{sessions-MDQYY5CB.mjs → sessions-RTK3CEW6.mjs} +5 -4
- package/dist/cli/{sessions-WY7VN4AE.js → sessions-ZGRJPCFF.js} +6 -5
- package/dist/cli/{settings-HTNTFKCE.js → settings-PD5KWQQZ.js} +80 -77
- package/dist/cli/{settings-4RWZPCT5.mjs → settings-XDRBPRDE.mjs} +14 -11
- package/dist/cli/{setup-P3GYYZWG.mjs → setup-3HPYAOCC.mjs} +12 -10
- package/dist/cli/{setup-QGCAP62X.js → setup-E2Q6PXHC.js} +53 -51
- package/dist/cli/{skills-7NAE4ICL.mjs → skills-OOQFMPOV.mjs} +7 -6
- package/dist/cli/skills-XYWV52KB.js +31 -0
- package/dist/cli/tools-ASCDZJCK.js +55 -0
- package/dist/cli/tools-C5ZT3UIC.mjs +55 -0
- package/dist/cli/update-5RQSEIFM.js +33 -0
- package/dist/cli/{update-GODLRKNB.mjs → update-ZWJTADIW.mjs} +9 -8
- package/dist/cli/{workflow-4BXOUVEO.mjs → workflow-23NMPAJ7.mjs} +10 -8
- package/dist/cli/{workflow-AO3A6LXN.js → workflow-TCXU5YJV.js} +20 -18
- package/dist/client-DS2IWYZF.d.ts +10 -0
- package/dist/client-DTwnz_AW.d.mts +10 -0
- package/dist/{client-CYqG23K1.d.ts → client-core-B_6HAIBy.d.ts} +385 -12
- package/dist/{client-BbU5_j7n.d.mts → client-core-DzBSlY1U.d.mts} +385 -12
- package/dist/{compiler-manifest-CWz_sNOQ.d.ts → compiler-manifest-Dcyd3-Zd.d.mts} +43 -1
- package/dist/{compiler-manifest-CWz_sNOQ.d.mts → compiler-manifest-Dcyd3-Zd.d.ts} +43 -1
- package/dist/errors-d-sTrZhe.d.mts +142 -0
- package/dist/errors-yQwfgrcX.d.ts +142 -0
- package/dist/{index-BF2JB_Ug.d.mts → index-C6oXchjN.d.mts} +1 -1
- package/dist/{index-4NPXDzlD.d.ts → index-P56zy_z5.d.ts} +1 -1
- package/dist/index.d.mts +11 -147
- package/dist/index.d.ts +11 -147
- package/dist/index.js +15 -11
- package/dist/index.mjs +14 -10
- package/dist/install-integrity.json +141 -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 +2 -1
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/play-description.js +2 -2
- package/dist/plays/play-description.mjs +1 -1
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +17 -0
- package/dist/server.d.ts +17 -0
- package/dist/server.js +76 -0
- package/dist/server.mjs +76 -0
- package/package.json +6 -1
- package/dist/cli/auth-IACERYQH.js +0 -40
- package/dist/cli/chunk-PQUUWFXY.js +0 -95
- package/dist/cli/chunk-YBWAG72P.mjs +0 -95
- package/dist/cli/chunk-YQDUODZW.js +0 -1710
- package/dist/cli/git-JVI36ZFV.js +0 -24
- package/dist/cli/search-75X5LTDE.js +0 -30
- package/dist/cli/skills-BKJ53JOQ.js +0 -30
- package/dist/cli/tools-COWMIEJ6.mjs +0 -45
- package/dist/cli/tools-TASOCE7I.js +0 -45
- package/dist/cli/update-SJIKVME6.js +0 -32
|
@@ -1,12 +1,12 @@
|
|
|
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 _chunkPQUUWFXYjs = require('./chunk-PQUUWFXY.js');
|
|
5
4
|
|
|
5
|
+
var _chunk7SWNPNMLjs = require('./chunk-7SWNPNML.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _chunk5IYOUBFZjs = require('./chunk-5IYOUBFZ.js');
|
|
9
8
|
|
|
9
|
+
var _chunkOPJAJBD4js = require('./chunk-OPJAJBD4.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -24,10 +24,11 @@ var _chunk5IYOUBFZjs = require('./chunk-5IYOUBFZ.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var _chunkZ2GUFYT6js = require('./chunk-Z2GUFYT6.js');
|
|
28
27
|
|
|
28
|
+
var _chunk5LEAXRHVjs = require('./chunk-5LEAXRHV.js');
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
var _chunkIAYSWZDJjs = require('./chunk-IAYSWZDJ.js');
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
var _chunkAID3OYVJjs = require('./chunk-AID3OYVJ.js');
|
|
@@ -47,8 +48,10 @@ var _chunkJ33TSWO5js = require('./chunk-J33TSWO5.js');
|
|
|
47
48
|
var _chunkHGFFYVXNjs = require('./chunk-HGFFYVXN.js');
|
|
48
49
|
|
|
49
50
|
|
|
51
|
+
var _chunkJF3TLIMQjs = require('./chunk-JF3TLIMQ.js');
|
|
52
|
+
|
|
50
53
|
|
|
51
|
-
var
|
|
54
|
+
var _chunkBGTPIMSMjs = require('./chunk-BGTPIMSM.js');
|
|
52
55
|
|
|
53
56
|
|
|
54
57
|
var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
@@ -58,18 +61,18 @@ var _chunkXDVT3GOMjs = require('./chunk-XDVT3GOM.js');
|
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
|
|
61
|
-
var
|
|
64
|
+
var _chunkGEGW5HPZjs = require('./chunk-GEGW5HPZ.js');
|
|
62
65
|
|
|
63
66
|
|
|
64
67
|
|
|
65
68
|
|
|
66
|
-
var
|
|
69
|
+
var _chunk7LFIMWMWjs = require('./chunk-7LFIMWMW.js');
|
|
67
70
|
|
|
68
71
|
|
|
69
72
|
|
|
70
73
|
|
|
71
74
|
|
|
72
|
-
var
|
|
75
|
+
var _chunkZGQSFYD2js = require('./chunk-ZGQSFYD2.js');
|
|
73
76
|
|
|
74
77
|
|
|
75
78
|
|
|
@@ -77,12 +80,12 @@ var _chunkSCIR5JXWjs = require('./chunk-SCIR5JXW.js');
|
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
80
|
-
var
|
|
83
|
+
var _chunk3ACMRZRVjs = require('./chunk-3ACMRZRV.js');
|
|
81
84
|
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
|
|
85
|
-
var
|
|
88
|
+
var _chunkY4DPU4OMjs = require('./chunk-Y4DPU4OM.js');
|
|
86
89
|
|
|
87
90
|
|
|
88
91
|
var _chunkDIAWYWT5js = require('./chunk-DIAWYWT5.js');
|
|
@@ -144,35 +147,99 @@ var _crypto = require('crypto');
|
|
|
144
147
|
|
|
145
148
|
|
|
146
149
|
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
var PENDING_KEY_TTL_MS = 60 * 60 * 1e3;
|
|
153
|
+
var PENDING_PREFIX = "pending-tool-execution-";
|
|
147
154
|
var ToolCallRecovery = class _ToolCallRecovery {
|
|
148
|
-
constructor(idempotencyKey, path) {
|
|
155
|
+
constructor(idempotencyKey, path, resumed = false) {
|
|
149
156
|
this.idempotencyKey = idempotencyKey;
|
|
150
157
|
this.path = path;
|
|
158
|
+
this.resumed = resumed;
|
|
151
159
|
}
|
|
152
160
|
static open(input) {
|
|
153
161
|
if (!input.recover || input.idempotencyKey) {
|
|
154
162
|
return new _ToolCallRecovery(input.idempotencyKey, null);
|
|
155
163
|
}
|
|
156
164
|
const path = pendingToolExecutionPath(input);
|
|
157
|
-
|
|
165
|
+
discardExpiredPendingExecutions(_path.dirname.call(void 0, path));
|
|
166
|
+
if (input.fresh && _fs.existsSync.call(void 0, path)) {
|
|
167
|
+
discard(
|
|
168
|
+
path,
|
|
169
|
+
`Discarded the saved retry key for ${input.toolId} (--fresh).`
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
const { key, resumed } = loadOrCreatePendingToolExecution(path);
|
|
173
|
+
return new _ToolCallRecovery(key, path, resumed);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Drop the key after the server answered with a failure: the call ended,
|
|
177
|
+
* so running it again tries again instead of replaying that failure.
|
|
178
|
+
*/
|
|
179
|
+
discard() {
|
|
180
|
+
if (!this.path || !this.idempotencyKey) return;
|
|
181
|
+
try {
|
|
182
|
+
if (readPendingToolExecution(this.path) === this.idempotencyKey) {
|
|
183
|
+
_fs.unlinkSync.call(void 0, this.path);
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
if (error.code !== "ENOENT") throw error;
|
|
187
|
+
}
|
|
158
188
|
}
|
|
159
189
|
async acknowledgeDelivery() {
|
|
160
190
|
await completePendingToolExecution(this.path, this.idempotencyKey);
|
|
161
191
|
}
|
|
162
192
|
};
|
|
163
193
|
function pendingToolExecutionPath(input) {
|
|
164
|
-
const config =
|
|
194
|
+
const config = _chunkY4DPU4OMjs.resolveConfig.call(void 0, );
|
|
165
195
|
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");
|
|
166
196
|
return _path.join.call(void 0,
|
|
167
|
-
|
|
168
|
-
|
|
197
|
+
_chunkY4DPU4OMjs.sdkCliStateDirPath.call(void 0, config.baseUrl),
|
|
198
|
+
`${PENDING_PREFIX}${fingerprint}.json`
|
|
169
199
|
);
|
|
170
200
|
}
|
|
201
|
+
function discard(path, note) {
|
|
202
|
+
try {
|
|
203
|
+
_fs.unlinkSync.call(void 0, path);
|
|
204
|
+
process.stderr.write(`${note}
|
|
205
|
+
`);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
if (error.code !== "ENOENT") throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function discardExpiredPendingExecutions(directory) {
|
|
211
|
+
if (!_fs.existsSync.call(void 0, directory)) return;
|
|
212
|
+
const now = Date.now();
|
|
213
|
+
for (const name of _fs.readdirSync.call(void 0, directory)) {
|
|
214
|
+
if (!name.startsWith(PENDING_PREFIX) || !name.endsWith(".json")) continue;
|
|
215
|
+
const path = _path.join.call(void 0, directory, name);
|
|
216
|
+
try {
|
|
217
|
+
const modified = _fs.statSync.call(void 0, path).mtimeMs;
|
|
218
|
+
if (now - modified <= PENDING_KEY_TTL_MS) continue;
|
|
219
|
+
discard(
|
|
220
|
+
path,
|
|
221
|
+
`Discarded a retry key saved ${new Date(modified).toISOString()}, older than ${PENDING_KEY_TTL_MS / 6e4} minutes; the call runs again.`
|
|
222
|
+
);
|
|
223
|
+
} catch (error) {
|
|
224
|
+
if (error.code !== "ENOENT") throw error;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
171
228
|
function loadOrCreatePendingToolExecution(path) {
|
|
172
229
|
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
|
|
173
230
|
if (_fs.existsSync.call(void 0, path)) {
|
|
174
|
-
|
|
231
|
+
try {
|
|
232
|
+
return { key: readPendingToolExecution(path), resumed: true };
|
|
233
|
+
} catch (error) {
|
|
234
|
+
discard(
|
|
235
|
+
path,
|
|
236
|
+
`Discarded an unreadable retry key at ${path} (${error instanceof Error ? error.message : String(error)}).`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
175
239
|
}
|
|
240
|
+
return { key: createPendingToolExecution(path), resumed: false };
|
|
241
|
+
}
|
|
242
|
+
function createPendingToolExecution(path) {
|
|
176
243
|
const idempotencyKey = _crypto.randomUUID.call(void 0, );
|
|
177
244
|
const temporaryPath = `${path}.${process.pid}.${_crypto.randomUUID.call(void 0, )}.tmp`;
|
|
178
245
|
try {
|
|
@@ -276,16 +343,16 @@ function toolConnectionStatusMessage(input) {
|
|
|
276
343
|
var TOOL_EXECUTE_PREFLIGHT_TIMEOUT_MS = 750;
|
|
277
344
|
var TOOL_COMMAND_TEMPLATES = {
|
|
278
345
|
describe: "deepline describe <toolId>",
|
|
279
|
-
execute: "deepline
|
|
346
|
+
execute: "deepline run <toolId> --input '{...}'"
|
|
280
347
|
};
|
|
281
348
|
function toListedTool(tool) {
|
|
282
|
-
if (
|
|
349
|
+
if (_chunk5LEAXRHVjs.isPlayLikeTool.call(void 0, tool)) {
|
|
283
350
|
return {
|
|
284
351
|
...tool,
|
|
285
352
|
description: listedToolDescription(tool),
|
|
286
353
|
id: tool.toolId,
|
|
287
354
|
type: "play",
|
|
288
|
-
executeCommand:
|
|
355
|
+
executeCommand: _chunk5LEAXRHVjs.playRunCommandForTool.call(void 0, tool, tool.toolId)
|
|
289
356
|
};
|
|
290
357
|
}
|
|
291
358
|
return {
|
|
@@ -293,7 +360,7 @@ function toListedTool(tool) {
|
|
|
293
360
|
description: listedToolDescription(tool),
|
|
294
361
|
id: tool.toolId,
|
|
295
362
|
type: "tool",
|
|
296
|
-
executeCommand: `deepline
|
|
363
|
+
executeCommand: `deepline run ${tool.toolId}`
|
|
297
364
|
};
|
|
298
365
|
}
|
|
299
366
|
function parseGrepTerms(query, mode) {
|
|
@@ -367,16 +434,16 @@ function firstSentence(text) {
|
|
|
367
434
|
return (match ? match[0] : clean).trim();
|
|
368
435
|
}
|
|
369
436
|
function requiredInputIds(tool) {
|
|
370
|
-
const inputSchema =
|
|
437
|
+
const inputSchema = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
371
438
|
tool,
|
|
372
439
|
"inputSchema",
|
|
373
440
|
"input_schema"
|
|
374
441
|
);
|
|
375
|
-
return
|
|
442
|
+
return _chunk5LEAXRHVjs.toolInputFieldsForDisplay.call(void 0, inputSchema).filter((field) => field.required === true).map((field) => String(_nullishCoalesce(field.name, () => ( "")))).filter(Boolean);
|
|
376
443
|
}
|
|
377
444
|
function notConnectedSuffix(tool) {
|
|
378
445
|
const record = tool;
|
|
379
|
-
const status =
|
|
446
|
+
const status = _chunk5LEAXRHVjs.stringField.call(void 0, record, "credentialStatus", "credential_status");
|
|
380
447
|
const connected = record.connected;
|
|
381
448
|
const message = toolConnectionStatusMessage({
|
|
382
449
|
connected: connected === false ? false : void 0,
|
|
@@ -385,18 +452,18 @@ function notConnectedSuffix(tool) {
|
|
|
385
452
|
return message ? ` - \u26A0 ${message}` : "";
|
|
386
453
|
}
|
|
387
454
|
function shortPricingHint(tool) {
|
|
388
|
-
const pricing =
|
|
455
|
+
const pricing = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
389
456
|
tool,
|
|
390
457
|
"pricing"
|
|
391
458
|
);
|
|
392
459
|
const credits = numberField(pricing, "creditsPerUnit", "credits_per_unit");
|
|
393
|
-
const unit =
|
|
460
|
+
const unit = _chunk5LEAXRHVjs.stringField.call(void 0, pricing, "unit");
|
|
394
461
|
if (credits !== null) {
|
|
395
462
|
return `${formatDecimal(credits)} cr/${unit || "unit"}`;
|
|
396
463
|
}
|
|
397
|
-
const summary =
|
|
464
|
+
const summary = _chunk5LEAXRHVjs.stringField.call(void 0, pricing, "summary");
|
|
398
465
|
if (summary) return summary;
|
|
399
|
-
const displayText =
|
|
466
|
+
const displayText = _chunk5LEAXRHVjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
400
467
|
return displayText || null;
|
|
401
468
|
}
|
|
402
469
|
function aggregateCategorySummaries(tools) {
|
|
@@ -440,13 +507,13 @@ function categoryEnumerationRender(summaries) {
|
|
|
440
507
|
};
|
|
441
508
|
}
|
|
442
509
|
async function listToolCategories(emitJson, compact) {
|
|
443
|
-
const client = new (0,
|
|
510
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
444
511
|
if (!emitJson) {
|
|
445
512
|
const summaries2 = (await client.listToolCategories()).map((category) => ({
|
|
446
513
|
...category,
|
|
447
514
|
description: describeToolCategory(category.name)
|
|
448
515
|
}));
|
|
449
|
-
|
|
516
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
450
517
|
{ categories: summaries2, render: categoryEnumerationRender(summaries2) },
|
|
451
518
|
{ json: false }
|
|
452
519
|
);
|
|
@@ -456,7 +523,7 @@ async function listToolCategories(emitJson, compact) {
|
|
|
456
523
|
const items = rawTools.map(toListedTool);
|
|
457
524
|
const summaries = aggregateCategorySummaries(rawTools);
|
|
458
525
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
459
|
-
|
|
526
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
460
527
|
{
|
|
461
528
|
tools: outputItems,
|
|
462
529
|
count: outputItems.length,
|
|
@@ -475,7 +542,7 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
475
542
|
const known = summaries.map((item) => item.name);
|
|
476
543
|
const message = `Unknown tool category "${category}". Run \`deepline tools list\` to browse categories.`;
|
|
477
544
|
if (emitJson) {
|
|
478
|
-
|
|
545
|
+
_chunk3ACMRZRVjs.printJson.call(void 0, {
|
|
479
546
|
ok: false,
|
|
480
547
|
exitCode: 4,
|
|
481
548
|
code: "TOOL_CATEGORY_NOT_FOUND",
|
|
@@ -489,13 +556,13 @@ function unknownCategoryError(category, summaries, emitJson) {
|
|
|
489
556
|
const render = categoryEnumerationRender(summaries);
|
|
490
557
|
console.error(message);
|
|
491
558
|
console.error("");
|
|
492
|
-
console.error(
|
|
559
|
+
console.error(_chunk3ACMRZRVjs.renderCommandEnvelopeText.call(void 0, { render }).trimEnd());
|
|
493
560
|
console.error("");
|
|
494
561
|
console.error(`Valid categories: ${known.join(", ")}`);
|
|
495
562
|
return 4;
|
|
496
563
|
}
|
|
497
564
|
async function listToolsInCategory(category, emitJson) {
|
|
498
|
-
const client = new (0,
|
|
565
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
499
566
|
const { tools: rawTools, categories } = await client.listToolsInCategory(category);
|
|
500
567
|
const summaries = categories.map((item) => ({
|
|
501
568
|
...item,
|
|
@@ -531,7 +598,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
531
598
|
}
|
|
532
599
|
]
|
|
533
600
|
};
|
|
534
|
-
|
|
601
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
535
602
|
{
|
|
536
603
|
category,
|
|
537
604
|
total: rows.length,
|
|
@@ -544,7 +611,7 @@ async function listToolsInCategory(category, emitJson) {
|
|
|
544
611
|
return 0;
|
|
545
612
|
}
|
|
546
613
|
async function listToolsForCategoryFilter(requestedCategories, emitJson, compact) {
|
|
547
|
-
const client = new (0,
|
|
614
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
548
615
|
const items = (await client.listTools({
|
|
549
616
|
categories: requestedCategories.join(","),
|
|
550
617
|
compact
|
|
@@ -573,7 +640,7 @@ async function listToolsForCategoryFilter(requestedCategories, emitJson, compact
|
|
|
573
640
|
]
|
|
574
641
|
};
|
|
575
642
|
const outputItems = compact ? items.map(compactTool) : items;
|
|
576
|
-
|
|
643
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
577
644
|
{
|
|
578
645
|
tools: outputItems,
|
|
579
646
|
count: outputItems.length,
|
|
@@ -592,13 +659,13 @@ async function listTools(category, options = {}) {
|
|
|
592
659
|
const positional = _nullishCoalesce(_optionalChain([category, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11()]), () => ( ""));
|
|
593
660
|
const flagCategories = (_nullishCoalesce(options.categories, () => ( ""))).split(",").map((item) => item.trim()).filter(Boolean);
|
|
594
661
|
const compact = options.compact !== false;
|
|
595
|
-
const emitJson = options.json === true ||
|
|
662
|
+
const emitJson = options.json === true || _chunk3ACMRZRVjs.shouldEmitJson.call(void 0, );
|
|
596
663
|
if (positional && flagCategories.length > 0) {
|
|
597
664
|
const flagIsSameSingle = flagCategories.length === 1 && flagCategories[0] === positional;
|
|
598
665
|
if (!flagIsSameSingle) {
|
|
599
666
|
const message = `Category "${positional}" and --categories ${flagCategories.join(",")} disagree. Pass one: deepline tools list ${positional}`;
|
|
600
667
|
if (emitJson) {
|
|
601
|
-
|
|
668
|
+
_chunk3ACMRZRVjs.printJson.call(void 0, {
|
|
602
669
|
ok: false,
|
|
603
670
|
exitCode: 2,
|
|
604
671
|
code: "TOOL_LIST_CATEGORY_CONFLICT",
|
|
@@ -625,7 +692,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
625
692
|
console.error("Usage: deepline tools grep <query> [--json]");
|
|
626
693
|
return 1;
|
|
627
694
|
}
|
|
628
|
-
const client = new (0,
|
|
695
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
629
696
|
const requestedCategories = options.categories ? options.categories.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
630
697
|
const mode = _nullishCoalesce(options.mode, () => ( "all"));
|
|
631
698
|
const jsonOutput = options.json === true;
|
|
@@ -649,7 +716,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
649
716
|
query,
|
|
650
717
|
mode
|
|
651
718
|
}) : null;
|
|
652
|
-
|
|
719
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
653
720
|
{
|
|
654
721
|
tools: outputTools,
|
|
655
722
|
count: outputTools.length,
|
|
@@ -667,7 +734,7 @@ async function grepTools(queryInput, options = {}) {
|
|
|
667
734
|
} : {},
|
|
668
735
|
commandTemplates: TOOL_COMMAND_TEMPLATES
|
|
669
736
|
},
|
|
670
|
-
{ json: options.json ||
|
|
737
|
+
{ json: options.json || _chunk3ACMRZRVjs.shouldEmitJson.call(void 0, ) }
|
|
671
738
|
);
|
|
672
739
|
return 0;
|
|
673
740
|
}
|
|
@@ -715,15 +782,15 @@ function isMissingToolMetadataError(error) {
|
|
|
715
782
|
function playAliasToolErrorMessage(toolId, play) {
|
|
716
783
|
const playName = _nullishCoalesce(play.reference, () => ( play.name));
|
|
717
784
|
return `${toolId} is a play, not a tool.
|
|
718
|
-
Use: deepline
|
|
785
|
+
Use: deepline run ${playName} --input '{...}'
|
|
719
786
|
Inspect its schema with: deepline describe ${playName}`;
|
|
720
787
|
}
|
|
721
788
|
function printPlayAliasToolError(toolId, play) {
|
|
722
789
|
console.error(playAliasToolErrorMessage(toolId, play));
|
|
723
790
|
}
|
|
724
791
|
function playLikeToolExecuteErrorMessage(toolId, tool) {
|
|
725
|
-
const playReference = tool ?
|
|
726
|
-
const nextStep = playReference ? `Use: deepline
|
|
792
|
+
const playReference = tool ? _chunk5LEAXRHVjs.playReferenceForTool.call(void 0, tool) : null;
|
|
793
|
+
const nextStep = playReference ? `Use: deepline run ${playReference} --input '{...}'` : `Find the maintained workflow with: ${_chunk5LEAXRHVjs.playSearchCommandForToolId.call(void 0, toolId)}`;
|
|
727
794
|
return [
|
|
728
795
|
`${toolId} is a workflow/play entry, not an atomic provider tool.`,
|
|
729
796
|
nextStep,
|
|
@@ -746,20 +813,20 @@ function registerToolsCommands(program) {
|
|
|
746
813
|
"after",
|
|
747
814
|
`
|
|
748
815
|
Concepts:
|
|
749
|
-
Tools are atomic provider/API operations
|
|
750
|
-
|
|
816
|
+
Tools are atomic provider/API operations; plays are workflows. deepline run
|
|
817
|
+
runs either.
|
|
751
818
|
|
|
752
819
|
Common commands:
|
|
753
820
|
deepline search "name and company domain -> work email" --type tools
|
|
754
821
|
deepline describe hunter_email_verifier
|
|
755
|
-
deepline
|
|
756
|
-
deepline billing usage --request-id <
|
|
822
|
+
deepline run hunter_email_verifier --input '{"email":"a@b.com"}'
|
|
823
|
+
deepline billing usage --request-id <request-id>
|
|
757
824
|
|
|
758
825
|
Output:
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
826
|
+
deepline describe shows a tool's contract and price, and deepline run runs
|
|
827
|
+
it. The receipt's billing command (next.billing with --json) gives a call's
|
|
828
|
+
exact charge. Workspace balance changes also include other callers'
|
|
829
|
+
activity.
|
|
763
830
|
`
|
|
764
831
|
);
|
|
765
832
|
tools.command("connect <provider>").description(
|
|
@@ -778,7 +845,7 @@ Output:
|
|
|
778
845
|
if (options.preset !== void 0 && (options.scopes !== void 0 || options.optionalScopes !== void 0))
|
|
779
846
|
throw new Error("Use --preset or individual scopes, not both.");
|
|
780
847
|
const splitScopes = (value) => value.split(",").map((scope) => scope.trim()).filter(Boolean);
|
|
781
|
-
const result2 = await new (0,
|
|
848
|
+
const result2 = await new (0, _chunkJF3TLIMQjs.DeeplineClient)().startIntegrationOAuth(
|
|
782
849
|
provider,
|
|
783
850
|
{
|
|
784
851
|
...options.preset !== void 0 ? { preset: options.preset } : {},
|
|
@@ -790,7 +857,7 @@ Output:
|
|
|
790
857
|
throw new Error(
|
|
791
858
|
"The API did not return an OAuth authorization URL."
|
|
792
859
|
);
|
|
793
|
-
if (
|
|
860
|
+
if (_chunk3ACMRZRVjs.shouldEmitJson.call(void 0, options.json))
|
|
794
861
|
console.log(
|
|
795
862
|
JSON.stringify({ provider, redirect_url: result2.redirect_url })
|
|
796
863
|
);
|
|
@@ -816,7 +883,7 @@ Output:
|
|
|
816
883
|
"--credentials-file must contain a nonempty JSON object of string credential values."
|
|
817
884
|
);
|
|
818
885
|
}
|
|
819
|
-
const result = await new (0,
|
|
886
|
+
const result = await new (0, _chunkJF3TLIMQjs.DeeplineClient)().setIntegrationCredentials(
|
|
820
887
|
provider,
|
|
821
888
|
credentials
|
|
822
889
|
);
|
|
@@ -826,7 +893,7 @@ Output:
|
|
|
826
893
|
);
|
|
827
894
|
}
|
|
828
895
|
const confirmation = { provider, credential_saved: true };
|
|
829
|
-
if (
|
|
896
|
+
if (_chunk3ACMRZRVjs.shouldEmitJson.call(void 0, options.json))
|
|
830
897
|
console.log(JSON.stringify(confirmation));
|
|
831
898
|
else
|
|
832
899
|
console.log(
|
|
@@ -866,7 +933,7 @@ Examples:
|
|
|
866
933
|
json: Boolean(options.json)
|
|
867
934
|
});
|
|
868
935
|
});
|
|
869
|
-
|
|
936
|
+
_chunkOPJAJBD4js.registerDeprecatedSearchCommand.call(void 0, tools, () => ["tools", "monitors"]);
|
|
870
937
|
tools.command("grep <query>").description(
|
|
871
938
|
"Regex grep over tool ids, descriptions, categories, and input fields."
|
|
872
939
|
).addHelpText(
|
|
@@ -901,7 +968,7 @@ Examples:
|
|
|
901
968
|
});
|
|
902
969
|
const addToolMetadataCommand = (command) => {
|
|
903
970
|
let compatibilityMetadata;
|
|
904
|
-
|
|
971
|
+
_chunkGEGW5HPZjs.registerCompatibilityCatalog.call(void 0, command, () => ({
|
|
905
972
|
toolId: command.args[0],
|
|
906
973
|
acceptMetadata: (metadata) => {
|
|
907
974
|
compatibilityMetadata = metadata;
|
|
@@ -927,7 +994,7 @@ Examples:
|
|
|
927
994
|
deepline tools describe deeplineagent --model openai/gpt-5.6-luna
|
|
928
995
|
deepline tools describe ai_inference --estimate-payload @payload.json
|
|
929
996
|
deepline tools describe ai_evaluate --estimate-payload @payload.json
|
|
930
|
-
deepline
|
|
997
|
+
deepline run hunter_email_verifier --input '{"email":"a@b.com"}'
|
|
931
998
|
`
|
|
932
999
|
).option("--json", "Emit JSON output").option(
|
|
933
1000
|
"--model <model>",
|
|
@@ -971,7 +1038,7 @@ Examples:
|
|
|
971
1038
|
process.exitCode = await narrowView();
|
|
972
1039
|
return;
|
|
973
1040
|
}
|
|
974
|
-
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-
|
|
1041
|
+
const { describeAnything } = await Promise.resolve().then(() => _interopRequireWildcard(require("./describe-KYEULWPG.js")));
|
|
975
1042
|
process.exitCode = await describeAnything(
|
|
976
1043
|
toolId,
|
|
977
1044
|
{
|
|
@@ -986,12 +1053,12 @@ Examples:
|
|
|
986
1053
|
});
|
|
987
1054
|
};
|
|
988
1055
|
addToolMetadataCommand(
|
|
989
|
-
|
|
1056
|
+
_chunk7SWNPNMLjs.addDescribeOptions.call(void 0,
|
|
990
1057
|
tools.command("describe <toolId>", { hidden: true }).alias("get"),
|
|
991
1058
|
{ json: false }
|
|
992
1059
|
)
|
|
993
1060
|
);
|
|
994
|
-
tools.command("execute <toolId>").alias("call").description("Execute a tool by id.").addHelpText(
|
|
1061
|
+
tools.command("execute <toolId>", { hidden: true }).alias("call").description("Execute a tool by id.").addHelpText(
|
|
995
1062
|
"after",
|
|
996
1063
|
`
|
|
997
1064
|
Notes:
|
|
@@ -1055,7 +1122,7 @@ Examples:
|
|
|
1055
1122
|
options,
|
|
1056
1123
|
void 0,
|
|
1057
1124
|
true,
|
|
1058
|
-
|
|
1125
|
+
_chunk7LFIMWMWjs.resolveCliMaintenancePolicy.call(void 0, command.optsWithGlobals())
|
|
1059
1126
|
);
|
|
1060
1127
|
}
|
|
1061
1128
|
);
|
|
@@ -1063,13 +1130,13 @@ Examples:
|
|
|
1063
1130
|
function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
1064
1131
|
let metadata;
|
|
1065
1132
|
const startedAt = performance.now();
|
|
1066
|
-
const baseUrl =
|
|
1067
|
-
|
|
1068
|
-
const result =
|
|
1133
|
+
const baseUrl = _chunkY4DPU4OMjs.resolveConfig.call(void 0, ).baseUrl;
|
|
1134
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_compatibility_start" });
|
|
1135
|
+
const result = _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
1069
1136
|
"SDK compatibility",
|
|
1070
|
-
() =>
|
|
1137
|
+
() => _chunkZGQSFYD2js.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
1071
1138
|
command: "tools execute",
|
|
1072
|
-
skillsVersion:
|
|
1139
|
+
skillsVersion: _chunkY4DPU4OMjs.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
1073
1140
|
persistCache: false,
|
|
1074
1141
|
timeoutMs: TOOL_EXECUTE_PREFLIGHT_TIMEOUT_MS,
|
|
1075
1142
|
catalog: {
|
|
@@ -1083,7 +1150,7 @@ function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
|
1083
1150
|
})
|
|
1084
1151
|
).then(
|
|
1085
1152
|
(compatibility) => {
|
|
1086
|
-
|
|
1153
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, {
|
|
1087
1154
|
phase: "cli.tool_execute_compatibility_ready",
|
|
1088
1155
|
ms: performance.now() - startedAt,
|
|
1089
1156
|
ok: compatibility.error === null,
|
|
@@ -1092,7 +1159,7 @@ function beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) {
|
|
|
1092
1159
|
return compatibility;
|
|
1093
1160
|
},
|
|
1094
1161
|
(error) => {
|
|
1095
|
-
|
|
1162
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, {
|
|
1096
1163
|
phase: "cli.tool_execute_compatibility_ready",
|
|
1097
1164
|
ms: performance.now() - startedAt,
|
|
1098
1165
|
ok: false
|
|
@@ -1107,7 +1174,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1107
1174
|
console.error("Usage: deepline tools describe <toolId> [--json]");
|
|
1108
1175
|
return 1;
|
|
1109
1176
|
}
|
|
1110
|
-
const client = new (0,
|
|
1177
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
1111
1178
|
let tool;
|
|
1112
1179
|
try {
|
|
1113
1180
|
tool = await _asyncNullishCoalesce(compatibilityMetadata, async () => ( await client.getTool(toolId)));
|
|
@@ -1161,12 +1228,12 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1161
1228
|
const lines = toolPricingOnlyLines(tool, toolId);
|
|
1162
1229
|
if (inferenceQuote)
|
|
1163
1230
|
lines.push(...inferenceQuoteSummaryLines(inferenceQuote));
|
|
1164
|
-
|
|
1231
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0,
|
|
1165
1232
|
{
|
|
1166
1233
|
toolId: String(tool.toolId || toolId),
|
|
1167
1234
|
cost: _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost(),
|
|
1168
1235
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1169
|
-
...
|
|
1236
|
+
..._chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool) ? { pricing: _chunk5LEAXRHVjs.recordField.call(void 0, tool, "pricing") } : {},
|
|
1170
1237
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1171
1238
|
},
|
|
1172
1239
|
{
|
|
@@ -1177,14 +1244,14 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1177
1244
|
);
|
|
1178
1245
|
return 0;
|
|
1179
1246
|
}
|
|
1180
|
-
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !
|
|
1181
|
-
const contract =
|
|
1247
|
+
if ((options.schemaOnly || options.examplesOnly || options.gettersOnly) && !_chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool) && !_chunk5LEAXRHVjs.isPlayLikeTool.call(void 0, tool) && (options.json || options.contractJson)) {
|
|
1248
|
+
const contract = _chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1182
1249
|
tool,
|
|
1183
1250
|
toolId,
|
|
1184
1251
|
void 0,
|
|
1185
1252
|
seedToolListScript
|
|
1186
1253
|
);
|
|
1187
|
-
|
|
1254
|
+
_chunk3ACMRZRVjs.printCompactJson.call(void 0, {
|
|
1188
1255
|
toolId: contract.toolId,
|
|
1189
1256
|
...options.schemaOnly ? {
|
|
1190
1257
|
inputSchema: contract.inputSchema,
|
|
@@ -1207,8 +1274,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1207
1274
|
return 0;
|
|
1208
1275
|
}
|
|
1209
1276
|
if (options.contractJson) {
|
|
1210
|
-
|
|
1211
|
-
...
|
|
1277
|
+
_chunk3ACMRZRVjs.printCompactJson.call(void 0, {
|
|
1278
|
+
..._chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1212
1279
|
tool,
|
|
1213
1280
|
toolId,
|
|
1214
1281
|
void 0,
|
|
@@ -1221,8 +1288,8 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1221
1288
|
}
|
|
1222
1289
|
const emitJson = options.json === true;
|
|
1223
1290
|
if (emitJson) {
|
|
1224
|
-
|
|
1225
|
-
...
|
|
1291
|
+
_chunk3ACMRZRVjs.printCompactJson.call(void 0, {
|
|
1292
|
+
..._chunk5LEAXRHVjs.toolMetadataJsonForDescribe.call(void 0, tool, toolId, seedToolListScript),
|
|
1226
1293
|
...modelDescription ? { modelOptions: modelDescription } : {},
|
|
1227
1294
|
...inferenceQuote ? { inferenceQuote } : {}
|
|
1228
1295
|
});
|
|
@@ -1247,7 +1314,7 @@ async function getTool(toolId, options = {}, compatibilityMetadata) {
|
|
|
1247
1314
|
printCompactToolContract(tool, toolId);
|
|
1248
1315
|
if (modelDescription) {
|
|
1249
1316
|
process.stdout.write(`
|
|
1250
|
-
${
|
|
1317
|
+
${_chunk5LEAXRHVjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1251
1318
|
}
|
|
1252
1319
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1253
1320
|
return 0;
|
|
@@ -1255,7 +1322,7 @@ ${_chunkZ2GUFYT6js.formatModelDescription.call(void 0, modelDescription)}`);
|
|
|
1255
1322
|
printCompactToolContract(tool, toolId);
|
|
1256
1323
|
if (modelDescription) {
|
|
1257
1324
|
process.stdout.write(`
|
|
1258
|
-
${
|
|
1325
|
+
${_chunk5LEAXRHVjs.formatModelDescription.call(void 0, modelDescription)}`);
|
|
1259
1326
|
}
|
|
1260
1327
|
if (inferenceQuote) printInferenceQuoteSummary(inferenceQuote);
|
|
1261
1328
|
return 0;
|
|
@@ -1272,10 +1339,10 @@ function printInferenceQuoteSummary(quote) {
|
|
|
1272
1339
|
for (const line of inferenceQuoteSummaryLines(quote)) console.log(line);
|
|
1273
1340
|
}
|
|
1274
1341
|
function printMonitorTypeFilters(tool) {
|
|
1275
|
-
const schema =
|
|
1276
|
-
const properties =
|
|
1342
|
+
const schema = _chunk5LEAXRHVjs.recordField.call(void 0, tool, "payload_schema", "payloadSchema");
|
|
1343
|
+
const properties = _chunk5LEAXRHVjs.recordField.call(void 0, schema, "properties");
|
|
1277
1344
|
const required = new Set(
|
|
1278
|
-
|
|
1345
|
+
_chunk5LEAXRHVjs.arrayField.call(void 0, schema, "required").filter(
|
|
1279
1346
|
(v) => typeof v === "string"
|
|
1280
1347
|
)
|
|
1281
1348
|
);
|
|
@@ -1286,24 +1353,24 @@ function printMonitorTypeFilters(tool) {
|
|
|
1286
1353
|
}
|
|
1287
1354
|
console.log("Deploy filters (set in the monitor payload):");
|
|
1288
1355
|
for (const name of names) {
|
|
1289
|
-
const field =
|
|
1356
|
+
const field = _chunk5LEAXRHVjs.isRecord.call(void 0, properties[name]) ? properties[name] : {};
|
|
1290
1357
|
const star = required.has(name) ? "*" : "";
|
|
1291
|
-
const enumVals =
|
|
1358
|
+
const enumVals = _chunk5LEAXRHVjs.arrayField.call(void 0, field, "enum").filter(
|
|
1292
1359
|
(v) => typeof v === "string"
|
|
1293
1360
|
);
|
|
1294
|
-
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` :
|
|
1295
|
-
const desc =
|
|
1361
|
+
const type = enumVals.length ? `one of [${enumVals.join(", ")}]` : _chunk5LEAXRHVjs.stringField.call(void 0, field, "type") || "string";
|
|
1362
|
+
const desc = _chunk5LEAXRHVjs.stringField.call(void 0, field, "description");
|
|
1296
1363
|
console.log(`- ${name}${star}: ${type}${desc ? ` - ${desc}` : ""}`);
|
|
1297
1364
|
}
|
|
1298
1365
|
}
|
|
1299
1366
|
function printMonitorTypeFilterExamples(tool) {
|
|
1300
|
-
const documentation =
|
|
1301
|
-
const fields =
|
|
1367
|
+
const documentation = _chunk5LEAXRHVjs.recordField.call(void 0, tool, "documentation");
|
|
1368
|
+
const fields = _chunk5LEAXRHVjs.recordField.call(void 0, documentation, "fields");
|
|
1302
1369
|
const examples = Object.entries(fields).flatMap(([name, rawField]) => {
|
|
1303
|
-
const grammar =
|
|
1304
|
-
const example =
|
|
1370
|
+
const grammar = _chunk5LEAXRHVjs.recordField.call(void 0, _chunk5LEAXRHVjs.isRecord.call(void 0, rawField) ? rawField : {}, "grammar");
|
|
1371
|
+
const example = _chunk5LEAXRHVjs.stringField.call(void 0, grammar, "example");
|
|
1305
1372
|
const values = [
|
|
1306
|
-
...
|
|
1373
|
+
..._chunk5LEAXRHVjs.arrayField.call(void 0, grammar, "examples").filter(
|
|
1307
1374
|
(value) => typeof value === "string" && Boolean(value)
|
|
1308
1375
|
),
|
|
1309
1376
|
...example ? [example] : []
|
|
@@ -1318,21 +1385,21 @@ function printMonitorTypeFilterExamples(tool) {
|
|
|
1318
1385
|
}
|
|
1319
1386
|
}
|
|
1320
1387
|
function printMonitorTypeStreams(tool) {
|
|
1321
|
-
const streams =
|
|
1322
|
-
|
|
1388
|
+
const streams = _chunk5LEAXRHVjs.arrayField.call(void 0, tool, "streams", "output_streams").filter(
|
|
1389
|
+
_chunk5LEAXRHVjs.isRecord
|
|
1323
1390
|
);
|
|
1324
1391
|
if (!streams.length) return;
|
|
1325
1392
|
console.log("");
|
|
1326
1393
|
console.log("Filter columns (a play's sqlListeners.where, per stream):");
|
|
1327
1394
|
for (const stream of streams) {
|
|
1328
|
-
const name =
|
|
1329
|
-
const cols =
|
|
1395
|
+
const name = _chunk5LEAXRHVjs.stringField.call(void 0, stream, "stream");
|
|
1396
|
+
const cols = _chunk5LEAXRHVjs.arrayField.call(void 0, stream, "columns").filter(_chunk5LEAXRHVjs.isRecord).map((col) => _chunk5LEAXRHVjs.stringField.call(void 0, col, "name")).filter(Boolean);
|
|
1330
1397
|
console.log(`- ${name}: ${cols.join(", ")}`);
|
|
1331
1398
|
}
|
|
1332
1399
|
}
|
|
1333
1400
|
function monitorTypePricingLines(tool) {
|
|
1334
|
-
const pricing =
|
|
1335
|
-
const byType =
|
|
1401
|
+
const pricing = _chunk5LEAXRHVjs.recordField.call(void 0, tool, "pricing");
|
|
1402
|
+
const byType = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
1336
1403
|
pricing,
|
|
1337
1404
|
"pricing_by_radar_type",
|
|
1338
1405
|
"pricingByRadarType"
|
|
@@ -1343,9 +1410,9 @@ function monitorTypePricingLines(tool) {
|
|
|
1343
1410
|
}
|
|
1344
1411
|
const lines = ["Pricing (Deepline credits per accepted event):"];
|
|
1345
1412
|
for (const key of keys) {
|
|
1346
|
-
const entry =
|
|
1413
|
+
const entry = _chunk5LEAXRHVjs.isRecord.call(void 0, byType[key]) ? byType[key] : {};
|
|
1347
1414
|
const credits = numberField(entry, "deepline_credits", "deeplineCredits");
|
|
1348
|
-
const display =
|
|
1415
|
+
const display = _chunk5LEAXRHVjs.stringField.call(void 0, entry, "display");
|
|
1349
1416
|
const shown = display || (credits !== null ? `${formatDecimal(credits)} credits/event` : "not listed");
|
|
1350
1417
|
lines.push(`- ${key}: ${shown}`);
|
|
1351
1418
|
}
|
|
@@ -1355,20 +1422,20 @@ function printMonitorTypePricing(tool) {
|
|
|
1355
1422
|
for (const line of monitorTypePricingLines(tool)) console.log(line);
|
|
1356
1423
|
}
|
|
1357
1424
|
function printMonitorTypeDeploy(tool) {
|
|
1358
|
-
const deploy =
|
|
1359
|
-
const toolId =
|
|
1360
|
-
const example =
|
|
1425
|
+
const deploy = _chunk5LEAXRHVjs.recordField.call(void 0, tool, "deploy");
|
|
1426
|
+
const toolId = _chunk5LEAXRHVjs.stringField.call(void 0, tool, "toolId");
|
|
1427
|
+
const example = _chunk5LEAXRHVjs.stringField.call(void 0, deploy, "example") || `deepline monitors deploy '{"key":"...","tool":"${toolId}","payload":{...}}'`;
|
|
1361
1428
|
console.log("Deploy (a monitor type is deployed, not executed):");
|
|
1362
1429
|
console.log(` ${example}`);
|
|
1363
1430
|
}
|
|
1364
1431
|
function printMonitorTypeContract(tool, requestedToolId) {
|
|
1365
|
-
const toolId =
|
|
1432
|
+
const toolId = _chunk5LEAXRHVjs.stringField.call(void 0, tool, "toolId") || requestedToolId;
|
|
1366
1433
|
console.log(toolId);
|
|
1367
|
-
const displayName =
|
|
1434
|
+
const displayName = _chunk5LEAXRHVjs.stringField.call(void 0, tool, "displayName");
|
|
1368
1435
|
if (displayName) console.log(`Best for: ${displayName}`);
|
|
1369
|
-
const description =
|
|
1436
|
+
const description = _chunk5LEAXRHVjs.stringField.call(void 0, tool, "description");
|
|
1370
1437
|
if (description) console.log(`Description: ${description}`);
|
|
1371
|
-
const categories =
|
|
1438
|
+
const categories = _chunk5LEAXRHVjs.arrayField.call(void 0, tool, "categories").filter(
|
|
1372
1439
|
(v) => typeof v === "string"
|
|
1373
1440
|
);
|
|
1374
1441
|
if (categories.length) console.log(`Tags: ${categories.join(", ")}`);
|
|
@@ -1388,31 +1455,31 @@ function printMonitorTypeContract(tool, requestedToolId) {
|
|
|
1388
1455
|
console.log(`More: deepline describe ${toolId}`);
|
|
1389
1456
|
}
|
|
1390
1457
|
function toolGuidanceLines(guidance) {
|
|
1391
|
-
const record =
|
|
1392
|
-
const toolGuidance =
|
|
1393
|
-
const providerGuidance =
|
|
1458
|
+
const record = _chunk5LEAXRHVjs.isRecord.call(void 0, guidance) ? guidance : {};
|
|
1459
|
+
const toolGuidance = _chunk5LEAXRHVjs.stringField.call(void 0, record, "tool");
|
|
1460
|
+
const providerGuidance = _chunk5LEAXRHVjs.stringField.call(void 0, record, "provider");
|
|
1394
1461
|
return [
|
|
1395
1462
|
...toolGuidance ? [`- This tool: ${toolGuidance}`] : [],
|
|
1396
1463
|
...providerGuidance ? [`- Provider: ${providerGuidance}`] : []
|
|
1397
1464
|
];
|
|
1398
1465
|
}
|
|
1399
1466
|
function printCompactToolContract(tool, requestedToolId) {
|
|
1400
|
-
if (
|
|
1467
|
+
if (_chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1401
1468
|
printMonitorTypeContract(tool, requestedToolId);
|
|
1402
1469
|
return;
|
|
1403
1470
|
}
|
|
1404
|
-
const contract =
|
|
1471
|
+
const contract = _chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1405
1472
|
tool,
|
|
1406
1473
|
requestedToolId,
|
|
1407
1474
|
void 0,
|
|
1408
1475
|
seedToolListScript
|
|
1409
1476
|
);
|
|
1410
|
-
const cost =
|
|
1411
|
-
const getters =
|
|
1477
|
+
const cost = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.cost) ? contract.cost : {};
|
|
1478
|
+
const getters = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1412
1479
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1413
1480
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1414
|
-
const inputFields =
|
|
1415
|
-
|
|
1481
|
+
const inputFields = _chunk5LEAXRHVjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1482
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, contract, "inputSchema")
|
|
1416
1483
|
);
|
|
1417
1484
|
console.log(String(contract.toolId));
|
|
1418
1485
|
if (contract.displayName) console.log(`Best for: ${contract.displayName}`);
|
|
@@ -1429,9 +1496,9 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1429
1496
|
printToolOutputArrayShape(contract);
|
|
1430
1497
|
printToolExecutionHints(contract);
|
|
1431
1498
|
if (contract.deprecated === true) {
|
|
1432
|
-
const deprecation =
|
|
1433
|
-
const message =
|
|
1434
|
-
const replacementToolId =
|
|
1499
|
+
const deprecation = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.deprecation) ? contract.deprecation : {};
|
|
1500
|
+
const message = _chunk5LEAXRHVjs.stringField.call(void 0, deprecation, "message");
|
|
1501
|
+
const replacementToolId = _chunk5LEAXRHVjs.stringField.call(void 0,
|
|
1435
1502
|
deprecation,
|
|
1436
1503
|
"replacementToolId",
|
|
1437
1504
|
"replacement_tool_id"
|
|
@@ -1441,9 +1508,7 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1441
1508
|
);
|
|
1442
1509
|
if (message) console.log(`Migration: ${message}`);
|
|
1443
1510
|
if (replacementToolId) {
|
|
1444
|
-
console.log(
|
|
1445
|
-
`Use: deepline tools execute ${replacementToolId} --input '{...}'`
|
|
1446
|
-
);
|
|
1511
|
+
console.log(`Use: deepline run ${replacementToolId} --input '{...}'`);
|
|
1447
1512
|
}
|
|
1448
1513
|
console.log("");
|
|
1449
1514
|
console.log(
|
|
@@ -1456,12 +1521,12 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1456
1521
|
console.log("");
|
|
1457
1522
|
console.log("Inputs:");
|
|
1458
1523
|
for (const field of inputFields) {
|
|
1459
|
-
if (!
|
|
1460
|
-
const name =
|
|
1524
|
+
if (!_chunk5LEAXRHVjs.isRecord.call(void 0, field)) continue;
|
|
1525
|
+
const name = _chunk5LEAXRHVjs.stringField.call(void 0, field, "name");
|
|
1461
1526
|
if (!name) continue;
|
|
1462
1527
|
const required = field.required ? "*" : "";
|
|
1463
|
-
const type =
|
|
1464
|
-
const description =
|
|
1528
|
+
const type = _chunk5LEAXRHVjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1529
|
+
const description = _chunk5LEAXRHVjs.stringField.call(void 0, field, "description");
|
|
1465
1530
|
const enumValues = Array.isArray(field.enum) ? field.enum : [];
|
|
1466
1531
|
const enumSuffix = enumValues.length ? ` enum=${enumValues.map(String).join("|")}` : "";
|
|
1467
1532
|
const itemBoundsSuffix = arrayItemBoundsSuffix(field);
|
|
@@ -1476,8 +1541,8 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1476
1541
|
}
|
|
1477
1542
|
console.log("");
|
|
1478
1543
|
printToolExamplesOnly(tool, requestedToolId);
|
|
1479
|
-
const starterScript =
|
|
1480
|
-
const starterPath =
|
|
1544
|
+
const starterScript = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.starterScript) ? contract.starterScript : {};
|
|
1545
|
+
const starterPath = _chunk5LEAXRHVjs.stringField.call(void 0, starterScript, "path");
|
|
1481
1546
|
if (starterPath) {
|
|
1482
1547
|
console.log("");
|
|
1483
1548
|
console.log(`Starter script: ${starterPath}`);
|
|
@@ -1488,16 +1553,16 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1488
1553
|
console.log("Getters:");
|
|
1489
1554
|
if (listGetters.length) console.log(listGetterHeading());
|
|
1490
1555
|
for (const entry of listGetters) {
|
|
1491
|
-
if (
|
|
1556
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, entry))
|
|
1492
1557
|
console.log(
|
|
1493
|
-
`- ${
|
|
1558
|
+
`- ${_chunk5LEAXRHVjs.stringField.call(void 0, entry, "name")}: ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, entry)}`
|
|
1494
1559
|
);
|
|
1495
1560
|
}
|
|
1496
1561
|
if (valueGetters.length) console.log("Values:");
|
|
1497
1562
|
for (const entry of valueGetters) {
|
|
1498
|
-
if (
|
|
1563
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, entry))
|
|
1499
1564
|
console.log(
|
|
1500
|
-
`- ${
|
|
1565
|
+
`- ${_chunk5LEAXRHVjs.stringField.call(void 0, entry, "name")}: ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, entry)}`
|
|
1501
1566
|
);
|
|
1502
1567
|
}
|
|
1503
1568
|
}
|
|
@@ -1508,19 +1573,19 @@ function printCompactToolContract(tool, requestedToolId) {
|
|
|
1508
1573
|
console.log(`More: deepline describe ${contract.toolId}`);
|
|
1509
1574
|
}
|
|
1510
1575
|
function toolPricingOnlyLines(tool, requestedToolId, options = {}) {
|
|
1511
|
-
if (
|
|
1576
|
+
if (_chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1512
1577
|
return monitorTypePricingLines(tool);
|
|
1513
1578
|
}
|
|
1514
1579
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1515
1580
|
const cost = _chunkZM2YPJQJjs.Capability.fromCatalogEntry(tool).describe().customerCost();
|
|
1516
|
-
const pricingModel =
|
|
1517
|
-
const billing =
|
|
1518
|
-
const explicitUnit =
|
|
1581
|
+
const pricingModel = _chunk5LEAXRHVjs.stringField.call(void 0, cost, "pricingModel") || "unknown";
|
|
1582
|
+
const billing = _chunk5LEAXRHVjs.stringField.call(void 0, cost, "billingSourceLabel") || _chunk5LEAXRHVjs.stringField.call(void 0, cost, "billingSource") || _chunk5LEAXRHVjs.stringField.call(void 0, cost, "billingMode") || "unknown";
|
|
1583
|
+
const explicitUnit = _chunk5LEAXRHVjs.stringField.call(void 0, cost, "unit");
|
|
1519
1584
|
const unit = explicitUnit || (pricingModel === "per_page" ? "page" : pricingModel === "per_result" ? "result" : pricingModel === "fixed" ? "call" : pricingModel.replace(/^per_/, "") || "unit");
|
|
1520
1585
|
const credits = numberField(cost, "deeplineCreditsPerPricingUnit");
|
|
1521
1586
|
const usd = numberField(cost, "deeplineUsdPerPricingUnit");
|
|
1522
|
-
const displayText =
|
|
1523
|
-
const summary =
|
|
1587
|
+
const displayText = _chunk5LEAXRHVjs.stringField.call(void 0, cost, "displayText");
|
|
1588
|
+
const summary = _chunk5LEAXRHVjs.stringField.call(void 0, cost, "summary");
|
|
1524
1589
|
const price = displayText || summary || (credits !== null ? `${formatDecimal(credits)} Deepline credits${usd !== null ? ` / ${formatUsd(usd)}` : ""} per ${unit}` : "pricing unavailable");
|
|
1525
1590
|
return [
|
|
1526
1591
|
`${_nullishCoalesce(options.heading, () => ( `Pricing: ${toolId}`))}: ${price}`,
|
|
@@ -1537,19 +1602,19 @@ function printToolPricingOnly(tool, requestedToolId, options = {}) {
|
|
|
1537
1602
|
console.log(line);
|
|
1538
1603
|
}
|
|
1539
1604
|
function printToolSchemaOnly(tool, requestedToolId) {
|
|
1540
|
-
if (
|
|
1605
|
+
if (_chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1541
1606
|
printMonitorTypeFilters(tool);
|
|
1542
1607
|
printMonitorTypeStreams(tool);
|
|
1543
1608
|
return;
|
|
1544
1609
|
}
|
|
1545
|
-
const contract =
|
|
1610
|
+
const contract = _chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1546
1611
|
tool,
|
|
1547
1612
|
requestedToolId,
|
|
1548
1613
|
void 0,
|
|
1549
1614
|
seedToolListScript
|
|
1550
1615
|
);
|
|
1551
|
-
const inputFields =
|
|
1552
|
-
|
|
1616
|
+
const inputFields = _chunk5LEAXRHVjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1617
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, contract, "inputSchema")
|
|
1553
1618
|
);
|
|
1554
1619
|
console.log(`Schema: ${contract.toolId}`);
|
|
1555
1620
|
if (!inputFields.length) {
|
|
@@ -1576,27 +1641,27 @@ function printToolSchemaOnly(tool, requestedToolId) {
|
|
|
1576
1641
|
}
|
|
1577
1642
|
printToolOutputArrayShape(contract);
|
|
1578
1643
|
const declaredSchema = declaredToolJsonSchema(
|
|
1579
|
-
|
|
1644
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, contract, "inputSchema")
|
|
1580
1645
|
);
|
|
1581
1646
|
if (declaredSchema) {
|
|
1582
1647
|
console.log("Declared input JSON Schema:");
|
|
1583
1648
|
console.log(JSON.stringify(declaredSchema, null, 2));
|
|
1584
1649
|
}
|
|
1585
|
-
if (
|
|
1650
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, contract.responseSchema)) {
|
|
1586
1651
|
console.log("Deepline execution response JSON Schema:");
|
|
1587
1652
|
console.log(JSON.stringify(contract.responseSchema, null, 2));
|
|
1588
1653
|
}
|
|
1589
1654
|
}
|
|
1590
1655
|
function printToolExamplesOnly(tool, requestedToolId) {
|
|
1591
|
-
if (
|
|
1656
|
+
if (_chunk5LEAXRHVjs.isMonitorTypeTool.call(void 0, tool)) {
|
|
1592
1657
|
printMonitorTypeDeploy(tool);
|
|
1593
1658
|
return;
|
|
1594
1659
|
}
|
|
1595
|
-
if (
|
|
1660
|
+
if (_chunk5LEAXRHVjs.isPlayLikeTool.call(void 0, tool)) {
|
|
1596
1661
|
printPlayLikeToolUsage(tool, requestedToolId);
|
|
1597
1662
|
return;
|
|
1598
1663
|
}
|
|
1599
|
-
const contract =
|
|
1664
|
+
const contract = _chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1600
1665
|
tool,
|
|
1601
1666
|
requestedToolId,
|
|
1602
1667
|
void 0,
|
|
@@ -1604,9 +1669,9 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1604
1669
|
);
|
|
1605
1670
|
const toolId = String(contract.toolId);
|
|
1606
1671
|
const inputFields = Array.isArray(contract.inputFields) ? contract.inputFields : [];
|
|
1607
|
-
const examples =
|
|
1672
|
+
const examples = _chunk5LEAXRHVjs.arrayField.call(void 0, tool, "examples").filter(_chunk5LEAXRHVjs.isRecord);
|
|
1608
1673
|
const firstExample = examples[0];
|
|
1609
|
-
const sampleInput = firstExample &&
|
|
1674
|
+
const sampleInput = firstExample && _chunk5LEAXRHVjs.isRecord.call(void 0, firstExample.input) ? firstExample.input : _nullishCoalesce(samplePayload(_chunk5LEAXRHVjs.recordField.call(void 0, tool, "samples"), "request"), () => ( _chunk5LEAXRHVjs.samplePayloadForInputFields.call(void 0, inputFields)));
|
|
1610
1675
|
console.log("Example input payload:");
|
|
1611
1676
|
console.log(JSON.stringify(sampleInput, null, 2));
|
|
1612
1677
|
console.log(`Use in a play:`);
|
|
@@ -1620,32 +1685,32 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1620
1685
|
);
|
|
1621
1686
|
console.log("});");
|
|
1622
1687
|
console.log("const response = result.toolResponse.rawV2;");
|
|
1623
|
-
const getters =
|
|
1688
|
+
const getters = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1624
1689
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1625
1690
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1626
|
-
const firstGetter = valueGetters.find(
|
|
1691
|
+
const firstGetter = valueGetters.find(_chunk5LEAXRHVjs.isRecord);
|
|
1627
1692
|
if (firstGetter) {
|
|
1628
|
-
const name =
|
|
1629
|
-
const expression =
|
|
1693
|
+
const name = _chunk5LEAXRHVjs.stringField.call(void 0, firstGetter, "name") || "value";
|
|
1694
|
+
const expression = _chunk5LEAXRHVjs.stringField.call(void 0, firstGetter, "expression");
|
|
1630
1695
|
if (expression)
|
|
1631
1696
|
console.log(
|
|
1632
1697
|
`const ${safeIdentifier(name)} = ${expression.replace(/^toolExecutionResult\./, "result.")};`
|
|
1633
1698
|
);
|
|
1634
1699
|
}
|
|
1635
1700
|
const arrayNames = new Set(
|
|
1636
|
-
|
|
1637
|
-
|
|
1701
|
+
_chunk5LEAXRHVjs.recursiveToolInputFieldsForDisplay.call(void 0,
|
|
1702
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, tool, "outputSchema", "output_schema")
|
|
1638
1703
|
).filter((field) => String(field.type).split("|").includes("array")).map((field) => String(field.name).split(".").at(-1))
|
|
1639
1704
|
);
|
|
1640
1705
|
const firstList = _nullishCoalesce(listGetters.find(
|
|
1641
|
-
(entry) =>
|
|
1642
|
-
), () => ( listGetters.find(
|
|
1643
|
-
if (
|
|
1644
|
-
const name = safeIdentifier(
|
|
1706
|
+
(entry) => _chunk5LEAXRHVjs.isRecord.call(void 0, entry) && arrayNames.has(_chunk5LEAXRHVjs.stringField.call(void 0, entry, "name"))
|
|
1707
|
+
), () => ( listGetters.find(_chunk5LEAXRHVjs.isRecord)));
|
|
1708
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, firstList)) {
|
|
1709
|
+
const name = safeIdentifier(_chunk5LEAXRHVjs.stringField.call(void 0, firstList, "name") || "list");
|
|
1645
1710
|
if (_chunkJ33TSWO5js.playToolListGetterMode.call(void 0, ) === "array") {
|
|
1646
|
-
console.log(`const ${name}_rows = ${
|
|
1711
|
+
console.log(`const ${name}_rows = ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, firstList)};`);
|
|
1647
1712
|
} else {
|
|
1648
|
-
console.log(`const ${name}_ds = ${
|
|
1713
|
+
console.log(`const ${name}_ds = ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, firstList)};`);
|
|
1649
1714
|
console.log(
|
|
1650
1715
|
"// Complete small list from this response; throws above the memory cap."
|
|
1651
1716
|
);
|
|
@@ -1655,7 +1720,7 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1655
1720
|
console.log("```");
|
|
1656
1721
|
if (firstList) printListGetterConsumption();
|
|
1657
1722
|
for (const example of examples) {
|
|
1658
|
-
const description =
|
|
1723
|
+
const description = _chunk5LEAXRHVjs.stringField.call(void 0, example, "description");
|
|
1659
1724
|
if (description) console.log(description);
|
|
1660
1725
|
console.log("Example Deepline execution response:");
|
|
1661
1726
|
console.log(JSON.stringify(example.response, null, 2));
|
|
@@ -1670,14 +1735,14 @@ function printToolExamplesOnly(tool, requestedToolId) {
|
|
|
1670
1735
|
}
|
|
1671
1736
|
function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
1672
1737
|
const toolId = String(tool.toolId || requestedToolId);
|
|
1673
|
-
const inputFields =
|
|
1674
|
-
|
|
1738
|
+
const inputFields = _chunk5LEAXRHVjs.toolInputFieldsForDisplay.call(void 0,
|
|
1739
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, tool, "inputSchema", "input_schema")
|
|
1675
1740
|
);
|
|
1676
|
-
const sampleInput =
|
|
1677
|
-
const playReference =
|
|
1741
|
+
const sampleInput = _chunk5LEAXRHVjs.samplePayloadForInputFields.call(void 0, inputFields);
|
|
1742
|
+
const playReference = _chunk5LEAXRHVjs.playReferenceForTool.call(void 0, tool);
|
|
1678
1743
|
console.log("Run as a play:");
|
|
1679
1744
|
console.log(
|
|
1680
|
-
|
|
1745
|
+
_chunk5LEAXRHVjs.playRunCommandForTool.call(void 0,
|
|
1681
1746
|
tool,
|
|
1682
1747
|
toolId,
|
|
1683
1748
|
Object.keys(sampleInput).length ? sampleInput : void 0
|
|
@@ -1688,13 +1753,13 @@ function printPlayLikeToolUsage(tool, requestedToolId) {
|
|
|
1688
1753
|
}
|
|
1689
1754
|
}
|
|
1690
1755
|
function printToolGettersOnly(tool, requestedToolId) {
|
|
1691
|
-
const contract =
|
|
1756
|
+
const contract = _chunk5LEAXRHVjs.toolContractJsonForDescribe.call(void 0,
|
|
1692
1757
|
tool,
|
|
1693
1758
|
requestedToolId,
|
|
1694
1759
|
void 0,
|
|
1695
1760
|
seedToolListScript
|
|
1696
1761
|
);
|
|
1697
|
-
const getters =
|
|
1762
|
+
const getters = _chunk5LEAXRHVjs.isRecord.call(void 0, contract.getters) ? contract.getters : {};
|
|
1698
1763
|
const listGetters = Array.isArray(getters.extractedLists) ? getters.extractedLists : [];
|
|
1699
1764
|
const valueGetters = Array.isArray(getters.extractedValues) ? getters.extractedValues : [];
|
|
1700
1765
|
console.log(`Getters: ${contract.toolId}`);
|
|
@@ -1705,9 +1770,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1705
1770
|
if (listGetters.length) {
|
|
1706
1771
|
console.log(listGetterHeading());
|
|
1707
1772
|
for (const entry of listGetters) {
|
|
1708
|
-
if (
|
|
1773
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, entry))
|
|
1709
1774
|
console.log(
|
|
1710
|
-
`- ${
|
|
1775
|
+
`- ${_chunk5LEAXRHVjs.stringField.call(void 0, entry, "name")}: ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, entry)}`
|
|
1711
1776
|
);
|
|
1712
1777
|
}
|
|
1713
1778
|
printListGetterConsumption();
|
|
@@ -1715,9 +1780,9 @@ function printToolGettersOnly(tool, requestedToolId) {
|
|
|
1715
1780
|
if (valueGetters.length) {
|
|
1716
1781
|
console.log("Values:");
|
|
1717
1782
|
for (const entry of valueGetters) {
|
|
1718
|
-
if (
|
|
1783
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, entry))
|
|
1719
1784
|
console.log(
|
|
1720
|
-
`- ${
|
|
1785
|
+
`- ${_chunk5LEAXRHVjs.stringField.call(void 0, entry, "name")}: ${_chunk5LEAXRHVjs.playResultExpression.call(void 0, entry)}`
|
|
1721
1786
|
);
|
|
1722
1787
|
}
|
|
1723
1788
|
}
|
|
@@ -1755,22 +1820,22 @@ function listedToolDescription(tool) {
|
|
|
1755
1820
|
}
|
|
1756
1821
|
function formatListedToolCost(tool) {
|
|
1757
1822
|
const record = tool;
|
|
1758
|
-
if (
|
|
1823
|
+
if (_chunk5LEAXRHVjs.stringField.call(void 0, record, "billingSource", "billing_source") === "free") {
|
|
1759
1824
|
return "Cost: Free";
|
|
1760
1825
|
}
|
|
1761
|
-
const pricing =
|
|
1762
|
-
const displayText =
|
|
1826
|
+
const pricing = _chunk5LEAXRHVjs.recordField.call(void 0, record, "pricing");
|
|
1827
|
+
const displayText = _chunk5LEAXRHVjs.stringField.call(void 0, pricing, "displayText", "display_text");
|
|
1763
1828
|
return displayText ? `Cost: ${displayText}` : "";
|
|
1764
1829
|
}
|
|
1765
1830
|
function printToolOutputArrayShape(tool) {
|
|
1766
|
-
const outputFields =
|
|
1767
|
-
|
|
1831
|
+
const outputFields = _chunk5LEAXRHVjs.toolOutputFieldsForDisplay.call(void 0,
|
|
1832
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, _chunk5LEAXRHVjs.isRecord.call(void 0, tool) ? tool : {}, "outputSchema", "output_schema")
|
|
1768
1833
|
);
|
|
1769
1834
|
if (outputFields.length === 0) return;
|
|
1770
1835
|
console.log(" Output array shape (declared schema):");
|
|
1771
1836
|
for (const field of outputFields.slice(0, 60)) {
|
|
1772
1837
|
const name = String(field.name);
|
|
1773
|
-
const type =
|
|
1838
|
+
const type = _chunk5LEAXRHVjs.stringField.call(void 0, field, "type") || "unknown";
|
|
1774
1839
|
const itemBounds = arrayItemBoundsSuffix(field);
|
|
1775
1840
|
console.log(` - ${name}: ${type}${itemBounds}`);
|
|
1776
1841
|
}
|
|
@@ -1779,14 +1844,14 @@ function printToolOutputArrayShape(tool) {
|
|
|
1779
1844
|
}
|
|
1780
1845
|
}
|
|
1781
1846
|
function declaredToolJsonSchema(inputSchema) {
|
|
1782
|
-
if (
|
|
1847
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, inputSchema.jsonSchema)) {
|
|
1783
1848
|
return inputSchema.jsonSchema;
|
|
1784
1849
|
}
|
|
1785
1850
|
return Array.isArray(inputSchema.fields) ? null : inputSchema;
|
|
1786
1851
|
}
|
|
1787
1852
|
function arrayItemBoundsSuffix(field) {
|
|
1788
|
-
const itemSchema =
|
|
1789
|
-
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type :
|
|
1853
|
+
const itemSchema = _chunk5LEAXRHVjs.isRecord.call(void 0, field.items) ? field.items : null;
|
|
1854
|
+
const itemType = itemSchema ? typeof itemSchema.type === "string" ? itemSchema.type : _chunk5LEAXRHVjs.isRecord.call(void 0, itemSchema.properties) ? "object" : "unknown" : null;
|
|
1790
1855
|
const itemEnum = Array.isArray(_optionalChain([itemSchema, 'optionalAccess', _14 => _14.enum])) ? ` enum=${itemSchema.enum.map(String).join("|")}` : "";
|
|
1791
1856
|
const itemTypeSuffix = itemType && itemType !== "unknown" ? ` items=${itemType}${itemEnum}` : "";
|
|
1792
1857
|
const minItems = typeof field.minItems === "number" && Number.isFinite(field.minItems) ? field.minItems : null;
|
|
@@ -1799,21 +1864,21 @@ function arrayItemBoundsSuffix(field) {
|
|
|
1799
1864
|
return itemTypeSuffix;
|
|
1800
1865
|
}
|
|
1801
1866
|
function printToolExecutionHints(value) {
|
|
1802
|
-
const batchCapabilityRecord =
|
|
1803
|
-
|
|
1867
|
+
const batchCapabilityRecord = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
1868
|
+
_chunk5LEAXRHVjs.isRecord.call(void 0, value) ? value : {},
|
|
1804
1869
|
"batchCapability",
|
|
1805
1870
|
"batch_capability"
|
|
1806
1871
|
);
|
|
1807
1872
|
const batchCapability = Object.keys(batchCapabilityRecord).length > 0 ? batchCapabilityRecord : null;
|
|
1808
|
-
const executionMetadata =
|
|
1809
|
-
|
|
1873
|
+
const executionMetadata = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
1874
|
+
_chunk5LEAXRHVjs.isRecord.call(void 0, value) ? value : {},
|
|
1810
1875
|
"executionMetadata",
|
|
1811
1876
|
"execution_metadata"
|
|
1812
1877
|
);
|
|
1813
1878
|
if (batchCapability) {
|
|
1814
|
-
const status =
|
|
1815
|
-
const surface =
|
|
1816
|
-
const operation =
|
|
1879
|
+
const status = _chunk5LEAXRHVjs.stringField.call(void 0, batchCapability, "status") || "unknown";
|
|
1880
|
+
const surface = _chunk5LEAXRHVjs.stringField.call(void 0, batchCapability, "surface");
|
|
1881
|
+
const operation = _chunk5LEAXRHVjs.stringField.call(void 0,
|
|
1817
1882
|
batchCapability,
|
|
1818
1883
|
"batchOperation",
|
|
1819
1884
|
"batch_operation"
|
|
@@ -1823,7 +1888,7 @@ function printToolExecutionHints(value) {
|
|
|
1823
1888
|
"maxBatchSize",
|
|
1824
1889
|
"max_batch_size"
|
|
1825
1890
|
);
|
|
1826
|
-
const notes =
|
|
1891
|
+
const notes = _chunk5LEAXRHVjs.stringField.call(void 0, batchCapability, "notes");
|
|
1827
1892
|
console.log("");
|
|
1828
1893
|
console.log("Batching:");
|
|
1829
1894
|
console.log(`- Catalog status: ${status}${surface ? ` (${surface})` : ""}`);
|
|
@@ -1833,7 +1898,7 @@ function printToolExecutionHints(value) {
|
|
|
1833
1898
|
}
|
|
1834
1899
|
if (status === "compiled") {
|
|
1835
1900
|
console.log(
|
|
1836
|
-
"- Compatible per-row Play calls can coalesce; separate
|
|
1901
|
+
"- Compatible per-row Play calls can coalesce; each separate deepline run call makes its own request."
|
|
1837
1902
|
);
|
|
1838
1903
|
} else if (surface !== "docs") {
|
|
1839
1904
|
console.log(
|
|
@@ -1842,11 +1907,11 @@ function printToolExecutionHints(value) {
|
|
|
1842
1907
|
}
|
|
1843
1908
|
if (notes) console.log(`- Details: ${notes}`);
|
|
1844
1909
|
}
|
|
1845
|
-
const configuredRateLimits =
|
|
1910
|
+
const configuredRateLimits = _chunk5LEAXRHVjs.arrayField.call(void 0,
|
|
1846
1911
|
executionMetadata,
|
|
1847
1912
|
"configuredRateLimits",
|
|
1848
1913
|
"configured_rate_limits"
|
|
1849
|
-
).filter(
|
|
1914
|
+
).filter(_chunk5LEAXRHVjs.isRecord);
|
|
1850
1915
|
if (configuredRateLimits.length > 0) {
|
|
1851
1916
|
console.log("");
|
|
1852
1917
|
console.log(
|
|
@@ -1856,7 +1921,7 @@ function printToolExecutionHints(value) {
|
|
|
1856
1921
|
const requests = numberField(limit, "requestsPerWindow");
|
|
1857
1922
|
const windowMs = numberField(limit, "windowMs");
|
|
1858
1923
|
if (requests === null || windowMs === null) continue;
|
|
1859
|
-
const usage =
|
|
1924
|
+
const usage = _chunk5LEAXRHVjs.stringField.call(void 0, limit, "usage") || "unknown";
|
|
1860
1925
|
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;
|
|
1861
1926
|
const explicitMaxConcurrency = numberField(
|
|
1862
1927
|
limit,
|
|
@@ -1865,11 +1930,11 @@ function printToolExecutionHints(value) {
|
|
|
1865
1930
|
);
|
|
1866
1931
|
const concurrencyText = explicitMaxConcurrency === null ? "no explicit concurrency limit" : `explicit concurrency limit ${explicitMaxConcurrency}`;
|
|
1867
1932
|
console.log(
|
|
1868
|
-
`- ${requests} requests per ${formatRateWindow(windowMs)}${
|
|
1933
|
+
`- ${requests} requests per ${formatRateWindow(windowMs)}${_chunkIAYSWZDJjs.rateLimitQualifier.call(void 0, limit)} (${usageText}; ${concurrencyText})`
|
|
1869
1934
|
);
|
|
1870
1935
|
}
|
|
1871
1936
|
}
|
|
1872
|
-
const queueHint =
|
|
1937
|
+
const queueHint = _chunk5LEAXRHVjs.recordField.call(void 0, executionMetadata, "queueHint", "queue_hint");
|
|
1873
1938
|
const requestsPerSecondHint = numberField(
|
|
1874
1939
|
queueHint,
|
|
1875
1940
|
"requestsPerSecondHint",
|
|
@@ -1895,25 +1960,25 @@ function formatRateWindow(windowMs) {
|
|
|
1895
1960
|
}
|
|
1896
1961
|
function samplePayload(samples, key) {
|
|
1897
1962
|
const entry = samples[key];
|
|
1898
|
-
if (!
|
|
1963
|
+
if (!_chunk5LEAXRHVjs.isRecord.call(void 0, entry)) return void 0;
|
|
1899
1964
|
return Object.prototype.hasOwnProperty.call(entry, "payload") ? entry.payload : entry;
|
|
1900
1965
|
}
|
|
1901
1966
|
function commandEnvelopeFromRawResponse(rawResponse) {
|
|
1902
|
-
return
|
|
1967
|
+
return _chunk5LEAXRHVjs.isRecord.call(void 0, rawResponse) ? { ...rawResponse } : { status: "completed", result: rawResponse };
|
|
1903
1968
|
}
|
|
1904
1969
|
function toolExecuteExitCode(envelope) {
|
|
1905
1970
|
return envelope.status === "failed" || envelope.ok === false ? 1 : 0;
|
|
1906
1971
|
}
|
|
1907
1972
|
function extractToolExecutionWarningMessages(rawResponse) {
|
|
1908
|
-
if (!
|
|
1973
|
+
if (!_chunk5LEAXRHVjs.isRecord.call(void 0, rawResponse)) return [];
|
|
1909
1974
|
const candidates = [
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1975
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, _chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "toolResponse"), "meta"),
|
|
1976
|
+
_chunk5LEAXRHVjs.recordField.call(void 0,
|
|
1977
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, _chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "toolResponse"), "raw"),
|
|
1913
1978
|
"meta"
|
|
1914
1979
|
),
|
|
1915
|
-
|
|
1916
|
-
|
|
1980
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "meta"),
|
|
1981
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, _chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "result"), "meta")
|
|
1917
1982
|
];
|
|
1918
1983
|
const messages = [];
|
|
1919
1984
|
for (const candidate of candidates) {
|
|
@@ -1922,8 +1987,8 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1922
1987
|
for (const warning of warnings) {
|
|
1923
1988
|
if (typeof warning === "string" && warning.trim()) {
|
|
1924
1989
|
messages.push(warning.trim());
|
|
1925
|
-
} else if (
|
|
1926
|
-
const message =
|
|
1990
|
+
} else if (_chunk5LEAXRHVjs.isRecord.call(void 0, warning)) {
|
|
1991
|
+
const message = _chunk5LEAXRHVjs.stringField.call(void 0, warning, "message");
|
|
1927
1992
|
if (message) messages.push(message);
|
|
1928
1993
|
}
|
|
1929
1994
|
}
|
|
@@ -1931,30 +1996,30 @@ function extractToolExecutionWarningMessages(rawResponse) {
|
|
|
1931
1996
|
return [...new Set(messages)];
|
|
1932
1997
|
}
|
|
1933
1998
|
function apifySyncRecoveryNext(rawResponse) {
|
|
1934
|
-
if (!
|
|
1935
|
-
const toolResponse =
|
|
1936
|
-
const raw =
|
|
1999
|
+
if (!_chunk5LEAXRHVjs.isRecord.call(void 0, rawResponse) || rawResponse.status !== "running") return null;
|
|
2000
|
+
const toolResponse = _chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "toolResponse");
|
|
2001
|
+
const raw = _chunk5LEAXRHVjs.recordField.call(void 0, toolResponse, "raw");
|
|
1937
2002
|
if (raw.state !== "awaiting_apify") return null;
|
|
1938
|
-
const next =
|
|
1939
|
-
const getActorRun =
|
|
1940
|
-
const getActorRunTool =
|
|
1941
|
-
const getActorRunPayload =
|
|
2003
|
+
const next = _chunk5LEAXRHVjs.recordField.call(void 0, raw, "next");
|
|
2004
|
+
const getActorRun = _chunk5LEAXRHVjs.recordField.call(void 0, next, "getActorRun");
|
|
2005
|
+
const getActorRunTool = _chunk5LEAXRHVjs.stringField.call(void 0, getActorRun, "tool");
|
|
2006
|
+
const getActorRunPayload = _chunk5LEAXRHVjs.recordField.call(void 0, getActorRun, "payload");
|
|
1942
2007
|
if (!getActorRunTool || Object.keys(getActorRunPayload).length === 0) {
|
|
1943
2008
|
return null;
|
|
1944
2009
|
}
|
|
1945
|
-
const getDatasetItems =
|
|
1946
|
-
const getDatasetItemsTool =
|
|
1947
|
-
const getDatasetItemsPayload =
|
|
2010
|
+
const getDatasetItems = _chunk5LEAXRHVjs.recordField.call(void 0, next, "getDatasetItems");
|
|
2011
|
+
const getDatasetItemsTool = _chunk5LEAXRHVjs.stringField.call(void 0, getDatasetItems, "tool");
|
|
2012
|
+
const getDatasetItemsPayload = _chunk5LEAXRHVjs.recordField.call(void 0, getDatasetItems, "payload");
|
|
1948
2013
|
return {
|
|
1949
|
-
getActorRun: `deepline
|
|
2014
|
+
getActorRun: `deepline run ${getActorRunTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getActorRunPayload))}`,
|
|
1950
2015
|
...getDatasetItemsTool && Object.keys(getDatasetItemsPayload).length > 0 ? {
|
|
1951
|
-
getDatasetItems: `deepline
|
|
2016
|
+
getDatasetItems: `deepline run ${getDatasetItemsTool} --input ${_chunkAID3OYVJjs.shellQuote.call(void 0, JSON.stringify(getDatasetItemsPayload))}`
|
|
1952
2017
|
} : {}
|
|
1953
2018
|
};
|
|
1954
2019
|
}
|
|
1955
2020
|
function listExtractorPathsFromUsageGuidance(tool) {
|
|
1956
2021
|
const toolExecutionResult = _optionalChain([tool, 'access', _16 => _16.usageGuidance, 'optionalAccess', _17 => _17.toolExecutionResult]);
|
|
1957
|
-
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists :
|
|
2022
|
+
const extractedLists = Array.isArray(_optionalChain([toolExecutionResult, 'optionalAccess', _18 => _18.extractedLists])) ? toolExecutionResult.extractedLists : _chunk5LEAXRHVjs.isRecord.call(void 0, _optionalChain([toolExecutionResult, 'optionalAccess', _19 => _19.extractedLists])) ? Object.values(toolExecutionResult.extractedLists) : [];
|
|
1958
2023
|
return extractedLists.flatMap((entry) => {
|
|
1959
2024
|
const paths = _nullishCoalesce(_optionalChain([entry, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.candidatePaths]), () => ( _optionalChain([entry, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.rawToolOutputPaths])));
|
|
1960
2025
|
if (!Array.isArray(paths)) return [];
|
|
@@ -2039,7 +2104,7 @@ function parseJsonObjectArgument(raw, flagName) {
|
|
|
2039
2104
|
}
|
|
2040
2105
|
throw invalidJsonError(flagName, message);
|
|
2041
2106
|
}
|
|
2042
|
-
if (!
|
|
2107
|
+
if (!_chunk5LEAXRHVjs.isRecord.call(void 0, parsed)) {
|
|
2043
2108
|
throw invalidJsonError(flagName, "expected an object.");
|
|
2044
2109
|
}
|
|
2045
2110
|
return parsed;
|
|
@@ -2083,7 +2148,7 @@ function parseExecuteOptions(toolId, options, output) {
|
|
|
2083
2148
|
outputFormat = normalizeOutputFormat(options.outputFormat);
|
|
2084
2149
|
}
|
|
2085
2150
|
if (options.idempotencyKey !== void 0) {
|
|
2086
|
-
|
|
2151
|
+
_chunkBGTPIMSMjs.validateExecutionIdempotencyKey.call(void 0, options.idempotencyKey);
|
|
2087
2152
|
}
|
|
2088
2153
|
if (options.recoveryTimeoutMs !== void 0) {
|
|
2089
2154
|
const parsed = Number(options.recoveryTimeoutMs);
|
|
@@ -2212,7 +2277,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2212
2277
|
kind: summaryEntries.length > 0 ? "object" : "raw",
|
|
2213
2278
|
summary: input.summary
|
|
2214
2279
|
};
|
|
2215
|
-
const envelopeHasCanonicalOutput =
|
|
2280
|
+
const envelopeHasCanonicalOutput = _chunk5LEAXRHVjs.isRecord.call(void 0, envelope.toolResponse) && Object.prototype.hasOwnProperty.call(envelope.toolResponse, "raw");
|
|
2216
2281
|
const envelopeHasDeclaredOutput = Object.prototype.hasOwnProperty.call(
|
|
2217
2282
|
envelope,
|
|
2218
2283
|
"output"
|
|
@@ -2240,7 +2305,7 @@ function buildToolExecuteBaseEnvelope(input) {
|
|
|
2240
2305
|
return {
|
|
2241
2306
|
...envelope,
|
|
2242
2307
|
...input.idempotencyKey ? { idempotency_key: input.idempotencyKey } : {},
|
|
2243
|
-
...
|
|
2308
|
+
..._chunk5LEAXRHVjs.isRecord.call(void 0, input.rawResponse) && _chunk5LEAXRHVjs.isRecord.call(void 0, input.rawResponse.executionRecovery) ? { execution_recovery: input.rawResponse.executionRecovery } : {},
|
|
2244
2309
|
...envelopeHasCanonicalOutput || envelopeHasDeclaredOutput ? { output_preview: outputPreview } : { output: outputPreview },
|
|
2245
2310
|
...summaryEntries.length > 0 ? { summary: input.summary } : {},
|
|
2246
2311
|
...warningMessages.length > 0 ? { warnings: warningMessages } : {},
|
|
@@ -2301,7 +2366,7 @@ function buildToolExecuteRowArtifactEnvelope(input) {
|
|
|
2301
2366
|
void _render;
|
|
2302
2367
|
void _next;
|
|
2303
2368
|
void _local;
|
|
2304
|
-
const billingLookup =
|
|
2369
|
+
const billingLookup = _chunk5LEAXRHVjs.isRecord.call(void 0, input.baseEnvelope.next) && typeof input.baseEnvelope.next.billing === "string" ? input.baseEnvelope.next.billing : null;
|
|
2305
2370
|
const inspection = toolExecutionInspection(input);
|
|
2306
2371
|
return {
|
|
2307
2372
|
...base,
|
|
@@ -2396,6 +2461,166 @@ function printToolExecutionWarnings(toolId, params, metadata) {
|
|
|
2396
2461
|
console.error(`Warning: ${requestWarning.message}`);
|
|
2397
2462
|
}
|
|
2398
2463
|
}
|
|
2464
|
+
function valueAt(value, path) {
|
|
2465
|
+
return path.split(".").reduce((at, key) => _chunk5LEAXRHVjs.isRecord.call(void 0, at) ? at[key] : void 0, value);
|
|
2466
|
+
}
|
|
2467
|
+
function declaredOutputs(metadata, envelope, data) {
|
|
2468
|
+
const result = _optionalChain([metadata, 'access', _26 => _26.usageGuidance, 'optionalAccess', _27 => _27.toolExecutionResult]);
|
|
2469
|
+
const getters = ["extractedValues", "extractedLists"].flatMap(
|
|
2470
|
+
(kind) => {
|
|
2471
|
+
const group = _optionalChain([result, 'optionalAccess', _28 => _28[kind]]);
|
|
2472
|
+
return Array.isArray(group) ? group : _chunk5LEAXRHVjs.isRecord.call(void 0, group) ? Object.entries(group).map(([name, getter]) => ({
|
|
2473
|
+
name,
|
|
2474
|
+
...getter
|
|
2475
|
+
})) : [];
|
|
2476
|
+
}
|
|
2477
|
+
);
|
|
2478
|
+
return getters.flatMap((getter) => {
|
|
2479
|
+
const paths = _nullishCoalesce(_nullishCoalesce(_optionalChain([getter, 'access', _29 => _29.details, 'optionalAccess', _30 => _30.rawToolOutputPaths]), () => ( _optionalChain([getter, 'access', _31 => _31.details, 'optionalAccess', _32 => _32.candidatePaths]))), () => ( []));
|
|
2480
|
+
for (const path of paths) {
|
|
2481
|
+
const value = valueAt(envelope, path);
|
|
2482
|
+
if (value === void 0) continue;
|
|
2483
|
+
const inFile = path.replace(/^toolResponse\.raw(V2)?\./, "");
|
|
2484
|
+
return [
|
|
2485
|
+
{
|
|
2486
|
+
name: getter.name,
|
|
2487
|
+
value,
|
|
2488
|
+
path: valueAt(data, inFile) === void 0 ? null : inFile
|
|
2489
|
+
}
|
|
2490
|
+
];
|
|
2491
|
+
}
|
|
2492
|
+
return [];
|
|
2493
|
+
});
|
|
2494
|
+
}
|
|
2495
|
+
function writeToolReceipt(input) {
|
|
2496
|
+
const { response, metadata } = input;
|
|
2497
|
+
const envelope = _chunk5LEAXRHVjs.isRecord.call(void 0, response) ? response : {};
|
|
2498
|
+
const jobId = typeof envelope.job_id === "string" ? envelope.job_id : null;
|
|
2499
|
+
const toolResponse = _chunk5LEAXRHVjs.recordField.call(void 0, envelope, "toolResponse");
|
|
2500
|
+
const data = Object.hasOwn(toolResponse, "rawV2") ? toolResponse.rawV2 : Object.hasOwn(toolResponse, "raw") ? toolResponse.raw : Object.hasOwn(envelope, "output") ? envelope.output : Object.hasOwn(envelope, "result") ? envelope.result : response;
|
|
2501
|
+
const status = typeof envelope.status === "string" ? envelope.status : "completed";
|
|
2502
|
+
const charged = _chunk5LEAXRHVjs.recordField.call(void 0, envelope, "billing").credits_charged;
|
|
2503
|
+
_chunk7SWNPNMLjs.writeExecutionOutput.call(void 0,
|
|
2504
|
+
{
|
|
2505
|
+
id: _nullishCoalesce(input.key, () => ( jobId)),
|
|
2506
|
+
status,
|
|
2507
|
+
...["queued", "running", "pending"].includes(status) ? {} : { data },
|
|
2508
|
+
error: _nullishCoalesce(envelope.error, () => ( null)),
|
|
2509
|
+
complete: null,
|
|
2510
|
+
declared: declaredOutputs(metadata, envelope, data),
|
|
2511
|
+
credits: typeof charged === "number" ? charged : null,
|
|
2512
|
+
warnings: [
|
|
2513
|
+
..._nullishCoalesce(input.warnings, () => ( [])),
|
|
2514
|
+
...extractToolExecutionWarningMessages(response)
|
|
2515
|
+
],
|
|
2516
|
+
next: {
|
|
2517
|
+
...apifySyncRecoveryNext(response),
|
|
2518
|
+
...input.key ? { status: `deepline runs get ${input.key}` } : {},
|
|
2519
|
+
...jobId ? {
|
|
2520
|
+
billing: `deepline billing usage --request-id ${_chunkAID3OYVJjs.shellQuote.call(void 0, jobId)} --json`
|
|
2521
|
+
} : {}
|
|
2522
|
+
}
|
|
2523
|
+
},
|
|
2524
|
+
input.output
|
|
2525
|
+
);
|
|
2526
|
+
return status === "failed" || envelope.error ? 1 : 0;
|
|
2527
|
+
}
|
|
2528
|
+
async function executeToolForReceipt(input) {
|
|
2529
|
+
const { toolId, params, output } = input;
|
|
2530
|
+
let key = null;
|
|
2531
|
+
let retryKey = null;
|
|
2532
|
+
let received = false;
|
|
2533
|
+
try {
|
|
2534
|
+
const cliInvocationId = _nullishCoalesce(_chunkGEGW5HPZjs.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkGEGW5HPZjs.beginToolExecuteCommand.call(void 0, )));
|
|
2535
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
2536
|
+
const metadata = await _asyncNullishCoalesce(input.metadata, async () => ( await client.getTool(toolId, { cliInvocationId })));
|
|
2537
|
+
printToolExecutionWarnings(toolId, params, metadata);
|
|
2538
|
+
const responseIntent = _optionalChain([output, 'access', _33 => _33.csvOut, 'optionalAccess', _34 => _34.length]) ? "row_artifact" : "raw";
|
|
2539
|
+
const recovery = ToolCallRecovery.open({
|
|
2540
|
+
toolId,
|
|
2541
|
+
params,
|
|
2542
|
+
responseIntent,
|
|
2543
|
+
recover: true,
|
|
2544
|
+
fresh: input.fresh
|
|
2545
|
+
});
|
|
2546
|
+
key = _nullishCoalesce(recovery.idempotencyKey, () => ( null));
|
|
2547
|
+
retryKey = recovery;
|
|
2548
|
+
const response = await client.executeTool(toolId, params, {
|
|
2549
|
+
responseIntent,
|
|
2550
|
+
...input.timeoutMs !== void 0 ? { timeout: input.timeoutMs } : {},
|
|
2551
|
+
..._optionalChain([metadata, 'access', _35 => _35.executionMetadata, 'optionalAccess', _36 => _36.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {},
|
|
2552
|
+
...key ? { idempotencyKey: key } : {},
|
|
2553
|
+
searchRef: _chunkOPJAJBD4js.recentSearchRef.call(void 0, ),
|
|
2554
|
+
cliInvocationId,
|
|
2555
|
+
onResponseReceived: _chunk7SWNPNMLjs.recordApiResponse
|
|
2556
|
+
}).catch((error) => {
|
|
2557
|
+
const guidance = toolGuidanceLines(metadata.guidance);
|
|
2558
|
+
if (guidance.length)
|
|
2559
|
+
console.error([`Guidance for ${toolId}:`, ...guidance].join("\n"));
|
|
2560
|
+
throw error;
|
|
2561
|
+
});
|
|
2562
|
+
received = true;
|
|
2563
|
+
const code = writeToolReceipt({
|
|
2564
|
+
key,
|
|
2565
|
+
metadata,
|
|
2566
|
+
response,
|
|
2567
|
+
output,
|
|
2568
|
+
warnings: recovery.resumed ? [
|
|
2569
|
+
"Resumed an interrupted call with its saved retry key; it was not charged again. --fresh calls the provider again."
|
|
2570
|
+
] : []
|
|
2571
|
+
});
|
|
2572
|
+
await recovery.acknowledgeDelivery();
|
|
2573
|
+
return code;
|
|
2574
|
+
} catch (error) {
|
|
2575
|
+
if (received) throw error;
|
|
2576
|
+
const outcomeKnown = answeredWithFailure(error);
|
|
2577
|
+
if (outcomeKnown) _optionalChain([retryKey, 'optionalAccess', _37 => _37.discard, 'call', _38 => _38()]);
|
|
2578
|
+
_chunk7SWNPNMLjs.writeExecutionOutput.call(void 0,
|
|
2579
|
+
{
|
|
2580
|
+
id: outcomeKnown ? null : key,
|
|
2581
|
+
status: "failed",
|
|
2582
|
+
error: {
|
|
2583
|
+
message: error instanceof Error ? error.message : String(error),
|
|
2584
|
+
...error instanceof _chunkDIAWYWT5js.DeeplineError ? { code: error.code } : {}
|
|
2585
|
+
},
|
|
2586
|
+
...key && !outcomeKnown ? {
|
|
2587
|
+
next: {
|
|
2588
|
+
retry: "Run the same command again: it picks up this call without paying twice."
|
|
2589
|
+
}
|
|
2590
|
+
} : {}
|
|
2591
|
+
},
|
|
2592
|
+
output
|
|
2593
|
+
);
|
|
2594
|
+
return 1;
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
function answeredWithFailure(error) {
|
|
2598
|
+
return error instanceof _chunkDIAWYWT5js.DeeplineError && typeof error.statusCode === "number" && error.statusCode < 500 && // A request timeout says nothing about whether the call went through.
|
|
2599
|
+
error.statusCode !== 408 && error.code !== "EXECUTION_OUTCOME_UNKNOWN";
|
|
2600
|
+
}
|
|
2601
|
+
async function getToolExecutionReceipt(key, output) {
|
|
2602
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
2603
|
+
const execution = await client.executions.getByKey(key);
|
|
2604
|
+
output.label = `${execution.toolId} (tool)`;
|
|
2605
|
+
if (execution.response === void 0) {
|
|
2606
|
+
_chunk7SWNPNMLjs.writeExecutionOutput.call(void 0,
|
|
2607
|
+
{
|
|
2608
|
+
id: key,
|
|
2609
|
+
status: execution.executionRecovery.state,
|
|
2610
|
+
next: { status: `deepline runs get ${key}` }
|
|
2611
|
+
},
|
|
2612
|
+
output
|
|
2613
|
+
);
|
|
2614
|
+
return 1;
|
|
2615
|
+
}
|
|
2616
|
+
const metadata = await client.getTool(execution.toolId);
|
|
2617
|
+
return writeToolReceipt({
|
|
2618
|
+
key,
|
|
2619
|
+
metadata,
|
|
2620
|
+
response: execution.response,
|
|
2621
|
+
output
|
|
2622
|
+
});
|
|
2623
|
+
}
|
|
2399
2624
|
async function executeTool(toolId, options, compatibilityMetadata, deferCompatibility = false, maintenancePolicy = "configured") {
|
|
2400
2625
|
const output = toolExecuteJsonOption(options.json);
|
|
2401
2626
|
const wantsJson = (_nullishCoalesce(options.outputFormat, () => ( "auto"))).trim().toLowerCase() !== "csv";
|
|
@@ -2404,19 +2629,19 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2404
2629
|
parsed = parseExecuteOptions(toolId, options, output);
|
|
2405
2630
|
} catch (error) {
|
|
2406
2631
|
if (wantsJson) {
|
|
2407
|
-
|
|
2632
|
+
_chunk3ACMRZRVjs.printJsonError.call(void 0, error);
|
|
2408
2633
|
} else {
|
|
2409
2634
|
console.error(error instanceof Error ? error.message : String(error));
|
|
2410
2635
|
}
|
|
2411
2636
|
return error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "IDEMPOTENCY_KEY_INVALID" ? 2 : 1;
|
|
2412
2637
|
}
|
|
2413
|
-
const cliInvocationId = _nullishCoalesce(
|
|
2638
|
+
const cliInvocationId = _nullishCoalesce(_chunkGEGW5HPZjs.getToolExecuteInvocationId.call(void 0, ), () => ( _chunkGEGW5HPZjs.beginToolExecuteCommand.call(void 0, )));
|
|
2414
2639
|
const deferredCompatibility = deferCompatibility ? beginDeferredToolExecuteCompatibility(toolId, cliInvocationId) : void 0;
|
|
2415
|
-
const tracing =
|
|
2640
|
+
const tracing = _chunk7LFIMWMWjs.isCliTraceEnabled.call(void 0, );
|
|
2416
2641
|
const clientStartedAt = tracing ? performance.now() : void 0;
|
|
2417
|
-
const client = new (0,
|
|
2642
|
+
const client = new (0, _chunkJF3TLIMQjs.DeeplineClient)();
|
|
2418
2643
|
if (clientStartedAt !== void 0) {
|
|
2419
|
-
|
|
2644
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, {
|
|
2420
2645
|
phase: "cli.tool_execute_client_setup",
|
|
2421
2646
|
ms: performance.now() - clientStartedAt
|
|
2422
2647
|
});
|
|
@@ -2425,13 +2650,13 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2425
2650
|
const readMetadata = async () => {
|
|
2426
2651
|
if (metadata) return metadata;
|
|
2427
2652
|
try {
|
|
2428
|
-
metadata = await
|
|
2653
|
+
metadata = await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2429
2654
|
"tool metadata lookup",
|
|
2430
2655
|
() => client.getTool(parsed.toolId, { cliInvocationId })
|
|
2431
2656
|
);
|
|
2432
2657
|
} catch (error) {
|
|
2433
2658
|
if (isMissingToolMetadataError(error)) {
|
|
2434
|
-
const play = await
|
|
2659
|
+
const play = await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2435
2660
|
"play alias lookup",
|
|
2436
2661
|
() => findPlayForToolId(client, parsed.toolId, cliInvocationId)
|
|
2437
2662
|
);
|
|
@@ -2445,7 +2670,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2445
2670
|
}
|
|
2446
2671
|
throw error;
|
|
2447
2672
|
}
|
|
2448
|
-
if (
|
|
2673
|
+
if (_chunk5LEAXRHVjs.isPlayLikeTool.call(void 0, metadata)) {
|
|
2449
2674
|
throw new (0, _chunkDIAWYWT5js.DeeplineError)(
|
|
2450
2675
|
playLikeToolExecuteErrorMessage(
|
|
2451
2676
|
parsed.toolId,
|
|
@@ -2465,12 +2690,12 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2465
2690
|
} catch (e3) {
|
|
2466
2691
|
}
|
|
2467
2692
|
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2468
|
-
if (!metadata && _optionalChain([preflightCompatibility, 'optionalAccess',
|
|
2693
|
+
if (!metadata && _optionalChain([preflightCompatibility, 'optionalAccess', _39 => _39.response, 'optionalAccess', _40 => _40.update_required]) !== true) {
|
|
2469
2694
|
try {
|
|
2470
2695
|
metadata = await readMetadata();
|
|
2471
2696
|
} catch (error) {
|
|
2472
2697
|
if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2473
|
-
if (wantsJson)
|
|
2698
|
+
if (wantsJson) _chunk3ACMRZRVjs.printJsonError.call(void 0, error);
|
|
2474
2699
|
else console.error(error.message);
|
|
2475
2700
|
return 2;
|
|
2476
2701
|
}
|
|
@@ -2486,7 +2711,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2486
2711
|
metadata = await readMetadata();
|
|
2487
2712
|
} catch (error) {
|
|
2488
2713
|
if (error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2489
|
-
if (wantsJson)
|
|
2714
|
+
if (wantsJson) _chunk3ACMRZRVjs.printJsonError.call(void 0, error);
|
|
2490
2715
|
else console.error(error.message);
|
|
2491
2716
|
return 2;
|
|
2492
2717
|
}
|
|
@@ -2512,11 +2737,11 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2512
2737
|
responseIntent,
|
|
2513
2738
|
...idempotencyKey ? { idempotencyKey } : {},
|
|
2514
2739
|
...parsed.recoveryTimeoutMs !== void 0 ? { recoveryTimeoutMs: parsed.recoveryTimeoutMs } : {},
|
|
2515
|
-
searchRef:
|
|
2740
|
+
searchRef: _chunkOPJAJBD4js.recentSearchRef.call(void 0, ),
|
|
2516
2741
|
cliInvocationId,
|
|
2517
|
-
onResponseReceived:
|
|
2742
|
+
onResponseReceived: _chunk7SWNPNMLjs.recordApiResponse,
|
|
2518
2743
|
...tracing ? {
|
|
2519
|
-
onServerTiming: (serverTiming) =>
|
|
2744
|
+
onServerTiming: (serverTiming) => _chunk7LFIMWMWjs.recordCliTrace.call(void 0, {
|
|
2520
2745
|
phase: "tool_execute_server_timing",
|
|
2521
2746
|
cliInvocationId,
|
|
2522
2747
|
serverTiming,
|
|
@@ -2527,51 +2752,51 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2527
2752
|
let rawResponse;
|
|
2528
2753
|
let successfulCompatibilityResponse;
|
|
2529
2754
|
try {
|
|
2530
|
-
const executeResult = await
|
|
2755
|
+
const executeResult = await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2531
2756
|
"execute request",
|
|
2532
2757
|
async () => {
|
|
2533
2758
|
try {
|
|
2534
2759
|
if (tracing) {
|
|
2535
2760
|
submissionStartedAt = performance.now();
|
|
2536
|
-
|
|
2761
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2537
2762
|
}
|
|
2538
2763
|
return await client.executeTool(parsed.toolId, parsed.params, {
|
|
2539
2764
|
...executeOptions,
|
|
2540
2765
|
atomicToolOnly: true,
|
|
2541
|
-
..._optionalChain([metadata, 'optionalAccess',
|
|
2766
|
+
..._optionalChain([metadata, 'optionalAccess', _41 => _41.executionMetadata, 'optionalAccess', _42 => _42.retrySafeAmbiguousDelivery]) === true ? { retryAmbiguousDelivery: true } : {}
|
|
2542
2767
|
});
|
|
2543
2768
|
} catch (error) {
|
|
2544
2769
|
if (!(error instanceof _chunkDIAWYWT5js.DeeplineError) || error.code !== "ATOMIC_TOOL_EXECUTE_UNSUPPORTED")
|
|
2545
2770
|
throw error;
|
|
2546
|
-
const baseUrl =
|
|
2771
|
+
const baseUrl = _chunkY4DPU4OMjs.resolveConfig.call(void 0, ).baseUrl;
|
|
2547
2772
|
if (maintenancePolicy !== "off") {
|
|
2548
|
-
|
|
2773
|
+
_chunkZGQSFYD2js.flushDeferredSkillsSyncNotices.call(void 0, baseUrl);
|
|
2549
2774
|
}
|
|
2550
|
-
const compatibility = deferredCompatibility ? await deferredCompatibility.result : await
|
|
2775
|
+
const compatibility = deferredCompatibility ? await deferredCompatibility.result : await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2551
2776
|
"SDK compatibility",
|
|
2552
|
-
() =>
|
|
2777
|
+
() => _chunkZGQSFYD2js.checkSdkCompatibility.call(void 0, baseUrl, {
|
|
2553
2778
|
command: "tools execute",
|
|
2554
|
-
skillsVersion:
|
|
2779
|
+
skillsVersion: _chunkY4DPU4OMjs.readSdkSkillsLocalVersion.call(void 0, baseUrl),
|
|
2555
2780
|
persistCache: maintenancePolicy !== "off"
|
|
2556
2781
|
})
|
|
2557
2782
|
);
|
|
2558
2783
|
if (compatibility.error) throw compatibility.error;
|
|
2559
|
-
metadata = _nullishCoalesce(_optionalChain([deferredCompatibility, 'optionalAccess',
|
|
2560
|
-
if (maintenancePolicy !== "off" && await
|
|
2784
|
+
metadata = _nullishCoalesce(_optionalChain([deferredCompatibility, 'optionalAccess', _43 => _43.readMetadata, 'call', _44 => _44()]), () => ( metadata));
|
|
2785
|
+
if (maintenancePolicy !== "off" && await _chunkGEGW5HPZjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2561
2786
|
compatibility.response,
|
|
2562
2787
|
baseUrl,
|
|
2563
2788
|
maintenancePolicy
|
|
2564
2789
|
)) {
|
|
2565
2790
|
return void 0;
|
|
2566
2791
|
}
|
|
2567
|
-
|
|
2792
|
+
_chunkZGQSFYD2js.enforceSdkCompatibilityResponse.call(void 0, compatibility.response, {
|
|
2568
2793
|
quietAdvisory: wantsJson
|
|
2569
2794
|
});
|
|
2570
2795
|
if (maintenancePolicy !== "off") {
|
|
2571
|
-
await
|
|
2796
|
+
await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2572
2797
|
"agent skills sync",
|
|
2573
|
-
() =>
|
|
2574
|
-
update: _optionalChain([compatibility, 'access',
|
|
2798
|
+
() => _chunkZGQSFYD2js.syncSdkSkillsIfNeeded.call(void 0, baseUrl, {
|
|
2799
|
+
update: _optionalChain([compatibility, 'access', _45 => _45.response, 'optionalAccess', _46 => _46.skills]),
|
|
2575
2800
|
mode: "detached"
|
|
2576
2801
|
})
|
|
2577
2802
|
);
|
|
@@ -2579,11 +2804,11 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2579
2804
|
const legacyMetadata = await readMetadata();
|
|
2580
2805
|
if (tracing) {
|
|
2581
2806
|
submissionStartedAt = performance.now();
|
|
2582
|
-
|
|
2807
|
+
_chunk7LFIMWMWjs.recordCliTrace.call(void 0, { phase: "cli.tool_execute_request_start" });
|
|
2583
2808
|
}
|
|
2584
2809
|
return client.executeTool(parsed.toolId, parsed.params, {
|
|
2585
2810
|
...executeOptions,
|
|
2586
|
-
..._optionalChain([legacyMetadata, 'access',
|
|
2811
|
+
..._optionalChain([legacyMetadata, 'access', _47 => _47.executionMetadata, 'optionalAccess', _48 => _48.retrySafeTransientHttp]) === true ? { maxRetries: 2, retryApiErrors: true } : {}
|
|
2587
2812
|
});
|
|
2588
2813
|
}
|
|
2589
2814
|
}
|
|
@@ -2600,8 +2825,8 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2600
2825
|
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2601
2826
|
const updateRequiredBeforeExecution = error instanceof _chunkDIAWYWT5js.DeeplineError && error.code === "SDK_UPDATE_REQUIRED";
|
|
2602
2827
|
if (updateRequiredBeforeExecution && maintenancePolicy !== "off" && compatibility && !compatibility.error) {
|
|
2603
|
-
const baseUrl =
|
|
2604
|
-
if (await
|
|
2828
|
+
const baseUrl = _chunkY4DPU4OMjs.resolveConfig.call(void 0, ).baseUrl;
|
|
2829
|
+
if (await _chunkGEGW5HPZjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2605
2830
|
compatibility.response,
|
|
2606
2831
|
baseUrl,
|
|
2607
2832
|
maintenancePolicy
|
|
@@ -2620,14 +2845,14 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2620
2845
|
failure = diagnosticError;
|
|
2621
2846
|
}
|
|
2622
2847
|
if (failure instanceof _chunkDIAWYWT5js.DeeplineError && failure.code === "PLAY_ALIAS_USED_AS_TOOL") {
|
|
2623
|
-
if (wantsJson)
|
|
2848
|
+
if (wantsJson) _chunk3ACMRZRVjs.printJsonError.call(void 0, failure);
|
|
2624
2849
|
else console.error(failure.message);
|
|
2625
2850
|
return 2;
|
|
2626
2851
|
}
|
|
2627
|
-
const guidanceLines = toolGuidanceLines(_optionalChain([metadata, 'optionalAccess',
|
|
2852
|
+
const guidanceLines = toolGuidanceLines(_optionalChain([metadata, 'optionalAccess', _49 => _49.guidance]));
|
|
2628
2853
|
if (guidanceLines.length > 0) {
|
|
2629
2854
|
if (wantsJson && failure instanceof Error) {
|
|
2630
|
-
Object.assign(failure, { guidance: _optionalChain([metadata, 'optionalAccess',
|
|
2855
|
+
Object.assign(failure, { guidance: _optionalChain([metadata, 'optionalAccess', _50 => _50.guidance]) });
|
|
2631
2856
|
} else {
|
|
2632
2857
|
console.error(
|
|
2633
2858
|
[`Guidance for ${parsed.toolId}:`, ...guidanceLines].join("\n")
|
|
@@ -2643,13 +2868,13 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2643
2868
|
} catch (e5) {
|
|
2644
2869
|
}
|
|
2645
2870
|
metadata = _nullishCoalesce(deferredCompatibility.readMetadata(), () => ( metadata));
|
|
2646
|
-
const compatibilityResponse = _optionalChain([compatibility, 'optionalAccess',
|
|
2871
|
+
const compatibilityResponse = _optionalChain([compatibility, 'optionalAccess', _51 => _51.response]);
|
|
2647
2872
|
successfulCompatibilityResponse = _nullishCoalesce(compatibilityResponse, () => ( void 0));
|
|
2648
|
-
const autoUpdate = _optionalChain([compatibilityResponse, 'optionalAccess',
|
|
2649
|
-
if (maintenancePolicy !== "off" && compatibilityResponse && _optionalChain([autoUpdate, 'optionalAccess',
|
|
2650
|
-
await
|
|
2873
|
+
const autoUpdate = _optionalChain([compatibilityResponse, 'optionalAccess', _52 => _52.auto_update]);
|
|
2874
|
+
if (maintenancePolicy !== "off" && compatibilityResponse && _optionalChain([autoUpdate, 'optionalAccess', _53 => _53.should_auto_update]) && !autoUpdate.required && autoUpdate.reason !== "rollback_forced") {
|
|
2875
|
+
await _chunkGEGW5HPZjs.maybeAutoUpdateAndRelaunch.call(void 0,
|
|
2651
2876
|
compatibilityResponse,
|
|
2652
|
-
|
|
2877
|
+
_chunkY4DPU4OMjs.resolveConfig.call(void 0, ).baseUrl,
|
|
2653
2878
|
maintenancePolicy
|
|
2654
2879
|
);
|
|
2655
2880
|
}
|
|
@@ -2667,8 +2892,8 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2667
2892
|
);
|
|
2668
2893
|
}
|
|
2669
2894
|
}
|
|
2670
|
-
const responseMetadata =
|
|
2671
|
-
|
|
2895
|
+
const responseMetadata = _chunk5LEAXRHVjs.recordField.call(void 0,
|
|
2896
|
+
_chunk5LEAXRHVjs.recordField.call(void 0, rawResponse, "_metadata"),
|
|
2672
2897
|
"tool"
|
|
2673
2898
|
);
|
|
2674
2899
|
const listOutputPaths = responseMetadata.listOutputPaths;
|
|
@@ -2680,11 +2905,11 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2680
2905
|
await readMetadata()
|
|
2681
2906
|
);
|
|
2682
2907
|
}
|
|
2683
|
-
if (
|
|
2908
|
+
if (_chunk5LEAXRHVjs.isRecord.call(void 0, rawResponse)) {
|
|
2684
2909
|
const { _metadata, ...execution } = rawResponse;
|
|
2685
2910
|
rawResponse = execution;
|
|
2686
2911
|
}
|
|
2687
|
-
const { listConversion, summary, baseEnvelope } = await
|
|
2912
|
+
const { listConversion, summary, baseEnvelope } = await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2688
2913
|
"result formatting",
|
|
2689
2914
|
async () => {
|
|
2690
2915
|
const listConversion2 = _chunkHGFFYVXNjs.tryConvertToList.call(void 0, rawResponse, {
|
|
@@ -2704,7 +2929,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2704
2929
|
rawResponse,
|
|
2705
2930
|
listConversion: listConversion2,
|
|
2706
2931
|
summary: summary2,
|
|
2707
|
-
guidance: _optionalChain([metadata, 'optionalAccess',
|
|
2932
|
+
guidance: _optionalChain([metadata, 'optionalAccess', _54 => _54.guidance]),
|
|
2708
2933
|
listExpected: listExtractorPaths.length > 0
|
|
2709
2934
|
});
|
|
2710
2935
|
return { listConversion: listConversion2, summary: summary2, baseEnvelope: baseEnvelope2 };
|
|
@@ -2719,9 +2944,9 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2719
2944
|
}
|
|
2720
2945
|
skillsSyncAttempted = true;
|
|
2721
2946
|
try {
|
|
2722
|
-
await
|
|
2947
|
+
await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2723
2948
|
"agent skills sync",
|
|
2724
|
-
() =>
|
|
2949
|
+
() => _chunkZGQSFYD2js.syncSdkSkillsIfNeeded.call(void 0, _chunkY4DPU4OMjs.resolveConfig.call(void 0, ).baseUrl, {
|
|
2725
2950
|
update: deliveredCompatibilityResponse.skills,
|
|
2726
2951
|
mode: "detached"
|
|
2727
2952
|
})
|
|
@@ -2732,15 +2957,15 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2732
2957
|
);
|
|
2733
2958
|
}
|
|
2734
2959
|
};
|
|
2735
|
-
const printDeliveredEnvelope = (envelope, options2 = {}) =>
|
|
2960
|
+
const printDeliveredEnvelope = (envelope, options2 = {}) => _chunk3ACMRZRVjs.printCommandEnvelope.call(void 0, envelope, {
|
|
2736
2961
|
...options2,
|
|
2737
2962
|
json: _nullishCoalesce(options2.json, () => ( wantsJson))
|
|
2738
2963
|
});
|
|
2739
2964
|
const printDeliveredJsonEnvelope = async (envelope, options2 = {}) => {
|
|
2740
2965
|
await syncSkillsForDeliveredOutput();
|
|
2741
|
-
|
|
2966
|
+
_chunk3ACMRZRVjs.printCommandEnvelope.call(void 0, envelope, { ...options2, json: true });
|
|
2742
2967
|
};
|
|
2743
|
-
const delivered = await
|
|
2968
|
+
const delivered = await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0, "output delivery", async () => {
|
|
2744
2969
|
if (!parsed.outPath && (parsed.outputFormat === "json" || parsed.outputFormat === "auto" && wantsJson)) {
|
|
2745
2970
|
await printDeliveredJsonEnvelope(baseEnvelope);
|
|
2746
2971
|
return true;
|
|
@@ -2753,7 +2978,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2753
2978
|
await printDeliveredJsonEnvelope({
|
|
2754
2979
|
...baseEnvelope,
|
|
2755
2980
|
local: {
|
|
2756
|
-
...
|
|
2981
|
+
..._chunk5LEAXRHVjs.isRecord.call(void 0, baseEnvelope.local) ? baseEnvelope.local : {},
|
|
2757
2982
|
payload_file: jsonPath
|
|
2758
2983
|
}
|
|
2759
2984
|
});
|
|
@@ -2769,7 +2994,7 @@ async function executeTool(toolId, options, compatibilityMetadata, deferCompatib
|
|
|
2769
2994
|
`${parsed.toolId} did not expose row-shaped output to write as CSV. ${inspection.inspectDescription} Run: ${inspection.inspect}`
|
|
2770
2995
|
);
|
|
2771
2996
|
if (wantsJson) {
|
|
2772
|
-
|
|
2997
|
+
_chunk3ACMRZRVjs.printJsonError.call(void 0, error);
|
|
2773
2998
|
} else {
|
|
2774
2999
|
console.error(error.message);
|
|
2775
3000
|
}
|
|
@@ -2864,14 +3089,14 @@ inspect: ${inspection.inspect}
|
|
|
2864
3089
|
return true;
|
|
2865
3090
|
});
|
|
2866
3091
|
if (delivered) {
|
|
2867
|
-
await
|
|
3092
|
+
await _chunkGEGW5HPZjs.runToolExecuteStage.call(void 0,
|
|
2868
3093
|
"acknowledge delivery",
|
|
2869
3094
|
() => recovery.acknowledgeDelivery()
|
|
2870
3095
|
);
|
|
2871
3096
|
}
|
|
2872
3097
|
if (delivered && deliveredCompatibilityResponse && deliveredCompatibilityResponse.update_required !== true) {
|
|
2873
|
-
|
|
2874
|
-
quietAdvisory: wantsJson || maintenancePolicy === "off" || _optionalChain([deliveredCompatibilityResponse, 'access',
|
|
3098
|
+
_chunkZGQSFYD2js.enforceSdkCompatibilityResponse.call(void 0, deliveredCompatibilityResponse, {
|
|
3099
|
+
quietAdvisory: wantsJson || maintenancePolicy === "off" || _optionalChain([deliveredCompatibilityResponse, 'access', _55 => _55.auto_update, 'optionalAccess', _56 => _56.should_auto_update]) === true
|
|
2875
3100
|
});
|
|
2876
3101
|
}
|
|
2877
3102
|
if (delivered && !skillsSyncAttempted) await syncSkillsForDeliveredOutput();
|
|
@@ -2885,4 +3110,8 @@ inspect: ${inspection.inspect}
|
|
|
2885
3110
|
|
|
2886
3111
|
|
|
2887
3112
|
|
|
2888
|
-
|
|
3113
|
+
|
|
3114
|
+
|
|
3115
|
+
|
|
3116
|
+
|
|
3117
|
+
exports.registerToolsCommands = registerToolsCommands; exports.printMonitorTypeContract = printMonitorTypeContract; exports.printCompactToolContract = printCompactToolContract; exports.extractToolExecutionWarningMessages = extractToolExecutionWarningMessages; exports.parseToolExecuteTimeout = parseToolExecuteTimeout; exports.seedToolListScript = seedToolListScript; exports.buildToolExecuteBaseEnvelope = buildToolExecuteBaseEnvelope; exports.writeToolReceipt = writeToolReceipt; exports.executeToolForReceipt = executeToolForReceipt; exports.getToolExecutionReceipt = getToolExecutionReceipt;
|