deepline 0.3.409 → 0.3.411
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/agent-runtime.ts +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +206 -333
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/auth-M7TBLW55.js +40 -0
- package/dist/cli/{auth-5HIIACF7.mjs → auth-YD6ZTMB2.mjs} +6 -6
- package/dist/cli/{billing-4275N7FL.js → billing-2L3MOB42.js} +84 -84
- package/dist/cli/{billing-EVZ3ZWKC.mjs → billing-ZT46GV4C.mjs} +8 -8
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-GAICVLKL.js → chunk-2NI6DHN7.js} +2 -2
- package/dist/cli/{chunk-JGHG4NBA.js → chunk-2WUY3VNK.js} +19 -4
- package/dist/cli/{chunk-FHPCKULR.mjs → chunk-4BA6ATHA.mjs} +2 -2
- package/dist/cli/{chunk-RTCDW2GU.js → chunk-4O4WNFFC.js} +170 -49
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-AU4OFDFX.js → chunk-5IGDNBG7.js} +26 -26
- package/dist/cli/{chunk-WYQO2CBS.mjs → chunk-5LRWWMRV.mjs} +149 -28
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/chunk-6AUE6JXY.js +35 -0
- package/dist/cli/chunk-7DSMMCXP.js +501 -0
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-J6DCKJNM.mjs → chunk-BJV3VSKE.mjs} +16 -1
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/{chunk-BEVLCKXG.mjs → chunk-E4KBNNNB.mjs} +1 -1
- package/dist/cli/{chunk-2PRO2JTX.mjs → chunk-E52TKKVI.mjs} +36 -284
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-2GI3QD3L.js → chunk-FRVPOXGB.js} +644 -330
- package/dist/cli/chunk-G43JLBDE.mjs +501 -0
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/chunk-IPGV6VFA.mjs +6084 -0
- package/dist/cli/{chunk-IT3XBJQR.mjs → chunk-IR3AKJAY.mjs} +330 -625
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/chunk-JQMZUWNM.mjs +35 -0
- package/dist/cli/chunk-JYHSEGRM.js +6084 -0
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-O3VSXP2F.js → chunk-LWBM5FFL.js} +50 -50
- package/dist/cli/{chunk-VWBTTJYQ.mjs → chunk-M6OASCVL.mjs} +6 -3
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NQWIZ5PZ.js +313 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-TQNHMWUR.mjs → chunk-OGSXENOF.mjs} +5 -2
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/{chunk-FJCIUF34.js → chunk-OZSC6CEW.js} +128 -376
- package/dist/cli/{chunk-NZSF57UO.mjs → chunk-PO2VU6WV.mjs} +2 -2
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-N44JHMKY.mjs → chunk-RFES6Q2J.mjs} +452 -138
- package/dist/cli/{chunk-DEC3JECC.js → chunk-RMINBDYY.js} +5 -2
- package/dist/cli/{chunk-WLOCMJWV.js → chunk-TPFD4F5S.js} +426 -721
- package/dist/cli/{chunk-V76R6HMV.js → chunk-U5AQKE3T.js} +1029 -806
- package/dist/cli/{chunk-PBZYY7VZ.mjs → chunk-UAEVKAUR.mjs} +734 -511
- package/dist/cli/{chunk-WHG43Z67.js → chunk-VGHWJL4W.js} +11 -8
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XAB47ZRV.mjs +313 -0
- package/dist/cli/{chunk-JRAVVJ3T.mjs → chunk-XJD6LZCO.mjs} +2 -2
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-YD7B53RW.js → chunk-ZHWBU36H.js} +12 -12
- package/dist/cli/{csv-A2MP6EFV.mjs → csv-BKNRRW7D.mjs} +5 -5
- package/dist/cli/{csv-BBOTCGQY.js → csv-SVDP2EU7.js} +14 -14
- package/dist/cli/{db-3W5DMTUX.mjs → db-LU4KLRM6.mjs} +15 -20
- package/dist/cli/{db-G4CODDCA.js → db-OQ6S7TTZ.js} +42 -47
- package/dist/cli/{describe-PQTQ5B6F.js → describe-45TGETKR.js} +27 -22
- package/dist/cli/{describe-XYJ2ZT4M.mjs → describe-U4KOGDRA.mjs} +20 -15
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-UR67CA5H.mjs → executions-2GAAUXLA.mjs} +8 -8
- package/dist/cli/{executions-TLANVR7Y.js → executions-VZN56VRC.js} +10 -10
- package/dist/cli/{feedback-6C2YTRJL.js → feedback-NS76B5GU.js} +13 -9
- package/dist/cli/{feedback-WHCMGEIL.mjs → feedback-XW5IWA5R.mjs} +11 -7
- package/dist/cli/{git-GWLB6VSA.mjs → git-CLI66XP6.mjs} +6 -6
- package/dist/cli/git-VGYRGFEN.js +24 -0
- package/dist/cli/index.js +236 -348
- package/dist/cli/index.mjs +162 -274
- package/dist/cli/{legacy-noops-ZUFA7RWI.js → legacy-noops-HCFB3ZOV.js} +9 -9
- package/dist/cli/{legacy-noops-KF4XIFEF.mjs → legacy-noops-ODDOMLBL.mjs} +6 -6
- package/dist/cli/{monitors-TB3K2IVE.js → monitors-7WXQ7JFT.js} +94 -94
- package/dist/cli/{monitors-6UOIDIMB.mjs → monitors-ZXX456TE.mjs} +8 -8
- package/dist/cli/{org-CKWMBPIR.js → org-YLX5PHBQ.js} +68 -68
- package/dist/cli/{org-WGHHMVDZ.mjs → org-YUN3TLNP.mjs} +8 -8
- package/dist/cli/{play-LYPAXCLD.mjs → play-LL73A7EP.mjs} +533 -98
- package/dist/cli/{play-N2B3KAVS.js → play-YGOXL52D.js} +1067 -632
- package/dist/cli/{providers-6DI5BVZJ.mjs → providers-35QSAUHL.mjs} +8 -8
- package/dist/cli/{providers-UR42MD6Z.js → providers-RHCIU2PX.js} +11 -11
- package/dist/cli/{quickstart-MNA2S6PO.mjs → quickstart-6BN3LCZH.mjs} +5 -5
- package/dist/cli/{quickstart-FCJG4XGB.js → quickstart-ORMM4NRK.js} +7 -7
- package/dist/cli/search-EWDMUPHR.js +30 -0
- package/dist/cli/{search-VPPYUJ2M.mjs → search-GAERWLSE.mjs} +9 -9
- package/dist/cli/{secrets-QOSMVO36.js → secrets-3AFCTGT7.js} +17 -17
- package/dist/cli/{secrets-DRI4W7Z5.mjs → secrets-FCL5PALY.mjs} +8 -8
- package/dist/cli/sessions-3OEHEQG7.js +16 -0
- package/dist/cli/{sessions-DQNUKP43.mjs → sessions-RSSL7I7O.mjs} +6 -6
- package/dist/cli/{settings-DWDK3Y2R.mjs → settings-GE4NRE7Y.mjs} +12 -12
- package/dist/cli/{settings-JUGGCOPS.js → settings-RX5K4I7H.js} +79 -79
- package/dist/cli/{setup-AWBHNYXK.js → setup-N3ZNAEL5.js} +45 -44
- package/dist/cli/{setup-D5DWVNY4.mjs → setup-X3RXGG4F.mjs} +11 -10
- package/dist/cli/{skills-YV2XR35J.mjs → skills-5JEAJBDE.mjs} +7 -7
- package/dist/cli/skills-VAAQVEQC.js +29 -0
- package/dist/cli/tools-BYYOT2DU.js +44 -0
- package/dist/cli/{tools-VFJYHNV2.mjs → tools-JOKUWEBZ.mjs} +19 -14
- package/dist/cli/update-36G4ZD7B.js +31 -0
- package/dist/cli/{update-IM6VOTGL.mjs → update-UBHEVFR3.mjs} +11 -9
- package/dist/cli/{workflow-26URBWPV.mjs → workflow-FR6EXAXF.mjs} +44 -20
- package/dist/cli/{workflow-3BS6U6SL.js → workflow-SZAVOHN6.js} +54 -30
- package/dist/{client-BfInrZPB.d.mts → client-74k4IPh6.d.mts} +135 -54
- package/dist/{client-BMjJFpan.d.ts → client-C1IK1f8c.d.ts} +135 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +118 -102
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +5 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-F6BX32XZ.js +0 -40
- package/dist/cli/chunk-264PC2RN.mjs +0 -83
- package/dist/cli/chunk-44ZTYHMQ.mjs +0 -155
- package/dist/cli/chunk-53HN7WZN.js +0 -392
- package/dist/cli/chunk-7AALNGTA.mjs +0 -392
- package/dist/cli/chunk-ALD4COBH.js +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-WNUR6VP5.js +0 -83
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-VQFF6D7C.js +0 -24
- package/dist/cli/search-NCEEONMQ.js +0 -30
- package/dist/cli/sessions-3WYKQABW.js +0 -16
- package/dist/cli/skills-AKPAJVSO.js +0 -29
- package/dist/cli/tools-RBKEK6PM.js +0 -39
- package/dist/cli/update-VFNUBLDA.js +0 -29
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZHWBU36Hjs = require('./chunk-ZHWBU36H.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkYD7B53RWjs = require('./chunk-YD7B53RW.js');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
@@ -18,159 +17,16 @@ var _chunkYD7B53RWjs = require('./chunk-YD7B53RW.js');
|
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
|
|
20
|
+
var _chunkOZSC6CEWjs = require('./chunk-OZSC6CEW.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var _chunkDEC3JECCjs = require('./chunk-DEC3JECC.js');
|
|
32
|
-
|
|
33
|
-
// src/cli/commands/skills.ts
|
|
34
|
-
var _child_process = require('child_process');
|
|
35
|
-
var _fs = require('fs');
|
|
36
|
-
var _os = require('os');
|
|
37
|
-
var _path = require('path');
|
|
38
|
-
|
|
39
|
-
// contracts/install-commands.json
|
|
40
|
-
var install_commands_default = {
|
|
41
|
-
skills: {
|
|
42
|
-
index_path: "/.well-known/skills/index.json",
|
|
43
|
-
default_agents: [
|
|
44
|
-
"codex",
|
|
45
|
-
"claude-code",
|
|
46
|
-
"cursor",
|
|
47
|
-
"gemini-cli",
|
|
48
|
-
"antigravity"
|
|
49
|
-
],
|
|
50
|
-
npx_binary: "npx",
|
|
51
|
-
npx_add_args_template: [
|
|
52
|
-
"--yes",
|
|
53
|
-
"skills@1.5.15",
|
|
54
|
-
"add",
|
|
55
|
-
"{skills_source_url}",
|
|
56
|
-
"--agent",
|
|
57
|
-
"{agents}",
|
|
58
|
-
"--global",
|
|
59
|
-
"--yes",
|
|
60
|
-
"--skill",
|
|
61
|
-
"{skill_name}",
|
|
62
|
-
"--full-depth"
|
|
63
|
-
]
|
|
64
|
-
},
|
|
65
|
-
cli: {
|
|
66
|
-
sdk_npm_global: "npm install -g deepline@latest"
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// src/cli/install-commands.ts
|
|
71
|
-
var INSTALL_COMMANDS = install_commands_default;
|
|
72
|
-
var skillsNpxPackage = INSTALL_COMMANDS.skills.npx_add_args_template.find(
|
|
73
|
-
(arg) => /^skills@\d+\.\d+\.\d+$/.test(arg)
|
|
74
|
-
);
|
|
75
|
-
if (!skillsNpxPackage) {
|
|
76
|
-
throw new Error(
|
|
77
|
-
"shared_libs/cli/install-commands.json must pin an exact skills package version."
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
var SKILLS_NPX_PACKAGE = skillsNpxPackage;
|
|
81
|
-
var DEFAULT_V1_SKILL_NAMES = [
|
|
82
|
-
"deepline-org-chart",
|
|
83
|
-
"build-tam",
|
|
84
|
-
"clay-to-deepline",
|
|
85
|
-
"deepline-analytics",
|
|
86
|
-
"deepline-engine",
|
|
87
|
-
// Retired: its guidance lives in `feedback send --help` and `sessions send
|
|
88
|
-
// --help`. Kept as a stub because installed CLIs list it and refuse to
|
|
89
|
-
// sync any skill when the published index lacks a listed name. Move to
|
|
90
|
-
// LEGACY_SKILL_NAMES_TO_REMOVE once those CLIs are out of the field.
|
|
91
|
-
"deepline-feedback",
|
|
92
|
-
"deepline-gtm",
|
|
93
|
-
"deepline-start",
|
|
94
|
-
"deepline-plays",
|
|
95
|
-
"deepline-quickstart",
|
|
96
|
-
"deepline-research",
|
|
97
|
-
"deepline-scoring",
|
|
98
|
-
"find-qualified-titles",
|
|
99
|
-
"linkedin-url-lookup",
|
|
100
|
-
// Deprecated alias for `deepline-scoring`, kept installable so saved prompts
|
|
101
|
-
// and scripts using `/niche-signal-discovery` keep routing to the renamed
|
|
102
|
-
// skill. Move to LEGACY_SKILL_NAMES_TO_REMOVE once the window closes.
|
|
103
|
-
"niche-signal-discovery",
|
|
104
|
-
"portfolio-prospecting"
|
|
105
|
-
];
|
|
106
|
-
var DEFAULT_SDK_SKILL_NAMES = [...DEFAULT_V1_SKILL_NAMES];
|
|
107
|
-
var LEGACY_SKILL_NAMES_TO_REMOVE = [
|
|
108
|
-
"deepline-plays-feedback",
|
|
109
|
-
"deepline-plays-quickstart",
|
|
110
|
-
"workflow-hello-world"
|
|
111
|
-
];
|
|
112
|
-
function normalizeBaseUrl(baseUrl) {
|
|
113
|
-
return baseUrl.replace(/\/$/, "");
|
|
114
|
-
}
|
|
115
|
-
function renderTemplate(template, values) {
|
|
116
|
-
return template.replace(/\{([a-z_]+)\}/g, (match, key) => {
|
|
117
|
-
return _nullishCoalesce(values[key], () => ( match));
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
function skillsIndexUrl(baseUrl) {
|
|
121
|
-
return `${normalizeBaseUrl(baseUrl)}${INSTALL_COMMANDS.skills.index_path}`;
|
|
122
|
-
}
|
|
123
|
-
function skillsSourceUrl(baseUrl) {
|
|
124
|
-
return normalizeBaseUrl(baseUrl);
|
|
125
|
-
}
|
|
126
|
-
function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
127
|
-
const skillNames = Array.isArray(skillName) ? skillName : [skillName];
|
|
128
|
-
const [firstSkillName, ...extraSkillNames] = skillNames;
|
|
129
|
-
const agents = _nullishCoalesce(options.agents, () => ( _chunkFJCIUF34js.DEFAULT_SKILL_AGENTS));
|
|
130
|
-
const values = {
|
|
131
|
-
skills_index_url: skillsIndexUrl(baseUrl),
|
|
132
|
-
skills_source_url: skillsSourceUrl(baseUrl),
|
|
133
|
-
agents: agents.join(" "),
|
|
134
|
-
skill_name: _nullishCoalesce(firstSkillName, () => ( ""))
|
|
135
|
-
};
|
|
136
|
-
const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
|
|
137
|
-
(arg, index) => {
|
|
138
|
-
const next = index === 0 && options.firstArg ? options.firstArg : arg;
|
|
139
|
-
const value = renderTemplate(next, values);
|
|
140
|
-
if (arg === "{agents}") {
|
|
141
|
-
return agents;
|
|
142
|
-
}
|
|
143
|
-
if (arg === "{skill_name}") {
|
|
144
|
-
return [
|
|
145
|
-
value,
|
|
146
|
-
...extraSkillNames.flatMap((name) => ["--skill", name])
|
|
147
|
-
];
|
|
148
|
-
}
|
|
149
|
-
return value;
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
return rendered;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// src/cli/skills-sync.ts
|
|
156
|
-
|
|
157
|
-
var _crypto = require('crypto');
|
|
158
|
-
|
|
159
|
-
var _zlib = require('zlib');
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
26
|
+
var _chunkRMINBDYYjs = require('./chunk-RMINBDYY.js');
|
|
172
27
|
|
|
173
28
|
// src/compat.ts
|
|
29
|
+
var _crypto = require('crypto');
|
|
174
30
|
|
|
175
31
|
|
|
176
32
|
|
|
@@ -178,11 +34,11 @@ var _zlib = require('zlib');
|
|
|
178
34
|
|
|
179
35
|
|
|
180
36
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
37
|
+
var _fs = require('fs');
|
|
38
|
+
var _os = require('os');
|
|
39
|
+
var _path = require('path');
|
|
185
40
|
var CHECK_TIMEOUT_MS = 2e3;
|
|
41
|
+
var SDK_CLI_AUTO_UPDATE_CAPABILITY = "safe-continuation-v1";
|
|
186
42
|
var SDK_COMPATIBILITY_TRUST_MS = 10 * 60 * 1e3;
|
|
187
43
|
var SDK_COMPATIBILITY_CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
188
44
|
var SDK_COMPATIBILITY_FAST_DEADLINE_MS = 400;
|
|
@@ -201,33 +57,33 @@ function shouldSkipCompatibilityCheck() {
|
|
|
201
57
|
const value = _optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.DEEPLINE_SKIP_SDK_COMPAT_CHECK, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4(), 'access', _5 => _5.toLowerCase, 'call', _6 => _6()]);
|
|
202
58
|
return value === "1" || value === "true" || value === "yes";
|
|
203
59
|
}
|
|
204
|
-
function sdkCompatibilityCachePath(baseUrl, homeDir = _os.homedir.call(void 0, )) {
|
|
205
|
-
return _path.join.call(void 0,
|
|
60
|
+
function sdkCompatibilityCachePath(baseUrl, homeDir = _optionalChain([process, 'access', _7 => _7.env, 'access', _8 => _8.HOME, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) || _os.homedir.call(void 0, )) {
|
|
61
|
+
return _path.join.call(void 0, _chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
|
|
206
62
|
}
|
|
207
|
-
function legacySdkCompatibilityCachePath(homeDir = _os.homedir.call(void 0, )) {
|
|
63
|
+
function legacySdkCompatibilityCachePath(homeDir = _optionalChain([process, 'access', _11 => _11.env, 'access', _12 => _12.HOME, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]) || _os.homedir.call(void 0, )) {
|
|
208
64
|
return _path.join.call(void 0, homeDir, ".cache", "deepline", "sdk-compat-cache.json");
|
|
209
65
|
}
|
|
210
66
|
function compatibilityCacheKey(baseUrl, command, skillsVersion) {
|
|
211
67
|
return JSON.stringify({
|
|
212
68
|
baseUrl: baseUrl.replace(/\/$/, ""),
|
|
213
|
-
version:
|
|
214
|
-
apiContract:
|
|
215
|
-
apiMajor:
|
|
216
|
-
command: _optionalChain([command, 'optionalAccess',
|
|
69
|
+
version: _chunkOZSC6CEWjs.SDK_VERSION,
|
|
70
|
+
apiContract: _chunkOZSC6CEWjs.SDK_API_CONTRACT,
|
|
71
|
+
apiMajor: _chunkOZSC6CEWjs.SDK_API_MAJOR,
|
|
72
|
+
command: _optionalChain([command, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]) || null,
|
|
217
73
|
skillsVersion: _nullishCoalesce(skillsVersion, () => ( null))
|
|
218
74
|
});
|
|
219
75
|
}
|
|
220
76
|
function legacyCompatibilityCacheKey(baseUrl, command) {
|
|
221
77
|
return JSON.stringify({
|
|
222
78
|
baseUrl: baseUrl.replace(/\/$/, ""),
|
|
223
|
-
version:
|
|
224
|
-
apiContract:
|
|
225
|
-
command: _optionalChain([command, 'optionalAccess',
|
|
79
|
+
version: _chunkOZSC6CEWjs.SDK_VERSION,
|
|
80
|
+
apiContract: _chunkOZSC6CEWjs.SDK_API_CONTRACT,
|
|
81
|
+
command: _optionalChain([command, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]) || null
|
|
226
82
|
});
|
|
227
83
|
}
|
|
228
84
|
function isCleanCompatibilityPolicy(response) {
|
|
229
85
|
if (!response) return false;
|
|
230
|
-
return response.ok === true && response.update_required !== true && response.status !== "unsupported" && !_optionalChain([response, 'access',
|
|
86
|
+
return response.ok === true && response.update_required !== true && response.status !== "unsupported" && !_optionalChain([response, 'access', _19 => _19.auto_update, 'optionalAccess', _20 => _20.should_auto_update]) && !response.cli_family;
|
|
231
87
|
}
|
|
232
88
|
function readFreshCleanCompatibility(baseUrl, command, skillsVersion) {
|
|
233
89
|
const cached = readCachedCompatibility(baseUrl, command, skillsVersion);
|
|
@@ -244,8 +100,24 @@ function isSavedWithin(savedAt, windowMs, now) {
|
|
|
244
100
|
const age = now - savedAt;
|
|
245
101
|
return Number.isFinite(age) && age >= 0 && age <= windowMs;
|
|
246
102
|
}
|
|
103
|
+
var UPDATE_ADVISORY_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
104
|
+
function claimUpdateAdvisory(baseUrl, now = Date.now()) {
|
|
105
|
+
const path = _path.join.call(void 0, _chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl), "update-advisory.json");
|
|
106
|
+
try {
|
|
107
|
+
const { shownAt } = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
|
|
108
|
+
if (isSavedWithin(shownAt, UPDATE_ADVISORY_INTERVAL_MS, now)) return false;
|
|
109
|
+
} catch (e) {
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
|
|
113
|
+
_fs.writeFileSync.call(void 0, path, `${JSON.stringify({ shownAt: now })}
|
|
114
|
+
`);
|
|
115
|
+
} catch (e2) {
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
247
119
|
function readCachedCompatibility(baseUrl, command, skillsVersion) {
|
|
248
|
-
return _nullishCoalesce(_optionalChain([readCachedCompatibilityEntry, 'call',
|
|
120
|
+
return _nullishCoalesce(_optionalChain([readCachedCompatibilityEntry, 'call', _21 => _21(baseUrl, command, skillsVersion), 'optionalAccess', _22 => _22.response]), () => ( null));
|
|
249
121
|
}
|
|
250
122
|
function readCachedCompatibilityEntry(baseUrl, command, skillsVersion) {
|
|
251
123
|
try {
|
|
@@ -259,12 +131,12 @@ function readCachedCompatibilityEntry(baseUrl, command, skillsVersion) {
|
|
|
259
131
|
const parsed = JSON.parse(
|
|
260
132
|
_fs.readFileSync.call(void 0, cachePath, "utf8")
|
|
261
133
|
);
|
|
262
|
-
const entry = _nullishCoalesce(_optionalChain([parsed, 'access',
|
|
134
|
+
const entry = _nullishCoalesce(_optionalChain([parsed, 'access', _23 => _23.entries, 'optionalAccess', _24 => _24[compatibilityCacheKey(baseUrl, command, skillsVersion)]]), () => ( (useLegacyCache ? _optionalChain([parsed, 'access', _25 => _25.entries, 'optionalAccess', _26 => _26[legacyCompatibilityCacheKey(baseUrl, command)]]) : void 0)));
|
|
263
135
|
if (!entry || !isSavedWithin(entry.savedAt, SDK_COMPATIBILITY_CACHE_TTL_MS, Date.now())) {
|
|
264
136
|
return null;
|
|
265
137
|
}
|
|
266
138
|
return entry;
|
|
267
|
-
} catch (
|
|
139
|
+
} catch (e3) {
|
|
268
140
|
return null;
|
|
269
141
|
}
|
|
270
142
|
}
|
|
@@ -281,7 +153,7 @@ function invalidateCachedCompatibility(baseUrl, command, skillsVersion) {
|
|
|
281
153
|
delete entries[compatibilityCacheKey(baseUrl, command, skillsVersion)];
|
|
282
154
|
delete entries[legacyCompatibilityCacheKey(baseUrl, command)];
|
|
283
155
|
writeCompatibilityCacheFile(cachePath, { entries });
|
|
284
|
-
} catch (
|
|
156
|
+
} catch (e4) {
|
|
285
157
|
}
|
|
286
158
|
}
|
|
287
159
|
function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
|
|
@@ -291,7 +163,7 @@ function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
|
|
|
291
163
|
if (_fs.existsSync.call(void 0, path)) {
|
|
292
164
|
try {
|
|
293
165
|
existing = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
|
|
294
|
-
} catch (
|
|
166
|
+
} catch (e5) {
|
|
295
167
|
}
|
|
296
168
|
}
|
|
297
169
|
const entries = _nullishCoalesce(existing.entries, () => ( {}));
|
|
@@ -300,7 +172,7 @@ function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
|
|
|
300
172
|
response
|
|
301
173
|
};
|
|
302
174
|
writeCompatibilityCacheFile(path, { entries });
|
|
303
|
-
} catch (
|
|
175
|
+
} catch (e6) {
|
|
304
176
|
}
|
|
305
177
|
}
|
|
306
178
|
async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
@@ -314,30 +186,35 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
314
186
|
);
|
|
315
187
|
try {
|
|
316
188
|
const url = new URL("/api/v2/sdk/compat", baseUrl);
|
|
317
|
-
url.searchParams.set("version",
|
|
318
|
-
if (_optionalChain([options, 'access',
|
|
189
|
+
url.searchParams.set("version", _chunkOZSC6CEWjs.SDK_VERSION);
|
|
190
|
+
if (_optionalChain([options, 'access', _27 => _27.command, 'optionalAccess', _28 => _28.trim, 'call', _29 => _29()])) {
|
|
319
191
|
url.searchParams.set("command", options.command.trim());
|
|
320
192
|
}
|
|
321
193
|
if (options.skillsVersion !== void 0) {
|
|
322
194
|
url.searchParams.set("skills_version", _nullishCoalesce(options.skillsVersion, () => ( "")));
|
|
323
195
|
url.searchParams.set(
|
|
324
196
|
"skills_cli_capability",
|
|
325
|
-
String(
|
|
197
|
+
String(_chunkRMINBDYYjs.SDK_RELEASE.packageCapabilities.skillsGuidance)
|
|
326
198
|
);
|
|
327
199
|
}
|
|
328
200
|
if (options.catalog) {
|
|
329
201
|
url.searchParams.set("catalog_tool_id", options.catalog.toolId);
|
|
202
|
+
if (options.catalog.purpose) {
|
|
203
|
+
url.searchParams.set("catalog_purpose", options.catalog.purpose);
|
|
204
|
+
}
|
|
330
205
|
}
|
|
331
206
|
const response = await fetch(url, {
|
|
332
207
|
method: "GET",
|
|
333
208
|
headers: {
|
|
334
|
-
...
|
|
335
|
-
"User-Agent": `deepline-ts-sdk/${
|
|
336
|
-
"X-Deepline-SDK-Version":
|
|
337
|
-
"X-Deepline-API-Major": String(
|
|
338
|
-
"X-Deepline-API-Contract":
|
|
209
|
+
..._chunkOZSC6CEWjs.deploymentProtectionHeaders.call(void 0, ),
|
|
210
|
+
"User-Agent": `deepline-ts-sdk/${_chunkOZSC6CEWjs.SDK_VERSION}`,
|
|
211
|
+
"X-Deepline-SDK-Version": _chunkOZSC6CEWjs.SDK_VERSION,
|
|
212
|
+
"X-Deepline-API-Major": String(_chunkOZSC6CEWjs.SDK_API_MAJOR),
|
|
213
|
+
"X-Deepline-API-Contract": _chunkOZSC6CEWjs.SDK_API_CONTRACT,
|
|
339
214
|
"X-Deepline-CLI-Update-Preferences": "1",
|
|
340
|
-
|
|
215
|
+
"X-Deepline-CLI-Auto-Update-Capability": SDK_CLI_AUTO_UPDATE_CAPABILITY,
|
|
216
|
+
...options.catalog ? { Authorization: `Bearer ${_chunkOZSC6CEWjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {},
|
|
217
|
+
..._optionalChain([options, 'access', _30 => _30.catalog, 'optionalAccess', _31 => _31.cliInvocationId]) ? { "X-Deepline-CLI-Invocation-ID": options.catalog.cliInvocationId } : {}
|
|
341
218
|
},
|
|
342
219
|
signal: controller.signal
|
|
343
220
|
});
|
|
@@ -356,7 +233,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
356
233
|
data
|
|
357
234
|
);
|
|
358
235
|
}
|
|
359
|
-
if (options.catalog && catalogMetadata && typeof catalogMetadata === "object" && "toolId" in catalogMetadata && catalogMetadata.toolId === options.catalog.toolId) {
|
|
236
|
+
if (data.ok && options.catalog && catalogMetadata && typeof catalogMetadata === "object" && "toolId" in catalogMetadata && catalogMetadata.toolId === options.catalog.toolId) {
|
|
360
237
|
options.catalog.acceptMetadata(catalogMetadata);
|
|
361
238
|
}
|
|
362
239
|
return { response: data, error: null };
|
|
@@ -386,7 +263,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
386
263
|
}
|
|
387
264
|
function isCiEnvironment() {
|
|
388
265
|
return ["CI", "GITHUB_ACTIONS"].some((name) => {
|
|
389
|
-
const value = _optionalChain([process, 'access',
|
|
266
|
+
const value = _optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33[name], 'optionalAccess', _34 => _34.trim, 'call', _35 => _35(), 'access', _36 => _36.toLowerCase, 'call', _37 => _37()]);
|
|
390
267
|
return value === "1" || value === "true" || value === "yes";
|
|
391
268
|
});
|
|
392
269
|
}
|
|
@@ -403,6 +280,269 @@ function enforceSdkCompatibilityResponse(response, options = {}) {
|
|
|
403
280
|
}
|
|
404
281
|
}
|
|
405
282
|
|
|
283
|
+
// contracts/install-commands.json
|
|
284
|
+
var install_commands_default = {
|
|
285
|
+
skills: {
|
|
286
|
+
index_path: "/.well-known/skills/index.json",
|
|
287
|
+
default_agents: [
|
|
288
|
+
"codex",
|
|
289
|
+
"claude-code",
|
|
290
|
+
"cursor",
|
|
291
|
+
"gemini-cli",
|
|
292
|
+
"antigravity"
|
|
293
|
+
],
|
|
294
|
+
npx_binary: "npx",
|
|
295
|
+
npx_add_args_template: [
|
|
296
|
+
"--yes",
|
|
297
|
+
"skills@1.5.15",
|
|
298
|
+
"add",
|
|
299
|
+
"{skills_source_url}",
|
|
300
|
+
"--agent",
|
|
301
|
+
"{agents}",
|
|
302
|
+
"--global",
|
|
303
|
+
"--yes",
|
|
304
|
+
"--skill",
|
|
305
|
+
"{skill_name}",
|
|
306
|
+
"--full-depth"
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
cli: {
|
|
310
|
+
sdk_npm_global: "npm install -g deepline@latest"
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
// src/cli/install-commands.ts
|
|
315
|
+
var INSTALL_COMMANDS = install_commands_default;
|
|
316
|
+
var skillsNpxPackage = INSTALL_COMMANDS.skills.npx_add_args_template.find(
|
|
317
|
+
(arg) => /^skills@\d+\.\d+\.\d+$/.test(arg)
|
|
318
|
+
);
|
|
319
|
+
if (!skillsNpxPackage) {
|
|
320
|
+
throw new Error(
|
|
321
|
+
"shared_libs/cli/install-commands.json must pin an exact skills package version."
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
var SKILLS_NPX_PACKAGE = skillsNpxPackage;
|
|
325
|
+
var DEFAULT_V1_SKILL_NAMES = [
|
|
326
|
+
"deepline-org-chart",
|
|
327
|
+
"build-tam",
|
|
328
|
+
"clay-to-deepline",
|
|
329
|
+
"deepline-analytics",
|
|
330
|
+
"deepline-engine",
|
|
331
|
+
// Retired: its guidance lives in `feedback send --help` and `sessions send
|
|
332
|
+
// --help`. Kept as a stub because installed CLIs list it and refuse to
|
|
333
|
+
// sync any skill when the published index lacks a listed name. Move to
|
|
334
|
+
// LEGACY_SKILL_NAMES_TO_REMOVE once those CLIs are out of the field.
|
|
335
|
+
"deepline-feedback",
|
|
336
|
+
"deepline-gtm",
|
|
337
|
+
"deepline-start",
|
|
338
|
+
"deepline-plays",
|
|
339
|
+
"deepline-quickstart",
|
|
340
|
+
"deepline-research",
|
|
341
|
+
"deepline-scoring",
|
|
342
|
+
"find-qualified-titles",
|
|
343
|
+
"linkedin-url-lookup",
|
|
344
|
+
// Deprecated alias for `deepline-scoring`, kept installable so saved prompts
|
|
345
|
+
// and scripts using `/niche-signal-discovery` keep routing to the renamed
|
|
346
|
+
// skill. Move to LEGACY_SKILL_NAMES_TO_REMOVE once the window closes.
|
|
347
|
+
"niche-signal-discovery",
|
|
348
|
+
"portfolio-prospecting"
|
|
349
|
+
];
|
|
350
|
+
var DEFAULT_SDK_SKILL_NAMES = [...DEFAULT_V1_SKILL_NAMES];
|
|
351
|
+
var LEGACY_SKILL_NAMES_TO_REMOVE = [
|
|
352
|
+
"deepline-plays-feedback",
|
|
353
|
+
"deepline-plays-quickstart",
|
|
354
|
+
"workflow-hello-world"
|
|
355
|
+
];
|
|
356
|
+
function normalizeBaseUrl(baseUrl) {
|
|
357
|
+
return baseUrl.replace(/\/$/, "");
|
|
358
|
+
}
|
|
359
|
+
function renderTemplate(template, values) {
|
|
360
|
+
return template.replace(/\{([a-z_]+)\}/g, (match, key) => {
|
|
361
|
+
return _nullishCoalesce(values[key], () => ( match));
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
function skillsIndexUrl(baseUrl) {
|
|
365
|
+
return `${normalizeBaseUrl(baseUrl)}${INSTALL_COMMANDS.skills.index_path}`;
|
|
366
|
+
}
|
|
367
|
+
function skillsSourceUrl(baseUrl) {
|
|
368
|
+
return normalizeBaseUrl(baseUrl);
|
|
369
|
+
}
|
|
370
|
+
function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
|
|
371
|
+
const skillNames = Array.isArray(skillName) ? skillName : [skillName];
|
|
372
|
+
const [firstSkillName, ...extraSkillNames] = skillNames;
|
|
373
|
+
const agents = _nullishCoalesce(options.agents, () => ( _chunkOZSC6CEWjs.DEFAULT_SKILL_AGENTS));
|
|
374
|
+
const values = {
|
|
375
|
+
skills_index_url: skillsIndexUrl(baseUrl),
|
|
376
|
+
skills_source_url: skillsSourceUrl(baseUrl),
|
|
377
|
+
agents: agents.join(" "),
|
|
378
|
+
skill_name: _nullishCoalesce(firstSkillName, () => ( ""))
|
|
379
|
+
};
|
|
380
|
+
const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
|
|
381
|
+
(arg, index) => {
|
|
382
|
+
const next = index === 0 && options.firstArg ? options.firstArg : arg;
|
|
383
|
+
const value = renderTemplate(next, values);
|
|
384
|
+
if (arg === "{agents}") {
|
|
385
|
+
return agents;
|
|
386
|
+
}
|
|
387
|
+
if (arg === "{skill_name}") {
|
|
388
|
+
return [
|
|
389
|
+
value,
|
|
390
|
+
...extraSkillNames.flatMap((name) => ["--skill", name])
|
|
391
|
+
];
|
|
392
|
+
}
|
|
393
|
+
return value;
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
return rendered;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// src/cli/progress.ts
|
|
400
|
+
var _worker_threads = require('worker_threads');
|
|
401
|
+
var CliProgress = (_class = class {
|
|
402
|
+
__init() {this.lastMessage = null}
|
|
403
|
+
__init2() {this.interactive = Boolean(process.stderr.isTTY)}
|
|
404
|
+
__init3() {this.grey = "\x1B[90m"}
|
|
405
|
+
__init4() {this.cyan = "\x1B[36m"}
|
|
406
|
+
__init5() {this.dim = "\x1B[2m"}
|
|
407
|
+
__init6() {this.reset = "\x1B[0m"}
|
|
408
|
+
__init7() {this.worker = null}
|
|
409
|
+
|
|
410
|
+
// --json output is one JSON document: progress never renders under it.
|
|
411
|
+
constructor(enabled) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
|
|
412
|
+
this.enabled = enabled && !_chunkZHWBU36Hjs.isJsonOutputMode.call(void 0, );
|
|
413
|
+
}
|
|
414
|
+
phase(message) {
|
|
415
|
+
if (!this.enabled || this.lastMessage === message) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
if (this.interactive && this.lastMessage) {
|
|
419
|
+
this.settle("\u2713");
|
|
420
|
+
}
|
|
421
|
+
this.lastMessage = message;
|
|
422
|
+
if (!this.interactive) {
|
|
423
|
+
process.stderr.write(`${message}
|
|
424
|
+
`);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
this.ensureWorker();
|
|
428
|
+
_optionalChain([this, 'access', _38 => _38.worker, 'optionalAccess', _39 => _39.postMessage, 'call', _40 => _40({ type: "phase", message })]);
|
|
429
|
+
}
|
|
430
|
+
complete() {
|
|
431
|
+
this.settle("\u2713");
|
|
432
|
+
}
|
|
433
|
+
fail() {
|
|
434
|
+
this.settle("\u2717");
|
|
435
|
+
}
|
|
436
|
+
writeLogLine(line) {
|
|
437
|
+
if (_chunkZHWBU36Hjs.isJsonOutputMode.call(void 0, )) return;
|
|
438
|
+
if (!this.enabled) {
|
|
439
|
+
process.stderr.write(`${line}
|
|
440
|
+
`);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
const message = this.interactive ? `${this.cyan}[logs]${this.reset} ${this.dim}${line}${this.reset}` : `[logs] ${line}`;
|
|
444
|
+
if (!this.interactive) {
|
|
445
|
+
process.stderr.write(`${message}
|
|
446
|
+
`);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const activeMessage = this.lastMessage;
|
|
450
|
+
_optionalChain([this, 'access', _41 => _41.worker, 'optionalAccess', _42 => _42.terminate, 'call', _43 => _43(), 'access', _44 => _44.catch, 'call', _45 => _45(() => void 0)]);
|
|
451
|
+
this.worker = null;
|
|
452
|
+
process.stderr.write(`\r\x1B[2K${message}
|
|
453
|
+
`);
|
|
454
|
+
if (activeMessage) {
|
|
455
|
+
this.startWorker().postMessage({ type: "phase", message: activeMessage });
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
writeLine(line, stream = process.stderr) {
|
|
459
|
+
if (!this.enabled || !this.interactive) {
|
|
460
|
+
stream.write(`${line}
|
|
461
|
+
`);
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const activeMessage = this.lastMessage;
|
|
465
|
+
_optionalChain([this, 'access', _46 => _46.worker, 'optionalAccess', _47 => _47.terminate, 'call', _48 => _48(), 'access', _49 => _49.catch, 'call', _50 => _50(() => void 0)]);
|
|
466
|
+
this.worker = null;
|
|
467
|
+
stream.write(`\r\x1B[2K${line}
|
|
468
|
+
`);
|
|
469
|
+
if (activeMessage) {
|
|
470
|
+
this.startWorker().postMessage({ type: "phase", message: activeMessage });
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
settle(mark) {
|
|
474
|
+
if (!this.enabled || !this.lastMessage) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
if (this.interactive) {
|
|
478
|
+
_optionalChain([this, 'access', _51 => _51.worker, 'optionalAccess', _52 => _52.terminate, 'call', _53 => _53(), 'access', _54 => _54.catch, 'call', _55 => _55(() => void 0)]);
|
|
479
|
+
this.worker = null;
|
|
480
|
+
process.stderr.write(
|
|
481
|
+
`\r\x1B[2K${this.grey}${mark} ${this.lastMessage}${this.reset}
|
|
482
|
+
`
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
this.lastMessage = null;
|
|
486
|
+
}
|
|
487
|
+
ensureWorker() {
|
|
488
|
+
this.startWorker();
|
|
489
|
+
}
|
|
490
|
+
startWorker() {
|
|
491
|
+
if (this.worker) {
|
|
492
|
+
return this.worker;
|
|
493
|
+
}
|
|
494
|
+
this.worker = new (0, _worker_threads.Worker)(
|
|
495
|
+
`
|
|
496
|
+
const { parentPort } = require('node:worker_threads');
|
|
497
|
+
const { writeSync } = require('node:fs');
|
|
498
|
+
const frames = ['\u2014', '\\\\', '|', '/'];
|
|
499
|
+
const grey = '\\x1b[90m';
|
|
500
|
+
const reset = '\\x1b[0m';
|
|
501
|
+
let message = '';
|
|
502
|
+
let frameIndex = 0;
|
|
503
|
+
let timer = null;
|
|
504
|
+
function render() {
|
|
505
|
+
if (!message) return;
|
|
506
|
+
const frame = frames[frameIndex % frames.length] || '\u2014';
|
|
507
|
+
frameIndex += 1;
|
|
508
|
+
writeSync(2, '\\r\\x1b[2K' + grey + frame + ' ' + message + reset);
|
|
509
|
+
}
|
|
510
|
+
parentPort.on('message', (event) => {
|
|
511
|
+
if (event.type === 'phase') {
|
|
512
|
+
message = String(event.message || '');
|
|
513
|
+
frameIndex = 0;
|
|
514
|
+
render();
|
|
515
|
+
if (!timer) {
|
|
516
|
+
timer = setInterval(render, 120);
|
|
517
|
+
timer.unref && timer.unref();
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (event.type === 'stop') {
|
|
521
|
+
if (timer) clearInterval(timer);
|
|
522
|
+
timer = null;
|
|
523
|
+
writeSync(2, '\\r\\x1b[2K');
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
`,
|
|
527
|
+
{ eval: true }
|
|
528
|
+
);
|
|
529
|
+
this.worker.unref();
|
|
530
|
+
return this.worker;
|
|
531
|
+
}
|
|
532
|
+
}, _class);
|
|
533
|
+
var activeProgress = null;
|
|
534
|
+
function setActiveCliProgress(progress) {
|
|
535
|
+
activeProgress = progress;
|
|
536
|
+
}
|
|
537
|
+
function getActiveCliProgress() {
|
|
538
|
+
return activeProgress;
|
|
539
|
+
}
|
|
540
|
+
function createCliProgress(enabled) {
|
|
541
|
+
const progress = new CliProgress(enabled);
|
|
542
|
+
setActiveCliProgress(progress);
|
|
543
|
+
return progress;
|
|
544
|
+
}
|
|
545
|
+
|
|
406
546
|
// src/cli/windows-arg-escape.ts
|
|
407
547
|
|
|
408
548
|
|
|
@@ -451,7 +591,7 @@ function resolveWindowsExecutable(command, env, cwd) {
|
|
|
451
591
|
) : _path.win32.resolve(cwd, command + extension);
|
|
452
592
|
try {
|
|
453
593
|
if (_fs.statSync.call(void 0, candidate).isFile()) return candidate;
|
|
454
|
-
} catch (
|
|
594
|
+
} catch (e7) {
|
|
455
595
|
}
|
|
456
596
|
}
|
|
457
597
|
}
|
|
@@ -482,7 +622,7 @@ function isFailureReportingDisabled() {
|
|
|
482
622
|
return truthyEnv(FAILURE_REPORT_DISABLE_ENV);
|
|
483
623
|
}
|
|
484
624
|
function redactFailureText(value, maxChars = MAX_FAILURE_TEXT_CHARS) {
|
|
485
|
-
const home = _optionalChain([process, 'access',
|
|
625
|
+
const home = _optionalChain([process, 'access', _56 => _56.env, 'access', _57 => _57.HOME, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
|
|
486
626
|
let text = String(_nullishCoalesce(value, () => ( "")));
|
|
487
627
|
if (!text) return "";
|
|
488
628
|
if (home && home !== "/") {
|
|
@@ -547,7 +687,13 @@ function classifyNetworkFailure(error) {
|
|
|
547
687
|
if (combined.includes("remotedisconnected") || combined.includes("remote end closed connection") || combined.includes("other side closed") || combined.includes("socket hang up")) {
|
|
548
688
|
return "network_remote_disconnected";
|
|
549
689
|
}
|
|
550
|
-
if (
|
|
690
|
+
if (
|
|
691
|
+
// Local filenames and retry commands may contain "ssl" or "tls".
|
|
692
|
+
// Require a transport identifier or protocol failure text instead.
|
|
693
|
+
code.includes("ssl") || code.includes("tls") || name.includes("ssl") || name.includes("tls") || /(?:^|[\s[(:])(?:ssl|tls)[\s:_-]+(?:error|handshake|certificate|routines|connection|failed|failure)(?:$|[\s:_-])/.test(
|
|
694
|
+
text
|
|
695
|
+
) || combined.includes("unexpected_eof_while_reading")
|
|
696
|
+
) {
|
|
551
697
|
return "network_ssl_error";
|
|
552
698
|
}
|
|
553
699
|
current = _nullishCoalesce(record.cause, () => ( record.context));
|
|
@@ -578,7 +724,7 @@ function classifyNetworkCauseCategory(error) {
|
|
|
578
724
|
}
|
|
579
725
|
function isNetworkFailure(error) {
|
|
580
726
|
if (!(error instanceof Error)) return false;
|
|
581
|
-
if (error instanceof
|
|
727
|
+
if (error instanceof _chunkPPDBRJRWjs.DeeplineError && error.statusCode) return false;
|
|
582
728
|
const code = classifyNetworkFailure(error);
|
|
583
729
|
return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
|
|
584
730
|
}
|
|
@@ -590,37 +736,37 @@ function buildEnvironmentContext() {
|
|
|
590
736
|
node_version: process.version,
|
|
591
737
|
runtime: "Node.js",
|
|
592
738
|
hostname: _os.hostname.call(void 0, ),
|
|
593
|
-
agent_runtime:
|
|
739
|
+
agent_runtime: _chunkOZSC6CEWjs.detectAgentRuntime.call(void 0, )
|
|
594
740
|
};
|
|
595
741
|
for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
|
|
596
|
-
const normalized = _optionalChain([process, 'access',
|
|
742
|
+
const normalized = _optionalChain([process, 'access', _60 => _60.env, 'access', _61 => _61[key], 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
|
|
597
743
|
if (normalized) context[key.toLowerCase()] = normalized;
|
|
598
744
|
}
|
|
599
|
-
if (_optionalChain([process, 'access',
|
|
745
|
+
if (_optionalChain([process, 'access', _64 => _64.env, 'access', _65 => _65.CLAUDE_PROJECT_DIR, 'optionalAccess', _66 => _66.trim, 'call', _67 => _67()])) {
|
|
600
746
|
context.claude_project_dir_present = "true";
|
|
601
747
|
}
|
|
602
|
-
if (_optionalChain([process, 'access',
|
|
748
|
+
if (_optionalChain([process, 'access', _68 => _68.env, 'access', _69 => _69.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()])) {
|
|
603
749
|
context.deepline_plugin_root_present = "true";
|
|
604
750
|
}
|
|
605
|
-
if (_optionalChain([process, 'access',
|
|
751
|
+
if (_optionalChain([process, 'access', _72 => _72.env, 'access', _73 => _73.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()])) {
|
|
606
752
|
context.deepline_plugin_skills_dir_present = "true";
|
|
607
753
|
}
|
|
608
|
-
if (_optionalChain([process, 'access',
|
|
754
|
+
if (_optionalChain([process, 'access', _76 => _76.env, 'access', _77 => _77.HOME, 'optionalAccess', _78 => _78.trim, 'call', _79 => _79(), 'access', _80 => _80.startsWith, 'call', _81 => _81("/sessions/")])) {
|
|
609
755
|
context.home_scope = "sessions";
|
|
610
756
|
}
|
|
611
757
|
return context;
|
|
612
758
|
}
|
|
613
759
|
function failureReportHeaders(apiKey) {
|
|
614
760
|
return {
|
|
615
|
-
...
|
|
761
|
+
..._chunkOZSC6CEWjs.deploymentProtectionHeaders.call(void 0, ),
|
|
616
762
|
Authorization: `Bearer ${apiKey}`,
|
|
617
763
|
"Content-Type": "application/json",
|
|
618
|
-
"User-Agent": `deepline-ts-sdk/${
|
|
764
|
+
"User-Agent": `deepline-ts-sdk/${_chunkOZSC6CEWjs.SDK_VERSION}`,
|
|
619
765
|
"X-Deepline-Client-Family": "sdk",
|
|
620
766
|
"X-Deepline-CLI-Family": "sdk",
|
|
621
|
-
"X-Deepline-Agent-Runtime":
|
|
622
|
-
"X-Deepline-CLI-Version":
|
|
623
|
-
"X-Deepline-SDK-Version":
|
|
767
|
+
"X-Deepline-Agent-Runtime": _chunkOZSC6CEWjs.detectAgentRuntime.call(void 0, ),
|
|
768
|
+
"X-Deepline-CLI-Version": _chunkOZSC6CEWjs.SDK_VERSION,
|
|
769
|
+
"X-Deepline-SDK-Version": _chunkOZSC6CEWjs.SDK_VERSION
|
|
624
770
|
};
|
|
625
771
|
}
|
|
626
772
|
async function postFailureReport(input) {
|
|
@@ -635,7 +781,7 @@ async function postFailureReport(input) {
|
|
|
635
781
|
signal: controller.signal
|
|
636
782
|
});
|
|
637
783
|
return true;
|
|
638
|
-
} catch (
|
|
784
|
+
} catch (e8) {
|
|
639
785
|
return false;
|
|
640
786
|
} finally {
|
|
641
787
|
clearTimeout(timeout);
|
|
@@ -648,8 +794,8 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
|
|
|
648
794
|
if (isFailureReportingDisabled()) return false;
|
|
649
795
|
let apiKey = "";
|
|
650
796
|
try {
|
|
651
|
-
apiKey =
|
|
652
|
-
} catch (
|
|
797
|
+
apiKey = _chunkOZSC6CEWjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
|
|
798
|
+
} catch (e9) {
|
|
653
799
|
return false;
|
|
654
800
|
}
|
|
655
801
|
if (!apiKey) return false;
|
|
@@ -675,7 +821,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
|
|
|
675
821
|
failure_code: failureCode2,
|
|
676
822
|
failure_stage: failureStage,
|
|
677
823
|
error_body: "Automatic Deepline skills installation failed.",
|
|
678
|
-
cli_version:
|
|
824
|
+
cli_version: _chunkOZSC6CEWjs.SDK_VERSION,
|
|
679
825
|
context: {
|
|
680
826
|
environment: buildEnvironmentContext(),
|
|
681
827
|
skills_sync: {
|
|
@@ -706,7 +852,7 @@ function commandTokens(argv) {
|
|
|
706
852
|
}
|
|
707
853
|
function isServerLoggedPlayRunStartFailure(input) {
|
|
708
854
|
const [subcommand, command] = commandTokens(input.argv);
|
|
709
|
-
return subcommand === "plays" && command === "run" && input.error instanceof
|
|
855
|
+
return subcommand === "plays" && command === "run" && input.error instanceof _chunkPPDBRJRWjs.DeeplineError && typeof input.error.statusCode === "number";
|
|
710
856
|
}
|
|
711
857
|
function shouldReport(input) {
|
|
712
858
|
if (input.error !== void 0) return true;
|
|
@@ -716,7 +862,7 @@ function failureCode(input) {
|
|
|
716
862
|
if (input.error !== void 0) {
|
|
717
863
|
if (isNetworkFailure(input.error))
|
|
718
864
|
return classifyNetworkFailure(input.error);
|
|
719
|
-
if (input.error instanceof
|
|
865
|
+
if (input.error instanceof _chunkPPDBRJRWjs.DeeplineError && input.error.code) {
|
|
720
866
|
return input.error.code;
|
|
721
867
|
}
|
|
722
868
|
if (input.error instanceof Error && input.error.name)
|
|
@@ -739,8 +885,8 @@ function resolvedFailureKind(input) {
|
|
|
739
885
|
return input.error === void 0 ? "command_exit" : "uncaught_exception";
|
|
740
886
|
}
|
|
741
887
|
function safeRequestDiagnostics(error) {
|
|
742
|
-
if (!(error instanceof
|
|
743
|
-
const request = _optionalChain([error, 'access',
|
|
888
|
+
if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError)) return null;
|
|
889
|
+
const request = _optionalChain([error, 'access', _82 => _82.details, 'optionalAccess', _83 => _83.request]);
|
|
744
890
|
if (!request || typeof request !== "object" || Array.isArray(request))
|
|
745
891
|
return null;
|
|
746
892
|
const value = request;
|
|
@@ -760,7 +906,7 @@ function safeRequestDiagnostics(error) {
|
|
|
760
906
|
if (url.protocol === "https:" || url.protocol === "http:") {
|
|
761
907
|
result.url = redactFailureText(`${url.origin}${url.pathname}`, 1e3);
|
|
762
908
|
}
|
|
763
|
-
} catch (
|
|
909
|
+
} catch (e10) {
|
|
764
910
|
}
|
|
765
911
|
}
|
|
766
912
|
if (typeof value.failedAtUtc === "string" && Number.isFinite(Date.parse(value.failedAtUtc))) {
|
|
@@ -795,7 +941,7 @@ function buildFailureReport(input) {
|
|
|
795
941
|
failure_kind: failureKind,
|
|
796
942
|
failure_code: code,
|
|
797
943
|
failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
|
|
798
|
-
cli_version:
|
|
944
|
+
cli_version: _chunkOZSC6CEWjs.SDK_VERSION,
|
|
799
945
|
context: {
|
|
800
946
|
base_url: redactFailureText(input.baseUrl, 400),
|
|
801
947
|
command_summary: sanitizeCommand(input.argv),
|
|
@@ -815,8 +961,8 @@ async function maybeReportSdkCliFailure(input) {
|
|
|
815
961
|
if (isServerLoggedPlayRunStartFailure(input)) return false;
|
|
816
962
|
const exitCode = resolvedExitCode(input);
|
|
817
963
|
if (!shouldReport({ exitCode, error: input.error })) return false;
|
|
818
|
-
const baseUrl =
|
|
819
|
-
const apiKey =
|
|
964
|
+
const baseUrl = _chunkOZSC6CEWjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
|
|
965
|
+
const apiKey = _chunkOZSC6CEWjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
|
|
820
966
|
if (!apiKey) return false;
|
|
821
967
|
return postFailureReport({
|
|
822
968
|
baseUrl,
|
|
@@ -833,29 +979,45 @@ async function maybeReportSdkCliFailure(input) {
|
|
|
833
979
|
}
|
|
834
980
|
|
|
835
981
|
// src/cli/skills-sync.ts
|
|
982
|
+
var _child_process = require('child_process');
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
var _zlib = require('zlib');
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
836
998
|
var CHECK_TIMEOUT_MS2 = 3e3;
|
|
837
999
|
var INSTALLER_PROBE_TIMEOUT_MS = 1e3;
|
|
838
1000
|
var PUBLISHED_VERIFICATION_RETRY_MS = 5 * 6e4;
|
|
839
1001
|
function shouldSkipSkillsSync() {
|
|
840
|
-
if (
|
|
1002
|
+
if (_chunkOZSC6CEWjs.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
|
|
841
1003
|
return true;
|
|
842
1004
|
}
|
|
843
|
-
const value = _optionalChain([process, 'access',
|
|
1005
|
+
const value = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.DEEPLINE_SKIP_SKILLS_SYNC, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87(), 'access', _88 => _88.toLowerCase, 'call', _89 => _89()]);
|
|
844
1006
|
return value === "1" || value === "true" || value === "yes" || value === "on";
|
|
845
1007
|
}
|
|
846
1008
|
function unavailableSkillsNoticePath(baseUrl) {
|
|
847
|
-
return _path.join.call(void 0,
|
|
1009
|
+
return _path.join.call(void 0, _chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
|
|
848
1010
|
}
|
|
849
1011
|
var SKILLS_SYNC_IN_PROGRESS_TTL_MS = 10 * 60 * 1e3;
|
|
850
1012
|
var SKILLS_SYNC_IN_PROGRESS_PID_CAP_MS = 6 * 60 * 60 * 1e3;
|
|
851
|
-
var agentLeaseSegment =
|
|
1013
|
+
var agentLeaseSegment = _chunkOZSC6CEWjs.skillsAgentPathSegment;
|
|
852
1014
|
function sortedLeaseAgents(agents) {
|
|
853
|
-
const expanded = agents.includes("*") ? [...agents, ...
|
|
1015
|
+
const expanded = agents.includes("*") ? [...agents, ..._chunkOZSC6CEWjs.KNOWN_SKILL_AGENTS] : agents;
|
|
854
1016
|
return [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
|
|
855
1017
|
}
|
|
856
1018
|
function inProgressSkillsSyncPath(baseUrl, agent) {
|
|
857
1019
|
return _path.join.call(void 0,
|
|
858
|
-
|
|
1020
|
+
_chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
859
1021
|
`skills-sync-in-progress-${agentLeaseSegment(agent)}`
|
|
860
1022
|
);
|
|
861
1023
|
}
|
|
@@ -915,7 +1077,7 @@ function quarantine(path, tag) {
|
|
|
915
1077
|
try {
|
|
916
1078
|
_fs.renameSync.call(void 0, path, holding);
|
|
917
1079
|
return holding;
|
|
918
|
-
} catch (
|
|
1080
|
+
} catch (e11) {
|
|
919
1081
|
return null;
|
|
920
1082
|
}
|
|
921
1083
|
}
|
|
@@ -1014,7 +1176,7 @@ var SkillsStateUnavailableError = class extends Error {
|
|
|
1014
1176
|
constructor(baseUrl, error) {
|
|
1015
1177
|
const detail = error instanceof Error ? error.message : String(error);
|
|
1016
1178
|
super(
|
|
1017
|
-
`Could not save skills state in ${
|
|
1179
|
+
`Could not save skills state in ${_chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl)}: ${detail}`
|
|
1018
1180
|
);
|
|
1019
1181
|
this.name = "SkillsStateUnavailableError";
|
|
1020
1182
|
}
|
|
@@ -1035,7 +1197,7 @@ function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
|
|
|
1035
1197
|
`,
|
|
1036
1198
|
"utf-8"
|
|
1037
1199
|
);
|
|
1038
|
-
} catch (
|
|
1200
|
+
} catch (e12) {
|
|
1039
1201
|
}
|
|
1040
1202
|
}
|
|
1041
1203
|
}
|
|
@@ -1045,7 +1207,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
|
|
|
1045
1207
|
if (!claimToken) {
|
|
1046
1208
|
try {
|
|
1047
1209
|
_fs.rmSync.call(void 0, dir, { recursive: true, force: true });
|
|
1048
|
-
} catch (
|
|
1210
|
+
} catch (e13) {
|
|
1049
1211
|
}
|
|
1050
1212
|
continue;
|
|
1051
1213
|
}
|
|
@@ -1056,7 +1218,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
|
|
|
1056
1218
|
_fs.renameSync.call(void 0, tombstone, dir);
|
|
1057
1219
|
continue;
|
|
1058
1220
|
}
|
|
1059
|
-
} catch (
|
|
1221
|
+
} catch (e14) {
|
|
1060
1222
|
}
|
|
1061
1223
|
_fs.rmSync.call(void 0, tombstone, { recursive: true, force: true });
|
|
1062
1224
|
}
|
|
@@ -1089,7 +1251,7 @@ async function acquireSkillsInstallLease(baseUrl, agents, version, options = {
|
|
|
1089
1251
|
if (Date.now() >= deadline) return null;
|
|
1090
1252
|
if (!waited) {
|
|
1091
1253
|
waited = true;
|
|
1092
|
-
_optionalChain([options, 'access',
|
|
1254
|
+
_optionalChain([options, 'access', _90 => _90.onWait, 'optionalCall', _91 => _91()]);
|
|
1093
1255
|
}
|
|
1094
1256
|
await new Promise((resolve) => setTimeout(resolve, pollMs));
|
|
1095
1257
|
}
|
|
@@ -1099,7 +1261,7 @@ function skillsInstallLeasePath(baseUrl, agents) {
|
|
|
1099
1261
|
}
|
|
1100
1262
|
function deferredSkillsNoticePath(baseUrl, agents) {
|
|
1101
1263
|
return _path.join.call(void 0,
|
|
1102
|
-
|
|
1264
|
+
_chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1103
1265
|
`skills-sync-notice-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}`
|
|
1104
1266
|
);
|
|
1105
1267
|
}
|
|
@@ -1110,7 +1272,7 @@ function deferSkillsNotice(baseUrl, agents) {
|
|
|
1110
1272
|
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
|
|
1111
1273
|
_fs.appendFileSync.call(void 0, path, `${text.trimEnd()}
|
|
1112
1274
|
`, "utf-8");
|
|
1113
|
-
} catch (
|
|
1275
|
+
} catch (e15) {
|
|
1114
1276
|
}
|
|
1115
1277
|
};
|
|
1116
1278
|
}
|
|
@@ -1122,19 +1284,19 @@ function flushDeferredSkillsNotices(baseUrl, agents) {
|
|
|
1122
1284
|
let text = "";
|
|
1123
1285
|
try {
|
|
1124
1286
|
text = _fs.readFileSync.call(void 0, tombstone, "utf-8");
|
|
1125
|
-
} catch (
|
|
1287
|
+
} catch (e16) {
|
|
1126
1288
|
return;
|
|
1127
1289
|
} finally {
|
|
1128
1290
|
try {
|
|
1129
1291
|
_fs.unlinkSync.call(void 0, tombstone);
|
|
1130
|
-
} catch (
|
|
1292
|
+
} catch (e17) {
|
|
1131
1293
|
}
|
|
1132
1294
|
}
|
|
1133
1295
|
if (text.trim()) writeSdkSkillsStatusLine(text.trimEnd());
|
|
1134
1296
|
}
|
|
1135
1297
|
function flushDeferredSkillsSyncNotices(baseUrl) {
|
|
1136
|
-
if (shouldSkipSkillsSync() ||
|
|
1137
|
-
const agents =
|
|
1298
|
+
if (shouldSkipSkillsSync() || _chunkOZSC6CEWjs.hasActivePluginSkills.call(void 0, )) return;
|
|
1299
|
+
const agents = _chunkOZSC6CEWjs.resolveAutoSyncSkillAgents.call(void 0, );
|
|
1138
1300
|
if (agents.length === 0) return;
|
|
1139
1301
|
flushDeferredSkillsNotices(baseUrl, agents);
|
|
1140
1302
|
}
|
|
@@ -1145,12 +1307,12 @@ function spawnDetachedSkillsSyncChild(argv, onSpawnError) {
|
|
|
1145
1307
|
stdio: "ignore",
|
|
1146
1308
|
env: process.env
|
|
1147
1309
|
});
|
|
1148
|
-
child.on("error", () => _optionalChain([onSpawnError, 'optionalCall',
|
|
1310
|
+
child.on("error", () => _optionalChain([onSpawnError, 'optionalCall', _92 => _92()]));
|
|
1149
1311
|
child.unref();
|
|
1150
1312
|
}
|
|
1151
1313
|
function failedSkillsSyncPath(baseUrl, agents) {
|
|
1152
1314
|
return _path.join.call(void 0,
|
|
1153
|
-
|
|
1315
|
+
_chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1154
1316
|
`skills-sync-failed-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}-version`
|
|
1155
1317
|
);
|
|
1156
1318
|
}
|
|
@@ -1160,7 +1322,7 @@ function hasMarkedSkillsSyncVersion(path, version) {
|
|
|
1160
1322
|
function readMarkedSkillsSyncVersion(path) {
|
|
1161
1323
|
try {
|
|
1162
1324
|
return _fs.existsSync.call(void 0, path) ? _fs.readFileSync.call(void 0, path, "utf-8").trim() : "";
|
|
1163
|
-
} catch (
|
|
1325
|
+
} catch (e18) {
|
|
1164
1326
|
return "";
|
|
1165
1327
|
}
|
|
1166
1328
|
}
|
|
@@ -1170,7 +1332,7 @@ function writeMarkedSkillsSyncVersion(path, version) {
|
|
|
1170
1332
|
_fs.writeFileSync.call(void 0, path, `${version}
|
|
1171
1333
|
`, "utf-8");
|
|
1172
1334
|
return true;
|
|
1173
|
-
} catch (
|
|
1335
|
+
} catch (e19) {
|
|
1174
1336
|
return false;
|
|
1175
1337
|
}
|
|
1176
1338
|
}
|
|
@@ -1179,8 +1341,8 @@ function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames, reason
|
|
|
1179
1341
|
if (hasMarkedSkillsSyncVersion(path, remoteVersion)) return;
|
|
1180
1342
|
writeMarkedSkillsSyncVersion(path, remoteVersion);
|
|
1181
1343
|
const probes = reason === "no-installer" ? _nullishCoalesce(knownProbes, () => ( probeInstallers())) : null;
|
|
1182
|
-
const manualCommand = _optionalChain([probes, 'optionalAccess',
|
|
1183
|
-
const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess',
|
|
1344
|
+
const manualCommand = _optionalChain([probes, 'optionalAccess', _93 => _93.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkOZSC6CEWjs.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
|
|
1345
|
+
const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess', _94 => _94.bunx]) === "missing" && probes.npx === "missing" ? "neither `bunx` nor `npx` was found on PATH. Make one available." : `installer version check failed for ${Object.entries(_nullishCoalesce(probes, () => ( {}))).filter(([, result]) => result === "failed").map(([command]) => `\`${command}\``).join(" and ")}. Check those commands with --version.`;
|
|
1184
1346
|
notice(
|
|
1185
1347
|
`Deepline agent skills are out of date, but ${explanation} To install manually, run:
|
|
1186
1348
|
${manualCommand}`
|
|
@@ -1189,7 +1351,7 @@ ${manualCommand}`
|
|
|
1189
1351
|
function clearUnavailableSkillsNotice(baseUrl) {
|
|
1190
1352
|
try {
|
|
1191
1353
|
_fs.unlinkSync.call(void 0, unavailableSkillsNoticePath(baseUrl));
|
|
1192
|
-
} catch (
|
|
1354
|
+
} catch (e20) {
|
|
1193
1355
|
}
|
|
1194
1356
|
}
|
|
1195
1357
|
function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
@@ -1201,7 +1363,7 @@ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
|
|
|
1201
1363
|
const retry = JSON.parse(marked);
|
|
1202
1364
|
const now = Date.now();
|
|
1203
1365
|
return retry.version === remoteVersion && typeof retry.retryAfter === "number" && retry.retryAfter > now && retry.retryAfter <= now + PUBLISHED_VERIFICATION_RETRY_MS;
|
|
1204
|
-
} catch (
|
|
1366
|
+
} catch (e21) {
|
|
1205
1367
|
return false;
|
|
1206
1368
|
}
|
|
1207
1369
|
}
|
|
@@ -1226,7 +1388,7 @@ function deferPublishedVerificationRetry(baseUrl, remoteVersion, agents) {
|
|
|
1226
1388
|
function clearFailedSkillsSync(baseUrl, agents) {
|
|
1227
1389
|
try {
|
|
1228
1390
|
_fs.unlinkSync.call(void 0, failedSkillsSyncPath(baseUrl, agents));
|
|
1229
|
-
} catch (
|
|
1391
|
+
} catch (e22) {
|
|
1230
1392
|
}
|
|
1231
1393
|
}
|
|
1232
1394
|
function clearFailedAutomaticSkillsSync(baseUrl, agents) {
|
|
@@ -1249,14 +1411,14 @@ async function fetchV1SkillIndex(baseUrl) {
|
|
|
1249
1411
|
if (!response.ok) return null;
|
|
1250
1412
|
const data = await response.json().catch(() => null);
|
|
1251
1413
|
return data;
|
|
1252
|
-
} catch (
|
|
1414
|
+
} catch (e23) {
|
|
1253
1415
|
return null;
|
|
1254
1416
|
} finally {
|
|
1255
1417
|
clearTimeout(timeout);
|
|
1256
1418
|
}
|
|
1257
1419
|
}
|
|
1258
1420
|
function v1SkillNames(index) {
|
|
1259
|
-
const skills = Array.isArray(_optionalChain([index, 'optionalAccess',
|
|
1421
|
+
const skills = Array.isArray(_optionalChain([index, 'optionalAccess', _95 => _95.skills])) ? index.skills : [];
|
|
1260
1422
|
return sortedUniqueSkillNames(
|
|
1261
1423
|
skills.filter((skill) => skill && skill.install_surface === "v1").map((skill) => skill.name).filter(
|
|
1262
1424
|
(name) => typeof name === "string" && name.length > 0
|
|
@@ -1267,7 +1429,7 @@ function buildSdkSkillNames(v1SkillNames2) {
|
|
|
1267
1429
|
return sortedUniqueSkillNames(v1SkillNames2);
|
|
1268
1430
|
}
|
|
1269
1431
|
function isDefaultAgentSet(agents) {
|
|
1270
|
-
return agents.length ===
|
|
1432
|
+
return agents.length === _chunkOZSC6CEWjs.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkOZSC6CEWjs.DEFAULT_SKILL_AGENTS[index]);
|
|
1271
1433
|
}
|
|
1272
1434
|
function safeSkillFilePath(value) {
|
|
1273
1435
|
if (typeof value !== "string" || !value) return false;
|
|
@@ -1327,7 +1489,7 @@ function publishedArchiveFiles(bytes, expectedFiles, name) {
|
|
|
1327
1489
|
var PublishedSkillsVerificationError = class extends Error {
|
|
1328
1490
|
};
|
|
1329
1491
|
async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillNames, index) {
|
|
1330
|
-
if (_optionalChain([index, 'optionalAccess',
|
|
1492
|
+
if (_optionalChain([index, 'optionalAccess', _96 => _96.version]) !== remoteVersion) {
|
|
1331
1493
|
throw new PublishedSkillsVerificationError(
|
|
1332
1494
|
"the published skill index version does not match the server version"
|
|
1333
1495
|
);
|
|
@@ -1343,7 +1505,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
|
|
|
1343
1505
|
const entry = entries.find(
|
|
1344
1506
|
(skill) => skill && skill.name === name && skill.install_surface === "v1"
|
|
1345
1507
|
);
|
|
1346
|
-
if (!Array.isArray(_optionalChain([entry, 'optionalAccess',
|
|
1508
|
+
if (!Array.isArray(_optionalChain([entry, 'optionalAccess', _97 => _97.files])) || !entry.files.length || !entry.files.every(safeSkillFilePath) || new Set(entry.files).size !== entry.files.length || !entry.files.includes("SKILL.md") || entry.type !== "archive" || entry.url !== `./archives/${name}.tar.gz` || typeof entry.digest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(entry.digest)) {
|
|
1347
1509
|
throw new PublishedSkillsVerificationError(
|
|
1348
1510
|
`invalid published file list for ${name}`
|
|
1349
1511
|
);
|
|
@@ -1397,7 +1559,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
|
|
|
1397
1559
|
controller.abort();
|
|
1398
1560
|
}
|
|
1399
1561
|
const home = _os.homedir.call(void 0, );
|
|
1400
|
-
const claudeConfigDir = _optionalChain([process, 'access',
|
|
1562
|
+
const claudeConfigDir = _optionalChain([process, 'access', _98 => _98.env, 'access', _99 => _99.CLAUDE_CONFIG_DIR, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]) || _path.join.call(void 0, home, ".claude");
|
|
1401
1563
|
for (const [name, { files }] of published) {
|
|
1402
1564
|
for (const root of [
|
|
1403
1565
|
_path.join.call(void 0, home, ".agents", "skills", name),
|
|
@@ -1424,23 +1586,23 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
|
|
|
1424
1586
|
method: "POST",
|
|
1425
1587
|
headers: { "Content-Type": "application/json" },
|
|
1426
1588
|
body: JSON.stringify({
|
|
1427
|
-
sdk_cli: { version:
|
|
1589
|
+
sdk_cli: { version: _chunkOZSC6CEWjs.SDK_VERSION },
|
|
1428
1590
|
skills: {
|
|
1429
1591
|
version: localVersion,
|
|
1430
|
-
capability:
|
|
1592
|
+
capability: _chunkRMINBDYYjs.SDK_RELEASE.packageCapabilities.skillsGuidance
|
|
1431
1593
|
}
|
|
1432
1594
|
}),
|
|
1433
1595
|
signal: controller.signal
|
|
1434
1596
|
});
|
|
1435
1597
|
if (!response.ok) return null;
|
|
1436
1598
|
const data = await response.json().catch(() => null);
|
|
1437
|
-
const skills = _optionalChain([data, 'optionalAccess',
|
|
1599
|
+
const skills = _optionalChain([data, 'optionalAccess', _102 => _102.skills]);
|
|
1438
1600
|
if (!skills) return null;
|
|
1439
1601
|
return {
|
|
1440
1602
|
needsUpdate: skills.needs_update === true,
|
|
1441
|
-
remoteVersion: typeof _optionalChain([skills, 'access',
|
|
1603
|
+
remoteVersion: typeof _optionalChain([skills, 'access', _103 => _103.remote, 'optionalAccess', _104 => _104.version]) === "string" ? skills.remote.version.trim() : ""
|
|
1442
1604
|
};
|
|
1443
|
-
} catch (
|
|
1605
|
+
} catch (e24) {
|
|
1444
1606
|
return null;
|
|
1445
1607
|
} finally {
|
|
1446
1608
|
clearTimeout(timeout);
|
|
@@ -1466,7 +1628,7 @@ function probeInstallers(timeoutMs) {
|
|
|
1466
1628
|
}
|
|
1467
1629
|
function noInstallerProbePath(baseUrl) {
|
|
1468
1630
|
return _path.join.call(void 0,
|
|
1469
|
-
|
|
1631
|
+
_chunkOZSC6CEWjs.sdkCliStateDirPath.call(void 0, baseUrl),
|
|
1470
1632
|
"skills-sync-no-installer-unknown.json"
|
|
1471
1633
|
);
|
|
1472
1634
|
}
|
|
@@ -1474,12 +1636,12 @@ function cachedUnavailableInstallerProbes(baseUrl, remoteVersion, allowBoundedFa
|
|
|
1474
1636
|
const path = noInstallerProbePath(baseUrl);
|
|
1475
1637
|
try {
|
|
1476
1638
|
const cached = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
|
|
1477
|
-
if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access',
|
|
1639
|
+
if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access', _105 => _105.probes, 'optionalAccess', _106 => _106.bunx]) === "missing" || _optionalChain([cached, 'access', _107 => _107.probes, 'optionalAccess', _108 => _108.bunx]) === "failed") && (_optionalChain([cached, 'access', _109 => _109.probes, 'optionalAccess', _110 => _110.npx]) === "missing" || _optionalChain([cached, 'access', _111 => _111.probes, 'optionalAccess', _112 => _112.npx]) === "failed") && // A terminal timeout is not evidence that the unbounded child probe
|
|
1478
1640
|
// will fail. Older caches without probe provenance are ambiguous too.
|
|
1479
1641
|
(allowBoundedFailures || cached.probeTimeoutMs === null || cached.probes.bunx === "missing" && cached.probes.npx === "missing")) {
|
|
1480
1642
|
return cached.probes;
|
|
1481
1643
|
}
|
|
1482
|
-
} catch (
|
|
1644
|
+
} catch (e25) {
|
|
1483
1645
|
}
|
|
1484
1646
|
return null;
|
|
1485
1647
|
}
|
|
@@ -1498,14 +1660,14 @@ function rememberUnavailableInstallerProbes(baseUrl, remoteVersion, probes, prob
|
|
|
1498
1660
|
}),
|
|
1499
1661
|
"utf-8"
|
|
1500
1662
|
);
|
|
1501
|
-
} catch (
|
|
1663
|
+
} catch (e26) {
|
|
1502
1664
|
}
|
|
1503
1665
|
}
|
|
1504
1666
|
}
|
|
1505
1667
|
function clearUnavailableInstallerProbes(baseUrl) {
|
|
1506
1668
|
try {
|
|
1507
1669
|
_fs.unlinkSync.call(void 0, noInstallerProbePath(baseUrl));
|
|
1508
|
-
} catch (
|
|
1670
|
+
} catch (e27) {
|
|
1509
1671
|
}
|
|
1510
1672
|
}
|
|
1511
1673
|
function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
|
|
@@ -1528,7 +1690,7 @@ function probeCommand(command, timeoutMs) {
|
|
|
1528
1690
|
timeout: timeoutMs
|
|
1529
1691
|
});
|
|
1530
1692
|
if (result.status === 0) return "available";
|
|
1531
|
-
return _optionalChain([result, 'access',
|
|
1693
|
+
return _optionalChain([result, 'access', _113 => _113.error, 'optionalAccess', _114 => _114.code]) === "ENOENT" ? "missing" : "failed";
|
|
1532
1694
|
}
|
|
1533
1695
|
function hasCommand(command) {
|
|
1534
1696
|
return probeCommand(command) === "available";
|
|
@@ -1545,7 +1707,7 @@ function temporarySkillsSyncSkipCommand() {
|
|
|
1545
1707
|
function resolveSkillsInstallSpawn(install, platform2 = process.platform) {
|
|
1546
1708
|
return resolveShellSpawn(install.command, install.args, platform2);
|
|
1547
1709
|
}
|
|
1548
|
-
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents =
|
|
1710
|
+
function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkOZSC6CEWjs.DEFAULT_SKILL_AGENTS, knownProbes) {
|
|
1549
1711
|
const commands = [];
|
|
1550
1712
|
const probes = _nullishCoalesce(knownProbes, () => ( probeInstallers()));
|
|
1551
1713
|
if (probes.bunx === "available") {
|
|
@@ -1687,7 +1849,7 @@ function runLegacySkillsCleanup(agents) {
|
|
|
1687
1849
|
}
|
|
1688
1850
|
}
|
|
1689
1851
|
function writeSdkSkillsStatusLine(line) {
|
|
1690
|
-
const progress =
|
|
1852
|
+
const progress = getActiveCliProgress();
|
|
1691
1853
|
if (progress) {
|
|
1692
1854
|
progress.writeLine(line);
|
|
1693
1855
|
return;
|
|
@@ -1697,11 +1859,11 @@ function writeSdkSkillsStatusLine(line) {
|
|
|
1697
1859
|
}
|
|
1698
1860
|
async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
1699
1861
|
if (shouldSkipSkillsSync()) return;
|
|
1700
|
-
const usingPluginSkills =
|
|
1862
|
+
const usingPluginSkills = _chunkOZSC6CEWjs.hasActivePluginSkills.call(void 0, );
|
|
1701
1863
|
if (usingPluginSkills) {
|
|
1702
1864
|
return;
|
|
1703
1865
|
}
|
|
1704
|
-
const agents =
|
|
1866
|
+
const agents = _chunkOZSC6CEWjs.resolveAutoSyncSkillAgents.call(void 0, );
|
|
1705
1867
|
if (options.mode === "detached" && agents.length > 0) {
|
|
1706
1868
|
flushDeferredSkillsNotices(baseUrl, agents);
|
|
1707
1869
|
}
|
|
@@ -1729,12 +1891,12 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
|
|
|
1729
1891
|
return;
|
|
1730
1892
|
}
|
|
1731
1893
|
try {
|
|
1732
|
-
const localVersion =
|
|
1894
|
+
const localVersion = _chunkOZSC6CEWjs.readSdkSkillsLocalVersion.call(void 0, baseUrl);
|
|
1733
1895
|
const update = options.update === void 0 ? claimedVersion ? { needsUpdate: true, remoteVersion: claimedVersion } : await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
|
|
1734
1896
|
needsUpdate: options.update.needs_update,
|
|
1735
1897
|
remoteVersion: options.update.remote.version
|
|
1736
1898
|
} : null;
|
|
1737
|
-
if (!_optionalChain([update, 'optionalAccess',
|
|
1899
|
+
if (!_optionalChain([update, 'optionalAccess', _115 => _115.needsUpdate]) || !update.remoteVersion) {
|
|
1738
1900
|
return;
|
|
1739
1901
|
}
|
|
1740
1902
|
if (agents.length > 0 && hasFailedSkillsSync(baseUrl, update.remoteVersion, agents)) {
|
|
@@ -1895,7 +2057,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1895
2057
|
}
|
|
1896
2058
|
}
|
|
1897
2059
|
runLegacySkillsCleanup(agents);
|
|
1898
|
-
if (!
|
|
2060
|
+
if (!_chunkOZSC6CEWjs.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
|
|
1899
2061
|
notice(
|
|
1900
2062
|
"Deepline agent skills installed, but the local skills version could not be recorded. A later command will retry the refresh."
|
|
1901
2063
|
);
|
|
@@ -1907,466 +2069,6 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
|
|
|
1907
2069
|
notice("Deepline agent skills are up to date.");
|
|
1908
2070
|
}
|
|
1909
2071
|
|
|
1910
|
-
// src/cli/commands/skills.ts
|
|
1911
|
-
var SKILLS_INSTALL_LEASE_WAIT_MS = 9e4;
|
|
1912
|
-
var SKILLS_PROCESS_TIMEOUT_MS = 45e3;
|
|
1913
|
-
var RUNTIME_TO_SKILLS_AGENT = {
|
|
1914
|
-
antigravity: "antigravity",
|
|
1915
|
-
claude_code: "claude-code",
|
|
1916
|
-
claude_cowork: "claude-code",
|
|
1917
|
-
cline: "cline",
|
|
1918
|
-
codex: "codex",
|
|
1919
|
-
cursor: "cursor",
|
|
1920
|
-
gemini: "gemini-cli",
|
|
1921
|
-
windsurf: "windsurf"
|
|
1922
|
-
};
|
|
1923
|
-
var AGENT_MARKERS = [
|
|
1924
|
-
{ agent: "codex", paths: [".codex"] },
|
|
1925
|
-
{ agent: "claude-code", paths: [".claude"] },
|
|
1926
|
-
{ agent: "cursor", paths: [".cursor"] },
|
|
1927
|
-
{ agent: "gemini-cli", paths: [".gemini", ".gemini-cli"] },
|
|
1928
|
-
{ agent: "antigravity", paths: [".antigravity"] }
|
|
1929
|
-
];
|
|
1930
|
-
var WORKSPACE_SKILL_ROOTS_BY_AGENT = {
|
|
1931
|
-
antigravity: [".agents"],
|
|
1932
|
-
"claude-code": [".claude"],
|
|
1933
|
-
cline: [".agents"],
|
|
1934
|
-
codex: [".agents"],
|
|
1935
|
-
cursor: [".agents"],
|
|
1936
|
-
"gemini-cli": [".agents"],
|
|
1937
|
-
windsurf: [".windsurf"],
|
|
1938
|
-
"*": [".agents", ".claude", ".windsurf"]
|
|
1939
|
-
};
|
|
1940
|
-
function workspaceSkillRootsForAgents(agents) {
|
|
1941
|
-
return [
|
|
1942
|
-
...new Set(
|
|
1943
|
-
agents.flatMap((agent) => _nullishCoalesce(WORKSPACE_SKILL_ROOTS_BY_AGENT[agent], () => ( [])))
|
|
1944
|
-
)
|
|
1945
|
-
].sort((a, b) => a.localeCompare(b));
|
|
1946
|
-
}
|
|
1947
|
-
function normalizeScope(value) {
|
|
1948
|
-
if (value === "global") return "global";
|
|
1949
|
-
if (value === "local") return "local";
|
|
1950
|
-
if (!value) return inferActiveSkillsScope();
|
|
1951
|
-
throw new Error("--scope must be one of: global, local");
|
|
1952
|
-
}
|
|
1953
|
-
function inferActiveSkillsScope(entrypoint = _nullishCoalesce(process.argv[1], () => ( ""))) {
|
|
1954
|
-
return /[\\/]\.deepline[\\/]runtime[\\/]/.test(entrypoint) ? "local" : "global";
|
|
1955
|
-
}
|
|
1956
|
-
function resolveLocalRoot() {
|
|
1957
|
-
const target = _chunkFJCIUF34js.resolveProjectPinTarget.call(void 0, );
|
|
1958
|
-
if (!target.ok) {
|
|
1959
|
-
throw new Error(
|
|
1960
|
-
`Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
|
|
1961
|
-
", "
|
|
1962
|
-
)}. Set CLAUDE_PROJECT_DIR or cd into the intended project folder.`
|
|
1963
|
-
);
|
|
1964
|
-
}
|
|
1965
|
-
return target.dir;
|
|
1966
|
-
}
|
|
1967
|
-
function detectSkillsAgents(input) {
|
|
1968
|
-
const runtime = _nullishCoalesce(input.runtime, () => ( _chunkFJCIUF34js.detectAgentRuntime.call(void 0, )));
|
|
1969
|
-
const knownAgent = RUNTIME_TO_SKILLS_AGENT[runtime];
|
|
1970
|
-
if (knownAgent) return [knownAgent];
|
|
1971
|
-
const roots = [
|
|
1972
|
-
...input.scope === "local" && input.root ? [input.root] : [],
|
|
1973
|
-
_nullishCoalesce(input.homeDir, () => ( _os.homedir.call(void 0, )))
|
|
1974
|
-
];
|
|
1975
|
-
const detected = AGENT_MARKERS.filter(
|
|
1976
|
-
(marker) => roots.some(
|
|
1977
|
-
(root) => marker.paths.some((path) => _fs.existsSync.call(void 0, _path.join.call(void 0, root, path)))
|
|
1978
|
-
)
|
|
1979
|
-
).map((marker) => marker.agent);
|
|
1980
|
-
return detected.length > 0 ? detected : ["*"];
|
|
1981
|
-
}
|
|
1982
|
-
function skillsStatePathForScope(baseUrl, scope, root) {
|
|
1983
|
-
return scope === "local" && root ? _path.join.call(void 0, root, ".deepline", "setup", "skills.json") : _path.join.call(void 0, _chunkFJCIUF34js.sdkCliStateDirPath.call(void 0, baseUrl), "skills-install.json");
|
|
1984
|
-
}
|
|
1985
|
-
function buildSkillsPlan(input) {
|
|
1986
|
-
const scopeArgs = input.scope === "global" ? ["--global"] : [];
|
|
1987
|
-
const legacyNames = [...LEGACY_SKILL_NAMES_TO_REMOVE].sort(
|
|
1988
|
-
(a, b) => a.localeCompare(b)
|
|
1989
|
-
);
|
|
1990
|
-
return {
|
|
1991
|
-
scope: input.scope,
|
|
1992
|
-
root: input.root,
|
|
1993
|
-
agents: input.agents,
|
|
1994
|
-
skillNames: input.skillNames,
|
|
1995
|
-
version: input.version,
|
|
1996
|
-
remove: {
|
|
1997
|
-
command: "npm",
|
|
1998
|
-
args: [
|
|
1999
|
-
"exec",
|
|
2000
|
-
"--yes",
|
|
2001
|
-
`--package=${SKILLS_NPX_PACKAGE}`,
|
|
2002
|
-
"--",
|
|
2003
|
-
"skills",
|
|
2004
|
-
"remove",
|
|
2005
|
-
...scopeArgs,
|
|
2006
|
-
"--agent",
|
|
2007
|
-
...input.agents,
|
|
2008
|
-
"-y",
|
|
2009
|
-
...legacyNames
|
|
2010
|
-
]
|
|
2011
|
-
},
|
|
2012
|
-
install: {
|
|
2013
|
-
command: "npm",
|
|
2014
|
-
args: [
|
|
2015
|
-
"exec",
|
|
2016
|
-
"--yes",
|
|
2017
|
-
`--package=${SKILLS_NPX_PACKAGE}`,
|
|
2018
|
-
"--",
|
|
2019
|
-
"skills",
|
|
2020
|
-
"add",
|
|
2021
|
-
skillsSourceUrl(input.baseUrl),
|
|
2022
|
-
"--agent",
|
|
2023
|
-
...input.agents,
|
|
2024
|
-
...scopeArgs,
|
|
2025
|
-
"--yes",
|
|
2026
|
-
...input.skillNames.flatMap((name) => ["--skill", name]),
|
|
2027
|
-
"--full-depth"
|
|
2028
|
-
]
|
|
2029
|
-
},
|
|
2030
|
-
statePath: skillsStatePathForScope(input.baseUrl, input.scope, input.root)
|
|
2031
|
-
};
|
|
2032
|
-
}
|
|
2033
|
-
function sortedStrings(value) {
|
|
2034
|
-
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
|
|
2035
|
-
return null;
|
|
2036
|
-
}
|
|
2037
|
-
return [...value].sort((a, b) => a.localeCompare(b));
|
|
2038
|
-
}
|
|
2039
|
-
function isSkillsPlanCurrent(plan, state) {
|
|
2040
|
-
if (!state || state.scope !== plan.scope || state.skillsVersion !== plan.version) {
|
|
2041
|
-
return false;
|
|
2042
|
-
}
|
|
2043
|
-
const installedAgents = sortedStrings(state.agents);
|
|
2044
|
-
const installedSkillNames = sortedStrings(state.skillNames);
|
|
2045
|
-
if (!installedAgents || !installedSkillNames) return false;
|
|
2046
|
-
return installedAgents.join("\0") === [...plan.agents].sort((a, b) => a.localeCompare(b)).join("\0") && installedSkillNames.join("\0") === [...plan.skillNames].sort((a, b) => a.localeCompare(b)).join("\0");
|
|
2047
|
-
}
|
|
2048
|
-
function readSkillsInstallState(path) {
|
|
2049
|
-
try {
|
|
2050
|
-
const parsed = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
|
|
2051
|
-
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
2052
|
-
} catch (e26) {
|
|
2053
|
-
return null;
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
function runProcess(command, args, cwd) {
|
|
2057
|
-
return new Promise((resolve, reject) => {
|
|
2058
|
-
const plan = resolveShellSpawn(
|
|
2059
|
-
command,
|
|
2060
|
-
args,
|
|
2061
|
-
process.platform,
|
|
2062
|
-
process.env,
|
|
2063
|
-
cwd
|
|
2064
|
-
);
|
|
2065
|
-
const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
|
|
2066
|
-
cwd,
|
|
2067
|
-
env: process.env,
|
|
2068
|
-
stdio: ["ignore", "ignore", "pipe"],
|
|
2069
|
-
shell: plan.shell
|
|
2070
|
-
});
|
|
2071
|
-
let stderr = "";
|
|
2072
|
-
child.stderr.on("data", (chunk) => {
|
|
2073
|
-
stderr += chunk.toString("utf8");
|
|
2074
|
-
process.stderr.write(chunk);
|
|
2075
|
-
});
|
|
2076
|
-
const timeout = setTimeout(() => {
|
|
2077
|
-
child.kill("SIGTERM");
|
|
2078
|
-
reject(
|
|
2079
|
-
new Error(
|
|
2080
|
-
`${SKILLS_NPX_PACKAGE} timed out after ${SKILLS_PROCESS_TIMEOUT_MS}ms.`
|
|
2081
|
-
)
|
|
2082
|
-
);
|
|
2083
|
-
}, SKILLS_PROCESS_TIMEOUT_MS);
|
|
2084
|
-
child.once("error", (error) => {
|
|
2085
|
-
clearTimeout(timeout);
|
|
2086
|
-
reject(error);
|
|
2087
|
-
});
|
|
2088
|
-
child.once("close", (code) => {
|
|
2089
|
-
clearTimeout(timeout);
|
|
2090
|
-
if (code && stderr.trim()) {
|
|
2091
|
-
process.stderr.write(`${SKILLS_NPX_PACKAGE} exited ${code}.
|
|
2092
|
-
`);
|
|
2093
|
-
}
|
|
2094
|
-
resolve(_nullishCoalesce(code, () => ( 1)));
|
|
2095
|
-
});
|
|
2096
|
-
});
|
|
2097
|
-
}
|
|
2098
|
-
async function runSkillsCommand(options, dependencies = {}) {
|
|
2099
|
-
let scope;
|
|
2100
|
-
let root;
|
|
2101
|
-
try {
|
|
2102
|
-
scope = normalizeScope(options.scope);
|
|
2103
|
-
root = scope === "local" ? resolveLocalRoot() : null;
|
|
2104
|
-
} catch (error) {
|
|
2105
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2106
|
-
{
|
|
2107
|
-
ok: false,
|
|
2108
|
-
status: "failed",
|
|
2109
|
-
code: "INVALID_SKILLS_SCOPE",
|
|
2110
|
-
exitCode: 2,
|
|
2111
|
-
message: error instanceof Error ? error.message : String(error)
|
|
2112
|
-
},
|
|
2113
|
-
{ json: options.json }
|
|
2114
|
-
);
|
|
2115
|
-
return 2;
|
|
2116
|
-
}
|
|
2117
|
-
const baseUrl = _chunkFJCIUF34js.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
|
|
2118
|
-
const catalog = {
|
|
2119
|
-
skillNames: [...DEFAULT_SDK_SKILL_NAMES],
|
|
2120
|
-
version: _chunkFJCIUF34js.SDK_VERSION
|
|
2121
|
-
};
|
|
2122
|
-
const agents = options.agent ? [options.agent] : detectSkillsAgents({ scope, root });
|
|
2123
|
-
const plan = buildSkillsPlan({ baseUrl, scope, root, agents, ...catalog });
|
|
2124
|
-
if (options.dryRun) {
|
|
2125
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2126
|
-
{ ok: true, status: "planned", dryRun: true, ...plan },
|
|
2127
|
-
{ json: options.json }
|
|
2128
|
-
);
|
|
2129
|
-
return 0;
|
|
2130
|
-
}
|
|
2131
|
-
if (isSkillsPlanCurrent(plan, readSkillsInstallState(plan.statePath)) && !hasFailedAutomaticSkillsSync(baseUrl, agents)) {
|
|
2132
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2133
|
-
{
|
|
2134
|
-
ok: true,
|
|
2135
|
-
status: "current",
|
|
2136
|
-
complete: true,
|
|
2137
|
-
changed: false,
|
|
2138
|
-
skipped: true,
|
|
2139
|
-
skipReason: "skills_version_current",
|
|
2140
|
-
scope,
|
|
2141
|
-
agents,
|
|
2142
|
-
skillsVersion: plan.version,
|
|
2143
|
-
skillCount: plan.skillNames.length,
|
|
2144
|
-
statePath: plan.statePath,
|
|
2145
|
-
render: {
|
|
2146
|
-
sections: [
|
|
2147
|
-
{
|
|
2148
|
-
title: "skills",
|
|
2149
|
-
lines: [
|
|
2150
|
-
`Scope: ${scope}`,
|
|
2151
|
-
`Agents: ${agents.join(", ")}`,
|
|
2152
|
-
`Current: ${plan.skillNames.length}`
|
|
2153
|
-
]
|
|
2154
|
-
}
|
|
2155
|
-
]
|
|
2156
|
-
}
|
|
2157
|
-
},
|
|
2158
|
-
{ json: options.json }
|
|
2159
|
-
);
|
|
2160
|
-
return 0;
|
|
2161
|
-
}
|
|
2162
|
-
if (scope === "local" && root) {
|
|
2163
|
-
const managedNames = [
|
|
2164
|
-
.../* @__PURE__ */ new Set([...plan.skillNames, ...LEGACY_SKILL_NAMES_TO_REMOVE])
|
|
2165
|
-
];
|
|
2166
|
-
const agentRoots = workspaceSkillRootsForAgents(plan.agents);
|
|
2167
|
-
_chunkFJCIUF34js.ensureProjectPrivatePathsIgnored.call(void 0, root, [
|
|
2168
|
-
".deepline/",
|
|
2169
|
-
...agentRoots.flatMap(
|
|
2170
|
-
(agentRoot) => managedNames.map((name) => `${agentRoot}/skills/${name}/`)
|
|
2171
|
-
)
|
|
2172
|
-
]);
|
|
2173
|
-
}
|
|
2174
|
-
let lease;
|
|
2175
|
-
try {
|
|
2176
|
-
lease = scope === "global" ? await acquireSkillsInstallLease(baseUrl, agents, plan.version, {
|
|
2177
|
-
waitMs: _nullishCoalesce(dependencies.installLeaseWaitMs, () => ( SKILLS_INSTALL_LEASE_WAIT_MS)),
|
|
2178
|
-
onWait: () => process.stderr.write(
|
|
2179
|
-
"Waiting for a background Deepline skills refresh to finish...\n"
|
|
2180
|
-
)
|
|
2181
|
-
}) : { release: () => {
|
|
2182
|
-
} };
|
|
2183
|
-
} catch (error) {
|
|
2184
|
-
if (!(error instanceof SkillsStateUnavailableError)) throw error;
|
|
2185
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2186
|
-
{
|
|
2187
|
-
ok: false,
|
|
2188
|
-
status: "failed",
|
|
2189
|
-
code: "SKILLS_STATE_UNAVAILABLE",
|
|
2190
|
-
exitCode: 5,
|
|
2191
|
-
scope,
|
|
2192
|
-
agents,
|
|
2193
|
-
message: error.message,
|
|
2194
|
-
next: `Resolve this filesystem error, then run: deepline skills --scope ${scope}`
|
|
2195
|
-
},
|
|
2196
|
-
{ json: options.json }
|
|
2197
|
-
);
|
|
2198
|
-
return 5;
|
|
2199
|
-
}
|
|
2200
|
-
if (!lease) {
|
|
2201
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2202
|
-
{
|
|
2203
|
-
ok: false,
|
|
2204
|
-
status: "failed",
|
|
2205
|
-
code: "SKILLS_SYNC_IN_PROGRESS",
|
|
2206
|
-
exitCode: 7,
|
|
2207
|
-
scope,
|
|
2208
|
-
agents,
|
|
2209
|
-
message: "A background Deepline skills refresh is still running for these agents.",
|
|
2210
|
-
next: `Retry in a moment: deepline skills --scope ${scope}. If no refresh is running, remove ${skillsInstallLeasePath(baseUrl, agents)}`
|
|
2211
|
-
},
|
|
2212
|
-
{ json: options.json }
|
|
2213
|
-
);
|
|
2214
|
-
return 7;
|
|
2215
|
-
}
|
|
2216
|
-
try {
|
|
2217
|
-
return await runSkillsInstallWithLease({
|
|
2218
|
-
options,
|
|
2219
|
-
dependencies,
|
|
2220
|
-
baseUrl,
|
|
2221
|
-
scope,
|
|
2222
|
-
root,
|
|
2223
|
-
agents,
|
|
2224
|
-
plan
|
|
2225
|
-
});
|
|
2226
|
-
} finally {
|
|
2227
|
-
lease.release();
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
async function runSkillsInstallWithLease(input) {
|
|
2231
|
-
const { options, dependencies, baseUrl, scope, root, agents, plan } = input;
|
|
2232
|
-
process.stderr.write(
|
|
2233
|
-
`Replacing Deepline skills for ${agents.join(", ")} (${scope})...
|
|
2234
|
-
`
|
|
2235
|
-
);
|
|
2236
|
-
const execute = _nullishCoalesce(dependencies.runProcess, () => ( runProcess));
|
|
2237
|
-
try {
|
|
2238
|
-
const installCode = await execute(
|
|
2239
|
-
plan.install.command,
|
|
2240
|
-
plan.install.args,
|
|
2241
|
-
_nullishCoalesce(root, () => ( void 0))
|
|
2242
|
-
);
|
|
2243
|
-
if (installCode !== 0) {
|
|
2244
|
-
throw new Error("Could not install the current Deepline skills.");
|
|
2245
|
-
}
|
|
2246
|
-
} catch (error) {
|
|
2247
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2248
|
-
{
|
|
2249
|
-
ok: false,
|
|
2250
|
-
status: "failed",
|
|
2251
|
-
code: "SKILLS_INSTALL_FAILED",
|
|
2252
|
-
exitCode: 5,
|
|
2253
|
-
scope,
|
|
2254
|
-
agents,
|
|
2255
|
-
message: error instanceof Error ? error.message : String(error),
|
|
2256
|
-
next: `deepline skills --scope ${scope}`
|
|
2257
|
-
},
|
|
2258
|
-
{ json: options.json }
|
|
2259
|
-
);
|
|
2260
|
-
return 5;
|
|
2261
|
-
}
|
|
2262
|
-
try {
|
|
2263
|
-
const removeCode = await execute(
|
|
2264
|
-
plan.remove.command,
|
|
2265
|
-
plan.remove.args,
|
|
2266
|
-
_nullishCoalesce(root, () => ( void 0))
|
|
2267
|
-
);
|
|
2268
|
-
if (removeCode !== 0) {
|
|
2269
|
-
process.stderr.write(
|
|
2270
|
-
"Current Deepline skills installed, but legacy skill cleanup failed. The installed skills remain usable.\n"
|
|
2271
|
-
);
|
|
2272
|
-
}
|
|
2273
|
-
} catch (error) {
|
|
2274
|
-
process.stderr.write(
|
|
2275
|
-
`Current Deepline skills installed, but legacy skill cleanup failed: ${error instanceof Error ? error.message : String(error)}. The installed skills remain usable.
|
|
2276
|
-
`
|
|
2277
|
-
);
|
|
2278
|
-
}
|
|
2279
|
-
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, plan.statePath), { recursive: true });
|
|
2280
|
-
_fs.writeFileSync.call(void 0,
|
|
2281
|
-
plan.statePath,
|
|
2282
|
-
`${JSON.stringify(
|
|
2283
|
-
{
|
|
2284
|
-
schemaVersion: 1,
|
|
2285
|
-
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2286
|
-
cliVersion: _chunkFJCIUF34js.SDK_VERSION,
|
|
2287
|
-
scope,
|
|
2288
|
-
agents,
|
|
2289
|
-
skillsVersion: plan.version,
|
|
2290
|
-
skillNames: plan.skillNames
|
|
2291
|
-
},
|
|
2292
|
-
null,
|
|
2293
|
-
2
|
|
2294
|
-
)}
|
|
2295
|
-
`,
|
|
2296
|
-
"utf8"
|
|
2297
|
-
);
|
|
2298
|
-
if (scope === "global") {
|
|
2299
|
-
clearFailedAutomaticSkillsSync(baseUrl, agents);
|
|
2300
|
-
}
|
|
2301
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2302
|
-
{
|
|
2303
|
-
ok: true,
|
|
2304
|
-
status: "complete",
|
|
2305
|
-
scope,
|
|
2306
|
-
agents,
|
|
2307
|
-
skillsVersion: plan.version,
|
|
2308
|
-
skillCount: plan.skillNames.length,
|
|
2309
|
-
statePath: plan.statePath,
|
|
2310
|
-
render: {
|
|
2311
|
-
sections: [
|
|
2312
|
-
{
|
|
2313
|
-
title: "skills",
|
|
2314
|
-
lines: [
|
|
2315
|
-
`Scope: ${scope}`,
|
|
2316
|
-
`Agents: ${agents.join(", ")}`,
|
|
2317
|
-
`Installed: ${plan.skillNames.length}`
|
|
2318
|
-
]
|
|
2319
|
-
}
|
|
2320
|
-
]
|
|
2321
|
-
}
|
|
2322
|
-
},
|
|
2323
|
-
{ json: options.json }
|
|
2324
|
-
);
|
|
2325
|
-
return 0;
|
|
2326
|
-
}
|
|
2327
|
-
function registerSkillsCommand(program) {
|
|
2328
|
-
program.command("skills").description("Replace Deepline agent skills with the current release.").option("--scope <scope>", "Install scope: global or local").option("--agent <agent>", "Override the detected agent target").option("--dry-run", "Print the install plan without changing files").option("--json", "Emit one JSON result envelope").addHelpText(
|
|
2329
|
-
"after",
|
|
2330
|
-
`
|
|
2331
|
-
Notes:
|
|
2332
|
-
This command reinstalls current Deepline-managed skills using ${SKILLS_NPX_PACKAGE},
|
|
2333
|
-
then removes legacy Deepline skill names. Local scope writes into the resolved
|
|
2334
|
-
persistent project.
|
|
2335
|
-
|
|
2336
|
-
Examples:
|
|
2337
|
-
deepline skills
|
|
2338
|
-
deepline skills --scope local
|
|
2339
|
-
deepline skills --agent codex --dry-run
|
|
2340
|
-
`
|
|
2341
|
-
).action(async (options) => {
|
|
2342
|
-
process.exitCode = await runSkillsCommand(options);
|
|
2343
|
-
});
|
|
2344
|
-
program.command(SKILLS_AUTO_SYNC_COMMAND, { hidden: true }).description("Refresh Deepline agent skills in the background.").option(
|
|
2345
|
-
"--claim <token>",
|
|
2346
|
-
"Owner token of the leases this child was started for."
|
|
2347
|
-
).action(async (options) => {
|
|
2348
|
-
const claim = _optionalChain([options, 'access', _88 => _88.claim, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
|
|
2349
|
-
if (!claim) {
|
|
2350
|
-
_chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
|
|
2351
|
-
{
|
|
2352
|
-
ok: false,
|
|
2353
|
-
status: "failed",
|
|
2354
|
-
code: "SKILLS_AUTO_SYNC_CLAIM_REQUIRED",
|
|
2355
|
-
exitCode: 2,
|
|
2356
|
-
message: "skills-auto-sync is started by ordinary deepline commands and requires the lease token they pass; run `deepline skills` to install skills yourself."
|
|
2357
|
-
},
|
|
2358
|
-
{ json: true }
|
|
2359
|
-
);
|
|
2360
|
-
process.exitCode = 2;
|
|
2361
|
-
return;
|
|
2362
|
-
}
|
|
2363
|
-
await syncSdkSkillsIfNeeded(_chunkFJCIUF34js.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, ""), {
|
|
2364
|
-
mode: "inline",
|
|
2365
|
-
notices: "defer",
|
|
2366
|
-
claim
|
|
2367
|
-
});
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
2072
|
|
|
2371
2073
|
|
|
2372
2074
|
|
|
@@ -2393,4 +2095,7 @@ Examples:
|
|
|
2393
2095
|
|
|
2394
2096
|
|
|
2395
2097
|
|
|
2396
|
-
|
|
2098
|
+
|
|
2099
|
+
|
|
2100
|
+
|
|
2101
|
+
exports.SDK_COMPATIBILITY_FAST_DEADLINE_MS = SDK_COMPATIBILITY_FAST_DEADLINE_MS; exports.readFreshCleanCompatibility = readFreshCleanCompatibility; exports.readTrustedCleanCompatibility = readTrustedCleanCompatibility; exports.claimUpdateAdvisory = claimUpdateAdvisory; exports.checkSdkCompatibility = checkSdkCompatibility; exports.isCiEnvironment = isCiEnvironment; exports.enforceSdkCompatibilityResponse = enforceSdkCompatibilityResponse; exports.SKILLS_NPX_PACKAGE = SKILLS_NPX_PACKAGE; exports.DEFAULT_SDK_SKILL_NAMES = DEFAULT_SDK_SKILL_NAMES; exports.LEGACY_SKILL_NAMES_TO_REMOVE = LEGACY_SKILL_NAMES_TO_REMOVE; exports.skillsSourceUrl = skillsSourceUrl; exports.getActiveCliProgress = getActiveCliProgress; exports.createCliProgress = createCliProgress; exports.resolveShellSpawn = resolveShellSpawn; exports.isFailureReportingDisabled = isFailureReportingDisabled; exports.redactFailureText = redactFailureText; exports.sanitizeCommand = sanitizeCommand; exports.failureReportHeaders = failureReportHeaders; exports.resolveSdkCliFailureExitCode = resolveSdkCliFailureExitCode; exports.maybeReportSdkCliFailure = maybeReportSdkCliFailure; exports.SkillsStateUnavailableError = SkillsStateUnavailableError; exports.acquireSkillsInstallLease = acquireSkillsInstallLease; exports.skillsInstallLeasePath = skillsInstallLeasePath; exports.flushDeferredSkillsSyncNotices = flushDeferredSkillsSyncNotices; exports.SKILLS_AUTO_SYNC_COMMAND = SKILLS_AUTO_SYNC_COMMAND; exports.hasFailedAutomaticSkillsSync = hasFailedAutomaticSkillsSync; exports.clearFailedAutomaticSkillsSync = clearFailedAutomaticSkillsSync; exports.syncSdkSkillsIfNeeded = syncSdkSkillsIfNeeded;
|