deepline 0.3.408 → 0.3.410
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/agent-runtime.ts +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +212 -334
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/{auth-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
- package/dist/cli/auth-UG4WOYGL.js +40 -0
- package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
- package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
- package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
- package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
- package/dist/cli/chunk-5TUGWDEB.js +313 -0
- package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
- package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
- package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
- package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
- package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
- package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NTVLGHFM.js +501 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
- package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
- package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
- package/dist/cli/chunk-T44IIOT6.mjs +501 -0
- package/dist/cli/chunk-VK2LZ5IP.js +35 -0
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
- package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
- package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
- package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
- package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
- package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
- package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
- package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
- package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
- package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
- package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
- package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
- package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
- package/dist/cli/git-I6CPBEVG.js +24 -0
- package/dist/cli/index.js +240 -352
- package/dist/cli/index.mjs +163 -275
- package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
- package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
- package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
- package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
- package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
- package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
- package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
- package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
- package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
- package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
- package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
- package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
- package/dist/cli/search-6NCH4HB5.js +30 -0
- package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
- package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
- package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
- package/dist/cli/sessions-235532DR.js +16 -0
- package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
- package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
- package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
- package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
- package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
- package/dist/cli/skills-3IWLYYRL.js +29 -0
- package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
- package/dist/cli/tools-LR66SPYU.js +44 -0
- package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
- package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
- package/dist/cli/update-SP7UEO53.js +31 -0
- package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
- package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
- package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
- package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +120 -104
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +5 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-3GB2K636.js +0 -40
- package/dist/cli/chunk-67RWR34T.mjs +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-HQY2SG3K.js +0 -83
- package/dist/cli/chunk-OSFWFV72.js +0 -155
- package/dist/cli/chunk-Q3LFI3VH.js +0 -392
- package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
- package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-YKUXXJOR.js +0 -24
- package/dist/cli/search-PPPYC5OZ.js +0 -30
- package/dist/cli/sessions-TEHEWW7O.js +0 -16
- package/dist/cli/skills-SYS7VRRK.js +0 -29
- package/dist/cli/tools-KK4BKVQR.js +0 -39
- package/dist/cli/update-2IV5JTX2.js +0 -29
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
printCommandEnvelope
|
|
6
|
-
} from "./chunk-4CFULMRB.mjs";
|
|
2
|
+
isJsonOutputMode
|
|
3
|
+
} from "./chunk-5V5Y37BC.mjs";
|
|
7
4
|
import {
|
|
8
5
|
DEFAULT_SKILL_AGENTS,
|
|
9
6
|
KNOWN_SKILL_AGENTS,
|
|
@@ -13,162 +10,20 @@ import {
|
|
|
13
10
|
autoDetectBaseUrl,
|
|
14
11
|
deploymentProtectionHeaders,
|
|
15
12
|
detectAgentRuntime,
|
|
16
|
-
ensureProjectPrivatePathsIgnored,
|
|
17
13
|
hasActivePluginSkills,
|
|
18
14
|
readSdkSkillsLocalVersion,
|
|
19
15
|
resolveApiKeyForBaseUrl,
|
|
20
16
|
resolveAutoSyncSkillAgents,
|
|
21
|
-
resolveProjectPinTarget,
|
|
22
17
|
sdkCliStateDirPath,
|
|
23
18
|
skillsAgentPathSegment,
|
|
24
19
|
writeSdkSkillsLocalVersion
|
|
25
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RFB25DSQ.mjs";
|
|
26
21
|
import {
|
|
27
22
|
DeeplineError
|
|
28
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-E4IXDAZI.mjs";
|
|
29
24
|
import {
|
|
30
25
|
SDK_RELEASE
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
|
|
33
|
-
// src/cli/commands/skills.ts
|
|
34
|
-
import { spawn as spawn2 } from "child_process";
|
|
35
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
36
|
-
import { homedir as homedir3 } from "os";
|
|
37
|
-
import { dirname as dirname3, join as join3 } from "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 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 = options.agents ?? 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: 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
|
-
import { spawn, spawnSync } from "child_process";
|
|
157
|
-
import { createHash, randomUUID as randomUUID2 } from "crypto";
|
|
158
|
-
import { homedir as homedir2 } from "os";
|
|
159
|
-
import { gunzipSync } from "zlib";
|
|
160
|
-
import {
|
|
161
|
-
appendFileSync,
|
|
162
|
-
existsSync as existsSync2,
|
|
163
|
-
mkdirSync as mkdirSync2,
|
|
164
|
-
readdirSync,
|
|
165
|
-
readFileSync as readFileSync2,
|
|
166
|
-
renameSync as renameSync2,
|
|
167
|
-
rmSync as rmSync2,
|
|
168
|
-
unlinkSync,
|
|
169
|
-
writeFileSync as writeFileSync2
|
|
170
|
-
} from "fs";
|
|
171
|
-
import { dirname as dirname2, join as join2 } from "path";
|
|
26
|
+
} from "./chunk-2YR7BIIC.mjs";
|
|
172
27
|
|
|
173
28
|
// src/compat.ts
|
|
174
29
|
import { randomUUID } from "crypto";
|
|
@@ -183,6 +38,7 @@ import {
|
|
|
183
38
|
import { homedir } from "os";
|
|
184
39
|
import { dirname, join } from "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,10 +57,10 @@ function shouldSkipCompatibilityCheck() {
|
|
|
201
57
|
const value = process.env.DEEPLINE_SKIP_SDK_COMPAT_CHECK?.trim().toLowerCase();
|
|
202
58
|
return value === "1" || value === "true" || value === "yes";
|
|
203
59
|
}
|
|
204
|
-
function sdkCompatibilityCachePath(baseUrl, homeDir = homedir()) {
|
|
60
|
+
function sdkCompatibilityCachePath(baseUrl, homeDir = process.env.HOME?.trim() || homedir()) {
|
|
205
61
|
return join(sdkCliStateDirPath(baseUrl, homeDir), "compat-cache.json");
|
|
206
62
|
}
|
|
207
|
-
function legacySdkCompatibilityCachePath(homeDir = homedir()) {
|
|
63
|
+
function legacySdkCompatibilityCachePath(homeDir = process.env.HOME?.trim() || homedir()) {
|
|
208
64
|
return join(homeDir, ".cache", "deepline", "sdk-compat-cache.json");
|
|
209
65
|
}
|
|
210
66
|
function compatibilityCacheKey(baseUrl, command, skillsVersion) {
|
|
@@ -244,6 +100,22 @@ 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 = join(sdkCliStateDirPath(baseUrl), "update-advisory.json");
|
|
106
|
+
try {
|
|
107
|
+
const { shownAt } = JSON.parse(readFileSync(path, "utf8"));
|
|
108
|
+
if (isSavedWithin(shownAt, UPDATE_ADVISORY_INTERVAL_MS, now)) return false;
|
|
109
|
+
} catch {
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
113
|
+
writeFileSync(path, `${JSON.stringify({ shownAt: now })}
|
|
114
|
+
`);
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
247
119
|
function readCachedCompatibility(baseUrl, command, skillsVersion) {
|
|
248
120
|
return readCachedCompatibilityEntry(baseUrl, command, skillsVersion)?.response ?? null;
|
|
249
121
|
}
|
|
@@ -327,6 +199,9 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
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",
|
|
@@ -337,7 +212,9 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
|
|
|
337
212
|
"X-Deepline-API-Major": String(SDK_API_MAJOR),
|
|
338
213
|
"X-Deepline-API-Contract": 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 ${resolveApiKeyForBaseUrl(baseUrl)}` } : {},
|
|
217
|
+
...options.catalog?.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 };
|
|
@@ -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 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 = options.agents ?? 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: 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
|
+
import { Worker } from "worker_threads";
|
|
401
|
+
var CliProgress = class {
|
|
402
|
+
lastMessage = null;
|
|
403
|
+
interactive = Boolean(process.stderr.isTTY);
|
|
404
|
+
grey = "\x1B[90m";
|
|
405
|
+
cyan = "\x1B[36m";
|
|
406
|
+
dim = "\x1B[2m";
|
|
407
|
+
reset = "\x1B[0m";
|
|
408
|
+
worker = null;
|
|
409
|
+
enabled;
|
|
410
|
+
// --json output is one JSON document: progress never renders under it.
|
|
411
|
+
constructor(enabled) {
|
|
412
|
+
this.enabled = enabled && !isJsonOutputMode();
|
|
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
|
+
this.worker?.postMessage({ type: "phase", message });
|
|
429
|
+
}
|
|
430
|
+
complete() {
|
|
431
|
+
this.settle("\u2713");
|
|
432
|
+
}
|
|
433
|
+
fail() {
|
|
434
|
+
this.settle("\u2717");
|
|
435
|
+
}
|
|
436
|
+
writeLogLine(line) {
|
|
437
|
+
if (isJsonOutputMode()) 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
|
+
this.worker?.terminate().catch(() => 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
|
+
this.worker?.terminate().catch(() => 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
|
+
this.worker?.terminate().catch(() => 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 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
|
+
};
|
|
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
|
import { statSync } from "fs";
|
|
408
548
|
import { win32 } from "path";
|
|
@@ -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 = record.cause ?? record.context;
|
|
@@ -833,6 +979,22 @@ async function maybeReportSdkCliFailure(input) {
|
|
|
833
979
|
}
|
|
834
980
|
|
|
835
981
|
// src/cli/skills-sync.ts
|
|
982
|
+
import { spawn, spawnSync } from "child_process";
|
|
983
|
+
import { createHash, randomUUID as randomUUID2 } from "crypto";
|
|
984
|
+
import { homedir as homedir2 } from "os";
|
|
985
|
+
import { gunzipSync } from "zlib";
|
|
986
|
+
import {
|
|
987
|
+
appendFileSync,
|
|
988
|
+
existsSync as existsSync2,
|
|
989
|
+
mkdirSync as mkdirSync2,
|
|
990
|
+
readdirSync,
|
|
991
|
+
readFileSync as readFileSync2,
|
|
992
|
+
renameSync as renameSync2,
|
|
993
|
+
rmSync as rmSync2,
|
|
994
|
+
unlinkSync,
|
|
995
|
+
writeFileSync as writeFileSync2
|
|
996
|
+
} from "fs";
|
|
997
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
836
998
|
var CHECK_TIMEOUT_MS2 = 3e3;
|
|
837
999
|
var INSTALLER_PROBE_TIMEOUT_MS = 1e3;
|
|
838
1000
|
var PUBLISHED_VERIFICATION_RETRY_MS = 5 * 6e4;
|
|
@@ -1907,474 +2069,20 @@ 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) => 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 = process.argv[1] ?? "") {
|
|
1954
|
-
return /[\\/]\.deepline[\\/]runtime[\\/]/.test(entrypoint) ? "local" : "global";
|
|
1955
|
-
}
|
|
1956
|
-
function resolveLocalRoot() {
|
|
1957
|
-
const target = resolveProjectPinTarget();
|
|
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 = input.runtime ?? detectAgentRuntime();
|
|
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
|
-
input.homeDir ?? homedir3()
|
|
1974
|
-
];
|
|
1975
|
-
const detected = AGENT_MARKERS.filter(
|
|
1976
|
-
(marker) => roots.some(
|
|
1977
|
-
(root) => marker.paths.some((path) => existsSync3(join3(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 ? join3(root, ".deepline", "setup", "skills.json") : join3(sdkCliStateDirPath(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(readFileSync3(path, "utf8"));
|
|
2051
|
-
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
2052
|
-
} catch {
|
|
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 = spawn2(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(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
|
-
printCommandEnvelope(
|
|
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 = autoDetectBaseUrl().replace(/\/$/, "");
|
|
2118
|
-
const catalog = {
|
|
2119
|
-
skillNames: [...DEFAULT_SDK_SKILL_NAMES],
|
|
2120
|
-
version: 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
|
-
printCommandEnvelope(
|
|
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
|
-
printCommandEnvelope(
|
|
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
|
-
ensureProjectPrivatePathsIgnored(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: 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
|
-
printCommandEnvelope(
|
|
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
|
-
printCommandEnvelope(
|
|
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 = dependencies.runProcess ?? runProcess;
|
|
2237
|
-
try {
|
|
2238
|
-
const installCode = await execute(
|
|
2239
|
-
plan.install.command,
|
|
2240
|
-
plan.install.args,
|
|
2241
|
-
root ?? void 0
|
|
2242
|
-
);
|
|
2243
|
-
if (installCode !== 0) {
|
|
2244
|
-
throw new Error("Could not install the current Deepline skills.");
|
|
2245
|
-
}
|
|
2246
|
-
} catch (error) {
|
|
2247
|
-
printCommandEnvelope(
|
|
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
|
-
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
|
-
mkdirSync3(dirname3(plan.statePath), { recursive: true });
|
|
2280
|
-
writeFileSync3(
|
|
2281
|
-
plan.statePath,
|
|
2282
|
-
`${JSON.stringify(
|
|
2283
|
-
{
|
|
2284
|
-
schemaVersion: 1,
|
|
2285
|
-
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2286
|
-
cliVersion: 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
|
-
printCommandEnvelope(
|
|
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 = options.claim?.trim();
|
|
2349
|
-
if (!claim) {
|
|
2350
|
-
printCommandEnvelope(
|
|
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(autoDetectBaseUrl().replace(/\/$/, ""), {
|
|
2364
|
-
mode: "inline",
|
|
2365
|
-
notices: "defer",
|
|
2366
|
-
claim
|
|
2367
|
-
});
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
2072
|
export {
|
|
2372
2073
|
SDK_COMPATIBILITY_FAST_DEADLINE_MS,
|
|
2373
2074
|
readFreshCleanCompatibility,
|
|
2374
2075
|
readTrustedCleanCompatibility,
|
|
2076
|
+
claimUpdateAdvisory,
|
|
2375
2077
|
checkSdkCompatibility,
|
|
2376
2078
|
isCiEnvironment,
|
|
2377
2079
|
enforceSdkCompatibilityResponse,
|
|
2080
|
+
SKILLS_NPX_PACKAGE,
|
|
2081
|
+
DEFAULT_SDK_SKILL_NAMES,
|
|
2082
|
+
LEGACY_SKILL_NAMES_TO_REMOVE,
|
|
2083
|
+
skillsSourceUrl,
|
|
2084
|
+
getActiveCliProgress,
|
|
2085
|
+
createCliProgress,
|
|
2378
2086
|
resolveShellSpawn,
|
|
2379
2087
|
isFailureReportingDisabled,
|
|
2380
2088
|
redactFailureText,
|
|
@@ -2382,15 +2090,12 @@ export {
|
|
|
2382
2090
|
failureReportHeaders,
|
|
2383
2091
|
resolveSdkCliFailureExitCode,
|
|
2384
2092
|
maybeReportSdkCliFailure,
|
|
2093
|
+
SkillsStateUnavailableError,
|
|
2094
|
+
acquireSkillsInstallLease,
|
|
2095
|
+
skillsInstallLeasePath,
|
|
2385
2096
|
flushDeferredSkillsSyncNotices,
|
|
2386
2097
|
SKILLS_AUTO_SYNC_COMMAND,
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
detectSkillsAgents,
|
|
2391
|
-
skillsStatePathForScope,
|
|
2392
|
-
buildSkillsPlan,
|
|
2393
|
-
isSkillsPlanCurrent,
|
|
2394
|
-
runSkillsCommand,
|
|
2395
|
-
registerSkillsCommand
|
|
2098
|
+
hasFailedAutomaticSkillsSync,
|
|
2099
|
+
clearFailedAutomaticSkillsSync,
|
|
2100
|
+
syncSdkSkillsIfNeeded
|
|
2396
2101
|
};
|