@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,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatDisplayPath,
|
|
3
|
+
sanitizeDisplayPaths
|
|
4
|
+
} from "./chunk-OMZYPQVA.js";
|
|
5
|
+
|
|
6
|
+
// src/job-runner-presenter.ts
|
|
7
|
+
function formatRunnerDoctor(resolution, expectedProtocol, sanitizeDiagnosticText) {
|
|
8
|
+
return [
|
|
9
|
+
`Native Runner Doctor\uFF1A${resolution.status}\uFF1BNode fallback ${resolution.nodeFallback}\uFF1B\u4E3B TUI \u4E0D\u56E0 runner \u95EE\u9898\u5D29\u6E83\u3002`,
|
|
10
|
+
`- enabled: ${resolution.enabled ? "yes" : "no"}`,
|
|
11
|
+
`- source: ${resolution.source}`,
|
|
12
|
+
`- platform/arch: ${resolution.platform}/${resolution.arch}`,
|
|
13
|
+
`- bundled platform/arch: ${resolution.platformArch}`,
|
|
14
|
+
`- bundled candidate: ${resolution.bundledCandidateRef}`,
|
|
15
|
+
`- resolved path: ${resolution.pathRef}`,
|
|
16
|
+
`- version/protocol: ${resolution.version ?? "unknown"} / ${resolution.protocol ?? expectedProtocol}`,
|
|
17
|
+
`- fallback reason: ${resolution.status === "available" ? "none" : resolution.lastError ? sanitizeDiagnosticText(resolution.lastError) : resolution.status}`,
|
|
18
|
+
`- next action: ${resolution.nextAction}`,
|
|
19
|
+
...(resolution.processGuardContract ?? []).map((line) => `- process guard contract: ${line}`),
|
|
20
|
+
"- boundary: runner only accepts Linghun-approved job specs; it is not a second provider/tool/agent runtime and cannot decide whether verification passed.",
|
|
21
|
+
"- DEFERRED: managed/bundled binary distribution, signing/AV/install matrix, real native-runner process-guard smoke, and parent hard-kill/crash proof."
|
|
22
|
+
].join("\n");
|
|
23
|
+
}
|
|
24
|
+
function formatJobRunnerInline(job) {
|
|
25
|
+
if (!job.runner) {
|
|
26
|
+
return "runner not started; Node/TUI default";
|
|
27
|
+
}
|
|
28
|
+
const heartbeat = job.runner.heartbeatAt ? `; heartbeat ${job.runner.heartbeatAt}` : "";
|
|
29
|
+
return `runner ${job.runner.adapter}/${job.runner.status}; resolution ${job.runner.resolution}; fallback ${job.runner.fallbackReason ?? "none"}${heartbeat}`;
|
|
30
|
+
}
|
|
31
|
+
function formatJobRunnerReportLine(job) {
|
|
32
|
+
if (!job.runner) {
|
|
33
|
+
return "- runner: not_started; Node/TUI default path remains active.";
|
|
34
|
+
}
|
|
35
|
+
const logRefs = job.runner.logRefs ? `; logs state ${job.runner.logRefs.state}, stdout ${job.runner.logRefs.stdout}, stderr ${job.runner.logRefs.stderr}` : "";
|
|
36
|
+
return `- runner: enabled ${job.runner.enabled}; adapter ${job.runner.adapter}; status ${job.runner.status}; resolution ${job.runner.resolution}; path ${job.runner.pathRef ?? "-"}; protocol ${job.runner.protocol ?? "unknown"}; version ${job.runner.version ?? "unknown"}; heartbeat ${job.runner.heartbeatAt ?? "-"}; fallback ${job.runner.fallbackReason ?? "none"}; last error ${job.runner.lastError ?? "none"}; next ${job.runner.nextAction}${logRefs}`;
|
|
37
|
+
}
|
|
38
|
+
function mapDurableJobToBackgroundStatus(status) {
|
|
39
|
+
if (status === "created" || status === "sleeping") {
|
|
40
|
+
return "paused";
|
|
41
|
+
}
|
|
42
|
+
if (status === "blocked") return "blocked";
|
|
43
|
+
return status === "completed" || status === "failed" || status === "cancelled" || status === "stale" || status === "timeout" ? status : "running";
|
|
44
|
+
}
|
|
45
|
+
function mapDurableJobToBackgroundResult(status) {
|
|
46
|
+
if (status === "completed") return "partial";
|
|
47
|
+
if (status === "failed") return "fail";
|
|
48
|
+
if (status === "cancelled") return "cancelled";
|
|
49
|
+
if (status === "stale") return "stale";
|
|
50
|
+
if (status === "timeout") return "timeout";
|
|
51
|
+
if (status === "blocked" || status === "sleeping") return "partial";
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
function formatJobNextAction(job, language) {
|
|
55
|
+
if (job.status === "running") {
|
|
56
|
+
return language === "en-US" ? `Use /job pause ${job.id}, /job cancel ${job.id}, /job report ${job.id}, or /job logs ${job.id}.` : `\u53EF\u7528 /job pause ${job.id}\u3001/job cancel ${job.id}\u3001/job report ${job.id} \u6216 /job logs ${job.id}\u3002`;
|
|
57
|
+
}
|
|
58
|
+
if (job.status === "created" || job.status === "sleeping") {
|
|
59
|
+
return language === "en-US" ? `Use /job resume ${job.id} when the handoff/resource guard is ready, or inspect /job report ${job.id}.` : `handoff/resource guard \u5C31\u7EEA\u540E\u7528 /job resume ${job.id}\uFF1B\u4E5F\u53EF\u5148\u770B /job report ${job.id}\u3002`;
|
|
60
|
+
}
|
|
61
|
+
if (job.status === "blocked") {
|
|
62
|
+
const reason = job.pauseReason ?? "";
|
|
63
|
+
if (reason.startsWith("needs_handoff_repair:")) {
|
|
64
|
+
return language === "en-US" ? `Repair the handoff packet or evidence state, then /job resume ${job.id}.` : `\u5148\u4FEE\u590D handoff/evidence \u72B6\u6001\uFF0C\u518D\u7528 /job resume ${job.id}\u3002`;
|
|
65
|
+
}
|
|
66
|
+
if (reason.startsWith("agent_blocked:")) {
|
|
67
|
+
return language === "en-US" ? `Inspect /job report ${job.id} and /job logs ${job.id}; resume after fixing the blocked child agent cause.` : `\u67E5\u770B /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u4FEE\u590D child agent \u963B\u585E\u539F\u56E0\u540E\u518D resume\u3002`;
|
|
68
|
+
}
|
|
69
|
+
if (reason.includes("provider") || reason.includes("model") || reason.includes("api_key")) {
|
|
70
|
+
return language === "en-US" ? `Fix model/provider configuration, then /job resume ${job.id}.` : `\u5148\u4FEE\u590D\u6A21\u578B/provider \u914D\u7F6E\uFF0C\u518D\u7528 /job resume ${job.id}\u3002`;
|
|
71
|
+
}
|
|
72
|
+
return language === "en-US" ? `Inspect /job report ${job.id} and /job logs ${job.id}; resume after fixing the blocked reason.` : `\u67E5\u770B /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u4FEE\u590D\u963B\u585E\u539F\u56E0\u540E\u518D resume\u3002`;
|
|
73
|
+
}
|
|
74
|
+
if (job.status === "stale") {
|
|
75
|
+
return language === "en-US" ? `Inspect /job report ${job.id} and /job logs ${job.id}; resume only after owner/heartbeat state is clear.` : `\u5148\u67E5\u770B /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u786E\u8BA4 owner/heartbeat \u72B6\u6001\u540E\u518D\u6062\u590D\u3002`;
|
|
76
|
+
}
|
|
77
|
+
if (job.status === "timeout") {
|
|
78
|
+
return language === "en-US" ? `Inspect /job report ${job.id} and /job logs ${job.id}; rerun with an explicit budget/runtime only if needed.` : `\u67E5\u770B /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u786E\u9700\u91CD\u8DD1\u65F6\u663E\u5F0F\u8BBE\u7F6E\u9884\u7B97/\u8FD0\u884C\u65F6\u3002`;
|
|
79
|
+
}
|
|
80
|
+
if (job.status === "cancelled") {
|
|
81
|
+
return language === "en-US" ? `Inspect /job report ${job.id} or /job logs ${job.id}; create a new job if work should continue.` : `\u67E5\u770B /job report ${job.id} \u6216 /job logs ${job.id}\uFF1B\u9700\u8981\u7EE7\u7EED\u65F6\u65B0\u5EFA job\u3002`;
|
|
82
|
+
}
|
|
83
|
+
if (job.status === "completed") {
|
|
84
|
+
return language === "en-US" ? `Review /job report ${job.id} and /job logs ${job.id}; run verification before treating the work as passed.` : `\u590D\u6838 /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u901A\u8FC7\u9A8C\u8BC1\u524D\u4E0D\u8981\u5F53\u4F5C\u5DF2\u901A\u8FC7\u3002`;
|
|
85
|
+
}
|
|
86
|
+
return language === "en-US" ? `Inspect /job report ${job.id} and /job logs ${job.id}; lifecycle status is not verification evidence.` : `\u67E5\u770B /job report ${job.id} \u548C /job logs ${job.id}\uFF1B\u751F\u547D\u5468\u671F\u72B6\u6001\u4E0D\u662F\u9A8C\u8BC1\u8BC1\u636E\u3002`;
|
|
87
|
+
}
|
|
88
|
+
function formatBackgroundDetails(task, language, projectPath) {
|
|
89
|
+
const progress = task.progress ? formatTaskProgress(task) : "none";
|
|
90
|
+
return [
|
|
91
|
+
language === "en-US" ? `Background ${task.id}` : `Background ${task.id}`,
|
|
92
|
+
`- kind: ${task.kind}`,
|
|
93
|
+
`- title: ${truncateLine(task.title, 72)}`,
|
|
94
|
+
`- status: ${task.status}; result ${task.result ?? "-"}`,
|
|
95
|
+
`- current step: ${truncateLine(task.currentStep ?? "-", 72)}`,
|
|
96
|
+
`- progress: ${progress}`,
|
|
97
|
+
`- why stale/blocked: ${formatBackgroundReason(task, language)}`,
|
|
98
|
+
`- resume/cancel: ${truncateLine(formatTaskText(task, task.nextAction ?? "-", projectPath), 96)}`,
|
|
99
|
+
`- summary: ${truncateLine(formatTaskText(task, task.userVisibleSummary, projectPath), 120)}`,
|
|
100
|
+
`- log path: ${formatDisplayPath(task.logPath, projectPath)}`,
|
|
101
|
+
`- output path: ${formatDisplayPath(task.outputPath, projectPath)}`,
|
|
102
|
+
`- has output: ${task.hasOutput}`,
|
|
103
|
+
`- started at: ${task.startedAt}`,
|
|
104
|
+
`- updated at: ${task.updatedAt}`
|
|
105
|
+
].join("\n");
|
|
106
|
+
}
|
|
107
|
+
function formatBackgroundOutputDetails(task, language, projectPath) {
|
|
108
|
+
const location = task.outputPath ?? task.logPath;
|
|
109
|
+
if (!location) {
|
|
110
|
+
return language === "en-US" ? `Background ${task.id} has no output path yet.` : `Background ${task.id} \u5C1A\u65E0\u8F93\u51FA\u8DEF\u5F84\u3002`;
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
`Background output ${task.id}`,
|
|
114
|
+
`- path: ${formatDisplayPath(location, projectPath)}`,
|
|
115
|
+
`- hasOutput: ${task.hasOutput}`,
|
|
116
|
+
`- status: ${task.status}`,
|
|
117
|
+
`- summary: ${formatTaskText(task, task.userVisibleSummary, projectPath)}`,
|
|
118
|
+
`- slices: /details output ${task.id} --tail 40 | --grep <pattern> --context 2 | --errors`
|
|
119
|
+
].join("\n");
|
|
120
|
+
}
|
|
121
|
+
function formatBackgroundTask(task, language) {
|
|
122
|
+
const progress = task.progress ? ` ${formatTaskProgress(task)}` : "";
|
|
123
|
+
const elapsed = formatElapsedSince(task.startedAt);
|
|
124
|
+
const title = truncateLine(
|
|
125
|
+
cleanPanelText(task.title, language === "en-US" ? "Background task" : "\u540E\u53F0\u4EFB\u52A1"),
|
|
126
|
+
28
|
|
127
|
+
);
|
|
128
|
+
const step = truncateLine(cleanPanelText(task.currentStep ?? "-", "-"), 30);
|
|
129
|
+
return language === "en-US" ? `[background] ${title} \xB7 ${task.status} \xB7 ${step}${progress} \xB7 elapsed ${elapsed}` : `[\u540E\u53F0] ${title} \xB7 ${task.status} \xB7 ${step}${progress} \xB7 \u8017\u65F6 ${elapsed}`;
|
|
130
|
+
}
|
|
131
|
+
function formatBackgroundTaskPanelRow(task, language) {
|
|
132
|
+
const progress = formatPanelProgress(task);
|
|
133
|
+
const step = cleanPanelText(task.currentStep ?? "-", "-");
|
|
134
|
+
const nextAction = cleanPanelText(formatTaskText(task, task.nextAction ?? "-", void 0), "-");
|
|
135
|
+
const title = cleanPanelText(task.title, language === "en-US" ? "Background task" : "\u540E\u53F0\u4EFB\u52A1");
|
|
136
|
+
return [
|
|
137
|
+
truncateLine(title, 28),
|
|
138
|
+
normalizePanelStatus(task.status, language),
|
|
139
|
+
progress,
|
|
140
|
+
truncateLine(step, 28),
|
|
141
|
+
truncateLine(nextAction, 42)
|
|
142
|
+
].join(" \xB7 ");
|
|
143
|
+
}
|
|
144
|
+
function formatBackgroundTaskPanelDetails(task, language, projectPath) {
|
|
145
|
+
const progress = formatPanelProgress(task);
|
|
146
|
+
return [
|
|
147
|
+
cleanPanelText(task.title, language === "en-US" ? "Background task" : "\u540E\u53F0\u4EFB\u52A1"),
|
|
148
|
+
`- status: ${normalizePanelStatus(task.status, language)}`,
|
|
149
|
+
`- progress: ${progress}`,
|
|
150
|
+
`- current step: ${cleanPanelText(task.currentStep ?? "-", "-")}`,
|
|
151
|
+
`- next action: ${cleanPanelText(formatTaskText(task, task.nextAction ?? "-", projectPath), "-", true)}`,
|
|
152
|
+
`- details: /details background ${task.id}`,
|
|
153
|
+
task.hasOutput ? `- output: /details output ${task.id}` : void 0,
|
|
154
|
+
task.logPath ? `- log: ${formatDisplayPath(task.logPath, projectPath)}` : void 0
|
|
155
|
+
].filter((line) => Boolean(line)).join("\n");
|
|
156
|
+
}
|
|
157
|
+
function formatElapsedSince(startedAt, nowMs = Date.now()) {
|
|
158
|
+
const start = Date.parse(startedAt);
|
|
159
|
+
if (!Number.isFinite(start)) return "0s";
|
|
160
|
+
const seconds = Math.max(0, Math.floor((nowMs - start) / 1e3));
|
|
161
|
+
if (seconds < 60) return `${seconds}s`;
|
|
162
|
+
const minutes = Math.floor(seconds / 60);
|
|
163
|
+
const rest = seconds % 60;
|
|
164
|
+
if (minutes < 60) return `${minutes}m${rest.toString().padStart(2, "0")}s`;
|
|
165
|
+
const hours = Math.floor(minutes / 60);
|
|
166
|
+
return `${hours}h${(minutes % 60).toString().padStart(2, "0")}m`;
|
|
167
|
+
}
|
|
168
|
+
function formatBackgroundReason(task, language) {
|
|
169
|
+
if (task.status === "stale") {
|
|
170
|
+
return language === "en-US" ? "heartbeat/output stopped; resume should inspect logs and state first" : "heartbeat/output \u5DF2\u505C\u6B62\uFF1B\u6062\u590D\u524D\u5E94\u5148\u68C0\u67E5\u65E5\u5FD7\u548C\u72B6\u6001";
|
|
171
|
+
}
|
|
172
|
+
if (task.status === "paused") {
|
|
173
|
+
return language === "en-US" ? "paused by resource guard, handoff repair, or user action" : "\u56E0\u8D44\u6E90\u5B88\u536B\u3001handoff \u4FEE\u590D\u6216\u7528\u6237\u64CD\u4F5C\u6682\u505C";
|
|
174
|
+
}
|
|
175
|
+
if (task.status === "timeout" || task.status === "cancelled") {
|
|
176
|
+
return language === "en-US" ? `${task.status}; this is not evidence that verification passed` : `${task.status}\uFF1B\u8FD9\u4E0D\u662F\u9A8C\u8BC1\u5DF2\u901A\u8FC7\u7684\u8BC1\u636E`;
|
|
177
|
+
}
|
|
178
|
+
return language === "en-US" ? "not stale" : "\u672A stale";
|
|
179
|
+
}
|
|
180
|
+
function truncateLine(value, max) {
|
|
181
|
+
const normalized = value.replace(/\s+/gu, " ").trim();
|
|
182
|
+
if (normalized.length <= max) return normalized;
|
|
183
|
+
if (max <= 1) return "\u2026";
|
|
184
|
+
return `${normalized.slice(0, max - 1)}\u2026`;
|
|
185
|
+
}
|
|
186
|
+
function formatPanelProgress(task) {
|
|
187
|
+
if (!task.progress) return "-";
|
|
188
|
+
return formatTaskProgress(task);
|
|
189
|
+
}
|
|
190
|
+
function formatTaskProgress(task) {
|
|
191
|
+
if (!task.progress) return "-";
|
|
192
|
+
const total = typeof task.progress.total === "number" ? task.progress.total : void 0;
|
|
193
|
+
const ratio = total ? `${task.progress.completed}/${total}` : `${task.progress.completed}`;
|
|
194
|
+
return task.progress.label ? `${ratio} ${task.progress.label}` : ratio;
|
|
195
|
+
}
|
|
196
|
+
function normalizePanelStatus(status, language) {
|
|
197
|
+
const isEn = language === "en-US";
|
|
198
|
+
if (status === "paused") return isEn ? "sleeping" : "sleeping";
|
|
199
|
+
if (status === "blocked") return isEn ? "blocked" : "\u963B\u585E";
|
|
200
|
+
if (status === "stale") return isEn ? "stale" : "stale";
|
|
201
|
+
if (status === "timeout") return isEn ? "timeout" : "timeout";
|
|
202
|
+
if (status === "failed") return isEn ? "failed" : "\u5931\u8D25";
|
|
203
|
+
if (status === "completed") return isEn ? "completed" : "\u5DF2\u5B8C\u6210";
|
|
204
|
+
if (status === "cancelled") return isEn ? "cancelled" : "\u5DF2\u53D6\u6D88";
|
|
205
|
+
return isEn ? "running" : "\u8FD0\u884C\u4E2D";
|
|
206
|
+
}
|
|
207
|
+
function formatTaskText(task, value, projectPath) {
|
|
208
|
+
const sanitized = sanitizeDisplayPaths(value, projectPath);
|
|
209
|
+
return task.kind === "job" ? normalizeJobPassWording(sanitized) : sanitized;
|
|
210
|
+
}
|
|
211
|
+
function normalizeJobPassWording(value) {
|
|
212
|
+
return value.replace(
|
|
213
|
+
/\bno PASS evidence generated\b/giu,
|
|
214
|
+
"no evidence that verification passed was generated"
|
|
215
|
+
).replace(
|
|
216
|
+
/\bnever count as verification PASS\b/giu,
|
|
217
|
+
"never count as evidence that verification passed"
|
|
218
|
+
).replace(/\bverification PASS\b/giu, "verification passed").replace(/\bPASS evidence\b/giu, "evidence that verification passed");
|
|
219
|
+
}
|
|
220
|
+
function cleanPanelText(value, fallback, preserveRefs = false) {
|
|
221
|
+
let cleaned = value.replace(
|
|
222
|
+
/\b(sourceRef|schema|debug|gate retry|passEvidence|raw evidence|tool_result raw|raw tool result|endpoint|runner=|evidenceRefs?|planId|runId|workflowId|forkId|threadId|system_event|provider abort|provider_abort|abort signal)\b/giu,
|
|
223
|
+
""
|
|
224
|
+
).replace(
|
|
225
|
+
/\b(gateId|requestId|schemaLoaded|trustLevel|endpointPath|fullOutputPath|logPath)\b/giu,
|
|
226
|
+
""
|
|
227
|
+
).replace(/[A-Za-z]:[\\/][^\r\n\s"'<>{}]+/gu, "[path]").replace(/(?:\/[^\r\n\s"'<>{}/]+){2,}/gu, "[path]");
|
|
228
|
+
if (!preserveRefs) {
|
|
229
|
+
cleaned = cleaned.replace(/\b(workflow|agent|job|run|plan)-[A-Za-z0-9_-]{6,}\b/giu, "$1").replace(
|
|
230
|
+
/\b[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}\b/gu,
|
|
231
|
+
"id"
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
cleaned = cleaned.replace(/\s+/gu, " ").trim();
|
|
235
|
+
if (!cleaned || cleaned.toLowerCase() === "unknown") return fallback;
|
|
236
|
+
return cleaned;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export {
|
|
240
|
+
formatRunnerDoctor,
|
|
241
|
+
formatJobRunnerInline,
|
|
242
|
+
formatJobRunnerReportLine,
|
|
243
|
+
mapDurableJobToBackgroundStatus,
|
|
244
|
+
mapDurableJobToBackgroundResult,
|
|
245
|
+
formatJobNextAction,
|
|
246
|
+
formatBackgroundDetails,
|
|
247
|
+
formatBackgroundOutputDetails,
|
|
248
|
+
formatBackgroundTask,
|
|
249
|
+
formatBackgroundTaskPanelRow,
|
|
250
|
+
formatBackgroundTaskPanelDetails,
|
|
251
|
+
formatElapsedSince
|
|
252
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createShellTheme
|
|
3
|
+
} from "./chunk-GC55DMZV.js";
|
|
4
|
+
import {
|
|
5
|
+
fitText,
|
|
6
|
+
lineChar,
|
|
7
|
+
wrapText
|
|
8
|
+
} from "./chunk-APJIC2O5.js";
|
|
9
|
+
|
|
10
|
+
// src/shell/components/CommandPanel.tsx
|
|
11
|
+
import { Box, Text } from "@linghun/ink-runtime";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
var HINT_TEXT = {
|
|
14
|
+
"zh-CN": "",
|
|
15
|
+
"en-US": ""
|
|
16
|
+
};
|
|
17
|
+
var SELECTABLE_HINT_TEXT = {
|
|
18
|
+
"zh-CN": "Enter \xB7 x \xB7 Esc",
|
|
19
|
+
"en-US": "Enter \xB7 x \xB7 Esc"
|
|
20
|
+
};
|
|
21
|
+
var DETAILS_HINT_TEXT = {
|
|
22
|
+
"zh-CN": "Ctrl+O \u8BE6\u60C5",
|
|
23
|
+
"en-US": "Ctrl+O details"
|
|
24
|
+
};
|
|
25
|
+
var MAX_SELECTABLE_ROWS = 8;
|
|
26
|
+
var MIN_PANEL_WIDTH = 56;
|
|
27
|
+
var MAX_PANEL_WIDTH = 108;
|
|
28
|
+
function CommandPanel({
|
|
29
|
+
panel,
|
|
30
|
+
width,
|
|
31
|
+
noColor,
|
|
32
|
+
language
|
|
33
|
+
}) {
|
|
34
|
+
const theme = createShellTheme(noColor);
|
|
35
|
+
const selectableRows = getSelectableRows(panel);
|
|
36
|
+
const hasSelectableRows = selectableRows.length > 0;
|
|
37
|
+
const hint = hasSelectableRows ? SELECTABLE_HINT_TEXT[language] ?? SELECTABLE_HINT_TEXT["zh-CN"] : HINT_TEXT[language] ?? HINT_TEXT["zh-CN"];
|
|
38
|
+
const cursor = selectableRows.length > 0 ? Math.max(0, Math.min(panel.cursor ?? 0, selectableRows.length - 1)) : 0;
|
|
39
|
+
const maxScrollOffset = Math.max(0, selectableRows.length - MAX_SELECTABLE_ROWS);
|
|
40
|
+
const scrollOffset = Math.max(0, Math.min(panel.scrollOffset ?? 0, maxScrollOffset));
|
|
41
|
+
const selectedDetailsText = selectableRows[cursor]?.detailsText;
|
|
42
|
+
const hasDetailsText = Boolean((selectedDetailsText ?? panel.detailsText ?? "").trim());
|
|
43
|
+
const detailsHint = DETAILS_HINT_TEXT[language] ?? DETAILS_HINT_TEXT["zh-CN"];
|
|
44
|
+
const renderedHint = [hint, hasDetailsText ? detailsHint : ""].filter(Boolean).join(" \xB7 ");
|
|
45
|
+
const expandedDetailsText = panel.expanded ? selectedDetailsText ?? panel.detailsText : void 0;
|
|
46
|
+
const cardWidth = Math.max(
|
|
47
|
+
Math.min(width - 2, MIN_PANEL_WIDTH),
|
|
48
|
+
Math.min(width - 2, MAX_PANEL_WIDTH)
|
|
49
|
+
);
|
|
50
|
+
const innerWidth = Math.max(20, cardWidth - 4);
|
|
51
|
+
const tone = panel.tone ?? "neutral";
|
|
52
|
+
const borderColor = tone === "error" ? theme.error ?? theme.status.fail : tone === "warning" ? theme.warning : theme.panel ?? theme.border;
|
|
53
|
+
const rule = lineChar(noColor);
|
|
54
|
+
const title = panel.title?.trim() ?? "";
|
|
55
|
+
const titleLabel = formatPanelTitle(title);
|
|
56
|
+
const titleMeta = title && titleLabel !== title ? title : "";
|
|
57
|
+
const topRuleWidth = Math.max(8, innerWidth - titleLabel.length - 4);
|
|
58
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, width: cardWidth, children: [
|
|
59
|
+
title ? /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
60
|
+
/* @__PURE__ */ jsx(Text, { color: borderColor, dimColor: true, children: `${rule.repeat(2)} ${titleLabel} ${rule.repeat(topRuleWidth)}` }),
|
|
61
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(Text, { color: theme.accent, bold: true, children: fitText(`\u276F ${titleLabel}`, Math.max(8, Math.floor(innerWidth * 0.45))) }),
|
|
63
|
+
titleMeta ? /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: fitText(` ${titleMeta}`, Math.max(8, innerWidth - titleLabel.length - 2)) }) : null
|
|
64
|
+
] })
|
|
65
|
+
] }) : null,
|
|
66
|
+
panel.summary && panel.summary.length > 0 ? /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: title ? 1 : 0, children: panel.summary.map((line, idx) => /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: renderSummaryLine(line, innerWidth).map(({ label, value }, lineIdx) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
67
|
+
label ? /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, children: fitText(label, 16) }) : null,
|
|
68
|
+
/* @__PURE__ */ jsx(Text, { bold: Boolean(label), children: fitText(value, label ? innerWidth - 16 : innerWidth) })
|
|
69
|
+
] }, `${idx}-${lineIdx}-${label}-${value}`)) }, `${idx}-${line}`)) }) : null,
|
|
70
|
+
panel.sections && panel.sections.length > 0 ? /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, children: panel.sections.map((section) => {
|
|
71
|
+
const renderedRows = section.rows.map(
|
|
72
|
+
(row) => renderCommandPanelRow({
|
|
73
|
+
row,
|
|
74
|
+
cursor,
|
|
75
|
+
scrollOffset,
|
|
76
|
+
selectableRows,
|
|
77
|
+
selectableCount: selectableRows.length,
|
|
78
|
+
innerWidth,
|
|
79
|
+
theme
|
|
80
|
+
})
|
|
81
|
+
).filter((row) => Boolean(row));
|
|
82
|
+
if (renderedRows.length === 0 && !section.title) return null;
|
|
83
|
+
return /* @__PURE__ */ jsxs(
|
|
84
|
+
Box,
|
|
85
|
+
{
|
|
86
|
+
flexDirection: "column",
|
|
87
|
+
children: [
|
|
88
|
+
section.title ? /* @__PURE__ */ jsx(Text, { color: theme.muted, bold: true, children: fitText(section.title.toUpperCase(), innerWidth) }) : null,
|
|
89
|
+
renderedRows
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
`section-${section.title ?? section.rows.map(getRowText).join("\n")}`
|
|
93
|
+
);
|
|
94
|
+
}) }) : null,
|
|
95
|
+
expandedDetailsText ? /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
96
|
+
/* @__PURE__ */ jsx(Text, { color: theme.muted, children: fitText(language === "en-US" ? "\u2014 details \u2014" : "\u2014 \u8BE6\u60C5 \u2014", innerWidth) }),
|
|
97
|
+
expandedDetailsText.split("\n").map((line, idx) => /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: wrapText(line, innerWidth).map((part, lineIdx) => /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, children: part }, `detail-${idx}-${lineIdx}-${part}`)) }, `detail-${idx}-${line}`))
|
|
98
|
+
] }) : null,
|
|
99
|
+
panel.actions && panel.actions.length > 0 ? /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: 1, children: panel.actions.map((action, idx) => /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: wrapText(`${idx === 0 ? "Actions " : " "}${action}`, innerWidth).map(
|
|
100
|
+
(part, lineIdx) => /* @__PURE__ */ jsx(
|
|
101
|
+
Text,
|
|
102
|
+
{
|
|
103
|
+
color: lineIdx === 0 ? theme.accent : theme.dim ?? theme.muted,
|
|
104
|
+
children: part
|
|
105
|
+
},
|
|
106
|
+
`action-${idx}-${lineIdx}-${part}`
|
|
107
|
+
)
|
|
108
|
+
) }, `action-${idx}-${action}`)) }) : null,
|
|
109
|
+
renderedHint ? /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { color: borderColor, dimColor: true, children: rule.repeat(innerWidth) }) }) : null,
|
|
110
|
+
renderedHint ? /* @__PURE__ */ jsx(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: fitText(renderedHint, innerWidth) }) : null
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
function formatPanelTitle(title) {
|
|
114
|
+
const normalized = title.replace(/^\/+/, "").replace(/\s+/gu, " ").trim();
|
|
115
|
+
if (!normalized) return "";
|
|
116
|
+
return normalized.split(" ")[0]?.toUpperCase() ?? normalized.toUpperCase();
|
|
117
|
+
}
|
|
118
|
+
function renderSummaryLine(line, innerWidth) {
|
|
119
|
+
const colon = line.match(/^([^::]{1,16})[::]\s*(.+)$/u);
|
|
120
|
+
if (colon?.[1] && colon[2]) {
|
|
121
|
+
return wrapText(colon[2], Math.max(8, innerWidth - 16)).map((part, idx) => ({
|
|
122
|
+
label: idx === 0 ? `${colon[1]} ` : "",
|
|
123
|
+
value: part
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
return wrapText(line, innerWidth).map((part) => ({ label: "", value: part }));
|
|
127
|
+
}
|
|
128
|
+
function getSelectableRows(panel) {
|
|
129
|
+
return (panel.sections ?? []).flatMap((section) => section.rows).filter(
|
|
130
|
+
(row) => typeof row !== "string" && row.selectable !== false && Boolean(row.taskRef)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
function getRowText(row) {
|
|
134
|
+
return typeof row === "string" ? row : row.text;
|
|
135
|
+
}
|
|
136
|
+
function renderCommandPanelRow({
|
|
137
|
+
row,
|
|
138
|
+
cursor,
|
|
139
|
+
scrollOffset,
|
|
140
|
+
selectableRows,
|
|
141
|
+
selectableCount,
|
|
142
|
+
innerWidth,
|
|
143
|
+
theme
|
|
144
|
+
}) {
|
|
145
|
+
const selectableIndex = typeof row === "string" || row.selectable === false || !row.taskRef ? -1 : selectableRows.indexOf(row);
|
|
146
|
+
if (selectableIndex >= 0 && selectableCount > MAX_SELECTABLE_ROWS) {
|
|
147
|
+
if (selectableIndex < scrollOffset || selectableIndex >= scrollOffset + MAX_SELECTABLE_ROWS) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const text = getRowText(row);
|
|
152
|
+
const isSelectable = selectableIndex >= 0;
|
|
153
|
+
const selected = isSelectable && selectableIndex === cursor;
|
|
154
|
+
const prefix = isSelectable ? selected ? "\u258C > " : " " : "";
|
|
155
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginTop: selected ? 0 : 0, children: wrapText(`${prefix}${text}`, innerWidth).map((part, lineIdx) => /* @__PURE__ */ jsx(
|
|
156
|
+
Text,
|
|
157
|
+
{
|
|
158
|
+
color: selected ? theme.accent : void 0,
|
|
159
|
+
bold: selected,
|
|
160
|
+
children: lineIdx === 0 ? part : ` ${fitText(part, Math.max(8, innerWidth - 2))}`
|
|
161
|
+
},
|
|
162
|
+
`row-${selectableIndex}-${lineIdx}-${part}`
|
|
163
|
+
)) }, `row-${selectableIndex}-${text}`);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export {
|
|
167
|
+
CommandPanel
|
|
168
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bytesPerTokenForFileType,
|
|
3
|
+
estimateToolCallsCharsLocal
|
|
4
|
+
} from "./chunk-WV6YJGZR.js";
|
|
5
|
+
import {
|
|
6
|
+
stableHash
|
|
7
|
+
} from "./chunk-4T5DJW54.js";
|
|
8
|
+
|
|
9
|
+
// src/compact-context.ts
|
|
10
|
+
import { randomUUID } from "crypto";
|
|
11
|
+
var DEFAULT_PRESERVE_RECENT_MESSAGES = 6;
|
|
12
|
+
var COMPACT_SUMMARY_LIMIT = 240;
|
|
13
|
+
function microCompactMessages(messages, options) {
|
|
14
|
+
const maxChars = Math.max(0, options.maxChars);
|
|
15
|
+
if (estimateModelMessagesChars(messages) <= maxChars) {
|
|
16
|
+
return { messages, boundary: null, changed: false };
|
|
17
|
+
}
|
|
18
|
+
const groups = groupMessagesWithoutSplittingToolPairs(messages);
|
|
19
|
+
const keepRecent = Math.max(
|
|
20
|
+
0,
|
|
21
|
+
options.preserveRecentMessages ?? DEFAULT_PRESERVE_RECENT_MESSAGES
|
|
22
|
+
);
|
|
23
|
+
const keepFromIndex = (() => {
|
|
24
|
+
let accumulatedChars = 0;
|
|
25
|
+
let accumulatedMessages = 0;
|
|
26
|
+
for (let i = groups.length - 1; i >= 0; i -= 1) {
|
|
27
|
+
const group = groups[i];
|
|
28
|
+
if (!group) continue;
|
|
29
|
+
const groupChars = estimateModelMessagesChars(group.messages);
|
|
30
|
+
if (accumulatedMessages >= keepRecent && accumulatedChars + groupChars > maxChars) {
|
|
31
|
+
return i + 1;
|
|
32
|
+
}
|
|
33
|
+
accumulatedChars += groupChars;
|
|
34
|
+
accumulatedMessages += group.messages.length;
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
})();
|
|
38
|
+
const selected = [];
|
|
39
|
+
for (let i = keepFromIndex; i < groups.length; i += 1) {
|
|
40
|
+
const group = groups[i];
|
|
41
|
+
if (!group) continue;
|
|
42
|
+
for (const msg of group.messages) {
|
|
43
|
+
selected.push(msg);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const system = messages[0]?.role === "system" ? messages[0] : void 0;
|
|
47
|
+
const finalMessages = system && selected[0] !== system ? [system, ...selected] : selected;
|
|
48
|
+
const finalSet = new Set(finalMessages);
|
|
49
|
+
const removed = messages.filter((message) => !finalSet.has(message));
|
|
50
|
+
const preservedEvidenceRefs = collectEvidenceRefs(finalMessages);
|
|
51
|
+
const compactedToolResultIds = removed.filter(
|
|
52
|
+
(message) => message.role === "tool"
|
|
53
|
+
).map((message) => message.tool_call_id);
|
|
54
|
+
const boundary = {
|
|
55
|
+
id: randomUUID(),
|
|
56
|
+
kind: options.kind ?? "micro",
|
|
57
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
58
|
+
preCompactTokenEstimate: estimateTokensFromChars(estimateModelMessagesChars(messages)),
|
|
59
|
+
postCompactTokenEstimate: estimateTokensFromChars(estimateModelMessagesChars(finalMessages)),
|
|
60
|
+
compactedToolResultIds,
|
|
61
|
+
preservedEvidenceRefs,
|
|
62
|
+
preservedFiles: collectFileRefs(finalMessages)
|
|
63
|
+
};
|
|
64
|
+
return { messages: finalMessages, boundary, changed: true };
|
|
65
|
+
}
|
|
66
|
+
function compactMessagesToFit(messages, options) {
|
|
67
|
+
const first = microCompactMessages(messages, options);
|
|
68
|
+
if (estimateModelMessagesChars(first.messages) <= Math.max(0, options.maxChars)) {
|
|
69
|
+
return first;
|
|
70
|
+
}
|
|
71
|
+
return microCompactMessages(first.messages, {
|
|
72
|
+
...options,
|
|
73
|
+
preserveRecentMessages: 1,
|
|
74
|
+
kind: options.kind ?? "micro"
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function createManualCompactBoundary(input) {
|
|
78
|
+
return {
|
|
79
|
+
id: randomUUID(),
|
|
80
|
+
kind: "manual",
|
|
81
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
82
|
+
preCompactTokenEstimate: estimateTokensFromChars(input.preCompactChars),
|
|
83
|
+
postCompactTokenEstimate: estimateTokensFromChars(input.postCompactChars),
|
|
84
|
+
compactedToolResultIds: [],
|
|
85
|
+
preservedEvidenceRefs: sanitizeRefs(input.preservedEvidenceRefs ?? []),
|
|
86
|
+
preservedFiles: sanitizeRefs(input.preservedFiles ?? []),
|
|
87
|
+
handoffPacketId: input.handoffPacketId
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function compactBoundaryHash(boundaries) {
|
|
91
|
+
return stableHash(
|
|
92
|
+
boundaries.map((boundary) => ({
|
|
93
|
+
id: boundary.id,
|
|
94
|
+
kind: boundary.kind,
|
|
95
|
+
createdAt: boundary.createdAt,
|
|
96
|
+
pre: boundary.preCompactTokenEstimate,
|
|
97
|
+
post: boundary.postCompactTokenEstimate,
|
|
98
|
+
evidence: boundary.preservedEvidenceRefs,
|
|
99
|
+
files: boundary.preservedFiles
|
|
100
|
+
}))
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function estimateModelMessagesChars(messages) {
|
|
104
|
+
return messages.reduce((total, message) => {
|
|
105
|
+
if (message.role === "assistant") {
|
|
106
|
+
return total + message.content.length + estimateToolCallsCharsLocal(message.toolCalls);
|
|
107
|
+
}
|
|
108
|
+
return total + message.content.length;
|
|
109
|
+
}, 0);
|
|
110
|
+
}
|
|
111
|
+
function groupMessagesWithoutSplittingToolPairs(messages) {
|
|
112
|
+
const groups = [];
|
|
113
|
+
let index = 0;
|
|
114
|
+
while (index < messages.length) {
|
|
115
|
+
const message = messages[index];
|
|
116
|
+
if (message?.role === "assistant" && message.toolCalls?.length) {
|
|
117
|
+
const group = [message];
|
|
118
|
+
const expected = new Set(message.toolCalls.map((toolCall) => toolCall.id));
|
|
119
|
+
let cursor = index + 1;
|
|
120
|
+
while (cursor < messages.length) {
|
|
121
|
+
const next = messages[cursor];
|
|
122
|
+
if (next?.role !== "tool" || !expected.has(next.tool_call_id)) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
group.push(next);
|
|
126
|
+
expected.delete(next.tool_call_id);
|
|
127
|
+
cursor += 1;
|
|
128
|
+
}
|
|
129
|
+
groups.push({ messages: expected.size === 0 ? group : [] });
|
|
130
|
+
index = cursor;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (message?.role === "tool") {
|
|
134
|
+
groups.push({ messages: [] });
|
|
135
|
+
index += 1;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (message) {
|
|
139
|
+
groups.push({ messages: [message] });
|
|
140
|
+
}
|
|
141
|
+
index += 1;
|
|
142
|
+
}
|
|
143
|
+
return groups;
|
|
144
|
+
}
|
|
145
|
+
function collectEvidenceRefs(messages) {
|
|
146
|
+
const refs = /* @__PURE__ */ new Set();
|
|
147
|
+
for (const message of messages) {
|
|
148
|
+
const matches = message.content.matchAll(/"evidenceId"\s*:\s*"([^"]+)"/g);
|
|
149
|
+
for (const match of matches) {
|
|
150
|
+
refs.add(match[1] ?? "");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return sanitizeRefs([...refs].filter(Boolean));
|
|
154
|
+
}
|
|
155
|
+
function collectFileRefs(messages) {
|
|
156
|
+
const refs = /* @__PURE__ */ new Set();
|
|
157
|
+
for (const message of messages) {
|
|
158
|
+
const matches = message.content.matchAll(
|
|
159
|
+
/"?(?:path|file|source)"?\s*[:=]\s*["']?([^"'\s,}]{1,160})/g
|
|
160
|
+
);
|
|
161
|
+
for (const match of matches) {
|
|
162
|
+
const value = match[1] ?? "";
|
|
163
|
+
if (value.includes("/") || value.includes(".")) {
|
|
164
|
+
refs.add(value);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return sanitizeRefs([...refs]);
|
|
169
|
+
}
|
|
170
|
+
function sanitizeRefs(refs) {
|
|
171
|
+
return refs.map((ref) => truncateText(ref.replace(/\s+/g, " "), COMPACT_SUMMARY_LIMIT)).slice(0, 20);
|
|
172
|
+
}
|
|
173
|
+
function estimateTokensFromChars(chars) {
|
|
174
|
+
return Math.ceil(chars / bytesPerTokenForFileType(""));
|
|
175
|
+
}
|
|
176
|
+
function truncateText(text, max) {
|
|
177
|
+
if (text.length <= max) return text;
|
|
178
|
+
return `${text.slice(0, Math.max(0, max - 1))}\u2026`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
microCompactMessages,
|
|
183
|
+
compactMessagesToFit,
|
|
184
|
+
createManualCompactBoundary,
|
|
185
|
+
compactBoundaryHash,
|
|
186
|
+
estimateModelMessagesChars
|
|
187
|
+
};
|