@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,489 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rememberBackgroundTask
|
|
3
|
+
} from "./chunk-ZZ2CNCXJ.js";
|
|
4
|
+
import {
|
|
5
|
+
createProcessGuard
|
|
6
|
+
} from "./chunk-JHGWGH2C.js";
|
|
7
|
+
import {
|
|
8
|
+
formatBackgroundTask
|
|
9
|
+
} from "./chunk-UDQT5CWK.js";
|
|
10
|
+
import {
|
|
11
|
+
LINGHUN_VERIFICATION_COMMAND_TIMEOUT_MS
|
|
12
|
+
} from "./chunk-IWUIOLMF.js";
|
|
13
|
+
import {
|
|
14
|
+
isRecord
|
|
15
|
+
} from "./chunk-QLRTQHTR.js";
|
|
16
|
+
import {
|
|
17
|
+
truncateDisplay,
|
|
18
|
+
writeLine
|
|
19
|
+
} from "./chunk-OMZYPQVA.js";
|
|
20
|
+
|
|
21
|
+
// src/verification-command-runtime.ts
|
|
22
|
+
import { spawn } from "child_process";
|
|
23
|
+
import { randomUUID } from "crypto";
|
|
24
|
+
import { mkdir, readFile, stat, writeFile } from "fs/promises";
|
|
25
|
+
import { join } from "path";
|
|
26
|
+
import { resolveStoragePaths } from "@linghun/config";
|
|
27
|
+
async function createVerificationPlan(projectPath, mode) {
|
|
28
|
+
if (mode === "smoke") {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
kind: "smoke",
|
|
32
|
+
command: `node -e "console.log('linghun verify smoke')"`,
|
|
33
|
+
reason: "\u6700\u5C0F\u5408\u6210 smoke\uFF1A\u4EC5\u786E\u8BA4 Verification Runner \u53EF\u6267\u884C\u547D\u4EE4\u5E76\u5F52\u6863 evidence\uFF1B\u4E0D\u662F\u771F\u5B9E provider/TUI/render/report \u4E3B\u94FE smoke\u3002",
|
|
34
|
+
synthetic: true
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
const packageJson = await safeReadJson(join(projectPath, "package.json"));
|
|
39
|
+
const scripts = isRecord(packageJson?.scripts) ? packageJson.scripts : {};
|
|
40
|
+
const packageManager = await detectPackageManager(projectPath);
|
|
41
|
+
if (mode === "real-smoke") {
|
|
42
|
+
return createRealSmokePlan(scripts, packageManager);
|
|
43
|
+
}
|
|
44
|
+
const steps = [];
|
|
45
|
+
addPackageStep(
|
|
46
|
+
steps,
|
|
47
|
+
scripts,
|
|
48
|
+
"typecheck",
|
|
49
|
+
"typecheck",
|
|
50
|
+
"TypeScript \u7C7B\u578B\u68C0\u67E5\u3002 ",
|
|
51
|
+
packageManager
|
|
52
|
+
);
|
|
53
|
+
addPackageStep(steps, scripts, "test", "test", "\u9879\u76EE\u6D4B\u8BD5\u5957\u4EF6\u3002 ", packageManager);
|
|
54
|
+
addPackageStep(steps, scripts, "lint", "lint", "lint \u9759\u6001\u68C0\u67E5\u3002 ", packageManager);
|
|
55
|
+
addPackageStep(steps, scripts, "build", "build", "\u6784\u5EFA\u9A8C\u8BC1\u3002 ", packageManager);
|
|
56
|
+
addPackageStep(steps, scripts, "smoke", "smoke", "\u9879\u76EE\u81EA\u5B9A\u4E49 smoke \u9A8C\u8BC1\u3002 ", packageManager);
|
|
57
|
+
if (steps.length > 0) {
|
|
58
|
+
if (mode === "focused") {
|
|
59
|
+
const focused = steps.filter(
|
|
60
|
+
(step) => step.kind === "typecheck" || step.kind === "test" || step.kind === "lint"
|
|
61
|
+
);
|
|
62
|
+
return focused.length > 0 ? focused : steps.slice(0, 1);
|
|
63
|
+
}
|
|
64
|
+
return steps;
|
|
65
|
+
}
|
|
66
|
+
if (mode === "focused") {
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
kind: "smoke",
|
|
70
|
+
command: "node --version",
|
|
71
|
+
reason: "\u672A\u53D1\u73B0\u9879\u76EE focused \u9A8C\u8BC1\u811A\u672C\uFF0C\u964D\u7EA7\u4E3A Node \u8FD0\u884C\u73AF\u5883 self-check\uFF1B\u8FD9\u662F synthetic\uFF0C\u4E0D\u80FD\u5F53\u4F5C real-smoke\u3002",
|
|
72
|
+
synthetic: true
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
return [
|
|
77
|
+
{
|
|
78
|
+
kind: "smoke",
|
|
79
|
+
command: "node --version",
|
|
80
|
+
reason: "\u672A\u53D1\u73B0\u9879\u76EE\u9A8C\u8BC1\u811A\u672C\uFF0C\u964D\u7EA7\u4E3A Node \u8FD0\u884C\u73AF\u5883 smoke \u68C0\u67E5\u3002",
|
|
81
|
+
synthetic: true
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
function createVerificationUnavailableReport(kind, reason) {
|
|
86
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
87
|
+
return {
|
|
88
|
+
id: randomUUID(),
|
|
89
|
+
status: "partial",
|
|
90
|
+
summary: `PARTIAL\uFF1A${kind} \u672A\u8FD0\u884C\uFF0C\u672A\u751F\u6210 PASS \u8BC1\u636E\u3002`,
|
|
91
|
+
commands: [],
|
|
92
|
+
unverified: [`${kind}: ${reason}`],
|
|
93
|
+
risk: [`${kind} \u7F3A\u5C11\u53EF\u6267\u884C\u5165\u53E3\uFF1B\u4E0D\u5F97\u58F0\u79F0\u9A8C\u8BC1\u901A\u8FC7\u3002`],
|
|
94
|
+
startedAt: now,
|
|
95
|
+
endedAt: now,
|
|
96
|
+
durationMs: 0,
|
|
97
|
+
nextAction: kind === "real-smoke" ? "\u5728 package.json \u589E\u52A0\u771F\u5B9E smoke \u811A\u672C\u540E\u8FD0\u884C /verify real-smoke\uFF0C\u6216\u660E\u786E\u964D\u7EA7\u4E3A synthetic self-check\u3002" : "\u8865\u5145\u9879\u76EE\u9A8C\u8BC1\u811A\u672C\uFF0C\u6216\u8FD0\u884C /verify smoke \u53EA\u505A runner self-check\u3002"
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function addPackageStep(steps, scripts, scriptName, kind, reason, packageManager = "pnpm") {
|
|
101
|
+
if (typeof scripts[scriptName] !== "string") {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
steps.push({ kind, command: formatPackageManagerCommand(packageManager, scriptName), reason });
|
|
105
|
+
}
|
|
106
|
+
function createRealSmokePlan(scripts, packageManager) {
|
|
107
|
+
if (typeof scripts.smoke === "string") {
|
|
108
|
+
return [
|
|
109
|
+
{
|
|
110
|
+
kind: "smoke",
|
|
111
|
+
command: formatPackageManagerCommand(packageManager, "smoke"),
|
|
112
|
+
reason: "\u9879\u76EE\u81EA\u5B9A\u4E49 real-smoke\uFF1A\u4F7F\u7528 package.json smoke \u811A\u672C\uFF1B\u975E synthetic\uFF0C\u53EF\u4F5C\u4E3A\u771F\u5B9E smoke \u5019\u9009\u8BC1\u636E\u3002",
|
|
113
|
+
synthetic: false
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
const candidates = [
|
|
118
|
+
{
|
|
119
|
+
scriptName: "smoke:tui-stdin",
|
|
120
|
+
reason: "\u9879\u76EE TUI stdin real-smoke\uFF1A\u8986\u76D6\u771F\u5B9E CLI/TUI \u8F93\u5165\u4E3B\u94FE\uFF1B\u975E synthetic\uFF0C\u53EF\u4F5C\u4E3A\u771F\u5B9E smoke \u5019\u9009\u8BC1\u636E\u3002"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
scriptName: "smoke:live-provider",
|
|
124
|
+
reason: "\u9879\u76EE live-provider real-smoke\uFF1A\u8986\u76D6\u771F\u5B9E provider \u8BF7\u6C42\u4E3B\u94FE\uFF1B\u975E synthetic\uFF0C\u53EF\u4F5C\u4E3A\u771F\u5B9E provider smoke \u5019\u9009\u8BC1\u636E\u3002"
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
return candidates.filter((candidate) => typeof scripts[candidate.scriptName] === "string").map((candidate) => ({
|
|
128
|
+
kind: "smoke",
|
|
129
|
+
command: formatPackageManagerCommand(packageManager, candidate.scriptName),
|
|
130
|
+
reason: candidate.reason,
|
|
131
|
+
synthetic: false
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
async function detectPackageManager(projectPath) {
|
|
135
|
+
if (await fileExists(join(projectPath, "pnpm-lock.yaml"))) return "pnpm";
|
|
136
|
+
if (await fileExists(join(projectPath, "package-lock.json"))) return "npm";
|
|
137
|
+
if (await fileExists(join(projectPath, "yarn.lock"))) return "yarn";
|
|
138
|
+
if (await fileExists(join(projectPath, "bun.lockb")) || await fileExists(join(projectPath, "bun.lock"))) {
|
|
139
|
+
return "bun";
|
|
140
|
+
}
|
|
141
|
+
return "pnpm";
|
|
142
|
+
}
|
|
143
|
+
function formatPackageManagerCommand(packageManager, scriptName) {
|
|
144
|
+
if (packageManager === "npm") return `npm run ${scriptName}`;
|
|
145
|
+
if (packageManager === "yarn") return `corepack yarn ${scriptName}`;
|
|
146
|
+
if (packageManager === "bun") return `bun run ${scriptName}`;
|
|
147
|
+
return `corepack pnpm ${scriptName}`;
|
|
148
|
+
}
|
|
149
|
+
async function fileExists(path) {
|
|
150
|
+
try {
|
|
151
|
+
await stat(path);
|
|
152
|
+
return true;
|
|
153
|
+
} catch {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async function runVerificationPlan(plan, context, sessionId, output, appendBackgroundTaskEvent) {
|
|
158
|
+
const runId = randomUUID();
|
|
159
|
+
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
160
|
+
const logRoot = join(
|
|
161
|
+
resolveStoragePaths(context.config, context.projectPath).logs,
|
|
162
|
+
"verification"
|
|
163
|
+
);
|
|
164
|
+
await mkdir(logRoot, { recursive: true });
|
|
165
|
+
const controller = new AbortController();
|
|
166
|
+
context.activeVerificationAbortController = controller;
|
|
167
|
+
context.interrupt = { type: "running", taskId: runId, canCancel: true };
|
|
168
|
+
const task = {
|
|
169
|
+
id: runId,
|
|
170
|
+
kind: "verification",
|
|
171
|
+
title: "Verification Runner",
|
|
172
|
+
status: "running",
|
|
173
|
+
currentStep: "preparing verification",
|
|
174
|
+
progress: { completed: 0, total: plan.length, label: "verify" },
|
|
175
|
+
startedAt,
|
|
176
|
+
updatedAt: startedAt,
|
|
177
|
+
heartbeatIntervalMs: 3e4,
|
|
178
|
+
staleAfterMs: 12e4,
|
|
179
|
+
logPath: logRoot,
|
|
180
|
+
hasOutput: false,
|
|
181
|
+
userVisibleSummary: `\u9A8C\u8BC1\u5DF2\u542F\u52A8\uFF1A${plan.length} \u4E2A\u6B65\u9AA4\u3002\u53EF\u7528 /background \u67E5\u770B\u8BE6\u60C5\u3002`,
|
|
182
|
+
nextAction: "\u7B49\u5F85 PASS / FAIL / PARTIAL \u7ED3\u679C\uFF0C\u5931\u8D25\u540E\u6309\u5EFA\u8BAE\u4FEE\u590D\u5E76\u590D\u8DD1 /verify\u3002"
|
|
183
|
+
};
|
|
184
|
+
rememberBackgroundTask(context, task);
|
|
185
|
+
await context.store.appendEvent(sessionId, {
|
|
186
|
+
type: "verification_start",
|
|
187
|
+
run: { id: runId, plan, startedAt },
|
|
188
|
+
createdAt: startedAt
|
|
189
|
+
});
|
|
190
|
+
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
191
|
+
writeLine(output, formatBackgroundTask(task, context.language));
|
|
192
|
+
const results = [];
|
|
193
|
+
const unverified = [];
|
|
194
|
+
const risk = [];
|
|
195
|
+
try {
|
|
196
|
+
for (const [index, step] of plan.entries()) {
|
|
197
|
+
const stepStarted = Date.now();
|
|
198
|
+
task.currentStep = `${step.kind} ${index + 1}/${plan.length}`;
|
|
199
|
+
task.progress = { completed: index, total: plan.length, label: step.kind };
|
|
200
|
+
task.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
201
|
+
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
202
|
+
writeLine(output, `\u9A8C\u8BC1\u6B65\u9AA4\uFF1A${task.currentStep} \xB7 ${step.command}`);
|
|
203
|
+
const logPath = join(logRoot, `${runId}-${index + 1}-${step.kind}.log`);
|
|
204
|
+
const result = await runVerificationCommand(
|
|
205
|
+
step.command,
|
|
206
|
+
context.projectPath,
|
|
207
|
+
controller.signal
|
|
208
|
+
);
|
|
209
|
+
const durationMs = Date.now() - stepStarted;
|
|
210
|
+
const runnerErrorLine = result.runnerError ? `runner error ${result.runnerError}
|
|
211
|
+
` : "";
|
|
212
|
+
const fullLog = `$ ${step.command}
|
|
213
|
+
exit code ${result.exitCode}
|
|
214
|
+
outcome ${result.outcome}
|
|
215
|
+
${runnerErrorLine}duration ${durationMs}ms
|
|
216
|
+
|
|
217
|
+
${result.output}`;
|
|
218
|
+
await writeFile(logPath, fullLog, "utf8");
|
|
219
|
+
const summary = summarizeVerificationOutput(
|
|
220
|
+
result.output,
|
|
221
|
+
result.exitCode,
|
|
222
|
+
result.runnerError
|
|
223
|
+
);
|
|
224
|
+
const wasMarkedStale = task.status === "stale";
|
|
225
|
+
const commandStatus = result.outcome === "cancelled" ? "cancelled" : result.outcome === "timeout" ? "timeout" : wasMarkedStale ? "stale" : result.runnerError ? "partial" : result.exitCode === 0 ? "pass" : "fail";
|
|
226
|
+
if (commandStatus === "fail") {
|
|
227
|
+
risk.push(`${step.kind} \u5931\u8D25\uFF1A${summary}`);
|
|
228
|
+
}
|
|
229
|
+
if (commandStatus === "partial") {
|
|
230
|
+
unverified.push(`${step.kind} runner error\uFF1A${summary}`);
|
|
231
|
+
risk.push(`${step.kind} runner/toolchain \u517C\u5BB9\u98CE\u9669\uFF1A${summary}`);
|
|
232
|
+
}
|
|
233
|
+
if (commandStatus === "cancelled" || commandStatus === "timeout") {
|
|
234
|
+
unverified.push(`${step.kind} ${commandStatus}\uFF1A${summary}`);
|
|
235
|
+
risk.push(`${step.kind} \u672A\u5B8C\u6210\uFF1A${commandStatus}\uFF1B\u4E0D\u5F97\u751F\u6210 PASS \u8BC1\u636E\u3002`);
|
|
236
|
+
}
|
|
237
|
+
if (commandStatus === "stale") {
|
|
238
|
+
unverified.push(`${step.kind} stale\uFF1A${summary}`);
|
|
239
|
+
risk.push(`${step.kind} \u66FE\u88AB\u6807\u8BB0\u4E3A stale\uFF1B\u5373\u4F7F\u547D\u4EE4\u968F\u540E\u7ED3\u675F\uFF0C\u4E5F\u4E0D\u5F97\u751F\u6210 PASS \u8BC1\u636E\u3002`);
|
|
240
|
+
}
|
|
241
|
+
results.push({
|
|
242
|
+
...step,
|
|
243
|
+
status: commandStatus,
|
|
244
|
+
exitCode: result.exitCode,
|
|
245
|
+
durationMs,
|
|
246
|
+
logPath,
|
|
247
|
+
summary,
|
|
248
|
+
runnerError: result.runnerError
|
|
249
|
+
});
|
|
250
|
+
task.lastOutputAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
251
|
+
task.hasOutput = Boolean(result.output.trim());
|
|
252
|
+
if (commandStatus === "cancelled" || commandStatus === "timeout" || commandStatus === "stale") {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const endedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
257
|
+
const failed = results.filter((item) => item.status === "fail");
|
|
258
|
+
const partial = results.filter((item) => item.status === "partial");
|
|
259
|
+
const cancelled = results.filter((item) => item.status === "cancelled");
|
|
260
|
+
const timedOut = results.filter((item) => item.status === "timeout");
|
|
261
|
+
const stale = results.filter((item) => item.status === "stale");
|
|
262
|
+
const hasRunnerError = partial.some((item) => item.runnerError);
|
|
263
|
+
const status = cancelled.length > 0 ? "cancelled" : timedOut.length > 0 ? "timeout" : stale.length > 0 ? "stale" : failed.length > 0 ? "fail" : partial.length > 0 || unverified.length > 0 ? "partial" : "pass";
|
|
264
|
+
const syntheticOnlyPass = status === "pass" && results.every((item) => item.synthetic === true || item.status !== "pass");
|
|
265
|
+
const report = {
|
|
266
|
+
id: runId,
|
|
267
|
+
status,
|
|
268
|
+
summary: status === "pass" ? syntheticOnlyPass ? "SELF-CHECK\uFF1Asynthetic self-check \u5DF2\u901A\u8FC7\uFF1B\u771F\u5B9E\u9A8C\u8BC1\u672A\u8FD0\u884C\uFF0C\u4E0D\u80FD\u4F5C\u4E3A\u771F\u5B9E PASS \u8BC1\u636E\u3002" : `PASS\uFF1A${results.length} \u4E2A\u9A8C\u8BC1\u6B65\u9AA4\u901A\u8FC7\u3002` : status === "fail" ? `FAIL\uFF1A${failed.length}/${results.length} \u4E2A\u9A8C\u8BC1\u6B65\u9AA4\u5931\u8D25\u3002` : status === "cancelled" ? "CANCELLED\uFF1A\u9A8C\u8BC1\u5DF2\u53D6\u6D88\uFF0C\u672A\u751F\u6210 PASS \u8BC1\u636E\u3002" : status === "timeout" ? "TIMEOUT\uFF1A\u9A8C\u8BC1\u8D85\u65F6\uFF0C\u672A\u751F\u6210 PASS \u8BC1\u636E\u3002" : status === "stale" ? "STALE\uFF1A\u9A8C\u8BC1\u4EFB\u52A1\u7591\u4F3C\u5361\u4F4F\uFF0C\u672A\u751F\u6210 PASS \u8BC1\u636E\u3002" : hasRunnerError ? "PARTIAL\uFF1A\u9A8C\u8BC1\u547D\u4EE4\u5DF2\u8FD0\u884C\uFF0C\u4F46 runner/toolchain \u9000\u51FA\u6E05\u7406\u5F02\u5E38\u3002" : `PARTIAL\uFF1A${unverified.length} \u9879\u672A\u9A8C\u8BC1\u3002`,
|
|
269
|
+
commands: results,
|
|
270
|
+
unverified,
|
|
271
|
+
risk,
|
|
272
|
+
logPath: logRoot,
|
|
273
|
+
startedAt,
|
|
274
|
+
endedAt,
|
|
275
|
+
durationMs: Date.parse(endedAt) - Date.parse(startedAt),
|
|
276
|
+
nextAction: status === "pass" ? "\u53EF\u7EE7\u7EED\u5BA1\u67E5\u7ED3\u679C\u6216\u8FDB\u5165\u4EA4\u4ED8\u603B\u7ED3\u3002" : hasRunnerError ? "\u67E5\u770B runner error \u65E5\u5FD7\uFF0C\u8BB0\u5F55 Node \u7248\u672C\uFF0C\u5E76\u5EFA\u8BAE\u7528 Node 22 LTS \u590D\u6838\u3002" : "\u5148\u67E5\u770B\u5931\u8D25\u547D\u4EE4\u4E0E\u65E5\u5FD7\uFF0C\u4FEE\u590D\u540E\u590D\u8DD1 /verify\u3002"
|
|
277
|
+
};
|
|
278
|
+
task.status = status === "fail" ? "failed" : status === "cancelled" || status === "timeout" || status === "stale" ? status : "completed";
|
|
279
|
+
task.result = status;
|
|
280
|
+
task.currentStep = status === "pass" ? "verification finished" : `verification ${status}`;
|
|
281
|
+
task.progress = { completed: results.length, total: plan.length, label: "verify" };
|
|
282
|
+
task.updatedAt = endedAt;
|
|
283
|
+
task.nextAction = report.nextAction;
|
|
284
|
+
task.userVisibleSummary = report.summary;
|
|
285
|
+
await appendBackgroundTaskEvent(context, sessionId, task);
|
|
286
|
+
await context.store.appendEvent(sessionId, {
|
|
287
|
+
type: "verification_end",
|
|
288
|
+
report,
|
|
289
|
+
createdAt: endedAt
|
|
290
|
+
});
|
|
291
|
+
return report;
|
|
292
|
+
} finally {
|
|
293
|
+
if (context.activeVerificationAbortController === controller) {
|
|
294
|
+
context.activeVerificationAbortController = void 0;
|
|
295
|
+
}
|
|
296
|
+
context.interrupt = { type: "idle" };
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
async function runVerificationCommand(command, cwd, signal, timeoutMs = LINGHUN_VERIFICATION_COMMAND_TIMEOUT_MS) {
|
|
300
|
+
return new Promise((resolveCommand) => {
|
|
301
|
+
const detached = process.platform !== "win32";
|
|
302
|
+
const child = spawn(command, { cwd, shell: true, detached, windowsHide: true });
|
|
303
|
+
const guard = createProcessGuard();
|
|
304
|
+
guard.track(child, { detached, label: "verification" });
|
|
305
|
+
let output = "";
|
|
306
|
+
let settled = false;
|
|
307
|
+
let forceTimer;
|
|
308
|
+
const scheduleForceStop = () => {
|
|
309
|
+
forceTimer = setTimeout(() => guard.requestStop(true), 1e3);
|
|
310
|
+
};
|
|
311
|
+
const settle = (result) => {
|
|
312
|
+
if (settled) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
settled = true;
|
|
316
|
+
clearTimeout(timeout);
|
|
317
|
+
if (forceTimer && result.outcome === void 0) {
|
|
318
|
+
clearTimeout(forceTimer);
|
|
319
|
+
}
|
|
320
|
+
signal?.removeEventListener("abort", onAbort);
|
|
321
|
+
resolveCommand({ ...result, outcome: result.outcome ?? "completed" });
|
|
322
|
+
};
|
|
323
|
+
const onAbort = () => {
|
|
324
|
+
const runnerError = "runner cancelled by interrupt";
|
|
325
|
+
output = output ? `${output}
|
|
326
|
+
${runnerError}` : runnerError;
|
|
327
|
+
guard.requestStop(false);
|
|
328
|
+
scheduleForceStop();
|
|
329
|
+
settle({ exitCode: 1, output, outcome: "cancelled", runnerError });
|
|
330
|
+
};
|
|
331
|
+
const timeout = setTimeout(() => {
|
|
332
|
+
const runnerError = `runner timeout after ${timeoutMs}ms`;
|
|
333
|
+
output = output ? `${output}
|
|
334
|
+
${runnerError}` : runnerError;
|
|
335
|
+
guard.requestStop(false);
|
|
336
|
+
scheduleForceStop();
|
|
337
|
+
settle({ exitCode: 1, output, outcome: "timeout", runnerError });
|
|
338
|
+
}, timeoutMs);
|
|
339
|
+
if (signal?.aborted) {
|
|
340
|
+
onAbort();
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
344
|
+
child.stdout.on("data", (chunk) => {
|
|
345
|
+
output += chunk.toString("utf8");
|
|
346
|
+
});
|
|
347
|
+
child.stderr.on("data", (chunk) => {
|
|
348
|
+
output += chunk.toString("utf8");
|
|
349
|
+
});
|
|
350
|
+
child.on("error", (error) => {
|
|
351
|
+
const runnerError = `runner error: ${error.message}`;
|
|
352
|
+
settle({
|
|
353
|
+
exitCode: 1,
|
|
354
|
+
output: output ? `${output}
|
|
355
|
+
${runnerError}` : runnerError,
|
|
356
|
+
runnerError
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
child.on("close", (code, childSignal) => {
|
|
360
|
+
const exitCode = code ?? 1;
|
|
361
|
+
const runnerError = detectRunnerCompatibilityError(output, exitCode, childSignal);
|
|
362
|
+
settle({ exitCode, output, runnerError });
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
function detectRunnerCompatibilityError(output, exitCode, signal) {
|
|
367
|
+
if (signal) {
|
|
368
|
+
return `runner stopped by signal ${signal}`;
|
|
369
|
+
}
|
|
370
|
+
if (exitCode === 0) {
|
|
371
|
+
return void 0;
|
|
372
|
+
}
|
|
373
|
+
const ansiPattern = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g");
|
|
374
|
+
const normalized = output.replace(ansiPattern, "");
|
|
375
|
+
const vitestPassed = /Test Files\s+\d+\s+passed/i.test(normalized) && /Tests\s+\d+\s+passed/i.test(normalized);
|
|
376
|
+
const nodeCleanupError = normalized.includes("TypeError: emitter.removeListener is not a function") || normalized.includes("emitter.removeListener is not a function");
|
|
377
|
+
if (vitestPassed && nodeCleanupError) {
|
|
378
|
+
return "runner/toolchain cleanup error after tests passed; verify again with Node 22 LTS";
|
|
379
|
+
}
|
|
380
|
+
const childSignal = normalized.match(/\bSIG(?:TERM|KILL|INT|HUP|ABRT)\b/);
|
|
381
|
+
if (childSignal) {
|
|
382
|
+
return `runner/child stopped by signal ${childSignal[0]}`;
|
|
383
|
+
}
|
|
384
|
+
return void 0;
|
|
385
|
+
}
|
|
386
|
+
function createReviewReport(context) {
|
|
387
|
+
const changedFiles = context.tools.changedFiles.length > 0 ? context.tools.changedFiles : ["\u672A\u8BB0\u5F55\u6539\u52A8"];
|
|
388
|
+
const verification = context.lastVerification;
|
|
389
|
+
const conservativeStatuses = [
|
|
390
|
+
"fail",
|
|
391
|
+
"partial",
|
|
392
|
+
"cancelled",
|
|
393
|
+
"timeout",
|
|
394
|
+
"stale"
|
|
395
|
+
];
|
|
396
|
+
const conservative = verification ? conservativeStatuses.includes(verification.status) : true;
|
|
397
|
+
const priority = verification?.status === "fail" || verification?.status === "timeout" || verification?.status === "stale" ? "P0" : conservative ? "P1" : "P2";
|
|
398
|
+
const risk = verification ? verification.risk.length > 0 ? verification.risk.join("; ") : `\u6700\u8FD1\u9A8C\u8BC1\u4E3A ${verification.status.toUpperCase()}` : "\u5C1A\u672A\u8FD0\u884C /verify\uFF0C\u4E0D\u80FD\u58F0\u79F0 PASS \u6216\u5DF2\u9A8C\u8BC1\u3002";
|
|
399
|
+
const suggestion = verification?.status === "fail" ? "\u5148\u6309\u5931\u8D25\u547D\u4EE4\u65E5\u5FD7\u4FEE\u590D\uFF0C\u518D\u590D\u8DD1 /verify\u3002" : verification?.status === "partial" ? "\u5148\u67E5\u770B runner error \u65E5\u5FD7\uFF1B\u5982\u4E3A Node/\u5DE5\u5177\u94FE\u9000\u51FA\u6E05\u7406\u5F02\u5E38\uFF0C\u5EFA\u8BAE\u7528 Node 22 LTS \u590D\u6838\u3002" : verification?.status === "cancelled" ? "\u9A8C\u8BC1\u5DF2\u53D6\u6D88\uFF1B\u5148\u786E\u8BA4\u53D6\u6D88\u539F\u56E0\uFF0C\u518D\u590D\u8DD1 /verify\uFF0C\u5F53\u524D\u4E0D\u5F97\u7ED9 PASS verdict\u3002" : verification?.status === "timeout" ? "\u9A8C\u8BC1\u8D85\u65F6\uFF1B\u5148\u67E5\u770B\u65E5\u5FD7\u548C\u8FDB\u7A0B\u6E05\u7406\u60C5\u51B5\uFF0C\u7F29\u5C0F\u547D\u4EE4\u6216\u4FEE\u590D\u5361\u4F4F\u70B9\u540E\u590D\u8DD1\u3002" : verification?.status === "stale" ? "\u9A8C\u8BC1\u4EFB\u52A1\u7591\u4F3C\u5361\u4F4F\uFF1B\u5148\u67E5\u770B /background \u548C\u65E5\u5FD7\uFF0C\u5FC5\u8981\u65F6 /interrupt \u540E\u590D\u8DD1\u3002" : verification ? "\u7ED3\u5408 diff \u4EBA\u5DE5\u786E\u8BA4\u9700\u6C42\u8986\u76D6\uFF1B\u5982\u6709\u65B0\u6539\u52A8\u8BF7\u590D\u8DD1 /verify\u3002" : "\u5148\u8FD0\u884C /verify \u6216 /verify plan\uFF0C\u5F62\u6210 test_result evidence\u3002";
|
|
400
|
+
return [
|
|
401
|
+
"Review Report",
|
|
402
|
+
`- Priority: ${priority}`,
|
|
403
|
+
`- Files: ${changedFiles.join(", ")}`,
|
|
404
|
+
`- Risk: ${risk}`,
|
|
405
|
+
`- Verdict: ${verification?.status === "pass" ? "SCOPED_PASS_WITH_EVIDENCE" : "CONSERVATIVE_NO_PASS"}`,
|
|
406
|
+
`- Suggestion: ${suggestion}`
|
|
407
|
+
].join("\n");
|
|
408
|
+
}
|
|
409
|
+
function formatVerificationPlan(plan, language) {
|
|
410
|
+
const header = language === "en-US" ? "Verification plan:" : "\u9A8C\u8BC1\u8BA1\u5212\uFF1A";
|
|
411
|
+
return [
|
|
412
|
+
header,
|
|
413
|
+
...plan.map((step, index) => `${index + 1}. [${step.kind}] ${step.command} \u2014 ${step.reason}`)
|
|
414
|
+
].join("\n");
|
|
415
|
+
}
|
|
416
|
+
function formatVerificationReport(report, language) {
|
|
417
|
+
return formatVerificationReportLines(report, language, true).join("\n");
|
|
418
|
+
}
|
|
419
|
+
function formatVerificationTaskSummary(report, language) {
|
|
420
|
+
return formatVerificationReportLines(report, language, false).join("\n");
|
|
421
|
+
}
|
|
422
|
+
function formatVerificationReportLines(report, language, includeCommandDetails) {
|
|
423
|
+
const statusLabel = report.status.toUpperCase();
|
|
424
|
+
const statusAlreadyShown = new RegExp(`^${statusLabel}(?:\\s|:|\uFF1A)`, "u").test(report.summary);
|
|
425
|
+
const summary = statusAlreadyShown ? report.summary : `${statusLabel} ${report.summary}`;
|
|
426
|
+
const syntheticOnlyPass = report.status === "pass" && report.commands.length > 0 && report.commands.every((command) => command.synthetic === true || command.status !== "pass");
|
|
427
|
+
const lines = [
|
|
428
|
+
summary,
|
|
429
|
+
language === "en-US" ? `Duration: ${report.durationMs}ms` : `\u8017\u65F6\uFF1A${report.durationMs}ms`
|
|
430
|
+
];
|
|
431
|
+
if (syntheticOnlyPass) {
|
|
432
|
+
lines.push(
|
|
433
|
+
language === "en-US" ? "Real verification did not run; this is not enough evidence for a real PASS." : "\u771F\u5B9E\u9A8C\u8BC1\u672A\u8FD0\u884C\uFF1B\u8FD9\u4E0D\u8DB3\u4EE5\u8BC1\u660E\u771F\u5B9E PASS\u3002"
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
if (includeCommandDetails) {
|
|
437
|
+
for (const command of report.commands) {
|
|
438
|
+
lines.push(
|
|
439
|
+
`- [${command.status.toUpperCase()}] ${command.command} (${command.durationMs}ms) log: ${command.logPath ?? "\u65E0\u65E5\u5FD7"}`
|
|
440
|
+
);
|
|
441
|
+
if (command.status !== "pass") {
|
|
442
|
+
lines.push(` \u6458\u8981\uFF1A${command.summary}`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
if (includeCommandDetails && report.unverified.length > 0) {
|
|
447
|
+
lines.push(`\u672A\u9A8C\u8BC1\uFF1A${report.unverified.join("; ")}`);
|
|
448
|
+
}
|
|
449
|
+
lines.push(`\u4E0B\u4E00\u6B65\uFF1A${report.nextAction}`);
|
|
450
|
+
if (!includeCommandDetails) {
|
|
451
|
+
lines.push(language === "en-US" ? "Details: /verify last" : "\u8BE6\u60C5\uFF1A/verify last");
|
|
452
|
+
}
|
|
453
|
+
return lines;
|
|
454
|
+
}
|
|
455
|
+
function formatVerificationLast(report, language) {
|
|
456
|
+
if (!report) {
|
|
457
|
+
return language === "en-US" ? "No verification has run yet." : "\u8FD8\u6CA1\u6709\u6700\u8FD1\u9A8C\u8BC1\u7ED3\u679C\u3002";
|
|
458
|
+
}
|
|
459
|
+
return formatVerificationReport(report, language);
|
|
460
|
+
}
|
|
461
|
+
function summarizeVerificationOutput(output, exitCode, runnerError) {
|
|
462
|
+
const lines = output.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
463
|
+
const tail = lines.slice(-6).join(" | ");
|
|
464
|
+
const summary = tail ? truncateDisplay(tail, 240) : "\u65E0\u8F93\u51FA";
|
|
465
|
+
return runnerError ? `exit code ${exitCode}; runner error ${runnerError}; ${summary}` : `exit code ${exitCode}; ${summary}`;
|
|
466
|
+
}
|
|
467
|
+
async function safeReadJson(path) {
|
|
468
|
+
try {
|
|
469
|
+
return JSON.parse(await readFile(path, "utf8"));
|
|
470
|
+
} catch {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export {
|
|
476
|
+
createVerificationPlan,
|
|
477
|
+
createVerificationUnavailableReport,
|
|
478
|
+
addPackageStep,
|
|
479
|
+
runVerificationPlan,
|
|
480
|
+
runVerificationCommand,
|
|
481
|
+
detectRunnerCompatibilityError,
|
|
482
|
+
createReviewReport,
|
|
483
|
+
formatVerificationPlan,
|
|
484
|
+
formatVerificationReport,
|
|
485
|
+
formatVerificationTaskSummary,
|
|
486
|
+
formatVerificationLast,
|
|
487
|
+
summarizeVerificationOutput,
|
|
488
|
+
safeReadJson
|
|
489
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// src/context-estimator.ts
|
|
2
|
+
import { extname } from "path";
|
|
3
|
+
var DEFAULT_BYTES_PER_TOKEN = 4;
|
|
4
|
+
var FILE_TYPE_BYTES_PER_TOKEN = {
|
|
5
|
+
".json": 2,
|
|
6
|
+
".jsonl": 2
|
|
7
|
+
};
|
|
8
|
+
function bytesPerTokenForFileType(fileExt) {
|
|
9
|
+
const normalized = normalizeFileExt(fileExt);
|
|
10
|
+
return FILE_TYPE_BYTES_PER_TOKEN[normalized] ?? DEFAULT_BYTES_PER_TOKEN;
|
|
11
|
+
}
|
|
12
|
+
function estimateTokensFromBytesForFileType(bytes, fileExt) {
|
|
13
|
+
const safeBytes = Number.isFinite(bytes) ? Math.max(0, bytes) : 0;
|
|
14
|
+
return Math.max(1, Math.ceil(safeBytes / bytesPerTokenForFileType(fileExt)));
|
|
15
|
+
}
|
|
16
|
+
function estimateFileTokens(filePath, bytes) {
|
|
17
|
+
return estimateTokensFromBytesForFileType(bytes, extname(filePath));
|
|
18
|
+
}
|
|
19
|
+
function normalizeFileExt(fileExt) {
|
|
20
|
+
const trimmed = (fileExt ?? "").trim().toLowerCase();
|
|
21
|
+
if (!trimmed) return "";
|
|
22
|
+
return trimmed.startsWith(".") ? trimmed : `.${trimmed}`;
|
|
23
|
+
}
|
|
24
|
+
function estimateValueChars(value, depth = 0) {
|
|
25
|
+
if (value === null || value === void 0) return 4;
|
|
26
|
+
if (typeof value === "string") return value.length + 2;
|
|
27
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value).length;
|
|
28
|
+
if (depth > 8) return 16;
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
let size = 2;
|
|
31
|
+
for (const item of value) {
|
|
32
|
+
size += estimateValueChars(item, depth + 1) + 1;
|
|
33
|
+
}
|
|
34
|
+
return size;
|
|
35
|
+
}
|
|
36
|
+
if (typeof value === "object") {
|
|
37
|
+
let size = 2;
|
|
38
|
+
for (const key of Object.keys(value)) {
|
|
39
|
+
size += key.length + 3;
|
|
40
|
+
size += estimateValueChars(value[key], depth + 1) + 1;
|
|
41
|
+
}
|
|
42
|
+
return size;
|
|
43
|
+
}
|
|
44
|
+
return 8;
|
|
45
|
+
}
|
|
46
|
+
function estimateToolCallsCharsLocal(toolCalls) {
|
|
47
|
+
if (!toolCalls || toolCalls.length === 0) return 2;
|
|
48
|
+
let size = 2;
|
|
49
|
+
for (const call of toolCalls) {
|
|
50
|
+
size += call.id.length + call.name.length + 28;
|
|
51
|
+
size += estimateValueChars(call.input);
|
|
52
|
+
}
|
|
53
|
+
return size;
|
|
54
|
+
}
|
|
55
|
+
function estimateModelMessageChars(messages) {
|
|
56
|
+
return messages.reduce((total, message) => {
|
|
57
|
+
if (message.role === "assistant") {
|
|
58
|
+
return total + message.content.length + estimateToolCallsCharsLocal(message.toolCalls);
|
|
59
|
+
}
|
|
60
|
+
return total + message.content.length;
|
|
61
|
+
}, 0);
|
|
62
|
+
}
|
|
63
|
+
function estimateTranscriptContextChars(transcript) {
|
|
64
|
+
return transcript.reduce((total, event) => {
|
|
65
|
+
if (event.type === "user_message") return total + event.text.length;
|
|
66
|
+
if (event.type === "assistant_text_delta") return total + event.text.length;
|
|
67
|
+
if (event.type === "tool_call_start") return total + estimateValueChars(event.input);
|
|
68
|
+
if (event.type === "tool_result") return total + estimateValueChars(event.content);
|
|
69
|
+
return total;
|
|
70
|
+
}, 0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
bytesPerTokenForFileType,
|
|
75
|
+
estimateTokensFromBytesForFileType,
|
|
76
|
+
estimateFileTokens,
|
|
77
|
+
estimateValueChars,
|
|
78
|
+
estimateToolCallsCharsLocal,
|
|
79
|
+
estimateModelMessageChars,
|
|
80
|
+
estimateTranscriptContextChars
|
|
81
|
+
};
|