@linghun/tui 0.1.0
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/LICENSE +190 -0
- package/dist/agent-completion-finalizer.d.ts +31 -0
- package/dist/agent-completion-finalizer.d.ts.map +1 -0
- package/dist/agent-completion-finalizer.js +20 -0
- package/dist/agent-handoff-safety.d.ts +13 -0
- package/dist/agent-handoff-safety.d.ts.map +1 -0
- package/dist/agent-handoff-safety.js +43 -0
- package/dist/agent-workflow-registry.d.ts +45 -0
- package/dist/agent-workflow-registry.d.ts.map +1 -0
- package/dist/agent-workflow-registry.js +12 -0
- package/dist/architecture-boundary.d.ts +151 -0
- package/dist/architecture-boundary.d.ts.map +1 -0
- package/dist/architecture-boundary.js +24 -0
- package/dist/architecture-runtime.d.ts +56 -0
- package/dist/architecture-runtime.d.ts.map +1 -0
- package/dist/architecture-runtime.js +18 -0
- package/dist/background-control-runtime.d.ts +29 -0
- package/dist/background-control-runtime.d.ts.map +1 -0
- package/dist/background-control-runtime.js +148 -0
- package/dist/bash-subcommand-parser.d.ts +34 -0
- package/dist/bash-subcommand-parser.d.ts.map +1 -0
- package/dist/bash-subcommand-parser.js +8 -0
- package/dist/batch-tool-confirmation.d.ts +18 -0
- package/dist/batch-tool-confirmation.d.ts.map +1 -0
- package/dist/batch-tool-confirmation.js +100 -0
- package/dist/break-cache-runtime.d.ts +40 -0
- package/dist/break-cache-runtime.d.ts.map +1 -0
- package/dist/break-cache-runtime.js +17 -0
- package/dist/btw-runtime.d.ts +45 -0
- package/dist/btw-runtime.d.ts.map +1 -0
- package/dist/btw-runtime.js +14 -0
- package/dist/cache-command-runtime.d.ts +22 -0
- package/dist/cache-command-runtime.d.ts.map +1 -0
- package/dist/cache-command-runtime.js +33 -0
- package/dist/cache-freshness.d.ts +26 -0
- package/dist/cache-freshness.d.ts.map +1 -0
- package/dist/cache-freshness.js +14 -0
- package/dist/capability-runtime.d.ts +75 -0
- package/dist/capability-runtime.d.ts.map +1 -0
- package/dist/capability-runtime.js +97 -0
- package/dist/chunk-2FVEKTKN.js +86 -0
- package/dist/chunk-2YL5VKJ5.js +531 -0
- package/dist/chunk-3AKXDMVS.js +85 -0
- package/dist/chunk-3GCIXKCI.js +221 -0
- package/dist/chunk-3LT6OWQ2.js +258 -0
- package/dist/chunk-3XNUDLOM.js +91 -0
- package/dist/chunk-4EIC5BCT.js +475 -0
- package/dist/chunk-4EP3TUFF.js +238 -0
- package/dist/chunk-4I2NWBOM.js +117 -0
- package/dist/chunk-4K6UB524.js +443 -0
- package/dist/chunk-4T5DJW54.js +88 -0
- package/dist/chunk-4WHZ6JKD.js +8105 -0
- package/dist/chunk-5H7RRF7C.js +6 -0
- package/dist/chunk-64MJP6FK.js +558 -0
- package/dist/chunk-66BNE332.js +1617 -0
- package/dist/chunk-6CI6TKLN.js +50 -0
- package/dist/chunk-6RJVTUWI.js +16 -0
- package/dist/chunk-6SMM5CMP.js +100 -0
- package/dist/chunk-6USL33ZO.js +289 -0
- package/dist/chunk-7ZE5JFAZ.js +760 -0
- package/dist/chunk-AKPXMCVF.js +1373 -0
- package/dist/chunk-AO4CXI37.js +284 -0
- package/dist/chunk-APJIC2O5.js +150 -0
- package/dist/chunk-B4GQTZMT.js +607 -0
- package/dist/chunk-BFVPLGAC.js +93 -0
- package/dist/chunk-BOV4K7FP.js +588 -0
- package/dist/chunk-CFMSB6ST.js +59 -0
- package/dist/chunk-CFXB5SE5.js +502 -0
- package/dist/chunk-CRQORMFF.js +32 -0
- package/dist/chunk-CRSLDQOA.js +146 -0
- package/dist/chunk-CRW3636S.js +214 -0
- package/dist/chunk-D3UTL2QX.js +86 -0
- package/dist/chunk-D7TCSOAZ.js +331 -0
- package/dist/chunk-DDXS2RDZ.js +228 -0
- package/dist/chunk-DICVLZHH.js +144 -0
- package/dist/chunk-DNQN74CC.js +1186 -0
- package/dist/chunk-DTK5NBTV.js +912 -0
- package/dist/chunk-E72U7WW7.js +50 -0
- package/dist/chunk-EBACIBJP.js +356 -0
- package/dist/chunk-ECFLCY5V.js +530 -0
- package/dist/chunk-EORRZP3F.js +109 -0
- package/dist/chunk-F43AMWLZ.js +115 -0
- package/dist/chunk-F46N43MG.js +56 -0
- package/dist/chunk-F6TVBCZV.js +51 -0
- package/dist/chunk-FRIMDSRU.js +242 -0
- package/dist/chunk-FTAEPAVY.js +314 -0
- package/dist/chunk-GC55DMZV.js +156 -0
- package/dist/chunk-GCMH5P4W.js +422 -0
- package/dist/chunk-GDQQNPBP.js +251 -0
- package/dist/chunk-GKZYTPN2.js +279 -0
- package/dist/chunk-GLWTWEGX.js +272 -0
- package/dist/chunk-GMUCSNUD.js +586 -0
- package/dist/chunk-GTP2KPLY.js +167 -0
- package/dist/chunk-GW5YDCRZ.js +42 -0
- package/dist/chunk-H3T4EF5F.js +87 -0
- package/dist/chunk-HAEU6OTS.js +381 -0
- package/dist/chunk-HQIJGQYU.js +172 -0
- package/dist/chunk-HW2TBXVK.js +34 -0
- package/dist/chunk-HWD22O6F.js +94 -0
- package/dist/chunk-I3NTAIMF.js +280 -0
- package/dist/chunk-IN42UISW.js +372 -0
- package/dist/chunk-IWUIOLMF.js +82 -0
- package/dist/chunk-J7ZE2JKP.js +283 -0
- package/dist/chunk-JBLVBO3U.js +109 -0
- package/dist/chunk-JDWXC2OQ.js +800 -0
- package/dist/chunk-JGDIO2NF.js +74 -0
- package/dist/chunk-JHGWGH2C.js +182 -0
- package/dist/chunk-JLCPHVBN.js +42 -0
- package/dist/chunk-JO5ANTMR.js +6027 -0
- package/dist/chunk-JPXSFZFC.js +100 -0
- package/dist/chunk-JQCRCDOC.js +1195 -0
- package/dist/chunk-K4FSYBSY.js +41 -0
- package/dist/chunk-K56D3X7S.js +1225 -0
- package/dist/chunk-KI7C6ZOD.js +92 -0
- package/dist/chunk-KO64OFSG.js +58 -0
- package/dist/chunk-KQJHVJZB.js +227 -0
- package/dist/chunk-KTWV5JC5.js +59 -0
- package/dist/chunk-L4XXW6Y5.js +374 -0
- package/dist/chunk-L5GOCMZP.js +18 -0
- package/dist/chunk-LDABZV5V.js +278 -0
- package/dist/chunk-LHHKPGLX.js +903 -0
- package/dist/chunk-LL7LBRDL.js +60 -0
- package/dist/chunk-LQTVYUT3.js +421 -0
- package/dist/chunk-LVIM2PA7.js +663 -0
- package/dist/chunk-M4AIK2SP.js +215 -0
- package/dist/chunk-MLUIOBKL.js +420 -0
- package/dist/chunk-MOJL4X4L.js +47 -0
- package/dist/chunk-MVONSJEN.js +300 -0
- package/dist/chunk-N7G2X2LK.js +709 -0
- package/dist/chunk-NKFKOEYX.js +146 -0
- package/dist/chunk-NMNOAFFT.js +167 -0
- package/dist/chunk-NSIKYD3X.js +74 -0
- package/dist/chunk-O7EFPSMC.js +60 -0
- package/dist/chunk-O7S3HYE6.js +210 -0
- package/dist/chunk-OEYW3JE3.js +262 -0
- package/dist/chunk-OF3K3CU5.js +159 -0
- package/dist/chunk-OMZYPQVA.js +298 -0
- package/dist/chunk-OZMX3E35.js +248 -0
- package/dist/chunk-P277M7Z5.js +303 -0
- package/dist/chunk-P4CPRJLI.js +65 -0
- package/dist/chunk-PBIPV4LD.js +494 -0
- package/dist/chunk-PGNALDEH.js +2003 -0
- package/dist/chunk-PGWW3DVE.js +157 -0
- package/dist/chunk-QB4VWH7W.js +515 -0
- package/dist/chunk-QBCGAIU7.js +120 -0
- package/dist/chunk-QIU3FJPC.js +99 -0
- package/dist/chunk-QLRTQHTR.js +744 -0
- package/dist/chunk-QTDGRZMZ.js +171 -0
- package/dist/chunk-RBOQJFIZ.js +183 -0
- package/dist/chunk-RDGM4RUE.js +178 -0
- package/dist/chunk-RM5JDRCW.js +71 -0
- package/dist/chunk-RM5QMOFY.js +189 -0
- package/dist/chunk-RMLTVKOY.js +588 -0
- package/dist/chunk-RVY34HK4.js +79 -0
- package/dist/chunk-S3YWTBXL.js +43 -0
- package/dist/chunk-SJOS5PM6.js +64 -0
- package/dist/chunk-SOPYWTFV.js +90 -0
- package/dist/chunk-SQIBPLLV.js +15 -0
- package/dist/chunk-SRZIA6B4.js +136 -0
- package/dist/chunk-SYBNJZEL.js +250 -0
- package/dist/chunk-TFZEFIQT.js +17 -0
- package/dist/chunk-THZBFYAH.js +136 -0
- package/dist/chunk-TJLC3QAS.js +83 -0
- package/dist/chunk-TYF4GJR3.js +598 -0
- package/dist/chunk-UDQT5CWK.js +252 -0
- package/dist/chunk-UOHZQIVL.js +168 -0
- package/dist/chunk-URNQUECO.js +187 -0
- package/dist/chunk-UT2TYK2A.js +148 -0
- package/dist/chunk-UT5BOJKU.js +190 -0
- package/dist/chunk-V7GDHHBL.js +526 -0
- package/dist/chunk-VCSRBS47.js +133 -0
- package/dist/chunk-VIBENDE3.js +152 -0
- package/dist/chunk-VTQL23UM.js +302 -0
- package/dist/chunk-W3KHJNSH.js +281 -0
- package/dist/chunk-W6NU7ZAV.js +52 -0
- package/dist/chunk-WHFDDZHY.js +407 -0
- package/dist/chunk-WJWYRBWH.js +48 -0
- package/dist/chunk-WKMBK5UP.js +145 -0
- package/dist/chunk-WQMSRO4D.js +489 -0
- package/dist/chunk-WV6YJGZR.js +81 -0
- package/dist/chunk-WVAQYKGL.js +269 -0
- package/dist/chunk-X7A22JHP.js +106 -0
- package/dist/chunk-XFPNU42I.js +59 -0
- package/dist/chunk-YH6UIHNF.js +161 -0
- package/dist/chunk-YPQFSFYK.js +19 -0
- package/dist/chunk-YTQFOZRZ.js +110 -0
- package/dist/chunk-ZJK25VFP.js +506 -0
- package/dist/chunk-ZOSK2UEU.js +1555 -0
- package/dist/chunk-ZYSN7AWW.js +336 -0
- package/dist/chunk-ZZ2CNCXJ.js +282 -0
- package/dist/command-panel-runtime.d.ts +33 -0
- package/dist/command-panel-runtime.d.ts.map +1 -0
- package/dist/command-panel-runtime.js +80 -0
- package/dist/compact-cache-command-runtime.d.ts +38 -0
- package/dist/compact-cache-command-runtime.d.ts.map +1 -0
- package/dist/compact-cache-command-runtime.js +146 -0
- package/dist/compact-context.d.ts +35 -0
- package/dist/compact-context.d.ts.map +1 -0
- package/dist/compact-context.js +16 -0
- package/dist/compact-preflight-runtime.d.ts +46 -0
- package/dist/compact-preflight-runtime.d.ts.map +1 -0
- package/dist/compact-preflight-runtime.js +62 -0
- package/dist/connector-runtime.d.ts +72 -0
- package/dist/connector-runtime.d.ts.map +1 -0
- package/dist/connector-runtime.js +88 -0
- package/dist/context-estimator.d.ts +20 -0
- package/dist/context-estimator.d.ts.map +1 -0
- package/dist/context-estimator.js +18 -0
- package/dist/context-window-runtime.d.ts +12 -0
- package/dist/context-window-runtime.d.ts.map +1 -0
- package/dist/context-window-runtime.js +10 -0
- package/dist/deep-compact-runtime.d.ts +53 -0
- package/dist/deep-compact-runtime.d.ts.map +1 -0
- package/dist/deep-compact-runtime.js +35 -0
- package/dist/deferred-tools-catalog.d.ts +52 -0
- package/dist/deferred-tools-catalog.d.ts.map +1 -0
- package/dist/deferred-tools-catalog.js +42 -0
- package/dist/details-status-runtime.d.ts +48 -0
- package/dist/details-status-runtime.d.ts.map +1 -0
- package/dist/details-status-runtime.js +102 -0
- package/dist/evidence-runtime.d.ts +48 -0
- package/dist/evidence-runtime.d.ts.map +1 -0
- package/dist/evidence-runtime.js +92 -0
- package/dist/extension-command-runtime.d.ts +63 -0
- package/dist/extension-command-runtime.d.ts.map +1 -0
- package/dist/extension-command-runtime.js +67 -0
- package/dist/extension-slash-runtime.d.ts +11 -0
- package/dist/extension-slash-runtime.d.ts.map +1 -0
- package/dist/extension-slash-runtime.js +79 -0
- package/dist/external-editor-runtime.d.ts +32 -0
- package/dist/external-editor-runtime.d.ts.map +1 -0
- package/dist/external-editor-runtime.js +71 -0
- package/dist/failure-learning-command-runtime.d.ts +10 -0
- package/dist/failure-learning-command-runtime.d.ts.map +1 -0
- package/dist/failure-learning-command-runtime.js +78 -0
- package/dist/failure-learning-presenter.d.ts +6 -0
- package/dist/failure-learning-presenter.d.ts.map +1 -0
- package/dist/failure-learning-presenter.js +12 -0
- package/dist/failure-learning-runtime.d.ts +39 -0
- package/dist/failure-learning-runtime.d.ts.map +1 -0
- package/dist/failure-learning-runtime.js +39 -0
- package/dist/feature-flag-runtime.d.ts +8 -0
- package/dist/feature-flag-runtime.d.ts.map +1 -0
- package/dist/feature-flag-runtime.js +12 -0
- package/dist/feishu-long-connection-runtime.d.ts +12 -0
- package/dist/feishu-long-connection-runtime.d.ts.map +1 -0
- package/dist/feishu-long-connection-runtime.js +7 -0
- package/dist/final-answer-gate.d.ts +24 -0
- package/dist/final-answer-gate.d.ts.map +1 -0
- package/dist/final-answer-gate.js +26 -0
- package/dist/ghost-text.d.ts +16 -0
- package/dist/ghost-text.d.ts.map +1 -0
- package/dist/ghost-text.js +8 -0
- package/dist/git-branch-runtime.d.ts +14 -0
- package/dist/git-branch-runtime.d.ts.map +1 -0
- package/dist/git-branch-runtime.js +68 -0
- package/dist/git-command-runtime.d.ts +22 -0
- package/dist/git-command-runtime.d.ts.map +1 -0
- package/dist/git-command-runtime.js +89 -0
- package/dist/git-operation-runtime.d.ts +188 -0
- package/dist/git-operation-runtime.d.ts.map +1 -0
- package/dist/git-operation-runtime.js +45 -0
- package/dist/git-runtime.d.ts +113 -0
- package/dist/git-runtime.d.ts.map +1 -0
- package/dist/git-runtime.js +16 -0
- package/dist/git-slash-runtime.d.ts +38 -0
- package/dist/git-slash-runtime.d.ts.map +1 -0
- package/dist/git-slash-runtime.js +18 -0
- package/dist/git-tool-dispatch-runtime.d.ts +108 -0
- package/dist/git-tool-dispatch-runtime.d.ts.map +1 -0
- package/dist/git-tool-dispatch-runtime.js +25 -0
- package/dist/git-tool-runtime.d.ts +64 -0
- package/dist/git-tool-runtime.d.ts.map +1 -0
- package/dist/git-tool-runtime.js +36 -0
- package/dist/guard-wiring.d.ts +67 -0
- package/dist/guard-wiring.d.ts.map +1 -0
- package/dist/guard-wiring.js +21 -0
- package/dist/handoff-session-runtime.d.ts +11 -0
- package/dist/handoff-session-runtime.d.ts.map +1 -0
- package/dist/handoff-session-runtime.js +36 -0
- package/dist/index-result-presenter.d.ts +14 -0
- package/dist/index-result-presenter.d.ts.map +1 -0
- package/dist/index-result-presenter.js +28 -0
- package/dist/index-runtime.d.ts +64 -0
- package/dist/index-runtime.d.ts.map +1 -0
- package/dist/index-runtime.js +28 -0
- package/dist/index-tool-runtime.d.ts +44 -0
- package/dist/index-tool-runtime.d.ts.map +1 -0
- package/dist/index-tool-runtime.js +24 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2346 -0
- package/dist/job-agent-command-runtime.d.ts +127 -0
- package/dist/job-agent-command-runtime.d.ts.map +1 -0
- package/dist/job-agent-command-runtime.js +138 -0
- package/dist/job-runner-presenter.d.ts +32 -0
- package/dist/job-runner-presenter.d.ts.map +1 -0
- package/dist/job-runner-presenter.js +30 -0
- package/dist/job-runtime.d.ts +65 -0
- package/dist/job-runtime.d.ts.map +1 -0
- package/dist/job-runtime.js +88 -0
- package/dist/keybinding-runtime.d.ts +29 -0
- package/dist/keybinding-runtime.d.ts.map +1 -0
- package/dist/keybinding-runtime.js +14 -0
- package/dist/log-artifact.d.ts +55 -0
- package/dist/log-artifact.d.ts.map +1 -0
- package/dist/log-artifact.js +10 -0
- package/dist/mcp-index-command-runtime.d.ts +21 -0
- package/dist/mcp-index-command-runtime.d.ts.map +1 -0
- package/dist/mcp-index-command-runtime.js +18 -0
- package/dist/mcp-index-runtime.d.ts +106 -0
- package/dist/mcp-index-runtime.d.ts.map +1 -0
- package/dist/mcp-index-runtime.js +142 -0
- package/dist/mcp-sse-runtime.d.ts +13 -0
- package/dist/mcp-sse-runtime.d.ts.map +1 -0
- package/dist/mcp-sse-runtime.js +8 -0
- package/dist/mcp-stdio-runtime.d.ts +37 -0
- package/dist/mcp-stdio-runtime.d.ts.map +1 -0
- package/dist/mcp-stdio-runtime.js +15 -0
- package/dist/memory-command-runtime.d.ts +37 -0
- package/dist/memory-command-runtime.d.ts.map +1 -0
- package/dist/memory-command-runtime.js +88 -0
- package/dist/memory-eviction-runtime.d.ts +7 -0
- package/dist/memory-eviction-runtime.d.ts.map +1 -0
- package/dist/memory-eviction-runtime.js +12 -0
- package/dist/memory-extraction-runtime.d.ts +40 -0
- package/dist/memory-extraction-runtime.d.ts.map +1 -0
- package/dist/memory-extraction-runtime.js +20 -0
- package/dist/memory-rules-runtime.d.ts +15 -0
- package/dist/memory-rules-runtime.d.ts.map +1 -0
- package/dist/memory-rules-runtime.js +14 -0
- package/dist/meta-scheduler-complexity.d.ts +16 -0
- package/dist/meta-scheduler-complexity.d.ts.map +1 -0
- package/dist/meta-scheduler-complexity.js +37 -0
- package/dist/meta-scheduler-runtime.d.ts +288 -0
- package/dist/meta-scheduler-runtime.d.ts.map +1 -0
- package/dist/meta-scheduler-runtime.js +17 -0
- package/dist/model-command-runtime.d.ts +12 -0
- package/dist/model-command-runtime.d.ts.map +1 -0
- package/dist/model-command-runtime.js +84 -0
- package/dist/model-doctor-runtime.d.ts +81 -0
- package/dist/model-doctor-runtime.d.ts.map +1 -0
- package/dist/model-doctor-runtime.js +46 -0
- package/dist/model-loop-runtime.d.ts +189 -0
- package/dist/model-loop-runtime.d.ts.map +1 -0
- package/dist/model-loop-runtime.js +141 -0
- package/dist/model-prompt-runtime.d.ts +25 -0
- package/dist/model-prompt-runtime.d.ts.map +1 -0
- package/dist/model-prompt-runtime.js +33 -0
- package/dist/model-setup-runtime.d.ts +28 -0
- package/dist/model-setup-runtime.d.ts.map +1 -0
- package/dist/model-setup-runtime.js +26 -0
- package/dist/model-stream-runtime.d.ts +47 -0
- package/dist/model-stream-runtime.d.ts.map +1 -0
- package/dist/model-stream-runtime.js +136 -0
- package/dist/model-tool-runtime.d.ts +114 -0
- package/dist/model-tool-runtime.d.ts.map +1 -0
- package/dist/model-tool-runtime.js +144 -0
- package/dist/natural-command-bridge.d.ts +158 -0
- package/dist/natural-command-bridge.d.ts.map +1 -0
- package/dist/natural-command-bridge.js +36 -0
- package/dist/pending-details-presenter.d.ts +8 -0
- package/dist/pending-details-presenter.d.ts.map +1 -0
- package/dist/pending-details-presenter.js +12 -0
- package/dist/permission-approval-runtime.d.ts +28 -0
- package/dist/permission-approval-runtime.d.ts.map +1 -0
- package/dist/permission-approval-runtime.js +136 -0
- package/dist/permission-continuation-runtime.d.ts +90 -0
- package/dist/permission-continuation-runtime.d.ts.map +1 -0
- package/dist/permission-continuation-runtime.js +68 -0
- package/dist/permission-policy-engine.d.ts +51 -0
- package/dist/permission-policy-engine.d.ts.map +1 -0
- package/dist/permission-policy-engine.js +12 -0
- package/dist/permission-presenter.d.ts +13 -0
- package/dist/permission-presenter.d.ts.map +1 -0
- package/dist/permission-presenter.js +8 -0
- package/dist/persistent-history.d.ts +18 -0
- package/dist/persistent-history.d.ts.map +1 -0
- package/dist/persistent-history.js +126 -0
- package/dist/platform-security.d.ts +4 -0
- package/dist/platform-security.d.ts.map +1 -0
- package/dist/platform-security.js +10 -0
- package/dist/process-command-runtime.d.ts +9 -0
- package/dist/process-command-runtime.d.ts.map +1 -0
- package/dist/process-command-runtime.js +11 -0
- package/dist/process-guard.d.ts +56 -0
- package/dist/process-guard.d.ts.map +1 -0
- package/dist/process-guard.js +22 -0
- package/dist/prompt-command-runtime.d.ts +12 -0
- package/dist/prompt-command-runtime.d.ts.map +1 -0
- package/dist/prompt-command-runtime.js +10 -0
- package/dist/prompt-stash.d.ts +15 -0
- package/dist/prompt-stash.d.ts.map +1 -0
- package/dist/prompt-stash.js +8 -0
- package/dist/provider-circuit-breaker.d.ts +132 -0
- package/dist/provider-circuit-breaker.d.ts.map +1 -0
- package/dist/provider-circuit-breaker.js +31 -0
- package/dist/provider-loop-runtime.d.ts +18 -0
- package/dist/provider-loop-runtime.d.ts.map +1 -0
- package/dist/provider-loop-runtime.js +16 -0
- package/dist/remote-command-runtime.d.ts +47 -0
- package/dist/remote-command-runtime.d.ts.map +1 -0
- package/dist/remote-command-runtime.js +125 -0
- package/dist/remote-inbound-bridge-runtime.d.ts +152 -0
- package/dist/remote-inbound-bridge-runtime.d.ts.map +1 -0
- package/dist/remote-inbound-bridge-runtime.js +44 -0
- package/dist/remote-mcp-presenter.d.ts +5 -0
- package/dist/remote-mcp-presenter.d.ts.map +1 -0
- package/dist/remote-mcp-presenter.js +10 -0
- package/dist/remote-repl-bridge-runtime.d.ts +134 -0
- package/dist/remote-repl-bridge-runtime.d.ts.map +1 -0
- package/dist/remote-repl-bridge-runtime.js +20 -0
- package/dist/remote-transport.d.ts +50 -0
- package/dist/remote-transport.d.ts.map +1 -0
- package/dist/remote-transport.js +14 -0
- package/dist/request-lifecycle-presenter.d.ts +25 -0
- package/dist/request-lifecycle-presenter.d.ts.map +1 -0
- package/dist/request-lifecycle-presenter.js +22 -0
- package/dist/runner-runtime.d.ts +41 -0
- package/dist/runner-runtime.d.ts.map +1 -0
- package/dist/runner-runtime.js +35 -0
- package/dist/runtime-budget.d.ts +38 -0
- package/dist/runtime-budget.d.ts.map +1 -0
- package/dist/runtime-budget.js +78 -0
- package/dist/runtime-path-marker.d.ts +112 -0
- package/dist/runtime-path-marker.d.ts.map +1 -0
- package/dist/runtime-path-marker.js +18 -0
- package/dist/runtime-status-presenter.d.ts +22 -0
- package/dist/runtime-status-presenter.d.ts.map +1 -0
- package/dist/runtime-status-presenter.js +15 -0
- package/dist/runtime-status-snapshot.d.ts +52 -0
- package/dist/runtime-status-snapshot.d.ts.map +1 -0
- package/dist/runtime-status-snapshot.js +11 -0
- package/dist/runtime-utils.d.ts +2 -0
- package/dist/runtime-utils.d.ts.map +1 -0
- package/dist/runtime-utils.js +6 -0
- package/dist/shell/clipboard.d.ts +23 -0
- package/dist/shell/clipboard.d.ts.map +1 -0
- package/dist/shell/clipboard.js +8 -0
- package/dist/shell/components/AgentProgressTree.d.ts +9 -0
- package/dist/shell/components/AgentProgressTree.d.ts.map +1 -0
- package/dist/shell/components/AgentProgressTree.js +9 -0
- package/dist/shell/components/BackgroundTaskOverlay.d.ts +8 -0
- package/dist/shell/components/BackgroundTaskOverlay.d.ts.map +1 -0
- package/dist/shell/components/BackgroundTaskOverlay.js +8 -0
- package/dist/shell/components/BtwPanel.d.ts +16 -0
- package/dist/shell/components/BtwPanel.d.ts.map +1 -0
- package/dist/shell/components/BtwPanel.js +8 -0
- package/dist/shell/components/CommandPanel.d.ts +11 -0
- package/dist/shell/components/CommandPanel.d.ts.map +1 -0
- package/dist/shell/components/CommandPanel.js +8 -0
- package/dist/shell/components/Composer.d.ts +187 -0
- package/dist/shell/components/Composer.d.ts.map +1 -0
- package/dist/shell/components/Composer.js +99 -0
- package/dist/shell/components/ConfigPanel.d.ts +11 -0
- package/dist/shell/components/ConfigPanel.d.ts.map +1 -0
- package/dist/shell/components/ConfigPanel.js +8 -0
- package/dist/shell/components/CtrlOToExpand.d.ts +30 -0
- package/dist/shell/components/CtrlOToExpand.d.ts.map +1 -0
- package/dist/shell/components/CtrlOToExpand.js +16 -0
- package/dist/shell/components/HelpPanel.d.ts +19 -0
- package/dist/shell/components/HelpPanel.d.ts.map +1 -0
- package/dist/shell/components/HelpPanel.js +8 -0
- package/dist/shell/components/HistorySearchPanel.d.ts +14 -0
- package/dist/shell/components/HistorySearchPanel.d.ts.map +1 -0
- package/dist/shell/components/HistorySearchPanel.js +104 -0
- package/dist/shell/components/MessageMarkdown.d.ts +34 -0
- package/dist/shell/components/MessageMarkdown.d.ts.map +1 -0
- package/dist/shell/components/MessageMarkdown.js +18 -0
- package/dist/shell/components/MessageResponse.d.ts +14 -0
- package/dist/shell/components/MessageResponse.d.ts.map +1 -0
- package/dist/shell/components/MessageResponse.js +6 -0
- package/dist/shell/components/MouseInputRouter.d.ts +28 -0
- package/dist/shell/components/MouseInputRouter.d.ts.map +1 -0
- package/dist/shell/components/MouseInputRouter.js +84 -0
- package/dist/shell/components/NotificationStack.d.ts +19 -0
- package/dist/shell/components/NotificationStack.d.ts.map +1 -0
- package/dist/shell/components/NotificationStack.js +6 -0
- package/dist/shell/components/OutputLine.d.ts +19 -0
- package/dist/shell/components/OutputLine.d.ts.map +1 -0
- package/dist/shell/components/OutputLine.js +38 -0
- package/dist/shell/components/ProductBlock.d.ts +10 -0
- package/dist/shell/components/ProductBlock.d.ts.map +1 -0
- package/dist/shell/components/ProductBlock.js +12 -0
- package/dist/shell/components/ScrollViewport.d.ts +43 -0
- package/dist/shell/components/ScrollViewport.d.ts.map +1 -0
- package/dist/shell/components/ScrollViewport.js +86 -0
- package/dist/shell/components/SessionsPanel.d.ts +24 -0
- package/dist/shell/components/SessionsPanel.d.ts.map +1 -0
- package/dist/shell/components/SessionsPanel.js +8 -0
- package/dist/shell/components/ShellApp.d.ts +8 -0
- package/dist/shell/components/ShellApp.d.ts.map +1 -0
- package/dist/shell/components/ShellApp.js +45 -0
- package/dist/shell/components/ShortcutPanel.d.ts +14 -0
- package/dist/shell/components/ShortcutPanel.d.ts.map +1 -0
- package/dist/shell/components/ShortcutPanel.js +59 -0
- package/dist/shell/components/SlashSuggestions.d.ts +24 -0
- package/dist/shell/components/SlashSuggestions.d.ts.map +1 -0
- package/dist/shell/components/SlashSuggestions.js +7 -0
- package/dist/shell/components/StatusFooter.d.ts +30 -0
- package/dist/shell/components/StatusFooter.d.ts.map +1 -0
- package/dist/shell/components/StatusFooter.js +7 -0
- package/dist/shell/components/StatusTray.d.ts +9 -0
- package/dist/shell/components/StatusTray.d.ts.map +1 -0
- package/dist/shell/components/StatusTray.js +6 -0
- package/dist/shell/components/StructuredDiff.d.ts +9 -0
- package/dist/shell/components/StructuredDiff.d.ts.map +1 -0
- package/dist/shell/components/StructuredDiff.js +7 -0
- package/dist/shell/components/TaskListView.d.ts +9 -0
- package/dist/shell/components/TaskListView.d.ts.map +1 -0
- package/dist/shell/components/TaskListView.js +9 -0
- package/dist/shell/components/TaskSuggestionBar.d.ts +15 -0
- package/dist/shell/components/TaskSuggestionBar.d.ts.map +1 -0
- package/dist/shell/components/TaskSuggestionBar.js +8 -0
- package/dist/shell/components/UnseenMessagePill.d.ts +12 -0
- package/dist/shell/components/UnseenMessagePill.d.ts.map +1 -0
- package/dist/shell/components/UnseenMessagePill.js +6 -0
- package/dist/shell/components/WorkflowProgressView.d.ts +9 -0
- package/dist/shell/components/WorkflowProgressView.d.ts.map +1 -0
- package/dist/shell/components/WorkflowProgressView.js +9 -0
- package/dist/shell/components/useAnchoredCursor.d.ts +32 -0
- package/dist/shell/components/useAnchoredCursor.d.ts.map +1 -0
- package/dist/shell/components/useAnchoredCursor.js +6 -0
- package/dist/shell/hooks/useRenderThrottle.d.ts +2 -0
- package/dist/shell/hooks/useRenderThrottle.d.ts.map +1 -0
- package/dist/shell/hooks/useRenderThrottle.js +35 -0
- package/dist/shell/hooks/useScrollBatcher.d.ts +10 -0
- package/dist/shell/hooks/useScrollBatcher.d.ts.map +1 -0
- package/dist/shell/hooks/useScrollBatcher.js +23 -0
- package/dist/shell/hooks/useScrollRuntime.d.ts +2 -0
- package/dist/shell/hooks/useScrollRuntime.d.ts.map +1 -0
- package/dist/shell/hooks/useScrollRuntime.js +6 -0
- package/dist/shell/hyperlink-utils.d.ts +18 -0
- package/dist/shell/hyperlink-utils.d.ts.map +1 -0
- package/dist/shell/hyperlink-utils.js +8 -0
- package/dist/shell/ink-renderer.d.ts +18 -0
- package/dist/shell/ink-renderer.d.ts.map +1 -0
- package/dist/shell/ink-renderer.js +54 -0
- package/dist/shell/models/command-transcript-presenter.d.ts +73 -0
- package/dist/shell/models/command-transcript-presenter.d.ts.map +1 -0
- package/dist/shell/models/command-transcript-presenter.js +26 -0
- package/dist/shell/models/help-panel.d.ts +37 -0
- package/dist/shell/models/help-panel.d.ts.map +1 -0
- package/dist/shell/models/help-panel.js +10 -0
- package/dist/shell/models/permission-elevation.d.ts +65 -0
- package/dist/shell/models/permission-elevation.d.ts.map +1 -0
- package/dist/shell/models/permission-elevation.js +10 -0
- package/dist/shell/models/permission-explanation.d.ts +45 -0
- package/dist/shell/models/permission-explanation.d.ts.map +1 -0
- package/dist/shell/models/permission-explanation.js +14 -0
- package/dist/shell/models/session-panel.d.ts +22 -0
- package/dist/shell/models/session-panel.d.ts.map +1 -0
- package/dist/shell/models/session-panel.js +18 -0
- package/dist/shell/models/task-scroll-state.d.ts +24 -0
- package/dist/shell/models/task-scroll-state.d.ts.map +1 -0
- package/dist/shell/models/task-scroll-state.js +26 -0
- package/dist/shell/models/terminal-input-runtime.d.ts +37 -0
- package/dist/shell/models/terminal-input-runtime.d.ts.map +1 -0
- package/dist/shell/models/terminal-input-runtime.js +18 -0
- package/dist/shell/models/transcript-scroll-state.d.ts +57 -0
- package/dist/shell/models/transcript-scroll-state.d.ts.map +1 -0
- package/dist/shell/models/transcript-scroll-state.js +12 -0
- package/dist/shell/models/transcript-selection-state.d.ts +39 -0
- package/dist/shell/models/transcript-selection-state.d.ts.map +1 -0
- package/dist/shell/models/transcript-selection-state.js +25 -0
- package/dist/shell/models/wheel-acceleration.d.ts +52 -0
- package/dist/shell/models/wheel-acceleration.d.ts.map +1 -0
- package/dist/shell/models/wheel-acceleration.js +6 -0
- package/dist/shell/output-utils.d.ts +22 -0
- package/dist/shell/output-utils.d.ts.map +1 -0
- package/dist/shell/output-utils.js +12 -0
- package/dist/shell/plain-renderer.d.ts +12 -0
- package/dist/shell/plain-renderer.d.ts.map +1 -0
- package/dist/shell/plain-renderer.js +13 -0
- package/dist/shell/progress-views.d.ts +10 -0
- package/dist/shell/progress-views.d.ts.map +1 -0
- package/dist/shell/progress-views.js +17 -0
- package/dist/shell/stdout-flush-barrier.d.ts +39 -0
- package/dist/shell/stdout-flush-barrier.d.ts.map +1 -0
- package/dist/shell/stdout-flush-barrier.js +10 -0
- package/dist/shell/terminal-capability.d.ts +54 -0
- package/dist/shell/terminal-capability.d.ts.map +1 -0
- package/dist/shell/terminal-capability.js +10 -0
- package/dist/shell/terminal-interaction-runtime.d.ts +11 -0
- package/dist/shell/terminal-interaction-runtime.d.ts.map +1 -0
- package/dist/shell/terminal-interaction-runtime.js +38 -0
- package/dist/shell/terminal-state-recovery.d.ts +52 -0
- package/dist/shell/terminal-state-recovery.d.ts.map +1 -0
- package/dist/shell/terminal-state-recovery.js +11 -0
- package/dist/shell/text-utils.d.ts +40 -0
- package/dist/shell/text-utils.d.ts.map +1 -0
- package/dist/shell/text-utils.js +26 -0
- package/dist/shell/theme.d.ts +41 -0
- package/dist/shell/theme.d.ts.map +1 -0
- package/dist/shell/theme.js +8 -0
- package/dist/shell/types.d.ts +784 -0
- package/dist/shell/types.d.ts.map +1 -0
- package/dist/shell/types.js +0 -0
- package/dist/shell/view-model.d.ts +82 -0
- package/dist/shell/view-model.d.ts.map +1 -0
- package/dist/shell/view-model.js +48 -0
- package/dist/slash-command-runtime.d.ts +64 -0
- package/dist/slash-command-runtime.d.ts.map +1 -0
- package/dist/slash-command-runtime.js +186 -0
- package/dist/slash-dispatch.d.ts +48 -0
- package/dist/slash-dispatch.d.ts.map +1 -0
- package/dist/slash-dispatch.js +53 -0
- package/dist/startup-runtime.d.ts +48 -0
- package/dist/startup-runtime.d.ts.map +1 -0
- package/dist/startup-runtime.js +43 -0
- package/dist/terminal-readiness-presenter.d.ts +131 -0
- package/dist/terminal-readiness-presenter.d.ts.map +1 -0
- package/dist/terminal-readiness-presenter.js +16 -0
- package/dist/terminal-readiness-runtime.d.ts +5 -0
- package/dist/terminal-readiness-runtime.d.ts.map +1 -0
- package/dist/terminal-readiness-runtime.js +15 -0
- package/dist/terminal-setup-runtime.d.ts +34 -0
- package/dist/terminal-setup-runtime.d.ts.map +1 -0
- package/dist/terminal-setup-runtime.js +257 -0
- package/dist/tool-output-presenter.d.ts +38 -0
- package/dist/tool-output-presenter.d.ts.map +1 -0
- package/dist/tool-output-presenter.js +16 -0
- package/dist/tool-result-budget.d.ts +42 -0
- package/dist/tool-result-budget.d.ts.map +1 -0
- package/dist/tool-result-budget.js +11 -0
- package/dist/tui-agent-job-runtime.d.ts +38 -0
- package/dist/tui-agent-job-runtime.d.ts.map +1 -0
- package/dist/tui-agent-job-runtime.js +86 -0
- package/dist/tui-context-runtime.d.ts +426 -0
- package/dist/tui-context-runtime.d.ts.map +1 -0
- package/dist/tui-context-runtime.js +65 -0
- package/dist/tui-data-types.d.ts +923 -0
- package/dist/tui-data-types.d.ts.map +1 -0
- package/dist/tui-data-types.js +0 -0
- package/dist/tui-details-runtime.d.ts +25 -0
- package/dist/tui-details-runtime.d.ts.map +1 -0
- package/dist/tui-details-runtime.js +29 -0
- package/dist/tui-memory-runtime.d.ts +33 -0
- package/dist/tui-memory-runtime.d.ts.map +1 -0
- package/dist/tui-memory-runtime.js +58 -0
- package/dist/tui-messages.d.ts +4 -0
- package/dist/tui-messages.d.ts.map +1 -0
- package/dist/tui-messages.js +6 -0
- package/dist/tui-model-runtime.d.ts +30 -0
- package/dist/tui-model-runtime.d.ts.map +1 -0
- package/dist/tui-model-runtime.js +39 -0
- package/dist/tui-output-surface.d.ts +141 -0
- package/dist/tui-output-surface.d.ts.map +1 -0
- package/dist/tui-output-surface.js +55 -0
- package/dist/tui-permission-runtime.d.ts +62 -0
- package/dist/tui-permission-runtime.d.ts.map +1 -0
- package/dist/tui-permission-runtime.js +24 -0
- package/dist/tui-state-runtime.d.ts +21 -0
- package/dist/tui-state-runtime.d.ts.map +1 -0
- package/dist/tui-state-runtime.js +47 -0
- package/dist/turn-continuity-runtime.d.ts +30 -0
- package/dist/turn-continuity-runtime.d.ts.map +1 -0
- package/dist/turn-continuity-runtime.js +8 -0
- package/dist/undo-ring.d.ts +16 -0
- package/dist/undo-ring.d.ts.map +1 -0
- package/dist/undo-ring.js +12 -0
- package/dist/usage-stats-presenter.d.ts +17 -0
- package/dist/usage-stats-presenter.d.ts.map +1 -0
- package/dist/usage-stats-presenter.js +22 -0
- package/dist/user-state-signal-runtime.d.ts +33 -0
- package/dist/user-state-signal-runtime.d.ts.map +1 -0
- package/dist/user-state-signal-runtime.js +8 -0
- package/dist/verification-command-runtime.d.ts +25 -0
- package/dist/verification-command-runtime.d.ts.map +1 -0
- package/dist/verification-command-runtime.js +51 -0
- package/dist/verification-level.d.ts +93 -0
- package/dist/verification-level.d.ts.map +1 -0
- package/dist/verification-level.js +18 -0
- package/dist/workflow-agent-runtime-bridge.d.ts +169 -0
- package/dist/workflow-agent-runtime-bridge.d.ts.map +1 -0
- package/dist/workflow-agent-runtime-bridge.js +9 -0
- package/dist/workflow-command-runtime.d.ts +94 -0
- package/dist/workflow-command-runtime.d.ts.map +1 -0
- package/dist/workflow-command-runtime.js +114 -0
- package/dist/workflow-plan-schema.d.ts +161 -0
- package/dist/workflow-plan-schema.d.ts.map +1 -0
- package/dist/workflow-plan-schema.js +12 -0
- package/dist/workflow-planner-entry.d.ts +52 -0
- package/dist/workflow-planner-entry.d.ts.map +1 -0
- package/dist/workflow-planner-entry.js +328 -0
- package/dist/workflow-task-surface.d.ts +39 -0
- package/dist/workflow-task-surface.d.ts.map +1 -0
- package/dist/workflow-task-surface.js +7 -0
- package/dist/workspace-reference-cache.d.ts +110 -0
- package/dist/workspace-reference-cache.d.ts.map +1 -0
- package/dist/workspace-reference-cache.js +12 -0
- package/package.json +41 -0
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createWorkspaceReferenceCache
|
|
3
|
+
} from "./chunk-ZJK25VFP.js";
|
|
4
|
+
import {
|
|
5
|
+
MEMORY_LEARNING_STATE_FILE
|
|
6
|
+
} from "./chunk-5H7RRF7C.js";
|
|
7
|
+
import {
|
|
8
|
+
createReplBridgeState
|
|
9
|
+
} from "./chunk-4EP3TUFF.js";
|
|
10
|
+
import {
|
|
11
|
+
loadMemoryRulesFile,
|
|
12
|
+
parseMemoryRuleFrontmatter
|
|
13
|
+
} from "./chunk-EORRZP3F.js";
|
|
14
|
+
import {
|
|
15
|
+
createCacheFreshness
|
|
16
|
+
} from "./chunk-4T5DJW54.js";
|
|
17
|
+
import {
|
|
18
|
+
formatError,
|
|
19
|
+
truncateDisplay
|
|
20
|
+
} from "./chunk-OMZYPQVA.js";
|
|
21
|
+
|
|
22
|
+
// src/tui-state-runtime.ts
|
|
23
|
+
import { spawnSync } from "child_process";
|
|
24
|
+
import { readFile, readdir, stat } from "fs/promises";
|
|
25
|
+
import { homedir } from "os";
|
|
26
|
+
import { basename, extname, join, resolve } from "path";
|
|
27
|
+
import {
|
|
28
|
+
resolveStoragePaths
|
|
29
|
+
} from "@linghun/config";
|
|
30
|
+
import { builtInTools } from "@linghun/tools";
|
|
31
|
+
var DEFAULT_CACHE_HISTORY_SIZE = 20;
|
|
32
|
+
var DEFAULT_CACHE_WARN_BELOW_HIT_RATE = 0.75;
|
|
33
|
+
var PROJECT_RULES_SUMMARY_WIDTH = 600;
|
|
34
|
+
function inferProviderForCacheModel(model) {
|
|
35
|
+
if (!model || model === "unknown") return "unknown";
|
|
36
|
+
if (model.startsWith("deepseek-")) return "deepseek";
|
|
37
|
+
return "unknown";
|
|
38
|
+
}
|
|
39
|
+
function createCacheState(projectPath, model = "unknown", mcpToolList = [], config) {
|
|
40
|
+
const freshness = createCacheFreshness({
|
|
41
|
+
systemPrompt: "Linghun interactive terminal with local extensions and workflows",
|
|
42
|
+
toolSchema: builtInTools,
|
|
43
|
+
mcpToolList: stabilizeMcpToolList(mcpToolList),
|
|
44
|
+
model,
|
|
45
|
+
provider: inferProviderForCacheModel(model),
|
|
46
|
+
projectRules: "local CLAUDE.md rules loaded by harness",
|
|
47
|
+
memory: "memory/handoff context not loaded yet",
|
|
48
|
+
compact: "not compacted",
|
|
49
|
+
plugins: []
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
config: {
|
|
53
|
+
maxTurns: DEFAULT_CACHE_HISTORY_SIZE,
|
|
54
|
+
warnBelowHitRate: DEFAULT_CACHE_WARN_BELOW_HIT_RATE,
|
|
55
|
+
persistPath: join(resolveStoragePaths(config, projectPath).cache, "cache-log.json"),
|
|
56
|
+
hintsMuted: false
|
|
57
|
+
},
|
|
58
|
+
history: [],
|
|
59
|
+
nextTurn: 1,
|
|
60
|
+
lastFreshness: freshness,
|
|
61
|
+
hintLastShownAt: {},
|
|
62
|
+
compacted: false,
|
|
63
|
+
compactBoundaries: [],
|
|
64
|
+
compactProjection: void 0,
|
|
65
|
+
deepCompact: void 0,
|
|
66
|
+
compactPressure: void 0,
|
|
67
|
+
compactFailure: void 0,
|
|
68
|
+
compactCooldownUntil: void 0,
|
|
69
|
+
deepCompactCooldownUntil: void 0,
|
|
70
|
+
workspaceReference: createWorkspaceReferenceCache(),
|
|
71
|
+
startedAt: Date.now()
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function createRemoteState(config) {
|
|
75
|
+
return {
|
|
76
|
+
enabled: config.remote.enabled,
|
|
77
|
+
channels: Object.entries(config.remote.channels).map(([id, channel]) => createRemoteChannelState(id, channel, config.remote.enabled)).sort((a, b) => a.id.localeCompare(b.id)),
|
|
78
|
+
events: [],
|
|
79
|
+
processedMessageIds: [],
|
|
80
|
+
sessionDisabledChannelIds: [],
|
|
81
|
+
pairings: [],
|
|
82
|
+
inbox: [],
|
|
83
|
+
localReplBridge: createReplBridgeState()
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function createRemoteChannelState(id, config, remoteEnabled) {
|
|
87
|
+
const active = remoteEnabled && config.enabled;
|
|
88
|
+
const bindingStatus = config.bindingUserId ? "bound" : "unbound";
|
|
89
|
+
const transportStatus = active ? getRemoteTransportStatus(config) : "unknown";
|
|
90
|
+
const disabledReason = active ? void 0 : "remote_disabled";
|
|
91
|
+
const blockedReason = disabledReason ?? getRemoteBlockedReason(config, transportStatus, bindingStatus);
|
|
92
|
+
return {
|
|
93
|
+
id,
|
|
94
|
+
config,
|
|
95
|
+
runtimeStatus: blockedReason ? blockedReason === "remote_disabled" ? "disabled" : "blocked" : "ready",
|
|
96
|
+
bindingStatus,
|
|
97
|
+
transportStatus,
|
|
98
|
+
lastError: blockedReason,
|
|
99
|
+
nextAction: getRemoteNextAction(id, config, blockedReason)
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function applyRemoteSessionDisables(remote) {
|
|
103
|
+
for (const channel of remote.channels) {
|
|
104
|
+
if (!remote.sessionDisabledChannelIds.includes(channel.id)) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
channel.runtimeStatus = "disabled";
|
|
108
|
+
channel.lastError = "disabled_by_user";
|
|
109
|
+
channel.nextAction = `/remote setup ${channel.id}`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function getRemoteTransportStatus(config) {
|
|
113
|
+
if (config.transport === "webhook_mock") {
|
|
114
|
+
return "mock";
|
|
115
|
+
}
|
|
116
|
+
if (config.transport === "webhook") {
|
|
117
|
+
return config.endpoint ? "ready" : "not_configured";
|
|
118
|
+
}
|
|
119
|
+
if (!config.cliPath) {
|
|
120
|
+
return "not_configured";
|
|
121
|
+
}
|
|
122
|
+
const result = spawnSync(config.cliPath, ["--version"], { encoding: "utf8", timeout: 2e3 });
|
|
123
|
+
return result.error ? "missing" : "ready";
|
|
124
|
+
}
|
|
125
|
+
function getRemoteBlockedReason(config, transportStatus, bindingStatus) {
|
|
126
|
+
if (bindingStatus !== "bound") {
|
|
127
|
+
return "not_bound";
|
|
128
|
+
}
|
|
129
|
+
if (config.transport === "official_cli" && transportStatus !== "ready") {
|
|
130
|
+
return transportStatus === "missing" ? "cli_missing" : "cli_not_configured";
|
|
131
|
+
}
|
|
132
|
+
if (config.transport === "webhook" && transportStatus !== "ready") {
|
|
133
|
+
return "webhook_missing";
|
|
134
|
+
}
|
|
135
|
+
if (!config.trustedSources.length) {
|
|
136
|
+
return "source_not_trusted";
|
|
137
|
+
}
|
|
138
|
+
return void 0;
|
|
139
|
+
}
|
|
140
|
+
function getRemoteNextAction(channelId, config, reason) {
|
|
141
|
+
if (!reason || reason === "remote_disabled") {
|
|
142
|
+
return reason ? `/remote setup ${channelId}` : `/remote test ${channelId}`;
|
|
143
|
+
}
|
|
144
|
+
if (reason === "not_bound") {
|
|
145
|
+
return `/remote setup ${channelId}`;
|
|
146
|
+
}
|
|
147
|
+
if (reason === "cli_missing") {
|
|
148
|
+
return getRemoteInstallHint(config.type);
|
|
149
|
+
}
|
|
150
|
+
if (reason === "webhook_missing") {
|
|
151
|
+
return `configure a redacted webhook endpoint or use /remote setup ${channelId}`;
|
|
152
|
+
}
|
|
153
|
+
if (reason === "source_not_trusted") {
|
|
154
|
+
return `bind a trusted source with /remote setup ${channelId}`;
|
|
155
|
+
}
|
|
156
|
+
return "/remote doctor";
|
|
157
|
+
}
|
|
158
|
+
function getRemoteInstallHint(type) {
|
|
159
|
+
if (type === "feishu" || type === "lark") {
|
|
160
|
+
return "install lark-cli/feishu-cli, then run feishu-cli config init or lark-cli auth login";
|
|
161
|
+
}
|
|
162
|
+
if (type === "dingtalk") {
|
|
163
|
+
return "install dws, then run dws auth login or dws device login";
|
|
164
|
+
}
|
|
165
|
+
return "install wecom-cli, then run wecom-cli init/auth";
|
|
166
|
+
}
|
|
167
|
+
function createMcpState(config) {
|
|
168
|
+
const servers = Object.entries(config.mcp.servers).map(
|
|
169
|
+
([name, server]) => ({
|
|
170
|
+
name,
|
|
171
|
+
command: server.command,
|
|
172
|
+
status: server.disabled || !config.mcp.enabledServers.includes(name) ? "disabled" : "configured"
|
|
173
|
+
})
|
|
174
|
+
).sort((a, b) => a.name.localeCompare(b.name));
|
|
175
|
+
return {
|
|
176
|
+
enabled: config.mcp.enabledServers.length > 0,
|
|
177
|
+
servers,
|
|
178
|
+
tools: stabilizeMcpToolList(
|
|
179
|
+
servers.filter((server) => server.status === "configured").flatMap((server) => createMcpToolPlaceholders(server.name, "placeholder"))
|
|
180
|
+
)
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function createMcpToolPlaceholders(serverName, discovery) {
|
|
184
|
+
if (serverName !== "codebase-memory") {
|
|
185
|
+
return [
|
|
186
|
+
{
|
|
187
|
+
server: serverName,
|
|
188
|
+
name: `${serverName}.status`,
|
|
189
|
+
description: "MCP server health and tool discovery placeholder; real tool schemas are not dumped.",
|
|
190
|
+
discovery,
|
|
191
|
+
trusted: discovery === "discovered",
|
|
192
|
+
schemaLoaded: discovery === "discovered",
|
|
193
|
+
runtimeVersion: discovery === "discovered" ? "compatible" : "unknown"
|
|
194
|
+
}
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
return Object.keys(codebaseMemoryRequiredArgs()).map((tool) => ({
|
|
198
|
+
server: serverName,
|
|
199
|
+
name: `${serverName}.${tool}`,
|
|
200
|
+
description: `codebase-memory ${tool}; schema summary only, full schema omitted.`,
|
|
201
|
+
discovery,
|
|
202
|
+
trusted: discovery === "discovered",
|
|
203
|
+
schemaLoaded: discovery === "discovered",
|
|
204
|
+
runtimeVersion: discovery === "discovered" ? "compatible" : "unknown"
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
async function createMemoryState(config, projectPath) {
|
|
208
|
+
const paths = resolveStoragePaths(config, projectPath);
|
|
209
|
+
const projectRulesPath = join(projectPath, "LINGHUN.md");
|
|
210
|
+
const projectRules = await loadProjectRulesSummary(projectRulesPath);
|
|
211
|
+
return {
|
|
212
|
+
projectRulesPath,
|
|
213
|
+
projectRulesExists: projectRules.exists,
|
|
214
|
+
projectRulesSummary: projectRules.summary,
|
|
215
|
+
...projectRules.error ? { projectRulesError: projectRules.error } : {},
|
|
216
|
+
...projectRules.includedPaths ? { projectRulesIncludedPaths: projectRules.includedPaths } : {},
|
|
217
|
+
...projectRules.warnings ? { projectRulesWarnings: projectRules.warnings } : {},
|
|
218
|
+
...projectRules.truncated ? { projectRulesTruncated: projectRules.truncated } : {},
|
|
219
|
+
projectDir: paths.memoryProject,
|
|
220
|
+
userDir: paths.memoryUser,
|
|
221
|
+
sessionDir: paths.memorySession,
|
|
222
|
+
candidates: await loadMemoryByStatus(paths, "candidate"),
|
|
223
|
+
accepted: await loadMemoryByStatus(paths, "accepted"),
|
|
224
|
+
rejected: await loadMemoryByStatus(paths, "rejected"),
|
|
225
|
+
disabled: await loadMemoryByStatus(paths, "disabled"),
|
|
226
|
+
retired: await loadMemoryByStatus(paths, "retired"),
|
|
227
|
+
...await loadMemoryLearningMode(paths) ?? {
|
|
228
|
+
learningMode: "active",
|
|
229
|
+
learningModeSource: "default"
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
async function loadProjectRulesSummary(path) {
|
|
234
|
+
try {
|
|
235
|
+
const loaded = await loadMemoryRulesFile(path);
|
|
236
|
+
const parsed = parseMemoryRuleFrontmatter(loaded.content);
|
|
237
|
+
return {
|
|
238
|
+
exists: true,
|
|
239
|
+
summary: summarizeProjectRules(parsed.body),
|
|
240
|
+
includedPaths: loaded.includedPaths,
|
|
241
|
+
warnings: loaded.warnings,
|
|
242
|
+
truncated: loaded.truncated
|
|
243
|
+
};
|
|
244
|
+
} catch (error) {
|
|
245
|
+
const code = error.code;
|
|
246
|
+
if (code === "ENOENT") {
|
|
247
|
+
return { exists: false, summary: "missing" };
|
|
248
|
+
}
|
|
249
|
+
return { exists: false, summary: "unreadable", error: formatError(error) };
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function summarizeProjectRules(content) {
|
|
253
|
+
const normalized = content.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0).join(" ").replace(/\s+/g, " ");
|
|
254
|
+
return truncateDisplay(normalized || "empty", PROJECT_RULES_SUMMARY_WIDTH);
|
|
255
|
+
}
|
|
256
|
+
async function loadMemoryByStatus(paths, status) {
|
|
257
|
+
const [projectMemory, userMemory] = await Promise.all([
|
|
258
|
+
loadMemoryDirByStatus(paths.memoryProject, status),
|
|
259
|
+
loadMemoryDirByStatus(paths.memoryUser, status)
|
|
260
|
+
]);
|
|
261
|
+
return [...projectMemory, ...userMemory].sort((a, b) => a.id.localeCompare(b.id));
|
|
262
|
+
}
|
|
263
|
+
async function loadMemoryLearningMode(paths) {
|
|
264
|
+
try {
|
|
265
|
+
const value = JSON.parse(
|
|
266
|
+
await readFile(join(paths.memoryUser, MEMORY_LEARNING_STATE_FILE), "utf8")
|
|
267
|
+
);
|
|
268
|
+
if (!isRecord(value)) return null;
|
|
269
|
+
if (value.learningMode !== "active" && value.learningMode !== "off") return null;
|
|
270
|
+
return { learningMode: value.learningMode, learningModeSource: "persisted" };
|
|
271
|
+
} catch {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async function loadMemoryDirByStatus(directory, status) {
|
|
276
|
+
let entries;
|
|
277
|
+
try {
|
|
278
|
+
entries = await readdir(directory);
|
|
279
|
+
} catch {
|
|
280
|
+
return [];
|
|
281
|
+
}
|
|
282
|
+
const memory = await Promise.all(
|
|
283
|
+
entries.filter((entry) => entry.endsWith(".json")).map(async (entry) => readMemoryCandidate(join(directory, entry)))
|
|
284
|
+
);
|
|
285
|
+
return memory.filter(
|
|
286
|
+
(item) => item !== null && normalizeMemoryStatus(item) === status
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
async function readMemoryCandidate(path) {
|
|
290
|
+
try {
|
|
291
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
292
|
+
return parseMemoryCandidate(value);
|
|
293
|
+
} catch {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
function parseMemoryCandidate(value) {
|
|
298
|
+
if (!isRecord(value)) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
if (typeof value.id !== "string" || typeof value.summary !== "string" || typeof value.source !== "string" || typeof value.createdAt !== "string") {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
if (value.scope !== "project" && value.scope !== "user" && value.scope !== "session") {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
const taxonomy = value.taxonomy === "user" || value.taxonomy === "feedback" || value.taxonomy === "project" || value.taxonomy === "reference" ? value.taxonomy : void 0;
|
|
308
|
+
const status = value.status === "candidate" || value.status === "accepted" || value.status === "rejected" || value.status === "disabled" || value.status === "retired" ? value.status : "accepted";
|
|
309
|
+
const risk = value.risk === "medium" || value.risk === "high" ? value.risk : "low";
|
|
310
|
+
const sourceRefs = Array.isArray(value.sourceRefs) ? value.sourceRefs.filter((item) => typeof item === "string") : [value.source];
|
|
311
|
+
return {
|
|
312
|
+
id: value.id,
|
|
313
|
+
scope: value.scope,
|
|
314
|
+
status,
|
|
315
|
+
...taxonomy ? { taxonomy } : {},
|
|
316
|
+
...typeof value.topic === "string" && value.topic.trim().length > 0 ? { topic: truncateDisplay(value.topic.trim(), 80) } : {},
|
|
317
|
+
summary: truncateDisplay(value.summary.replace(/\s+/g, " "), 240),
|
|
318
|
+
source: value.source,
|
|
319
|
+
sourceRefs: sourceRefs.slice(0, 6),
|
|
320
|
+
risk,
|
|
321
|
+
inferred: value.inferred === true,
|
|
322
|
+
createdAt: value.createdAt
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function normalizeMemoryStatus(item) {
|
|
326
|
+
return item.status ?? "accepted";
|
|
327
|
+
}
|
|
328
|
+
function resolveConfiguredDir(projectPath, configured) {
|
|
329
|
+
if (configured.startsWith("~/")) {
|
|
330
|
+
return join(homedir(), configured.slice(2));
|
|
331
|
+
}
|
|
332
|
+
return resolve(projectPath, configured);
|
|
333
|
+
}
|
|
334
|
+
async function createSkillState(config, projectPath) {
|
|
335
|
+
const projectDir = resolveConfiguredDir(projectPath, config.skills.projectDir);
|
|
336
|
+
const userDir = resolveConfiguredDir(projectPath, config.skills.userDir);
|
|
337
|
+
try {
|
|
338
|
+
const skills = await loadSkillSummaries(config, projectDir, userDir);
|
|
339
|
+
return {
|
|
340
|
+
enabled: config.skills.enabled,
|
|
341
|
+
projectDir,
|
|
342
|
+
userDir,
|
|
343
|
+
skills,
|
|
344
|
+
disabledIds: [...config.skills.disabledIds].sort((a, b) => a.localeCompare(b)),
|
|
345
|
+
trustedIds: [...config.skills.trustedIds].sort((a, b) => a.localeCompare(b)),
|
|
346
|
+
evolutionCandidates: [],
|
|
347
|
+
rejectedEvolutionCandidates: []
|
|
348
|
+
};
|
|
349
|
+
} catch (error) {
|
|
350
|
+
return {
|
|
351
|
+
enabled: config.skills.enabled,
|
|
352
|
+
projectDir,
|
|
353
|
+
userDir,
|
|
354
|
+
skills: [],
|
|
355
|
+
disabledIds: config.skills.disabledIds,
|
|
356
|
+
trustedIds: config.skills.trustedIds,
|
|
357
|
+
evolutionCandidates: [],
|
|
358
|
+
rejectedEvolutionCandidates: [],
|
|
359
|
+
lastError: formatError(error)
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function createWorkflowState(config) {
|
|
364
|
+
return {
|
|
365
|
+
enabled: config.workflows.enabled,
|
|
366
|
+
disabledIds: [...config.workflows.disabledIds].sort((a, b) => a.localeCompare(b)),
|
|
367
|
+
templates: [
|
|
368
|
+
workflow("bug-fix", "\u5B9A\u4F4D bug\u3001\u505A\u6700\u5C0F\u4FEE\u590D\u3001\u8FD0\u884C\u76F8\u5173\u9A8C\u8BC1", "medium", true, [
|
|
369
|
+
"corepack pnpm test",
|
|
370
|
+
"corepack pnpm typecheck"
|
|
371
|
+
]),
|
|
372
|
+
workflow("design-to-code", "\u628A\u5DF2\u786E\u8BA4\u8BBE\u8BA1\u8F6C\u6210\u6700\u5C0F\u4EE3\u7801\u6539\u52A8", "high", true, [
|
|
373
|
+
"corepack pnpm test",
|
|
374
|
+
"corepack pnpm build"
|
|
375
|
+
]),
|
|
376
|
+
workflow("doc-to-code", "\u6309\u6587\u6863\u5DEE\u5F02\u8865\u9F50\u4EE3\u7801\u5165\u53E3\u548C\u9A8C\u8BC1", "medium", true, [
|
|
377
|
+
"corepack pnpm test",
|
|
378
|
+
"corepack pnpm check"
|
|
379
|
+
]),
|
|
380
|
+
workflow("refactor-plan", "\u53EA\u8F93\u51FA\u91CD\u6784\u8BA1\u5212\u4E0E\u98CE\u9669\uFF0C\u4E0D\u76F4\u63A5\u6539\u4EE3\u7801", "medium", false, [
|
|
381
|
+
"corepack pnpm typecheck"
|
|
382
|
+
]),
|
|
383
|
+
workflow("release-note", "\u57FA\u4E8E\u5DF2\u9A8C\u8BC1\u53D8\u66F4\u751F\u6210\u53D1\u5E03\u8BF4\u660E", "low", false, ["corepack pnpm check"]),
|
|
384
|
+
workflow("review", "\u53EA\u8BFB\u5BA1\u67E5 diff\u3001\u98CE\u9669\u548C\u9A8C\u8BC1\u8BC1\u636E", "low", false, ["corepack pnpm test"]),
|
|
385
|
+
workflow(
|
|
386
|
+
"solution-completeness-check",
|
|
387
|
+
"\u5148\u5224\u65AD single_issue/systemic_gap\u3001\u5F71\u54CD\u9762\u3001P0/P1/P2\u3001\u9636\u6BB5\u8FB9\u754C\u548C\u9A8C\u8BC1\u65B9\u5F0F",
|
|
388
|
+
"low",
|
|
389
|
+
false,
|
|
390
|
+
["focused Solution Completeness Gate test"]
|
|
391
|
+
)
|
|
392
|
+
].sort((a, b) => a.id.localeCompare(b.id))
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function workflow(id, purpose, risk, writesFiles, recommendedValidation) {
|
|
396
|
+
return {
|
|
397
|
+
id,
|
|
398
|
+
purpose,
|
|
399
|
+
risk,
|
|
400
|
+
writesFiles,
|
|
401
|
+
recommendedValidation,
|
|
402
|
+
steps: [
|
|
403
|
+
"Start Gate\uFF1A\u542F\u52A8\u524D\u5148\u8BA9\u7528\u6237\u786E\u8BA4\u8303\u56F4\u3002",
|
|
404
|
+
"\u6267\u884C\u4E2D\u4EFB\u4F55\u5199\u6587\u4EF6\u3001Bash\u3001\u8054\u7F51\u6216\u4F9D\u8D56\u5B89\u88C5\u4ECD\u8D70\u73B0\u6709\u6743\u9650\u7BA1\u9053\u3002",
|
|
405
|
+
"\u7ED3\u675F\u524D\u63D0\u793A\u8FD0\u884C\u63A8\u8350\u9A8C\u8BC1\uFF0C\u5E76\u8F93\u51FA\u4FEE\u6539\u6587\u4EF6\u3001\u9A8C\u8BC1\u7ED3\u679C\u3001\u5DF2\u77E5\u9650\u5236\u548C\u8303\u56F4\u8FB9\u754C\u3002"
|
|
406
|
+
]
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
async function createHookState(config, projectPath) {
|
|
410
|
+
const hooks = await loadHookSummaries(config, projectPath);
|
|
411
|
+
return {
|
|
412
|
+
enabled: config.hooks.enabled,
|
|
413
|
+
projectTrusted: config.hooks.projectTrusted,
|
|
414
|
+
timeoutMs: config.hooks.timeoutMs,
|
|
415
|
+
outputLimitBytes: config.hooks.outputLimitBytes,
|
|
416
|
+
hooks,
|
|
417
|
+
recentErrors: hooks.flatMap(
|
|
418
|
+
(hook) => hook.lastError ? [`${hook.id}: ${hook.lastError}`] : []
|
|
419
|
+
)
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
async function createPluginState(config, projectPath) {
|
|
423
|
+
const projectDir = resolveConfiguredDir(projectPath, config.plugins.projectDir);
|
|
424
|
+
const userDir = resolveConfiguredDir(projectPath, config.plugins.userDir);
|
|
425
|
+
try {
|
|
426
|
+
const plugins = await loadPluginSummaries(config, projectDir, userDir);
|
|
427
|
+
return {
|
|
428
|
+
enabled: config.plugins.enabled,
|
|
429
|
+
projectDir,
|
|
430
|
+
userDir,
|
|
431
|
+
plugins,
|
|
432
|
+
disabledIds: [...config.plugins.disabledIds].sort((a, b) => a.localeCompare(b)),
|
|
433
|
+
trustedIds: [...config.plugins.trustedIds].sort((a, b) => a.localeCompare(b))
|
|
434
|
+
};
|
|
435
|
+
} catch (error) {
|
|
436
|
+
return {
|
|
437
|
+
enabled: config.plugins.enabled,
|
|
438
|
+
projectDir,
|
|
439
|
+
userDir,
|
|
440
|
+
plugins: [],
|
|
441
|
+
disabledIds: config.plugins.disabledIds,
|
|
442
|
+
trustedIds: config.plugins.trustedIds,
|
|
443
|
+
lastError: formatError(error)
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
async function loadSkillSummaries(config, projectDir, userDir) {
|
|
448
|
+
const loaded = await Promise.all([
|
|
449
|
+
loadSkillDir(config, projectDir, "project"),
|
|
450
|
+
loadSkillDir(config, userDir, "user")
|
|
451
|
+
]);
|
|
452
|
+
return loaded.flat().sort((a, b) => a.id.localeCompare(b.id));
|
|
453
|
+
}
|
|
454
|
+
async function loadSkillDir(config, directory, scope) {
|
|
455
|
+
const entries = await readJsonManifestFiles(directory);
|
|
456
|
+
const items = await Promise.all(entries.map((path) => readSkillManifest(config, path, scope)));
|
|
457
|
+
return items.filter((item) => item !== null);
|
|
458
|
+
}
|
|
459
|
+
async function readSkillManifest(config, path, scope) {
|
|
460
|
+
try {
|
|
461
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
462
|
+
const id = stableId(value.id, basename(path, extname(path)));
|
|
463
|
+
const permissions = stringArray(value.permissions).sort((a, b) => a.localeCompare(b));
|
|
464
|
+
const source = parseSource(value.source, scope);
|
|
465
|
+
const trusted = source === "official" || config.skills.trustedIds.includes(id);
|
|
466
|
+
const enabled = config.skills.enabled && !config.skills.disabledIds.includes(id) && trusted;
|
|
467
|
+
return {
|
|
468
|
+
id,
|
|
469
|
+
name: stringValue(value.name, id),
|
|
470
|
+
description: truncateDisplay(stringValue(value.description, "no description"), 240),
|
|
471
|
+
triggers: stringArray(value.triggers).sort((a, b) => a.localeCompare(b)),
|
|
472
|
+
summary: truncateDisplay(stringValue(value.summary, stringValue(value.description, "")), 600),
|
|
473
|
+
source,
|
|
474
|
+
scope,
|
|
475
|
+
path,
|
|
476
|
+
version: stringValue(value.version, "0.0.0"),
|
|
477
|
+
enabled,
|
|
478
|
+
trusted,
|
|
479
|
+
permissions,
|
|
480
|
+
mayWrite: permissions.includes("write"),
|
|
481
|
+
mayExecute: permissions.includes("bash") || permissions.includes("execute"),
|
|
482
|
+
mayNetwork: permissions.includes("network"),
|
|
483
|
+
lifecycle: readLifecycleRecord(value, {
|
|
484
|
+
path,
|
|
485
|
+
source,
|
|
486
|
+
trusted,
|
|
487
|
+
enabled,
|
|
488
|
+
permissions,
|
|
489
|
+
hasSchema: true
|
|
490
|
+
})
|
|
491
|
+
};
|
|
492
|
+
} catch (error) {
|
|
493
|
+
return {
|
|
494
|
+
id: basename(path, extname(path)),
|
|
495
|
+
name: basename(path),
|
|
496
|
+
description: "manifest load failed; skill isolated from main session",
|
|
497
|
+
triggers: [],
|
|
498
|
+
summary: "manifest load failed; skill isolated from prompt and tools",
|
|
499
|
+
source: scope === "project" ? "third-party" : "local",
|
|
500
|
+
scope,
|
|
501
|
+
path,
|
|
502
|
+
version: "unknown",
|
|
503
|
+
enabled: false,
|
|
504
|
+
trusted: false,
|
|
505
|
+
permissions: [],
|
|
506
|
+
mayWrite: false,
|
|
507
|
+
mayExecute: false,
|
|
508
|
+
mayNetwork: false,
|
|
509
|
+
lifecycle: {
|
|
510
|
+
localPath: path,
|
|
511
|
+
trustLevel: "disabled",
|
|
512
|
+
permissionSummary: "none",
|
|
513
|
+
discovered: false,
|
|
514
|
+
registered: false,
|
|
515
|
+
schemaLoaded: false,
|
|
516
|
+
runtimeVersion: "unknown"
|
|
517
|
+
},
|
|
518
|
+
lastError: formatError(error)
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
async function loadPluginSummaries(config, projectDir, userDir) {
|
|
523
|
+
const loaded = await Promise.all([
|
|
524
|
+
loadPluginDir(config, projectDir, "project"),
|
|
525
|
+
loadPluginDir(config, userDir, "user")
|
|
526
|
+
]);
|
|
527
|
+
return loaded.flat().sort((a, b) => a.id.localeCompare(b.id));
|
|
528
|
+
}
|
|
529
|
+
async function loadPluginDir(config, directory, scope) {
|
|
530
|
+
const entries = await readJsonManifestFiles(directory);
|
|
531
|
+
const items = await Promise.all(entries.map((path) => readPluginManifest(config, path, scope)));
|
|
532
|
+
return items.filter((item) => item !== null);
|
|
533
|
+
}
|
|
534
|
+
async function readPluginManifest(config, path, scope) {
|
|
535
|
+
try {
|
|
536
|
+
const value = JSON.parse(await readFile(path, "utf8"));
|
|
537
|
+
const id = stableId(value.id, basename(path, extname(path)));
|
|
538
|
+
const permissions = stringArray(value.permissions).sort((a, b) => a.localeCompare(b));
|
|
539
|
+
const source = parseSource(value.source, scope);
|
|
540
|
+
const trusted = source === "official" || config.plugins.trustedIds.includes(id);
|
|
541
|
+
const enabled = config.plugins.enabled && !config.plugins.disabledIds.includes(id) && trusted;
|
|
542
|
+
const contributions = normalizeContributions(value.contributions);
|
|
543
|
+
return {
|
|
544
|
+
id,
|
|
545
|
+
name: stringValue(value.name, id),
|
|
546
|
+
version: stringValue(value.version, "0.0.0"),
|
|
547
|
+
description: truncateDisplay(stringValue(value.description, "no description"), 240),
|
|
548
|
+
source,
|
|
549
|
+
scope,
|
|
550
|
+
path,
|
|
551
|
+
enabled,
|
|
552
|
+
trusted,
|
|
553
|
+
permissions,
|
|
554
|
+
mayWrite: permissions.includes("write"),
|
|
555
|
+
mayExecute: permissions.includes("bash") || permissions.includes("execute"),
|
|
556
|
+
mayNetwork: permissions.includes("network"),
|
|
557
|
+
lifecycle: readLifecycleRecord(value, {
|
|
558
|
+
path,
|
|
559
|
+
source,
|
|
560
|
+
trusted,
|
|
561
|
+
enabled,
|
|
562
|
+
permissions,
|
|
563
|
+
hasSchema: Object.values(contributions).some((items) => items.length > 0)
|
|
564
|
+
}),
|
|
565
|
+
contributions
|
|
566
|
+
};
|
|
567
|
+
} catch (error) {
|
|
568
|
+
return {
|
|
569
|
+
id: basename(path, extname(path)),
|
|
570
|
+
name: basename(path),
|
|
571
|
+
version: "unknown",
|
|
572
|
+
description: "manifest load failed; plugin isolated from main session",
|
|
573
|
+
source: scope === "project" ? "third-party" : "local",
|
|
574
|
+
scope,
|
|
575
|
+
path,
|
|
576
|
+
enabled: false,
|
|
577
|
+
trusted: false,
|
|
578
|
+
permissions: [],
|
|
579
|
+
mayWrite: false,
|
|
580
|
+
mayExecute: false,
|
|
581
|
+
mayNetwork: false,
|
|
582
|
+
lifecycle: {
|
|
583
|
+
localPath: path,
|
|
584
|
+
trustLevel: "disabled",
|
|
585
|
+
permissionSummary: "none",
|
|
586
|
+
discovered: false,
|
|
587
|
+
registered: false,
|
|
588
|
+
schemaLoaded: false,
|
|
589
|
+
runtimeVersion: "unknown"
|
|
590
|
+
},
|
|
591
|
+
contributions: normalizeContributions(void 0),
|
|
592
|
+
lastError: formatError(error)
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
async function loadHookSummaries(config, projectPath) {
|
|
597
|
+
const pluginHooks = (await createPluginState(config, projectPath)).plugins.flatMap(
|
|
598
|
+
(plugin) => plugin.contributions.hooks.map((event) => ({ plugin, event }))
|
|
599
|
+
);
|
|
600
|
+
return pluginHooks.map(({ plugin, event }) => ({
|
|
601
|
+
id: `${plugin.id}:${event}`,
|
|
602
|
+
event: parseHookEvent(event),
|
|
603
|
+
source: plugin.source,
|
|
604
|
+
scope: plugin.scope,
|
|
605
|
+
path: plugin.path,
|
|
606
|
+
enabled: config.hooks.enabled && plugin.enabled && plugin.trusted && (plugin.scope !== "project" || config.hooks.projectTrusted),
|
|
607
|
+
trusted: plugin.trusted && (plugin.scope !== "project" || config.hooks.projectTrusted),
|
|
608
|
+
timeoutMs: config.hooks.timeoutMs,
|
|
609
|
+
outputLimitBytes: config.hooks.outputLimitBytes,
|
|
610
|
+
permissions: plugin.permissions,
|
|
611
|
+
logPath: join(projectPath, ".linghun", "logs", "hooks", `${plugin.id}.log`),
|
|
612
|
+
lastError: plugin.lastError
|
|
613
|
+
})).sort((a, b) => `${a.event}:${a.id}`.localeCompare(`${b.event}:${b.id}`));
|
|
614
|
+
}
|
|
615
|
+
function parseHookEvent(value) {
|
|
616
|
+
const allowed = [
|
|
617
|
+
"Notification",
|
|
618
|
+
"Plugin",
|
|
619
|
+
"PostToolUse",
|
|
620
|
+
"PreToolUse",
|
|
621
|
+
"Stop",
|
|
622
|
+
"Workflow"
|
|
623
|
+
];
|
|
624
|
+
return allowed.includes(value) ? value : "Plugin";
|
|
625
|
+
}
|
|
626
|
+
async function readJsonManifestFiles(directory) {
|
|
627
|
+
let entries;
|
|
628
|
+
try {
|
|
629
|
+
entries = await readdir(directory);
|
|
630
|
+
} catch {
|
|
631
|
+
return [];
|
|
632
|
+
}
|
|
633
|
+
return entries.filter((entry) => entry.endsWith(".json")).map((entry) => join(directory, entry)).sort((a, b) => a.localeCompare(b));
|
|
634
|
+
}
|
|
635
|
+
function normalizeContributions(value) {
|
|
636
|
+
const input = isRecord(value) ? value : {};
|
|
637
|
+
return {
|
|
638
|
+
commands: stringArray(input.commands).sort((a, b) => a.localeCompare(b)),
|
|
639
|
+
hooks: stringArray(input.hooks).sort((a, b) => a.localeCompare(b)),
|
|
640
|
+
mcpServers: stringArray(input.mcpServers).sort((a, b) => a.localeCompare(b)),
|
|
641
|
+
providers: stringArray(input.providers).sort((a, b) => a.localeCompare(b)),
|
|
642
|
+
skills: stringArray(input.skills).sort((a, b) => a.localeCompare(b)),
|
|
643
|
+
workflows: stringArray(input.workflows).sort((a, b) => a.localeCompare(b))
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function parseSource(value, scope) {
|
|
647
|
+
if (value === "official" || value === "third-party" || value === "local") {
|
|
648
|
+
return value;
|
|
649
|
+
}
|
|
650
|
+
return scope === "project" ? "third-party" : "local";
|
|
651
|
+
}
|
|
652
|
+
function stableId(value, fallback) {
|
|
653
|
+
return stringValue(value, fallback).trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "-");
|
|
654
|
+
}
|
|
655
|
+
function stringArray(value) {
|
|
656
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
657
|
+
}
|
|
658
|
+
function stringValue(value, fallback) {
|
|
659
|
+
return typeof value === "string" && value.length > 0 ? value : fallback;
|
|
660
|
+
}
|
|
661
|
+
function permissionSummary(permissions) {
|
|
662
|
+
if (permissions.length === 0) {
|
|
663
|
+
return "none";
|
|
664
|
+
}
|
|
665
|
+
const risks = [
|
|
666
|
+
permissions.includes("write") ? "write" : void 0,
|
|
667
|
+
permissions.includes("bash") || permissions.includes("execute") ? "execute" : void 0,
|
|
668
|
+
permissions.includes("network") ? "network" : void 0
|
|
669
|
+
].filter((item) => Boolean(item));
|
|
670
|
+
return risks.length > 0 ? risks.join("+") : permissions.join("+");
|
|
671
|
+
}
|
|
672
|
+
function readLifecycleRecord(value, options) {
|
|
673
|
+
const raw = isRecord(value.lifecycle) ? value.lifecycle : value;
|
|
674
|
+
return {
|
|
675
|
+
sourceUrl: typeof raw.sourceUrl === "string" ? raw.sourceUrl : void 0,
|
|
676
|
+
localPath: typeof raw.localPath === "string" ? raw.localPath : options.path,
|
|
677
|
+
ref: typeof raw.ref === "string" ? raw.ref : void 0,
|
|
678
|
+
commit: typeof raw.commit === "string" ? raw.commit : void 0,
|
|
679
|
+
installedAt: typeof raw.installedAt === "string" ? raw.installedAt : void 0,
|
|
680
|
+
trustLevel: options.enabled ? "trusted" : options.trusted ? "disabled" : "untrusted",
|
|
681
|
+
permissionSummary: permissionSummary(options.permissions),
|
|
682
|
+
discovered: true,
|
|
683
|
+
registered: true,
|
|
684
|
+
schemaLoaded: options.hasSchema,
|
|
685
|
+
runtimeVersion: "compatible"
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
async function pathExists(path) {
|
|
689
|
+
try {
|
|
690
|
+
await stat(path);
|
|
691
|
+
return true;
|
|
692
|
+
} catch {
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function codebaseMemoryRequiredArgs() {
|
|
697
|
+
return {
|
|
698
|
+
list_projects: [],
|
|
699
|
+
index_status: ["project"],
|
|
700
|
+
detect_changes: ["project"],
|
|
701
|
+
index_repository: ["repo_path"],
|
|
702
|
+
search_code: ["project", "pattern"],
|
|
703
|
+
get_architecture: ["project"],
|
|
704
|
+
get_code_snippet: ["project", "qualified_name"],
|
|
705
|
+
query_graph: ["project", "query"],
|
|
706
|
+
trace_path: ["project", "from", "to"],
|
|
707
|
+
search_graph: ["project", "query"]
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function stabilizeMcpToolList(tools) {
|
|
711
|
+
return tools.map((tool) => ({
|
|
712
|
+
server: tool.server,
|
|
713
|
+
name: tool.name,
|
|
714
|
+
description: truncateDisplay(tool.description.replace(/\s+/g, " "), 120),
|
|
715
|
+
discovery: tool.discovery ?? "placeholder",
|
|
716
|
+
trusted: tool.trusted ?? false,
|
|
717
|
+
schemaLoaded: tool.schemaLoaded ?? false,
|
|
718
|
+
runtimeVersion: tool.runtimeVersion ?? "unknown"
|
|
719
|
+
})).sort((a, b) => `${a.server}:${a.name}`.localeCompare(`${b.server}:${b.name}`));
|
|
720
|
+
}
|
|
721
|
+
function isRecord(value) {
|
|
722
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export {
|
|
726
|
+
createCacheState,
|
|
727
|
+
createRemoteState,
|
|
728
|
+
applyRemoteSessionDisables,
|
|
729
|
+
getRemoteInstallHint,
|
|
730
|
+
createMcpState,
|
|
731
|
+
createMcpToolPlaceholders,
|
|
732
|
+
createMemoryState,
|
|
733
|
+
summarizeProjectRules,
|
|
734
|
+
normalizeMemoryStatus,
|
|
735
|
+
createSkillState,
|
|
736
|
+
createWorkflowState,
|
|
737
|
+
createHookState,
|
|
738
|
+
createPluginState,
|
|
739
|
+
stableId,
|
|
740
|
+
pathExists,
|
|
741
|
+
codebaseMemoryRequiredArgs,
|
|
742
|
+
stabilizeMcpToolList,
|
|
743
|
+
isRecord
|
|
744
|
+
};
|