chainlesschain 0.166.159 → 0.166.161
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/README.md +11 -5
- package/package.json +1 -1
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-CraNGNgc.js → AIOps-CNhLuFiB.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-C0jn6sgg.js → ActionButton-BVPZKoT-.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-DVrR_wjl.js → Analytics-Ct2gNxKd.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-CeKP8mgC.js → AppLayout-BnaA21bl.js} +1 -1
- package/src/assets/web-panel/assets/{Artifacts-OHCS9wLN.js → Artifacts-C5_NWBGG.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-C77b6pDl.js → Audit-y_MUbjLt.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-CefiwCgM.js → BackgroundAgents-C63koq2N.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-B-5KmWNA.js → Backup-Yo9hJesU.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-C3bJ1Qlc.js → BaseInput-uAsHWcNC.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-DBahPz9B.js → Chat-B9zs3I4L.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-J4BVVrXZ.js → ChatBubbleRenderer-fzKRaTLd.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-w856fzfY.js → Checkbox-BKHInWqb.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-XKmsL_C3.js → Codegen-gB60liCi.js} +1 -1
- package/src/assets/web-panel/assets/{Col-B37-gr7d.js → Col-B_iw_PIR.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DdahlN0f.js → Community-BTwbiBFd.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-oKnoE-9_.js → Compact-D851uR8p.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CnCRlOB_.js → Compliance-DQOQgtbc.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-D3Vr5R3E.js → Cowork-DzaEZbbm.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-X46CdLRQ.js → Cron-Df2xjxzZ.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-CV3_6jVw.js → Crosschain-D7eewpJM.js} +1 -1
- package/src/assets/web-panel/assets/{DID-Kr6H4WKr.js → DID-Dg9OtFGl.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-Bj4usrhx.js → Dashboard-B3dt4SYd.js} +1 -1
- package/src/assets/web-panel/assets/{Dropdown-V3DPV21D.js → Dropdown-C0vEIluP.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-8MCX0Y4b.js → EmailListRenderer-BLe81BHF.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-SUoykpjc.js → EvolutionSettings-CvN_ORvk.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-C0iE0T9x.js → FamilyGuardDashboard-xFaUcq6i.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-CSU3kpK2.js → Federation-DqGa6L60.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-Bcv2XJNw.js → FormItemContext-DumZjtkF.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-PdEqwQZd.js → GenericCardRenderer-CXxweSPC.js} +1 -1
- package/src/assets/web-panel/assets/{Git-CVZ0MSRN.js → Git-CF3OyEuV.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-CF64-eGc.js → Governance-DGBoeFcm.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-DJ1J40Th.js → Inference-CveIk_lk.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-Cf3ULXmf.js → KnowledgeGraph-msqPEvc0.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-DM_RbXG_.js → Logs-zAhceodz.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-B2wey_j8.js → MarkdownRenderer-DwP1jZr3.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-tqdANxLa.js → Marketplace-CIOc62w1.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BiSYAtKB.js → McpTools-Ye1FSjo-.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-hOvA-Tqp.js → Memory-COGlkLtO.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-CIpwBK6G.js → MobileBridge-BVkRPQSG.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-DMpV98oD.js → MobileProjects-AtAH5Uoo.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-CVoJZMuY.js → Mtc-CqiDh60D.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-Dz9YsrvV.js → MtcAudit-CruLSC3f.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-CamW3sTK.js → Multisig-YH7hDXe7.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-DlZo8q6W.js → NLProgramming-DT6rmEY_.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-DZJSYibx.js → Notes-Cjp991_L.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-BSlIIGOM.js → NotificationSettings-CMv9uHtV.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-Bo9vImgU.js → OrderTableRenderer-wp1zrUZe.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-B1sBf0Kk.js → Organization-CZGBH2f-.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-CD8GUNOV.js → Overflow-C5yb6LcI.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CeaIuSa9.js → P2P-C-3smRsS.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-DCOkcRse.js → PdhVaultBrowser-D9e1lYe_.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-DQCZnN_y.js → Permissions-YrtBFosR.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-D_9PtVvT.js → PersonalDataHub-CPIlHXmG.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-BawUxj0i.js → Pipeline-BAUQ4UL0.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-CPyw19Ai.js → Privacy-Du1mfYpr.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-GDtYLbL6.js → ProjectInit-DTZZPmI6.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-DhmGKXVL.js → ProjectSettings-D5vGoWmg.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-O2spSrud.js → Projects-CPyfgipD.js} +1 -1
- package/src/assets/web-panel/assets/Providers-BCo_GB4k.css +1 -0
- package/src/assets/web-panel/assets/Providers-DoJDphwe.js +1 -0
- package/src/assets/web-panel/assets/{QrScannerModal-Dcqm-i6j.js → QrScannerModal-DKezd77c.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-C6uPAeAE.js → QuickAsk-Dj5x0jA3.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-ClVlhga7.js → Recommend-D_Bk2N6M.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-2raJDKUb.js → RemoteSession-DoACu1j-.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-BYWC8k3t.js → Reputation-CHY48udA.js} +1 -1
- package/src/assets/web-panel/assets/{Row-Bv7Y68ai.js → Row-B2ji1NaC.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-Ba54MKvz.js → RssFeed-Cko4TT8o.js} +1 -1
- package/src/assets/web-panel/assets/{Search-B9EkRkZK.js → Search-D4Jq_y26.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DuXQGU4o.js → Security-CRj9UHDB.js} +1 -1
- package/src/assets/web-panel/assets/{Services-DJnCtY8x.js → Services-fZPfKCJD.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-BVDdtf_S.js → Skeleton-C_H68DxY.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-DGkYCesm.js → Skills-Bm4nTGzx.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-CHND6lwC.js → Sla-BBhY5p8N.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-Bg0Bgy9c.js → SpeechSettings-B0fvb--L.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-DwtcZ2Ml.js → SyncSettings-0HlhIGJ-.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-BoHc0cP2.js → Tasks-Bo-k7A9g.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-DAMs4m8X.js → Templates-BRTC7AUC.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-DkVQbOzT.js → Tenant-BpIv9shV.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-BTOLM8Yu.js → Terminal-Bt147VT7.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-BO5ZyxUU.js → TimelineRenderer-CBSVcKf5.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-D0LjCtSA.js → Tokens-JCGWdOyZ.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DgGXg9VB.js → Trigger-D2GaPoYt.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-BAEQrND-.js → Trust-BGicfDbx.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-TtBclFRw.js → UkeySign-DJLwi-VO.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-ByxvpIpS.js → VideoEditing-JdhxB9I3.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-CTa7jqur.js → Wallet-B8OqhQC-.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-oHbCSjrD.js → WebAuthn-0qeF3jwV.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-DQKQAdUS.js → WorkflowEditor-Br7NIU4X.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BcCU2FuK.js → chat-CdI93Uj-.js} +1 -1
- package/src/assets/web-panel/assets/{colors-BcXAFjHT.js → colors-hE8M4e8h.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-GhZzQppm.js → compact-item-BUhXh46K.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-Bc6nwTUy.js → createContext-B5ccktpR.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-DRH8Xt0Y.js → hasIn-CptjIqui.js} +1 -1
- package/src/assets/web-panel/assets/{index-BDIN9KWp.js → index-0aHON-dJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-mqlLcSgP.js → index-0dLpjWdQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-gvsatTPZ.js → index-B2gEgzUF.js} +1 -1
- package/src/assets/web-panel/assets/{index-CB1Thk9t.js → index-B4h7Yyll.js} +1 -1
- package/src/assets/web-panel/assets/{index-lEDZUWRO.js → index-B6aiDNJf.js} +1 -1
- package/src/assets/web-panel/assets/{index-DQnXn3vs.js → index-BB4StyBV.js} +1 -1
- package/src/assets/web-panel/assets/{index-60aCmptm.js → index-BBnyQBDE.js} +1 -1
- package/src/assets/web-panel/assets/{index-DCgr2bDL.js → index-BCmJolrc.js} +1 -1
- package/src/assets/web-panel/assets/{index-BaUmYzDB.js → index-Bb2rTuMK.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bebe5WYu.js → index-BktXJbRU.js} +1 -1
- package/src/assets/web-panel/assets/{index-wnmY4P7_.js → index-BsaY5ENn.js} +1 -1
- package/src/assets/web-panel/assets/{index-B7hScRVB.js → index-Bw1sj494.js} +1 -1
- package/src/assets/web-panel/assets/{index-DOBzu5UO.js → index-BzOVaC2t.js} +1 -1
- package/src/assets/web-panel/assets/{index-D6B_ELy6.js → index-C7sbKKIt.js} +1 -1
- package/src/assets/web-panel/assets/{index-BOquBdmK.js → index-CE7uX7n3.js} +1 -1
- package/src/assets/web-panel/assets/{index-DCCEt-pU.js → index-CGgx5Z0d.js} +1 -1
- package/src/assets/web-panel/assets/{index-DoRIPzwv.js → index-CNSnbjTb.js} +1 -1
- package/src/assets/web-panel/assets/{index-BQ6b5kJR.js → index-CV50XvUJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-D08s-CJ_.js → index-Ca1U3jvV.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXip1xUj.js → index-CgPmwwdZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-WrMfehhj.js → index-CiQ8T-Wj.js} +1 -1
- package/src/assets/web-panel/assets/{index-owU4npmQ.js → index-CmEKreTW.js} +1 -1
- package/src/assets/web-panel/assets/index-CwLYWliJ.js +1 -0
- package/src/assets/web-panel/assets/{index-Dzh9Ud2R.js → index-Cwf0XTa8.js} +3 -3
- package/src/assets/web-panel/assets/{index-Cexk6Y1r.js → index-D5i229Gh.js} +1 -1
- package/src/assets/web-panel/assets/{index-BdOccG1D.js → index-DG40DMAk.js} +1 -1
- package/src/assets/web-panel/assets/{index-CtC-B6Zy.js → index-DG7-sHcw.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFFyqn3k.js → index-DLmj9zeI.js} +1 -1
- package/src/assets/web-panel/assets/index-DMF7BcWf.js +1 -0
- package/src/assets/web-panel/assets/{index-DzhMohzV.js → index-DO3kRQnh.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bb5XCEKT.js → index-DRr1ldeO.js} +1 -1
- package/src/assets/web-panel/assets/{index-IW9dUJK_.js → index-DUWmPd0O.js} +1 -1
- package/src/assets/web-panel/assets/{index-D9QfJDQg.js → index-Dc8ZP-rA.js} +1 -1
- package/src/assets/web-panel/assets/{index-BsRmNZCk.js → index-DhdxOKQ4.js} +1 -1
- package/src/assets/web-panel/assets/{index-CSHz8UnK.js → index-Dxmu8cZG.js} +1 -1
- package/src/assets/web-panel/assets/{index-DNi_t23H.js → index-LQEMp44F.js} +1 -1
- package/src/assets/web-panel/assets/{index-DOtNt1m7.js → index-WVQ05cSo.js} +1 -1
- package/src/assets/web-panel/assets/{index-D6pWvvp-.js → index-f3OaRY6m.js} +1 -1
- package/src/assets/web-panel/assets/{index-BEQha9Ur.js → index-ri-ZBdPd.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-DfHPrIA5.js → initDefaultProps-DTj0zdLt.js} +1 -1
- package/src/assets/web-panel/assets/{motion-CCzrK3c5.js → motion-DnsNb0QQ.js} +1 -1
- package/src/assets/web-panel/assets/{move-B2uu6I9f.js → move-Bf_g7tYL.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-DtFu2-C_.js → mtc-parser-D2gv6Yis.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BFjLuAHb.js → omit-BCRtdA1N.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DfsjYq45.js → pickAttrs-COqVNaT6.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CDdYIVXw.js → placementArrow--K1Q_0hw.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CfrplFjn.js → responsiveObserve-BrMnRoWy.js} +1 -1
- package/src/assets/web-panel/assets/{slide-DHNX5Xwt.js → slide-DPlpqM13.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-BI-C3SSk.js → statusUtils-Ddby7oUh.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-C5Y3Oyy2.js → styleChecker-BV5JCSKe.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-atF45w0U.js → useFlexGapSupport-DeLyWVJE.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-C4M8-xm9.js → useFs-DIXerI3H.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-jjZdnfs_.js → usePersonalDataHub-BvhJbBzh.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-BRTSCmU3.js → vnode-DGQZc27k.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-BaS5ZYRC.js → zoom-BcHWSA8z.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +2 -2
- package/src/commands/llm.js +13 -0
- package/src/commands/plugin.js +147 -105
- package/src/commands/session.js +104 -87
- package/src/commands/setup.js +25 -16
- package/src/commands/status.js +19 -0
- package/src/commands/tasks.js +113 -0
- package/src/data/changelog.json +28 -2
- package/src/gateways/ws/message-dispatcher.js +5 -0
- package/src/harness/background-task-manager.js +102 -32
- package/src/harness/mcp-client.js +62 -3
- package/src/index.js +9 -0
- package/src/lib/doctor-checkup.js +21 -0
- package/src/lib/execution-location-runner-lifecycle.js +81 -2
- package/src/lib/lk-catalog.js +4 -0
- package/src/lib/lk-model-catalog.json +36 -15
- package/src/lib/lk-public-catalog.cjs +92 -0
- package/src/lib/llm-channel-presets.js +2 -2
- package/src/lib/mcp-server-handle.js +114 -0
- package/src/lib/mcp-stateless-protocol.js +123 -0
- package/src/lib/mcp-task-journal.js +32 -2
- package/src/lib/mcp-tool-metadata.js +1 -0
- package/src/lib/model-decision.js +85 -0
- package/src/lib/permission-profile.js +47 -0
- package/src/lib/plugin-runtime/marketplace-command-source.js +53 -12
- package/src/lib/plugin-runtime/remote-source.js +9 -5
- package/src/lib/public-ide-capability-manifest.js +2 -0
- package/src/lib/runnable-provider.js +15 -4
- package/src/lib/runner-lifecycle-metrics.js +64 -0
- package/src/lib/session-persistence-failure.js +7 -1
- package/src/lib/session-plan-approval.js +77 -0
- package/src/lib/session-transcript-history.js +48 -0
- package/src/lib/status-line.cjs +68 -5
- package/src/lib/status-line.js +39 -6
- package/src/lib/sub-agent-context.js +16 -0
- package/src/lib/sub-agent-registry.js +1 -0
- package/src/lib/task-list.js +26 -11
- package/src/lib/task-record.js +311 -0
- package/src/lib/unattended-action-policy.js +16 -0
- package/src/repl/agent-repl.js +16 -2
- package/src/runtime/agent-core.js +94 -4
- package/src/runtime/fallback-model.js +11 -1
- package/src/runtime/headless-runner.js +35 -0
- package/src/runtime/headless-stream.js +101 -9
- package/src/assets/web-panel/assets/Providers-CNKCrJbY.css +0 -1
- package/src/assets/web-panel/assets/Providers-lEDu4Qdj.js +0 -1
- package/src/assets/web-panel/assets/index-BlS3EjXM.js +0 -1
- package/src/assets/web-panel/assets/index-DwIMwROa.js +0 -1
package/src/commands/plugin.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
+
import { createHash } from "node:crypto";
|
|
9
10
|
import { logger } from "../lib/logger.js";
|
|
10
11
|
import {
|
|
11
12
|
enforcePluginPolicy,
|
|
@@ -39,6 +40,29 @@ function collectRepeatableOption(value, previous = []) {
|
|
|
39
40
|
return [...previous, value];
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
/** Normalize installer side effects into a stable machine-readable receipt. */
|
|
44
|
+
export function normalizeInstallCommandResult(value = null) {
|
|
45
|
+
const input = value && typeof value === "object" ? value : {};
|
|
46
|
+
const stderr = typeof input.stderr === "string" ? input.stderr : "";
|
|
47
|
+
const digest =
|
|
48
|
+
typeof input.stderrDigest === "string" && input.stderrDigest
|
|
49
|
+
? input.stderrDigest
|
|
50
|
+
: createHash("sha256").update(stderr, "utf8").digest("hex");
|
|
51
|
+
const exitCode = Number.isSafeInteger(input.exitCode) ? input.exitCode : null;
|
|
52
|
+
const ran = input.ran === true || exitCode !== null || input.started === true;
|
|
53
|
+
return {
|
|
54
|
+
ran,
|
|
55
|
+
exitCode,
|
|
56
|
+
timedOut: input.timedOut === true,
|
|
57
|
+
signaled: input.signaled === true || input.signal != null,
|
|
58
|
+
printedToStderr:
|
|
59
|
+
input.printedToStderr === true ||
|
|
60
|
+
stderr.length > 0 ||
|
|
61
|
+
input.stderrBytes > 0,
|
|
62
|
+
stderrDigest: digest,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
42
66
|
function normalizeRegistryUrls(value) {
|
|
43
67
|
if (Array.isArray(value)) return value.filter(Boolean);
|
|
44
68
|
return value ? [value] : [];
|
|
@@ -169,12 +193,10 @@ async function fetchRegistryRemoteArtifacts(
|
|
|
169
193
|
: null;
|
|
170
194
|
if (!signature && !sbom) return null;
|
|
171
195
|
const config = await loadOptionalPluginConfig();
|
|
172
|
-
const { resolveRegistryToken } =
|
|
173
|
-
"../lib/plugin-runtime/remote-source.js"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"../lib/plugin-runtime/marketplace-remote-artifacts.js"
|
|
177
|
-
);
|
|
196
|
+
const { resolveRegistryToken } =
|
|
197
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
198
|
+
const { fetchPluginMarketplaceRemoteArtifacts } =
|
|
199
|
+
await import("../lib/plugin-runtime/marketplace-remote-artifacts.js");
|
|
178
200
|
return fetchPluginMarketplaceRemoteArtifacts({
|
|
179
201
|
registryUrl,
|
|
180
202
|
token: resolveRegistryToken(registryUrl, { token, config }),
|
|
@@ -434,9 +456,8 @@ async function materializeRegistrySelection(
|
|
|
434
456
|
|
|
435
457
|
async function buildRegistryInstallPreflight(url, resolved, cwd) {
|
|
436
458
|
const { VERSION } = await import("../constants.js");
|
|
437
|
-
const { buildPluginMarketplaceInstallPreflight } =
|
|
438
|
-
"../lib/plugin-runtime/marketplace-catalog.js"
|
|
439
|
-
);
|
|
459
|
+
const { buildPluginMarketplaceInstallPreflight } =
|
|
460
|
+
await import("../lib/plugin-runtime/marketplace-catalog.js");
|
|
440
461
|
const installed = await discoverInstalledPluginVersions(cwd);
|
|
441
462
|
return buildPluginMarketplaceInstallPreflight({
|
|
442
463
|
registryUrl: url,
|
|
@@ -585,9 +606,8 @@ async function installedCatalogAuthorityMatches(
|
|
|
585
606
|
}
|
|
586
607
|
|
|
587
608
|
async function buildInstalledMarketplaceSnapshot(name, scope, cwd) {
|
|
588
|
-
const { listInstalled, readSourceMetadataStrict } =
|
|
589
|
-
"../lib/plugin-runtime/install.js"
|
|
590
|
-
);
|
|
609
|
+
const { listInstalled, readSourceMetadataStrict } =
|
|
610
|
+
await import("../lib/plugin-runtime/install.js");
|
|
591
611
|
const { discoverPlugins } = await import("../lib/plugin-runtime/scopes.js");
|
|
592
612
|
const row = listInstalled({ cwd, scopes: [scope] }).find(
|
|
593
613
|
(candidate) => candidate.name === name && candidate.scope === scope,
|
|
@@ -712,12 +732,10 @@ async function buildInstalledMarketplaceSnapshot(name, scope, cwd) {
|
|
|
712
732
|
}
|
|
713
733
|
|
|
714
734
|
async function buildRegistryUpdateImpact(preflight, name, scope, cwd) {
|
|
715
|
-
const { buildPluginMarketplaceUpdateImpact } =
|
|
716
|
-
"../lib/plugin-runtime/marketplace-impact.js"
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
"../lib/plugin-runtime/install.js"
|
|
720
|
-
);
|
|
735
|
+
const { buildPluginMarketplaceUpdateImpact } =
|
|
736
|
+
await import("../lib/plugin-runtime/marketplace-impact.js");
|
|
737
|
+
const { listInstalledAllScopes } =
|
|
738
|
+
await import("../lib/plugin-runtime/install.js");
|
|
721
739
|
const inventory = listInstalledAllScopes({ cwd }).filter(
|
|
722
740
|
(entry) => entry.name === name,
|
|
723
741
|
);
|
|
@@ -758,9 +776,8 @@ async function resolvePluginCapabilityNotice(
|
|
|
758
776
|
) {
|
|
759
777
|
try {
|
|
760
778
|
const { discoverPlugins } = await import("../lib/plugin-runtime/scopes.js");
|
|
761
|
-
const { describeCapabilities } =
|
|
762
|
-
"../lib/plugin-runtime/capabilities.js"
|
|
763
|
-
);
|
|
779
|
+
const { describeCapabilities } =
|
|
780
|
+
await import("../lib/plugin-runtime/capabilities.js");
|
|
764
781
|
const consent = await import("../lib/plugin-runtime/capability-consent.js");
|
|
765
782
|
const installed = discoverPlugins({
|
|
766
783
|
cwd,
|
|
@@ -1056,6 +1073,9 @@ export function registerPluginCommand(program) {
|
|
|
1056
1073
|
{
|
|
1057
1074
|
...result,
|
|
1058
1075
|
skills: skillResult.installed,
|
|
1076
|
+
installCommand: normalizeInstallCommandResult(
|
|
1077
|
+
result.installCommand,
|
|
1078
|
+
),
|
|
1059
1079
|
integrity: verifiedManifest
|
|
1060
1080
|
? {
|
|
1061
1081
|
sha256: verifiedManifest.sha256,
|
|
@@ -1147,9 +1167,8 @@ export function registerPluginCommand(program) {
|
|
|
1147
1167
|
.action(async (name, options) => {
|
|
1148
1168
|
try {
|
|
1149
1169
|
if (options.scope) {
|
|
1150
|
-
const { setPluginEnabled } =
|
|
1151
|
-
"../lib/plugin-runtime/install.js"
|
|
1152
|
-
);
|
|
1170
|
+
const { setPluginEnabled } =
|
|
1171
|
+
await import("../lib/plugin-runtime/install.js");
|
|
1153
1172
|
const result = setPluginEnabled(name, true, {
|
|
1154
1173
|
scope: options.scope,
|
|
1155
1174
|
cwd: process.cwd(),
|
|
@@ -1205,9 +1224,8 @@ export function registerPluginCommand(program) {
|
|
|
1205
1224
|
.action(async (name, options) => {
|
|
1206
1225
|
try {
|
|
1207
1226
|
if (options.scope) {
|
|
1208
|
-
const { setPluginEnabled } =
|
|
1209
|
-
"../lib/plugin-runtime/install.js"
|
|
1210
|
-
);
|
|
1227
|
+
const { setPluginEnabled } =
|
|
1228
|
+
await import("../lib/plugin-runtime/install.js");
|
|
1211
1229
|
const result = setPluginEnabled(name, false, {
|
|
1212
1230
|
scope: options.scope,
|
|
1213
1231
|
cwd: process.cwd(),
|
|
@@ -1612,13 +1630,11 @@ export function registerPluginCommand(program) {
|
|
|
1612
1630
|
.option("--public-key <path>", "Public key for signature verification")
|
|
1613
1631
|
.option("--json", "Output as JSON")
|
|
1614
1632
|
.action(async (dir, options) => {
|
|
1615
|
-
const { parsePluginManifest, summarizeComponents } =
|
|
1616
|
-
"../lib/plugin-runtime/manifest.js"
|
|
1617
|
-
);
|
|
1633
|
+
const { parsePluginManifest, summarizeComponents } =
|
|
1634
|
+
await import("../lib/plugin-runtime/manifest.js");
|
|
1618
1635
|
const manifest = parsePluginManifest(dir);
|
|
1619
|
-
const { summarizeGoalExtension } =
|
|
1620
|
-
"../lib/plugin-runtime/goal-extension-contract.js"
|
|
1621
|
-
);
|
|
1636
|
+
const { summarizeGoalExtension } =
|
|
1637
|
+
await import("../lib/plugin-runtime/goal-extension-contract.js");
|
|
1622
1638
|
const goalExtensionSummary = summarizeGoalExtension(manifest);
|
|
1623
1639
|
|
|
1624
1640
|
// Optional integrity/signature check on the manifest file itself.
|
|
@@ -1665,9 +1681,8 @@ export function registerPluginCommand(program) {
|
|
|
1665
1681
|
if (rawManifest && rawManifest.dependencies) {
|
|
1666
1682
|
const { checkPluginDependencies, formatDependencyIssues } =
|
|
1667
1683
|
await import("../lib/plugin-runtime/governance.js");
|
|
1668
|
-
const { discoverPlugins } =
|
|
1669
|
-
"../lib/plugin-runtime/scopes.js"
|
|
1670
|
-
);
|
|
1684
|
+
const { discoverPlugins } =
|
|
1685
|
+
await import("../lib/plugin-runtime/scopes.js");
|
|
1671
1686
|
const { VERSION } = await import("../constants.js");
|
|
1672
1687
|
const installed = {};
|
|
1673
1688
|
try {
|
|
@@ -1747,9 +1762,8 @@ export function registerPluginCommand(program) {
|
|
|
1747
1762
|
// so a user can compare against the components it ships (the audit findings
|
|
1748
1763
|
// for an under-declared manifest already surface in manifest.warnings).
|
|
1749
1764
|
if (manifest.capabilitiesDeclared) {
|
|
1750
|
-
const { describeCapabilities } =
|
|
1751
|
-
"../lib/plugin-runtime/capabilities.js"
|
|
1752
|
-
);
|
|
1765
|
+
const { describeCapabilities } =
|
|
1766
|
+
await import("../lib/plugin-runtime/capabilities.js");
|
|
1753
1767
|
const capLines = describeCapabilities(manifest.capabilities);
|
|
1754
1768
|
logger.log(chalk.bold("\nCapabilities (declared):"));
|
|
1755
1769
|
if (capLines.length === 0) logger.log(chalk.gray(" (none)"));
|
|
@@ -1869,11 +1883,11 @@ export function registerPluginCommand(program) {
|
|
|
1869
1883
|
let remoteArtifacts = null;
|
|
1870
1884
|
let archiveSourceAuthority = null;
|
|
1871
1885
|
let commandSourceAuthority = null;
|
|
1886
|
+
let installCommand = null;
|
|
1872
1887
|
let registryResolutionAuthority = null;
|
|
1873
1888
|
const registryUrls = normalizeRegistryUrls(options.registry);
|
|
1874
|
-
const { isRemoteSource, resolveRemoteSource } =
|
|
1875
|
-
"../lib/plugin-runtime/remote-source.js"
|
|
1876
|
-
);
|
|
1889
|
+
const { isRemoteSource, resolveRemoteSource } =
|
|
1890
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
1877
1891
|
if (
|
|
1878
1892
|
options.offline === true &&
|
|
1879
1893
|
registryUrls.length === 0 &&
|
|
@@ -2006,6 +2020,7 @@ export function registerPluginCommand(program) {
|
|
|
2006
2020
|
marketplacePreflight,
|
|
2007
2021
|
);
|
|
2008
2022
|
installSource = resolved.source;
|
|
2023
|
+
installCommand = resolved.installCommand || null;
|
|
2009
2024
|
archiveSourceAuthority = resolved.archiveAuthority || null;
|
|
2010
2025
|
commandSourceAuthority = resolved.commandAuthority || null;
|
|
2011
2026
|
registryResolutionAuthority =
|
|
@@ -2050,6 +2065,16 @@ export function registerPluginCommand(program) {
|
|
|
2050
2065
|
}
|
|
2051
2066
|
} catch (err) {
|
|
2052
2067
|
logger.error(`Registry resolution failed: ${err.message}`);
|
|
2068
|
+
if (options.json && (err.installCommand || installCommand)) {
|
|
2069
|
+
console.log(
|
|
2070
|
+
JSON.stringify({
|
|
2071
|
+
error: { code: err.code || "CC_PLUGIN_INSTALL_FAILED" },
|
|
2072
|
+
installCommand: normalizeInstallCommandResult(
|
|
2073
|
+
err.installCommand || installCommand,
|
|
2074
|
+
),
|
|
2075
|
+
}),
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2053
2078
|
process.exitCode = 1;
|
|
2054
2079
|
return;
|
|
2055
2080
|
}
|
|
@@ -2212,6 +2237,9 @@ export function registerPluginCommand(program) {
|
|
|
2212
2237
|
marketplacePreflight,
|
|
2213
2238
|
marketplaceImpact,
|
|
2214
2239
|
marketplaceAuthorityPersisted,
|
|
2240
|
+
installCommand: normalizeInstallCommandResult(
|
|
2241
|
+
res.installCommand || installCommand,
|
|
2242
|
+
),
|
|
2215
2243
|
marketplaceCleanupPending: lifecycleCleanupPending,
|
|
2216
2244
|
cleanupPending:
|
|
2217
2245
|
res.cleanupPending === true || lifecycleCleanupPending,
|
|
@@ -2288,6 +2316,16 @@ export function registerPluginCommand(program) {
|
|
|
2288
2316
|
}
|
|
2289
2317
|
}
|
|
2290
2318
|
logger.error(`Install failed: ${err.message}${recoveryNote}`);
|
|
2319
|
+
if (options.json && (err.installCommand || installCommand)) {
|
|
2320
|
+
console.log(
|
|
2321
|
+
JSON.stringify({
|
|
2322
|
+
error: { code: err.code || "CC_PLUGIN_INSTALL_FAILED" },
|
|
2323
|
+
installCommand: normalizeInstallCommandResult(
|
|
2324
|
+
err.installCommand || installCommand,
|
|
2325
|
+
),
|
|
2326
|
+
}),
|
|
2327
|
+
);
|
|
2328
|
+
}
|
|
2291
2329
|
process.exitCode = 1;
|
|
2292
2330
|
} finally {
|
|
2293
2331
|
cleanupRegistryRemoteArtifacts(remoteArtifacts);
|
|
@@ -2440,9 +2478,8 @@ export function registerPluginCommand(program) {
|
|
|
2440
2478
|
return;
|
|
2441
2479
|
}
|
|
2442
2480
|
|
|
2443
|
-
const { fetchRegistry, resolveRegistryToken } =
|
|
2444
|
-
"../lib/plugin-runtime/remote-source.js"
|
|
2445
|
-
);
|
|
2481
|
+
const { fetchRegistry, resolveRegistryToken } =
|
|
2482
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
2446
2483
|
const { buildPluginMarketplaceCatalog, MAX_MARKETPLACE_CATALOG_SOURCES } =
|
|
2447
2484
|
await import("../lib/plugin-runtime/marketplace-catalog.js");
|
|
2448
2485
|
if (registryUrls.length > MAX_MARKETPLACE_CATALOG_SOURCES) {
|
|
@@ -2463,9 +2500,8 @@ export function registerPluginCommand(program) {
|
|
|
2463
2500
|
process.exitCode = 1;
|
|
2464
2501
|
return;
|
|
2465
2502
|
}
|
|
2466
|
-
const { discoverPlugins } =
|
|
2467
|
-
"../lib/plugin-runtime/scopes.js"
|
|
2468
|
-
);
|
|
2503
|
+
const { discoverPlugins } =
|
|
2504
|
+
await import("../lib/plugin-runtime/scopes.js");
|
|
2469
2505
|
const { VERSION } = await import("../constants.js");
|
|
2470
2506
|
let config = null;
|
|
2471
2507
|
try {
|
|
@@ -2830,9 +2866,8 @@ export function registerPluginCommand(program) {
|
|
|
2830
2866
|
)
|
|
2831
2867
|
.option("--json", "Output as JSON")
|
|
2832
2868
|
.action(async (options) => {
|
|
2833
|
-
const { listInstalled, listInstalledAllScopes } =
|
|
2834
|
-
"../lib/plugin-runtime/install.js"
|
|
2835
|
-
);
|
|
2869
|
+
const { listInstalled, listInstalledAllScopes } =
|
|
2870
|
+
await import("../lib/plugin-runtime/install.js");
|
|
2836
2871
|
const rows = options.allScopes
|
|
2837
2872
|
? listInstalledAllScopes({ cwd: process.cwd() })
|
|
2838
2873
|
: listInstalled({ cwd: process.cwd() });
|
|
@@ -2844,9 +2879,8 @@ export function registerPluginCommand(program) {
|
|
|
2844
2879
|
logger.info("No plugins installed. Add one with: cc plugin add <dir>");
|
|
2845
2880
|
return;
|
|
2846
2881
|
}
|
|
2847
|
-
const { isPluginTrusted } =
|
|
2848
|
-
"../lib/plugin-runtime/trust.js"
|
|
2849
|
-
);
|
|
2882
|
+
const { isPluginTrusted } =
|
|
2883
|
+
await import("../lib/plugin-runtime/trust.js");
|
|
2850
2884
|
logger.log(chalk.bold(`Installed plugins (${rows.length}):`));
|
|
2851
2885
|
for (const r of rows) {
|
|
2852
2886
|
if (r.runtimeBlocked === true) {
|
|
@@ -2899,9 +2933,8 @@ export function registerPluginCommand(program) {
|
|
|
2899
2933
|
.option("--json", "Output the redacted transaction authority as JSON")
|
|
2900
2934
|
.action(async (name, options) => {
|
|
2901
2935
|
try {
|
|
2902
|
-
const { inspectPluginTransaction } =
|
|
2903
|
-
"../lib/plugin-runtime/install.js"
|
|
2904
|
-
);
|
|
2936
|
+
const { inspectPluginTransaction } =
|
|
2937
|
+
await import("../lib/plugin-runtime/install.js");
|
|
2905
2938
|
const transaction = inspectPluginTransaction(name, {
|
|
2906
2939
|
scope: options.scope,
|
|
2907
2940
|
cwd: process.cwd(),
|
|
@@ -2944,9 +2977,8 @@ export function registerPluginCommand(program) {
|
|
|
2944
2977
|
.option("--json", "Output the recovery result as JSON")
|
|
2945
2978
|
.action(async (name, options) => {
|
|
2946
2979
|
try {
|
|
2947
|
-
const { recoverPluginTransaction } =
|
|
2948
|
-
"../lib/plugin-runtime/install.js"
|
|
2949
|
-
);
|
|
2980
|
+
const { recoverPluginTransaction } =
|
|
2981
|
+
await import("../lib/plugin-runtime/install.js");
|
|
2950
2982
|
const recovery = recoverPluginTransaction(name, {
|
|
2951
2983
|
scope: options.scope,
|
|
2952
2984
|
cwd: process.cwd(),
|
|
@@ -2986,9 +3018,8 @@ export function registerPluginCommand(program) {
|
|
|
2986
3018
|
)
|
|
2987
3019
|
.action(async (name, options) => {
|
|
2988
3020
|
try {
|
|
2989
|
-
const { planPluginProvenanceMigration } =
|
|
2990
|
-
"../lib/plugin-runtime/install.js"
|
|
2991
|
-
);
|
|
3021
|
+
const { planPluginProvenanceMigration } =
|
|
3022
|
+
await import("../lib/plugin-runtime/install.js");
|
|
2992
3023
|
const plan = planPluginProvenanceMigration(name, {
|
|
2993
3024
|
scope: options.scope,
|
|
2994
3025
|
cwd: process.cwd(),
|
|
@@ -3030,9 +3061,8 @@ export function registerPluginCommand(program) {
|
|
|
3030
3061
|
"refusing provenance mutation without --yes after reviewing the signed plan",
|
|
3031
3062
|
);
|
|
3032
3063
|
}
|
|
3033
|
-
const { migratePluginProvenance } =
|
|
3034
|
-
"../lib/plugin-runtime/install.js"
|
|
3035
|
-
);
|
|
3064
|
+
const { migratePluginProvenance } =
|
|
3065
|
+
await import("../lib/plugin-runtime/install.js");
|
|
3036
3066
|
const result = migratePluginProvenance(name, {
|
|
3037
3067
|
scope: options.scope,
|
|
3038
3068
|
cwd: process.cwd(),
|
|
@@ -3076,9 +3106,8 @@ export function registerPluginCommand(program) {
|
|
|
3076
3106
|
.option("--json", "Output the versioned artifact readback as JSON")
|
|
3077
3107
|
.action(async (name, options) => {
|
|
3078
3108
|
try {
|
|
3079
|
-
const { listInstalled, readSourceMetadataStrict } =
|
|
3080
|
-
"../lib/plugin-runtime/install.js"
|
|
3081
|
-
);
|
|
3109
|
+
const { listInstalled, readSourceMetadataStrict } =
|
|
3110
|
+
await import("../lib/plugin-runtime/install.js");
|
|
3082
3111
|
const installed = listInstalled({
|
|
3083
3112
|
cwd: process.cwd(),
|
|
3084
3113
|
scopes: [options.scope],
|
|
@@ -3098,9 +3127,8 @@ export function registerPluginCommand(program) {
|
|
|
3098
3127
|
required: true,
|
|
3099
3128
|
requireRegistryAuthority: true,
|
|
3100
3129
|
});
|
|
3101
|
-
const { buildPluginMarketplaceArtifactReadback } =
|
|
3102
|
-
"../lib/plugin-runtime/marketplace-artifact-readback.js"
|
|
3103
|
-
);
|
|
3130
|
+
const { buildPluginMarketplaceArtifactReadback } =
|
|
3131
|
+
await import("../lib/plugin-runtime/marketplace-artifact-readback.js");
|
|
3104
3132
|
const evidence = buildPluginMarketplaceArtifactReadback({
|
|
3105
3133
|
root: installed.dir,
|
|
3106
3134
|
scope: installed.scope,
|
|
@@ -3173,12 +3201,10 @@ export function registerPluginCommand(program) {
|
|
|
3173
3201
|
.option("--scope <scope>", "Scope of the plugin", "project")
|
|
3174
3202
|
.option("--list", "List all trusted plugins instead")
|
|
3175
3203
|
.action(async (name, options) => {
|
|
3176
|
-
const { trustPlugin, listTrust } =
|
|
3177
|
-
"../lib/plugin-runtime/trust.js"
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
"../lib/plugin-runtime/install.js"
|
|
3181
|
-
);
|
|
3204
|
+
const { trustPlugin, listTrust } =
|
|
3205
|
+
await import("../lib/plugin-runtime/trust.js");
|
|
3206
|
+
const { getActiveVersion } =
|
|
3207
|
+
await import("../lib/plugin-runtime/install.js");
|
|
3182
3208
|
if (options.list) {
|
|
3183
3209
|
for (const t of listTrust()) {
|
|
3184
3210
|
logger.log(` ${chalk.cyan(t.name)} v${t.version} [${t.scope}]`);
|
|
@@ -3233,12 +3259,10 @@ export function registerPluginCommand(program) {
|
|
|
3233
3259
|
.option("--list", "List all capability consent entries")
|
|
3234
3260
|
.option("--json", "Output as JSON")
|
|
3235
3261
|
.action(async (name, options) => {
|
|
3236
|
-
const consent =
|
|
3237
|
-
"../lib/plugin-runtime/capability-consent.js"
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
"../lib/plugin-runtime/capabilities.js"
|
|
3241
|
-
);
|
|
3262
|
+
const consent =
|
|
3263
|
+
await import("../lib/plugin-runtime/capability-consent.js");
|
|
3264
|
+
const { describeCapabilities } =
|
|
3265
|
+
await import("../lib/plugin-runtime/capabilities.js");
|
|
3242
3266
|
|
|
3243
3267
|
if (!name || options.list) {
|
|
3244
3268
|
const rows = consent.listCapabilityConsent();
|
|
@@ -3275,9 +3299,8 @@ export function registerPluginCommand(program) {
|
|
|
3275
3299
|
}
|
|
3276
3300
|
|
|
3277
3301
|
// Resolve the installed plugin + its declared capabilities.
|
|
3278
|
-
const { discoverPlugins } =
|
|
3279
|
-
"../lib/plugin-runtime/scopes.js"
|
|
3280
|
-
);
|
|
3302
|
+
const { discoverPlugins } =
|
|
3303
|
+
await import("../lib/plugin-runtime/scopes.js");
|
|
3281
3304
|
let installed = null;
|
|
3282
3305
|
try {
|
|
3283
3306
|
installed = discoverPlugins({
|
|
@@ -3394,9 +3417,8 @@ export function registerPluginCommand(program) {
|
|
|
3394
3417
|
)
|
|
3395
3418
|
.option("--json", "Output as JSON")
|
|
3396
3419
|
.action(async (name, options) => {
|
|
3397
|
-
const { discoverPlugins } =
|
|
3398
|
-
"../lib/plugin-runtime/scopes.js"
|
|
3399
|
-
);
|
|
3420
|
+
const { discoverPlugins } =
|
|
3421
|
+
await import("../lib/plugin-runtime/scopes.js");
|
|
3400
3422
|
const optsMod = await import("../lib/plugin-runtime/plugin-options.js");
|
|
3401
3423
|
|
|
3402
3424
|
let installed = null;
|
|
@@ -3498,9 +3520,8 @@ export function registerPluginCommand(program) {
|
|
|
3498
3520
|
.option("--run", "Actually run the monitors for a few seconds, then reap")
|
|
3499
3521
|
.option("--seconds <n>", "With --run: how long to run", "3")
|
|
3500
3522
|
.action(async (options) => {
|
|
3501
|
-
const { collectPluginMonitors } =
|
|
3502
|
-
"../lib/plugin-runtime/monitors.js"
|
|
3503
|
-
);
|
|
3523
|
+
const { collectPluginMonitors } =
|
|
3524
|
+
await import("../lib/plugin-runtime/monitors.js");
|
|
3504
3525
|
const monitors = collectPluginMonitors({ cwd: process.cwd() });
|
|
3505
3526
|
if (options.json && !options.run) {
|
|
3506
3527
|
console.log(JSON.stringify(monitors, null, 2));
|
|
@@ -3524,9 +3545,8 @@ export function registerPluginCommand(program) {
|
|
|
3524
3545
|
}
|
|
3525
3546
|
if (!options.run) return;
|
|
3526
3547
|
|
|
3527
|
-
const { PluginMonitorSupervisor } =
|
|
3528
|
-
"../lib/plugin-monitor-supervisor.js"
|
|
3529
|
-
);
|
|
3548
|
+
const { PluginMonitorSupervisor } =
|
|
3549
|
+
await import("../lib/plugin-monitor-supervisor.js");
|
|
3530
3550
|
const secs = Math.max(1, parseInt(options.seconds, 10) || 3);
|
|
3531
3551
|
const sup = new PluginMonitorSupervisor();
|
|
3532
3552
|
const started = sup.start(monitors);
|
|
@@ -3556,9 +3576,8 @@ export function registerPluginCommand(program) {
|
|
|
3556
3576
|
"Approve a different-source fallback when removing the active version",
|
|
3557
3577
|
)
|
|
3558
3578
|
.action(async (name, options) => {
|
|
3559
|
-
const { listInstalled, uninstall } =
|
|
3560
|
-
"../lib/plugin-runtime/install.js"
|
|
3561
|
-
);
|
|
3579
|
+
const { listInstalled, uninstall } =
|
|
3580
|
+
await import("../lib/plugin-runtime/install.js");
|
|
3562
3581
|
try {
|
|
3563
3582
|
const blockedRow = listInstalled({
|
|
3564
3583
|
cwd: process.cwd(),
|
|
@@ -3664,11 +3683,11 @@ export function registerPluginCommand(program) {
|
|
|
3664
3683
|
let remoteArtifacts = null;
|
|
3665
3684
|
let archiveSourceAuthority = null;
|
|
3666
3685
|
let commandSourceAuthority = null;
|
|
3686
|
+
let installCommand = null;
|
|
3667
3687
|
let registryResolutionAuthority = null;
|
|
3668
3688
|
const registryUrls = normalizeRegistryUrls(options.registry);
|
|
3669
|
-
const { isRemoteSource, resolveRemoteSource } =
|
|
3670
|
-
"../lib/plugin-runtime/remote-source.js"
|
|
3671
|
-
);
|
|
3689
|
+
const { isRemoteSource, resolveRemoteSource } =
|
|
3690
|
+
await import("../lib/plugin-runtime/remote-source.js");
|
|
3672
3691
|
if (
|
|
3673
3692
|
options.offline === true &&
|
|
3674
3693
|
registryUrls.length === 0 &&
|
|
@@ -3817,6 +3836,7 @@ export function registerPluginCommand(program) {
|
|
|
3817
3836
|
marketplacePreflight,
|
|
3818
3837
|
);
|
|
3819
3838
|
installSource = resolved.source;
|
|
3839
|
+
installCommand = resolved.installCommand || null;
|
|
3820
3840
|
archiveSourceAuthority = resolved.archiveAuthority || null;
|
|
3821
3841
|
commandSourceAuthority = resolved.commandAuthority || null;
|
|
3822
3842
|
registryResolutionAuthority =
|
|
@@ -3861,6 +3881,16 @@ export function registerPluginCommand(program) {
|
|
|
3861
3881
|
}
|
|
3862
3882
|
} catch (err) {
|
|
3863
3883
|
logger.error(`Registry resolution failed: ${err.message}`);
|
|
3884
|
+
if (options.json && (err.installCommand || installCommand)) {
|
|
3885
|
+
console.log(
|
|
3886
|
+
JSON.stringify({
|
|
3887
|
+
error: { code: err.code || "CC_PLUGIN_UPGRADE_FAILED" },
|
|
3888
|
+
installCommand: normalizeInstallCommandResult(
|
|
3889
|
+
err.installCommand || installCommand,
|
|
3890
|
+
),
|
|
3891
|
+
}),
|
|
3892
|
+
);
|
|
3893
|
+
}
|
|
3864
3894
|
process.exitCode = 1;
|
|
3865
3895
|
return;
|
|
3866
3896
|
}
|
|
@@ -4058,6 +4088,9 @@ export function registerPluginCommand(program) {
|
|
|
4058
4088
|
marketplacePreflight,
|
|
4059
4089
|
marketplaceImpact,
|
|
4060
4090
|
marketplaceAuthorityPersisted,
|
|
4091
|
+
installCommand: normalizeInstallCommandResult(
|
|
4092
|
+
res.installCommand || installCommand,
|
|
4093
|
+
),
|
|
4061
4094
|
capabilities: upgradeNotice,
|
|
4062
4095
|
capabilitiesGranted,
|
|
4063
4096
|
activationStatus,
|
|
@@ -4134,6 +4167,16 @@ export function registerPluginCommand(program) {
|
|
|
4134
4167
|
}
|
|
4135
4168
|
}
|
|
4136
4169
|
logger.error(`Upgrade failed: ${err.message}${recoveryNote}`);
|
|
4170
|
+
if (options.json && (err.installCommand || installCommand)) {
|
|
4171
|
+
console.log(
|
|
4172
|
+
JSON.stringify({
|
|
4173
|
+
error: { code: err.code || "CC_PLUGIN_UPGRADE_FAILED" },
|
|
4174
|
+
installCommand: normalizeInstallCommandResult(
|
|
4175
|
+
err.installCommand || installCommand,
|
|
4176
|
+
),
|
|
4177
|
+
}),
|
|
4178
|
+
);
|
|
4179
|
+
}
|
|
4137
4180
|
process.exitCode = 1;
|
|
4138
4181
|
} finally {
|
|
4139
4182
|
cleanupRegistryRemoteArtifacts(remoteArtifacts);
|
|
@@ -4150,9 +4193,8 @@ export function registerPluginCommand(program) {
|
|
|
4150
4193
|
"Approve activating an installed version from a different source",
|
|
4151
4194
|
)
|
|
4152
4195
|
.action(async (name, version, options) => {
|
|
4153
|
-
const { setActiveVersion } =
|
|
4154
|
-
"../lib/plugin-runtime/install.js"
|
|
4155
|
-
);
|
|
4196
|
+
const { setActiveVersion } =
|
|
4197
|
+
await import("../lib/plugin-runtime/install.js");
|
|
4156
4198
|
try {
|
|
4157
4199
|
setActiveVersion(name, version, {
|
|
4158
4200
|
scope: options.scope,
|