@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,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appendGitOperationEvent,
|
|
3
|
+
performStablePoint,
|
|
4
|
+
performWorktreeCreate
|
|
5
|
+
} from "./chunk-7ZE5JFAZ.js";
|
|
6
|
+
import {
|
|
7
|
+
summarizeWorktreeRemovePlan
|
|
8
|
+
} from "./chunk-6USL33ZO.js";
|
|
9
|
+
import {
|
|
10
|
+
planManagedWorktreeRemove
|
|
11
|
+
} from "./chunk-4EIC5BCT.js";
|
|
12
|
+
|
|
13
|
+
// src/git-slash-runtime.ts
|
|
14
|
+
function parseStablePointSlashArgs(args) {
|
|
15
|
+
let includeUntracked = false;
|
|
16
|
+
const messageParts = [];
|
|
17
|
+
for (const arg of args) {
|
|
18
|
+
if (arg === "--include-untracked") {
|
|
19
|
+
includeUntracked = true;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
messageParts.push(arg);
|
|
23
|
+
}
|
|
24
|
+
const raw = messageParts.join(" ").trim();
|
|
25
|
+
const message = raw.replace(/^["'“‘]|["'”’]$/gu, "").trim();
|
|
26
|
+
return { message: message || void 0, includeUntracked };
|
|
27
|
+
}
|
|
28
|
+
function parseWorktreeSlashArgs(args) {
|
|
29
|
+
let name;
|
|
30
|
+
let branch;
|
|
31
|
+
let fromRef;
|
|
32
|
+
let force = false;
|
|
33
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
34
|
+
const arg = args[i];
|
|
35
|
+
if (arg === "--force") {
|
|
36
|
+
force = true;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (arg === "--branch" || arg === "-b") {
|
|
40
|
+
branch = args[i + 1];
|
|
41
|
+
i += 1;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (arg === "--from") {
|
|
45
|
+
fromRef = args[i + 1];
|
|
46
|
+
i += 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (!name && !arg.startsWith("-")) {
|
|
50
|
+
name = arg;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { name, branch, fromRef, force };
|
|
54
|
+
}
|
|
55
|
+
async function runStablePointCreateSlash(args, context, output, deps) {
|
|
56
|
+
const parsed = parseStablePointSlashArgs(args);
|
|
57
|
+
const sessionId = await deps.ensureSession(context);
|
|
58
|
+
if (context.permissionMode === "plan") {
|
|
59
|
+
const text = context.language === "en-US" ? "stable point was NOT created because Plan mode is read-only." : "stable point was NOT created because Plan mode is read-only. \u7A33\u5B9A\u70B9\u672A\u521B\u5EFA\uFF1A\u8BA1\u5212\u6A21\u5F0F\u53EA\u8BFB\u3002";
|
|
60
|
+
await appendGitOperationEvent(
|
|
61
|
+
deps.dispatch,
|
|
62
|
+
context,
|
|
63
|
+
sessionId,
|
|
64
|
+
{
|
|
65
|
+
operation: "stable_point_denied",
|
|
66
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
67
|
+
project: context.projectPath,
|
|
68
|
+
includeUntracked: parsed.includeUntracked,
|
|
69
|
+
result: "plan_read_only",
|
|
70
|
+
source: "slash"
|
|
71
|
+
},
|
|
72
|
+
"warning"
|
|
73
|
+
);
|
|
74
|
+
deps.writeLine(output, text);
|
|
75
|
+
deps.writeStatus(output, context);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const result = await performStablePoint(
|
|
79
|
+
context,
|
|
80
|
+
sessionId,
|
|
81
|
+
{ message: parsed.message, includeUntracked: parsed.includeUntracked },
|
|
82
|
+
deps.dispatch
|
|
83
|
+
);
|
|
84
|
+
deps.writeLine(output, result.text);
|
|
85
|
+
deps.writeStatus(output, context);
|
|
86
|
+
}
|
|
87
|
+
async function runWorktreeCreateSlash(args, context, output, deps) {
|
|
88
|
+
const parsed = parseWorktreeSlashArgs(args);
|
|
89
|
+
if (!parsed.name) {
|
|
90
|
+
deps.writeLine(output, "\u7528\u6CD5\uFF1A/worktree create <name> [--branch <branch>] [--from <ref>]");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const sessionId = await deps.ensureSession(context);
|
|
94
|
+
const result = await performWorktreeCreate(
|
|
95
|
+
context,
|
|
96
|
+
sessionId,
|
|
97
|
+
{ name: parsed.name, branch: parsed.branch, fromRef: parsed.fromRef },
|
|
98
|
+
deps.dispatch
|
|
99
|
+
);
|
|
100
|
+
deps.writeLine(output, result.text);
|
|
101
|
+
deps.writeStatus(output, context);
|
|
102
|
+
}
|
|
103
|
+
async function runWorktreeRemoveSlash(args, context, output, deps) {
|
|
104
|
+
const parsed = parseWorktreeSlashArgs(args);
|
|
105
|
+
if (!parsed.name) {
|
|
106
|
+
deps.writeLine(output, "\u7528\u6CD5\uFF1A/worktree remove <name> [--force]");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const sessionId = await deps.ensureSession(context);
|
|
110
|
+
const plan = await planManagedWorktreeRemove(context.projectPath, {
|
|
111
|
+
name: parsed.name,
|
|
112
|
+
force: parsed.force
|
|
113
|
+
});
|
|
114
|
+
const summary = summarizeWorktreeRemovePlan(plan, context.language);
|
|
115
|
+
if (summary.needsConfirmation && (plan.kind === "clean" || plan.kind === "dirty_force")) {
|
|
116
|
+
context.pendingLocalApproval = {
|
|
117
|
+
kind: "git_worktree_remove",
|
|
118
|
+
sessionId,
|
|
119
|
+
name: plan.name,
|
|
120
|
+
path: plan.path,
|
|
121
|
+
force: plan.kind === "dirty_force",
|
|
122
|
+
strong: summary.strong
|
|
123
|
+
};
|
|
124
|
+
await appendGitOperationEvent(
|
|
125
|
+
deps.dispatch,
|
|
126
|
+
context,
|
|
127
|
+
sessionId,
|
|
128
|
+
{
|
|
129
|
+
operation: "worktree_remove_requested",
|
|
130
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
131
|
+
name: plan.name,
|
|
132
|
+
path: plan.path,
|
|
133
|
+
force: plan.kind === "dirty_force",
|
|
134
|
+
result: "pending_confirmation"
|
|
135
|
+
},
|
|
136
|
+
"info"
|
|
137
|
+
);
|
|
138
|
+
deps.writeLine(output, summary.text);
|
|
139
|
+
deps.writeStatus(output, context);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (plan.kind === "dirty_blocked" || plan.kind === "not_managed") {
|
|
143
|
+
await appendGitOperationEvent(
|
|
144
|
+
deps.dispatch,
|
|
145
|
+
context,
|
|
146
|
+
sessionId,
|
|
147
|
+
{
|
|
148
|
+
operation: "worktree_remove_denied",
|
|
149
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
150
|
+
name: parsed.name,
|
|
151
|
+
reason: summary.text,
|
|
152
|
+
result: "denied"
|
|
153
|
+
},
|
|
154
|
+
"warning"
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
deps.writeLine(output, summary.text);
|
|
158
|
+
deps.writeStatus(output, context);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export {
|
|
162
|
+
parseStablePointSlashArgs,
|
|
163
|
+
parseWorktreeSlashArgs,
|
|
164
|
+
runStablePointCreateSlash,
|
|
165
|
+
runWorktreeCreateSlash,
|
|
166
|
+
runWorktreeRemoveSlash
|
|
167
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/shell/components/useAnchoredCursor.ts
|
|
2
|
+
import { useBoxMetrics, useCursor } from "@linghun/ink-runtime";
|
|
3
|
+
function getAbsoluteOrigin(node) {
|
|
4
|
+
if (!node) return null;
|
|
5
|
+
let x = 0;
|
|
6
|
+
let y = 0;
|
|
7
|
+
let cur = node;
|
|
8
|
+
while (cur && cur.nodeName !== "ink-root") {
|
|
9
|
+
const yogaNode = cur.yogaNode;
|
|
10
|
+
if (!yogaNode) return null;
|
|
11
|
+
const layout = yogaNode.getComputedLayout();
|
|
12
|
+
x += layout.left;
|
|
13
|
+
y += layout.top;
|
|
14
|
+
cur = cur.parentNode;
|
|
15
|
+
}
|
|
16
|
+
if (!cur || cur.nodeName !== "ink-root") return null;
|
|
17
|
+
return { x, y };
|
|
18
|
+
}
|
|
19
|
+
function useAnchoredCursor(declared, anchorRef, capability) {
|
|
20
|
+
const { setCursorPosition } = useCursor();
|
|
21
|
+
useBoxMetrics(anchorRef);
|
|
22
|
+
let desired;
|
|
23
|
+
if (declared && capability.cursorPositioning) {
|
|
24
|
+
let origin = null;
|
|
25
|
+
try {
|
|
26
|
+
origin = getAbsoluteOrigin(anchorRef.current);
|
|
27
|
+
} catch {
|
|
28
|
+
origin = null;
|
|
29
|
+
}
|
|
30
|
+
if (origin) {
|
|
31
|
+
desired = {
|
|
32
|
+
x: Math.max(0, Math.round(origin.x + declared.col)),
|
|
33
|
+
y: Math.max(0, Math.round(origin.y + declared.row))
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
setCursorPosition(desired);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
useAnchoredCursor
|
|
42
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/shell/models/permission-elevation.ts
|
|
2
|
+
var TEXT = {
|
|
3
|
+
"zh-CN": {
|
|
4
|
+
allowOnce: "\u672C\u6B21\u5141\u8BB8",
|
|
5
|
+
allowAlways: "\u59CB\u7EC8\u5141\u8BB8\u8BE5\u5DE5\u5177",
|
|
6
|
+
deny: "\u62D2\u7EDD",
|
|
7
|
+
details: "\u67E5\u770B\u8BE6\u60C5",
|
|
8
|
+
hintAllowOnce: "\u4EC5\u672C\u6B21\u6267\u884C\uFF1B\u89C4\u5219\u4E0D\u4F1A\u843D\u76D8",
|
|
9
|
+
hintAllowAlwaysLow: "\u672A\u6765\u540C\u5DE5\u5177\u9759\u9ED8\u901A\u8FC7\uFF08\u4F4E\u98CE\u9669\uFF09",
|
|
10
|
+
hintAllowAlwaysMedium: "\u672A\u6765\u540C\u5DE5\u5177\u9759\u9ED8\u901A\u8FC7\uFF08\u4E2D\u98CE\u9669\uFF0C\u8BF7\u786E\u8BA4\uFF09",
|
|
11
|
+
hintAllowAlwaysHigh: "\u672A\u6765\u540C\u5DE5\u5177\u9759\u9ED8\u901A\u8FC7\uFF08\u9AD8\u98CE\u9669\uFF0C\u5EFA\u8BAE\u5148 details\uFF09",
|
|
12
|
+
hintAllowAlwaysHidden: "\u5DF2\u5B58\u5728 allow \u89C4\u5219\uFF0C\u65E0\u9700\u91CD\u590D\u843D\u76D8",
|
|
13
|
+
hintDeny: "\u672C\u6B21\u62D2\u7EDD\uFF1B\u53EF\u7EE7\u7EED\u5BF9\u8BDD\u8C03\u6574\u65B9\u6848",
|
|
14
|
+
hintDetails: "\u5C55\u5F00\u539F\u56E0 / \u5F71\u54CD\u8303\u56F4 / \u5B89\u5168\u7EA7\u522B"
|
|
15
|
+
},
|
|
16
|
+
"en-US": {
|
|
17
|
+
allowOnce: "Allow once",
|
|
18
|
+
allowAlways: "Always allow this tool",
|
|
19
|
+
deny: "Deny",
|
|
20
|
+
details: "Details",
|
|
21
|
+
hintAllowOnce: "One-shot allow; no rule is persisted",
|
|
22
|
+
hintAllowAlwaysLow: "Future invocations of this tool pass silently (low risk)",
|
|
23
|
+
hintAllowAlwaysMedium: "Future invocations of this tool pass silently (medium risk)",
|
|
24
|
+
hintAllowAlwaysHigh: "Future invocations of this tool pass silently (HIGH risk; review details first)",
|
|
25
|
+
hintAllowAlwaysHidden: "An allow rule already exists; persisting again is redundant",
|
|
26
|
+
hintDeny: "Reject this invocation; you can keep iterating",
|
|
27
|
+
hintDetails: "Show reason / scope / safety level"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
function hasExistingAllowRule(rules, toolName, risk) {
|
|
31
|
+
for (const rule of rules) {
|
|
32
|
+
if (rule.effect !== "allow") continue;
|
|
33
|
+
if (rule.toolName !== toolName && rule.toolName !== "*") continue;
|
|
34
|
+
if (rule.risk && rule.risk !== risk) continue;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
function buildAllowAlwaysHint(text, risk) {
|
|
40
|
+
if (risk === "high") return text.hintAllowAlwaysHigh;
|
|
41
|
+
if (risk === "medium") return text.hintAllowAlwaysMedium;
|
|
42
|
+
return text.hintAllowAlwaysLow;
|
|
43
|
+
}
|
|
44
|
+
function buildAllowAlwaysSlashCommand(toolName, risk) {
|
|
45
|
+
return `/permissions add allow ${toolName} ${risk}`;
|
|
46
|
+
}
|
|
47
|
+
function describeAllowAlwaysCommand(toolName, risk) {
|
|
48
|
+
return buildAllowAlwaysSlashCommand(toolName, risk);
|
|
49
|
+
}
|
|
50
|
+
function buildElevationOptions(input) {
|
|
51
|
+
const text = TEXT[input.language];
|
|
52
|
+
const alreadyAllowed = hasExistingAllowRule(input.existingRules, input.toolName, input.risk);
|
|
53
|
+
const options = [];
|
|
54
|
+
options.push({
|
|
55
|
+
id: "allow_once",
|
|
56
|
+
shortcut: "y",
|
|
57
|
+
label: text.allowOnce,
|
|
58
|
+
hint: text.hintAllowOnce
|
|
59
|
+
});
|
|
60
|
+
if (!alreadyAllowed) {
|
|
61
|
+
options.push({
|
|
62
|
+
id: "allow_always_tool",
|
|
63
|
+
shortcut: "a",
|
|
64
|
+
label: text.allowAlways,
|
|
65
|
+
hint: buildAllowAlwaysHint(text, input.risk)
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
options.push({
|
|
69
|
+
id: "deny",
|
|
70
|
+
shortcut: "n",
|
|
71
|
+
label: text.deny,
|
|
72
|
+
hint: text.hintDeny
|
|
73
|
+
});
|
|
74
|
+
options.push({
|
|
75
|
+
id: "details",
|
|
76
|
+
shortcut: "d",
|
|
77
|
+
label: text.details,
|
|
78
|
+
hint: text.hintDetails
|
|
79
|
+
});
|
|
80
|
+
return options;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
hasExistingAllowRule,
|
|
85
|
+
describeAllowAlwaysCommand,
|
|
86
|
+
buildElevationOptions
|
|
87
|
+
};
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
// src/architecture-boundary.ts
|
|
2
|
+
var DEFAULT_THRESHOLDS = {
|
|
3
|
+
maxFileLines: 800,
|
|
4
|
+
maxFunctionLines: 200,
|
|
5
|
+
maxNestingDepth: 4,
|
|
6
|
+
maxExportsForGodFile: 40,
|
|
7
|
+
godFileLineThreshold: 1500
|
|
8
|
+
};
|
|
9
|
+
var SUBSTANTIAL_ADDED_LINES = 40;
|
|
10
|
+
var MULTI_EDIT_SUBSTANTIAL_COUNT = 3;
|
|
11
|
+
var BASH_FILE_WRITE_PATTERN = /(?:^|\s|[;&|]\s*)(>>?|tee(?:\s+-a)?)\s+(\S+)|cat\s+<<\s*\S+\s*>>?\s*(\S+)/giu;
|
|
12
|
+
function detectBashFileWriteTargets(command) {
|
|
13
|
+
const targets = [];
|
|
14
|
+
const cleaned = command.replace(/^```(?:bash|sh|shell)?\s*/iu, "").replace(/```\s*$/u, "");
|
|
15
|
+
const regex = BASH_FILE_WRITE_PATTERN;
|
|
16
|
+
for (const match of cleaned.matchAll(regex)) {
|
|
17
|
+
const target = (match[2] ?? match[3] ?? "").replace(/^["']|["']$/gu, "");
|
|
18
|
+
if (target && !target.startsWith("/dev/") && !target.startsWith("$") && !target.startsWith("~")) {
|
|
19
|
+
targets.push(target);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return targets;
|
|
23
|
+
}
|
|
24
|
+
var LAYER_ORDER = {
|
|
25
|
+
shared: 0,
|
|
26
|
+
config: 1,
|
|
27
|
+
core: 2,
|
|
28
|
+
providers: 3,
|
|
29
|
+
tools: 4,
|
|
30
|
+
tui: 5,
|
|
31
|
+
cli: 6
|
|
32
|
+
};
|
|
33
|
+
function checkFileBoundaries(metrics, thresholds = DEFAULT_THRESHOLDS) {
|
|
34
|
+
const violations = [];
|
|
35
|
+
if (metrics.lineCount > thresholds.maxFileLines) {
|
|
36
|
+
const severity = metrics.lineCount > thresholds.godFileLineThreshold ? "critical" : "warning";
|
|
37
|
+
violations.push({
|
|
38
|
+
kind: metrics.lineCount > thresholds.godFileLineThreshold ? "god-file" : "large-file",
|
|
39
|
+
severity,
|
|
40
|
+
file: metrics.path,
|
|
41
|
+
detail: `${metrics.lineCount} lines (threshold: ${thresholds.maxFileLines})`,
|
|
42
|
+
metric: metrics.lineCount,
|
|
43
|
+
threshold: thresholds.maxFileLines,
|
|
44
|
+
suggestion: severity === "critical" ? "Mark for staged extraction in a future phase; do not expand further." : "Avoid adding more logic to this file; prefer adjacent modules."
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (metrics.functionLengths) {
|
|
48
|
+
for (const fn of metrics.functionLengths) {
|
|
49
|
+
if (fn.lines > thresholds.maxFunctionLines) {
|
|
50
|
+
violations.push({
|
|
51
|
+
kind: "large-function",
|
|
52
|
+
severity: fn.lines > thresholds.maxFunctionLines * 2 ? "critical" : "warning",
|
|
53
|
+
file: metrics.path,
|
|
54
|
+
detail: `Function "${fn.name}" is ${fn.lines} lines (threshold: ${thresholds.maxFunctionLines})`,
|
|
55
|
+
metric: fn.lines,
|
|
56
|
+
threshold: thresholds.maxFunctionLines,
|
|
57
|
+
suggestion: "Extract sub-logic into focused helpers within the same module."
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (metrics.maxNestingDepth !== void 0 && metrics.maxNestingDepth > thresholds.maxNestingDepth) {
|
|
63
|
+
violations.push({
|
|
64
|
+
kind: "deep-nesting",
|
|
65
|
+
severity: metrics.maxNestingDepth > thresholds.maxNestingDepth + 2 ? "critical" : "warning",
|
|
66
|
+
file: metrics.path,
|
|
67
|
+
detail: `Max nesting depth: ${metrics.maxNestingDepth} (threshold: ${thresholds.maxNestingDepth})`,
|
|
68
|
+
metric: metrics.maxNestingDepth,
|
|
69
|
+
threshold: thresholds.maxNestingDepth,
|
|
70
|
+
suggestion: "Use early returns, guard clauses, or extract nested logic."
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (metrics.exportCount !== void 0 && metrics.exportCount > thresholds.maxExportsForGodFile && metrics.lineCount > thresholds.maxFileLines) {
|
|
74
|
+
if (!violations.some((v) => v.kind === "god-file")) {
|
|
75
|
+
violations.push({
|
|
76
|
+
kind: "god-file",
|
|
77
|
+
severity: "critical",
|
|
78
|
+
file: metrics.path,
|
|
79
|
+
detail: `${metrics.exportCount} exports + ${metrics.lineCount} lines indicates a god file`,
|
|
80
|
+
metric: metrics.exportCount,
|
|
81
|
+
threshold: thresholds.maxExportsForGodFile,
|
|
82
|
+
suggestion: "Mark for staged extraction; do not add new exports without extracting existing ones."
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return violations;
|
|
87
|
+
}
|
|
88
|
+
function detectCrossLayerImports(filePath, importSources) {
|
|
89
|
+
const fileLayer = inferLayer(filePath);
|
|
90
|
+
if (fileLayer === void 0) return [];
|
|
91
|
+
const violations = [];
|
|
92
|
+
for (const source of importSources) {
|
|
93
|
+
const sourceLayer = inferLayerFromImport(source);
|
|
94
|
+
if (sourceLayer === void 0) continue;
|
|
95
|
+
const fileOrder = LAYER_ORDER[fileLayer];
|
|
96
|
+
const sourceOrder = LAYER_ORDER[sourceLayer];
|
|
97
|
+
if (fileOrder !== void 0 && sourceOrder !== void 0 && sourceOrder > fileOrder) {
|
|
98
|
+
violations.push({
|
|
99
|
+
kind: "cross-layer-import",
|
|
100
|
+
severity: "warning",
|
|
101
|
+
file: filePath,
|
|
102
|
+
detail: `Layer "${fileLayer}" imports from higher layer "${sourceLayer}" via "${source}"`,
|
|
103
|
+
suggestion: "Move shared logic to a lower layer or use dependency inversion."
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return violations;
|
|
108
|
+
}
|
|
109
|
+
function detectCircularDependencyRisk(fileA, fileB) {
|
|
110
|
+
const aImportsB = fileA.importSources.some(
|
|
111
|
+
(source) => source.includes(extractModuleName(fileB.path))
|
|
112
|
+
);
|
|
113
|
+
const bImportsA = fileB.importSources.some(
|
|
114
|
+
(source) => source.includes(extractModuleName(fileA.path))
|
|
115
|
+
);
|
|
116
|
+
if (aImportsB && bImportsA) {
|
|
117
|
+
return {
|
|
118
|
+
kind: "circular-dependency-risk",
|
|
119
|
+
severity: "warning",
|
|
120
|
+
file: `${fileA.path} <-> ${fileB.path}`,
|
|
121
|
+
detail: `Mutual import detected between ${fileA.path} and ${fileB.path}`,
|
|
122
|
+
suggestion: "Extract shared types/logic into a third module to break the cycle."
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return void 0;
|
|
126
|
+
}
|
|
127
|
+
function checkBoundaries(files, thresholds = DEFAULT_THRESHOLDS) {
|
|
128
|
+
const violations = [];
|
|
129
|
+
for (const file of files) {
|
|
130
|
+
violations.push(...checkFileBoundaries(file, thresholds));
|
|
131
|
+
if (file.importSources) {
|
|
132
|
+
violations.push(...detectCrossLayerImports(file.path, file.importSources));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const hasCritical = violations.some((v) => v.severity === "critical");
|
|
136
|
+
const hasBlocking = hasCritical;
|
|
137
|
+
return {
|
|
138
|
+
violations,
|
|
139
|
+
hasBlocking,
|
|
140
|
+
hasCritical,
|
|
141
|
+
summary: formatBoundaryCheckSummary(violations)
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function validateChangeDeclaration(declaration) {
|
|
145
|
+
const warnings = [];
|
|
146
|
+
if (!declaration.files || declaration.files.length === 0) {
|
|
147
|
+
warnings.push("Change declaration missing: files list is empty.");
|
|
148
|
+
}
|
|
149
|
+
if (!declaration.mainPath) {
|
|
150
|
+
warnings.push("Change declaration missing: mainPath not specified.");
|
|
151
|
+
}
|
|
152
|
+
if (!declaration.verificationLevel) {
|
|
153
|
+
warnings.push("Change declaration missing: verificationLevel not specified.");
|
|
154
|
+
}
|
|
155
|
+
if (declaration.files && declaration.files.length > 3 && (!declaration.realSmokeRequired || declaration.realSmokeRequired.length === 0)) {
|
|
156
|
+
warnings.push(
|
|
157
|
+
"Large change (>3 files) without realSmokeRequired items. Declare what needs real smoke verification."
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return warnings;
|
|
161
|
+
}
|
|
162
|
+
function checkBoundaryEditPreflight(request, thresholds = DEFAULT_THRESHOLDS) {
|
|
163
|
+
if (!request.targetExists || request.reportArtifact) {
|
|
164
|
+
return { decision: "allow", reason: "new file or report artifact" };
|
|
165
|
+
}
|
|
166
|
+
const existingSource = request.existingSource;
|
|
167
|
+
if (existingSource === void 0) {
|
|
168
|
+
return { decision: "allow", reason: "existing content unavailable" };
|
|
169
|
+
}
|
|
170
|
+
const metrics = estimateFileMetrics(request.path, existingSource);
|
|
171
|
+
const isLargeFile = metrics.lineCount > thresholds.maxFileLines || metrics.lineCount > thresholds.godFileLineThreshold || (metrics.exportCount ?? 0) > thresholds.maxExportsForGodFile && metrics.lineCount > thresholds.maxFileLines;
|
|
172
|
+
if (!isLargeFile) {
|
|
173
|
+
return { decision: "allow", reason: "target is below large-file thresholds" };
|
|
174
|
+
}
|
|
175
|
+
if (request.toolName === "Bash") {
|
|
176
|
+
return {
|
|
177
|
+
decision: "confirm",
|
|
178
|
+
reason: "large-file-boundary",
|
|
179
|
+
path: request.path,
|
|
180
|
+
lineCount: metrics.lineCount,
|
|
181
|
+
threshold: thresholds.maxFileLines,
|
|
182
|
+
estimatedAddedLines: 0
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const estimatedAddedLines = estimateAddedLines(request.toolName, request.input);
|
|
186
|
+
if (!isSubstantialEdit(request.toolName, request.input, estimatedAddedLines)) {
|
|
187
|
+
return { decision: "allow", reason: "small local edit" };
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
decision: "confirm",
|
|
191
|
+
reason: "large-file-boundary",
|
|
192
|
+
path: request.path,
|
|
193
|
+
lineCount: metrics.lineCount,
|
|
194
|
+
threshold: thresholds.maxFileLines,
|
|
195
|
+
estimatedAddedLines
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function formatBoundaryViolations(violations) {
|
|
199
|
+
if (violations.length === 0) return "No architecture boundary violations detected.";
|
|
200
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
201
|
+
for (const v of violations) {
|
|
202
|
+
const list = grouped.get(v.kind) ?? [];
|
|
203
|
+
list.push(v);
|
|
204
|
+
grouped.set(v.kind, list);
|
|
205
|
+
}
|
|
206
|
+
const lines = [`Architecture boundary violations: ${violations.length}`];
|
|
207
|
+
for (const [kind, items] of grouped) {
|
|
208
|
+
lines.push(` ${kind} (${items.length}):`);
|
|
209
|
+
for (const item of items.slice(0, 5)) {
|
|
210
|
+
lines.push(` - [${item.severity}] ${item.file}: ${item.detail}`);
|
|
211
|
+
}
|
|
212
|
+
if (items.length > 5) {
|
|
213
|
+
lines.push(` ... and ${items.length - 5} more`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return lines.join("\n");
|
|
217
|
+
}
|
|
218
|
+
function estimateFileMetrics(path, source) {
|
|
219
|
+
const lines = source.split(/\r?\n/);
|
|
220
|
+
const lineCount = lines.length;
|
|
221
|
+
let exportCount = 0;
|
|
222
|
+
for (const line of lines) {
|
|
223
|
+
if (/^\s*export\s+(function|const|let|var|class|type|interface|enum|default)\b/.test(line)) {
|
|
224
|
+
exportCount++;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const functionLengths = estimateFunctionLengths(lines);
|
|
228
|
+
const maxNestingDepth = estimateMaxNesting(lines);
|
|
229
|
+
const importSources = [];
|
|
230
|
+
for (const line of lines) {
|
|
231
|
+
const match = line.match(/(?:from|import)\s+["']([^"']+)["']/);
|
|
232
|
+
if (match?.[1]) {
|
|
233
|
+
importSources.push(match[1]);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
path,
|
|
238
|
+
lineCount,
|
|
239
|
+
exportCount,
|
|
240
|
+
importSources,
|
|
241
|
+
functionLengths,
|
|
242
|
+
maxNestingDepth
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function inferLayer(filePath) {
|
|
246
|
+
const normalized = filePath.replace(/\\/g, "/").toLowerCase();
|
|
247
|
+
const match = normalized.match(/packages\/([^/]+)\//);
|
|
248
|
+
if (match?.[1]) return match[1];
|
|
249
|
+
const appMatch = normalized.match(/apps\/([^/]+)\//);
|
|
250
|
+
if (appMatch) return "cli";
|
|
251
|
+
return void 0;
|
|
252
|
+
}
|
|
253
|
+
function inferLayerFromImport(source) {
|
|
254
|
+
const match = source.match(/@linghun\/([^/]+)/);
|
|
255
|
+
if (match?.[1]) return match[1];
|
|
256
|
+
return void 0;
|
|
257
|
+
}
|
|
258
|
+
function extractModuleName(filePath) {
|
|
259
|
+
const normalized = filePath.replace(/\\/g, "/");
|
|
260
|
+
const parts = normalized.split("/");
|
|
261
|
+
const fileName = parts[parts.length - 1] ?? "";
|
|
262
|
+
return fileName.replace(/\.(ts|tsx|js|jsx)$/, "");
|
|
263
|
+
}
|
|
264
|
+
function estimateFunctionLengths(lines) {
|
|
265
|
+
const results = [];
|
|
266
|
+
const functionStartPattern = /^\s*(?:export\s+)?(?:async\s+)?function\s+(\w+)|^\s*(?:export\s+)?(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/;
|
|
267
|
+
let currentFunction;
|
|
268
|
+
for (let i = 0; i < lines.length; i++) {
|
|
269
|
+
const line = lines[i];
|
|
270
|
+
if (!currentFunction) {
|
|
271
|
+
const match = functionStartPattern.exec(line);
|
|
272
|
+
if (match) {
|
|
273
|
+
const name = match[1] ?? match[2] ?? "anonymous";
|
|
274
|
+
currentFunction = { name, startLine: i, braceDepth: 0 };
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (currentFunction) {
|
|
278
|
+
for (const char of line) {
|
|
279
|
+
if (char === "{") currentFunction.braceDepth++;
|
|
280
|
+
if (char === "}") currentFunction.braceDepth--;
|
|
281
|
+
}
|
|
282
|
+
if (currentFunction.braceDepth <= 0 && i > currentFunction.startLine) {
|
|
283
|
+
const length = i - currentFunction.startLine + 1;
|
|
284
|
+
if (length > 10) {
|
|
285
|
+
results.push({ name: currentFunction.name, lines: length });
|
|
286
|
+
}
|
|
287
|
+
currentFunction = void 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (currentFunction) {
|
|
292
|
+
const length = lines.length - currentFunction.startLine;
|
|
293
|
+
if (length > 10) {
|
|
294
|
+
results.push({ name: currentFunction.name, lines: length });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return results;
|
|
298
|
+
}
|
|
299
|
+
function estimateMaxNesting(lines) {
|
|
300
|
+
let maxDepth = 0;
|
|
301
|
+
let currentDepth = 0;
|
|
302
|
+
for (const line of lines) {
|
|
303
|
+
const stripped = line.replace(/\/\/.*$/, "").replace(/"[^"]*"|'[^']*'|`[^`]*`/g, "");
|
|
304
|
+
for (const char of stripped) {
|
|
305
|
+
if (char === "{" || char === "(" || char === "[") {
|
|
306
|
+
currentDepth++;
|
|
307
|
+
if (currentDepth > maxDepth) maxDepth = currentDepth;
|
|
308
|
+
}
|
|
309
|
+
if (char === "}" || char === ")" || char === "]") {
|
|
310
|
+
currentDepth = Math.max(0, currentDepth - 1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return maxDepth;
|
|
315
|
+
}
|
|
316
|
+
function estimateAddedLines(toolName, input) {
|
|
317
|
+
if (typeof input !== "object" || input === null) {
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
if (toolName === "Write") {
|
|
321
|
+
const content = input.content;
|
|
322
|
+
return typeof content === "string" ? lineCountOf(content) : 0;
|
|
323
|
+
}
|
|
324
|
+
if (toolName === "Edit") {
|
|
325
|
+
const oldText = input.oldText;
|
|
326
|
+
const newText = input.newText;
|
|
327
|
+
if (typeof newText !== "string") return 0;
|
|
328
|
+
const oldLines = typeof oldText === "string" ? lineCountOf(oldText) : 0;
|
|
329
|
+
return Math.max(0, lineCountOf(newText) - oldLines);
|
|
330
|
+
}
|
|
331
|
+
const edits = input.edits;
|
|
332
|
+
if (!Array.isArray(edits)) {
|
|
333
|
+
return 0;
|
|
334
|
+
}
|
|
335
|
+
return edits.reduce((total, item) => {
|
|
336
|
+
if (typeof item !== "object" || item === null) return total;
|
|
337
|
+
const oldText = item.oldText;
|
|
338
|
+
const newText = item.newText;
|
|
339
|
+
if (typeof newText !== "string") return total;
|
|
340
|
+
const oldLines = typeof oldText === "string" ? lineCountOf(oldText) : 0;
|
|
341
|
+
return total + Math.max(0, lineCountOf(newText) - oldLines);
|
|
342
|
+
}, 0);
|
|
343
|
+
}
|
|
344
|
+
function isSubstantialEdit(toolName, input, estimatedAddedLines) {
|
|
345
|
+
if (estimatedAddedLines >= SUBSTANTIAL_ADDED_LINES) {
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
if (toolName !== "MultiEdit" || typeof input !== "object" || input === null) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
const edits = input.edits;
|
|
352
|
+
return Array.isArray(edits) && edits.length >= MULTI_EDIT_SUBSTANTIAL_COUNT;
|
|
353
|
+
}
|
|
354
|
+
function lineCountOf(text) {
|
|
355
|
+
if (text.length === 0) return 0;
|
|
356
|
+
return text.split(/\r?\n/).length;
|
|
357
|
+
}
|
|
358
|
+
function formatBoundaryCheckSummary(violations) {
|
|
359
|
+
if (violations.length === 0) return "clean";
|
|
360
|
+
const critical = violations.filter((v) => v.severity === "critical").length;
|
|
361
|
+
const warning = violations.filter((v) => v.severity === "warning").length;
|
|
362
|
+
const info = violations.filter((v) => v.severity === "info").length;
|
|
363
|
+
const parts = [];
|
|
364
|
+
if (critical > 0) parts.push(`${critical} critical`);
|
|
365
|
+
if (warning > 0) parts.push(`${warning} warning`);
|
|
366
|
+
if (info > 0) parts.push(`${info} info`);
|
|
367
|
+
return parts.join(", ");
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export {
|
|
371
|
+
DEFAULT_THRESHOLDS,
|
|
372
|
+
detectBashFileWriteTargets,
|
|
373
|
+
checkFileBoundaries,
|
|
374
|
+
detectCrossLayerImports,
|
|
375
|
+
detectCircularDependencyRisk,
|
|
376
|
+
checkBoundaries,
|
|
377
|
+
validateChangeDeclaration,
|
|
378
|
+
checkBoundaryEditPreflight,
|
|
379
|
+
formatBoundaryViolations,
|
|
380
|
+
estimateFileMetrics
|
|
381
|
+
};
|