@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,709 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WorkflowProgressView
|
|
3
|
+
} from "./chunk-KO64OFSG.js";
|
|
4
|
+
import {
|
|
5
|
+
StatusFooter
|
|
6
|
+
} from "./chunk-SOPYWTFV.js";
|
|
7
|
+
import {
|
|
8
|
+
StatusTray
|
|
9
|
+
} from "./chunk-6RJVTUWI.js";
|
|
10
|
+
import {
|
|
11
|
+
TaskListView
|
|
12
|
+
} from "./chunk-JGDIO2NF.js";
|
|
13
|
+
import {
|
|
14
|
+
TaskSuggestionBar
|
|
15
|
+
} from "./chunk-CRQORMFF.js";
|
|
16
|
+
import {
|
|
17
|
+
UnseenMessagePill
|
|
18
|
+
} from "./chunk-SQIBPLLV.js";
|
|
19
|
+
import {
|
|
20
|
+
NotificationStack
|
|
21
|
+
} from "./chunk-JLCPHVBN.js";
|
|
22
|
+
import {
|
|
23
|
+
ProductBlock
|
|
24
|
+
} from "./chunk-M4AIK2SP.js";
|
|
25
|
+
import {
|
|
26
|
+
SessionsPanel
|
|
27
|
+
} from "./chunk-YH6UIHNF.js";
|
|
28
|
+
import {
|
|
29
|
+
BtwPanel
|
|
30
|
+
} from "./chunk-F6TVBCZV.js";
|
|
31
|
+
import {
|
|
32
|
+
CommandPanel
|
|
33
|
+
} from "./chunk-UOHZQIVL.js";
|
|
34
|
+
import {
|
|
35
|
+
Composer
|
|
36
|
+
} from "./chunk-ZOSK2UEU.js";
|
|
37
|
+
import {
|
|
38
|
+
ConfigPanel
|
|
39
|
+
} from "./chunk-VCSRBS47.js";
|
|
40
|
+
import {
|
|
41
|
+
HelpPanel
|
|
42
|
+
} from "./chunk-D3UTL2QX.js";
|
|
43
|
+
import {
|
|
44
|
+
StreamingMarkdown
|
|
45
|
+
} from "./chunk-DTK5NBTV.js";
|
|
46
|
+
import {
|
|
47
|
+
AgentProgressTree
|
|
48
|
+
} from "./chunk-TJLC3QAS.js";
|
|
49
|
+
import {
|
|
50
|
+
BackgroundTaskOverlay
|
|
51
|
+
} from "./chunk-6CI6TKLN.js";
|
|
52
|
+
import {
|
|
53
|
+
bindTerminalInteractionSignals,
|
|
54
|
+
createTerminalInteractionSession,
|
|
55
|
+
resolveTerminalInteractionModes,
|
|
56
|
+
writeBestEffort
|
|
57
|
+
} from "./chunk-F46N43MG.js";
|
|
58
|
+
import {
|
|
59
|
+
recoverTerminalState
|
|
60
|
+
} from "./chunk-CFMSB6ST.js";
|
|
61
|
+
import {
|
|
62
|
+
drainStdin,
|
|
63
|
+
writeSGRResetAndFlush
|
|
64
|
+
} from "./chunk-XFPNU42I.js";
|
|
65
|
+
import {
|
|
66
|
+
createShellTheme,
|
|
67
|
+
getStatusMarker
|
|
68
|
+
} from "./chunk-GC55DMZV.js";
|
|
69
|
+
import {
|
|
70
|
+
detectTerminalCapability
|
|
71
|
+
} from "./chunk-DICVLZHH.js";
|
|
72
|
+
import {
|
|
73
|
+
brandWordmark,
|
|
74
|
+
composerMaxWidth,
|
|
75
|
+
fitText,
|
|
76
|
+
taskComposerMaxWidth
|
|
77
|
+
} from "./chunk-APJIC2O5.js";
|
|
78
|
+
|
|
79
|
+
// src/shell/components/ShellApp.tsx
|
|
80
|
+
import { Box, Static, Text } from "@linghun/ink-runtime";
|
|
81
|
+
import { useEffect, useMemo, useState } from "react";
|
|
82
|
+
|
|
83
|
+
// src/shell/ink-renderer.tsx
|
|
84
|
+
import { render } from "@linghun/ink-runtime";
|
|
85
|
+
import "react";
|
|
86
|
+
import { jsx } from "react/jsx-runtime";
|
|
87
|
+
function shouldUseInkShell(input, output) {
|
|
88
|
+
if (process.env.LINGHUN_TUI_PLAIN === "1") return false;
|
|
89
|
+
if (process.env.TERM === "dumb") return false;
|
|
90
|
+
if (input.isTTY !== true) return false;
|
|
91
|
+
if (output.isTTY !== true) return false;
|
|
92
|
+
const capability = detectTerminalCapability();
|
|
93
|
+
if (!capability.cursorPositioning) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
function renderInkShell(controller, options = {}) {
|
|
97
|
+
const stdout = options.stdout;
|
|
98
|
+
const capability = detectTerminalCapability();
|
|
99
|
+
const useAlternateScreen = resolveAlternateScreen(capability);
|
|
100
|
+
const terminalInteractionModes = resolveTerminalInteractionModes({
|
|
101
|
+
capability,
|
|
102
|
+
appOwnedScreen: useAlternateScreen
|
|
103
|
+
});
|
|
104
|
+
const terminalInteractionSession = createTerminalInteractionSession(
|
|
105
|
+
stdout,
|
|
106
|
+
terminalInteractionModes
|
|
107
|
+
);
|
|
108
|
+
const terminalInteractionSignals = bindTerminalInteractionSignals(
|
|
109
|
+
process,
|
|
110
|
+
terminalInteractionSession
|
|
111
|
+
);
|
|
112
|
+
let instance;
|
|
113
|
+
try {
|
|
114
|
+
terminalInteractionSession.enable();
|
|
115
|
+
instance = render(/* @__PURE__ */ jsx(ShellApp, { controller, capability }), {
|
|
116
|
+
stdin: options.stdin,
|
|
117
|
+
stdout,
|
|
118
|
+
stderr: options.stderr,
|
|
119
|
+
exitOnCtrlC: false,
|
|
120
|
+
alternateScreen: useAlternateScreen
|
|
121
|
+
});
|
|
122
|
+
} catch (error) {
|
|
123
|
+
terminalInteractionSession.disable();
|
|
124
|
+
void recoverTerminalState(stdout, {
|
|
125
|
+
exitAlternateScreen: useAlternateScreen,
|
|
126
|
+
logError: (msg) => {
|
|
127
|
+
const stderr = options.stderr;
|
|
128
|
+
stderr?.write(`[linghun] ${msg}
|
|
129
|
+
`);
|
|
130
|
+
}
|
|
131
|
+
}).catch(() => {
|
|
132
|
+
});
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
let unmounted = false;
|
|
136
|
+
let resizeTimer;
|
|
137
|
+
let waitUntilExitPromise;
|
|
138
|
+
const doUnmount = () => {
|
|
139
|
+
if (unmounted) return;
|
|
140
|
+
unmounted = true;
|
|
141
|
+
if (resizeTimer) {
|
|
142
|
+
clearTimeout(resizeTimer);
|
|
143
|
+
resizeTimer = void 0;
|
|
144
|
+
}
|
|
145
|
+
terminalInteractionSignals.dispose();
|
|
146
|
+
stdout?.off("resize", onResize);
|
|
147
|
+
stdinStream?.off("close", doUnmount);
|
|
148
|
+
stdinStream?.off("end", doUnmount);
|
|
149
|
+
stdinStream?.off("error", doUnmount);
|
|
150
|
+
stdout?.off("close", doUnmount);
|
|
151
|
+
stdout?.off("error", doUnmount);
|
|
152
|
+
try {
|
|
153
|
+
instance.unmount();
|
|
154
|
+
} catch {
|
|
155
|
+
}
|
|
156
|
+
terminalInteractionSession.disable();
|
|
157
|
+
drainStdin(stdinStream);
|
|
158
|
+
void writeSGRResetAndFlush(stdout).catch(() => {
|
|
159
|
+
});
|
|
160
|
+
showTerminalCursor(stdout);
|
|
161
|
+
const stdin = options.stdin;
|
|
162
|
+
stdin?.unref?.();
|
|
163
|
+
};
|
|
164
|
+
const rerender = () => {
|
|
165
|
+
if (unmounted) return;
|
|
166
|
+
try {
|
|
167
|
+
instance.rerender(/* @__PURE__ */ jsx(ShellApp, { controller, capability }));
|
|
168
|
+
} catch (error) {
|
|
169
|
+
const stderr = options.stderr;
|
|
170
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
171
|
+
stderr?.write(`[linghun] Render error: ${message}
|
|
172
|
+
`);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const onResize = () => {
|
|
176
|
+
if (resizeTimer) clearTimeout(resizeTimer);
|
|
177
|
+
resizeTimer = setTimeout(() => {
|
|
178
|
+
resizeTimer = void 0;
|
|
179
|
+
if (unmounted) return;
|
|
180
|
+
try {
|
|
181
|
+
if (useAlternateScreen) {
|
|
182
|
+
instance.clear();
|
|
183
|
+
}
|
|
184
|
+
} catch {
|
|
185
|
+
}
|
|
186
|
+
terminalInteractionSession.reassert();
|
|
187
|
+
rerender();
|
|
188
|
+
}, 60);
|
|
189
|
+
};
|
|
190
|
+
const stdinStream = options.stdin;
|
|
191
|
+
stdinStream?.on("close", doUnmount);
|
|
192
|
+
stdinStream?.on("end", doUnmount);
|
|
193
|
+
stdinStream?.on("error", doUnmount);
|
|
194
|
+
stdout?.on("close", doUnmount);
|
|
195
|
+
stdout?.on("error", doUnmount);
|
|
196
|
+
stdout?.on("resize", onResize);
|
|
197
|
+
return {
|
|
198
|
+
rerender,
|
|
199
|
+
clear: () => instance.clear(),
|
|
200
|
+
unmount: doUnmount,
|
|
201
|
+
waitUntilExit: async () => {
|
|
202
|
+
if (unmounted) return;
|
|
203
|
+
waitUntilExitPromise ??= instance.waitUntilExit().then(() => void 0);
|
|
204
|
+
await waitUntilExitPromise;
|
|
205
|
+
},
|
|
206
|
+
waitUntilRenderFlush: async () => {
|
|
207
|
+
await instance.waitUntilRenderFlush();
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function resolveAlternateScreen(capability) {
|
|
212
|
+
if (process.env.LINGHUN_FULLSCREEN === "1") {
|
|
213
|
+
if (!capability.alternateScreen) return false;
|
|
214
|
+
if (process.env.TMUX_PANE || process.env.TERM_PROGRAM === "tmux") return false;
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
function showTerminalCursor(stdout) {
|
|
220
|
+
writeBestEffort(stdout, "\x1B[?25h");
|
|
221
|
+
}
|
|
222
|
+
function isNoColorTerminal() {
|
|
223
|
+
return process.env.NO_COLOR === "1" || process.env.FORCE_COLOR === "0";
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/shell/components/ShellApp.tsx
|
|
227
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
228
|
+
function ShellApp({
|
|
229
|
+
controller,
|
|
230
|
+
capability
|
|
231
|
+
}) {
|
|
232
|
+
const view = controller.getViewModel();
|
|
233
|
+
const theme = useMemo(() => createShellTheme(view.themeMode === "no-color"), [view.themeMode]);
|
|
234
|
+
const panel = resolvePanel(view, controller, view.width, view.themeMode === "no-color");
|
|
235
|
+
if (panel) {
|
|
236
|
+
const cardWidth = Math.min(view.width - 4, 80);
|
|
237
|
+
return /* @__PURE__ */ jsxs(
|
|
238
|
+
Box,
|
|
239
|
+
{
|
|
240
|
+
width: view.width,
|
|
241
|
+
height: view.height,
|
|
242
|
+
flexDirection: "column",
|
|
243
|
+
backgroundColor: theme.background,
|
|
244
|
+
alignItems: "center",
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ jsx2(Box, { flexGrow: 1, minHeight: 0 }),
|
|
247
|
+
/* @__PURE__ */ jsx2(Box, { flexShrink: 0, width: cardWidth, children: /* @__PURE__ */ jsx2(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: "\u2500".repeat(cardWidth) }) }),
|
|
248
|
+
/* @__PURE__ */ jsx2(
|
|
249
|
+
Box,
|
|
250
|
+
{
|
|
251
|
+
flexDirection: "column",
|
|
252
|
+
paddingTop: 1,
|
|
253
|
+
flexShrink: 1,
|
|
254
|
+
overflow: "hidden",
|
|
255
|
+
width: cardWidth,
|
|
256
|
+
children: panel
|
|
257
|
+
}
|
|
258
|
+
),
|
|
259
|
+
/* @__PURE__ */ jsx2(Box, { flexShrink: 0, width: cardWidth, children: /* @__PURE__ */ jsx2(Text, { color: theme.dim ?? theme.muted, dimColor: true, children: "\u2500".repeat(cardWidth) }) }),
|
|
260
|
+
/* @__PURE__ */ jsx2(Box, { flexGrow: 1, minHeight: 0 }),
|
|
261
|
+
view.taskFooter ? /* @__PURE__ */ jsx2(
|
|
262
|
+
StatusFooter,
|
|
263
|
+
{
|
|
264
|
+
footer: view.taskFooter,
|
|
265
|
+
theme,
|
|
266
|
+
width: view.width,
|
|
267
|
+
language: view.language,
|
|
268
|
+
modelDim: view.taskFooter.modelDim,
|
|
269
|
+
cacheTone: view.taskFooter.cacheTone
|
|
270
|
+
}
|
|
271
|
+
) : null,
|
|
272
|
+
/* @__PURE__ */ jsx2(Box, { height: 0, overflow: "hidden", children: /* @__PURE__ */ jsx2(Composer, { view, onInput: controller.onInput, capability }) })
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
if (view.viewMode === "task" || view.viewMode === "pending") {
|
|
278
|
+
return /* @__PURE__ */ jsx2(TaskLayout, { view, theme, controller, capability });
|
|
279
|
+
}
|
|
280
|
+
return /* @__PURE__ */ jsx2(HomeLayout, { view, theme, controller, capability });
|
|
281
|
+
}
|
|
282
|
+
function HomeLayout({
|
|
283
|
+
view,
|
|
284
|
+
theme,
|
|
285
|
+
controller,
|
|
286
|
+
capability
|
|
287
|
+
}) {
|
|
288
|
+
const noColor = view.themeMode === "no-color";
|
|
289
|
+
const cw = composerMaxWidth(view.width);
|
|
290
|
+
const brandLines = brandWordmark(noColor, view.width, capability);
|
|
291
|
+
return /* @__PURE__ */ jsxs(
|
|
292
|
+
Box,
|
|
293
|
+
{
|
|
294
|
+
flexDirection: "column",
|
|
295
|
+
width: view.width,
|
|
296
|
+
height: view.height,
|
|
297
|
+
alignItems: "center",
|
|
298
|
+
justifyContent: "center",
|
|
299
|
+
children: [
|
|
300
|
+
/* @__PURE__ */ jsx2(Box, { flexGrow: 1, minHeight: 0 }),
|
|
301
|
+
/* @__PURE__ */ jsx2(Box, { flexDirection: "column", alignItems: "center", children: brandLines.map((line) => /* @__PURE__ */ jsx2(Text, { color: theme.brand, bold: true, children: line }, line || "empty")) }),
|
|
302
|
+
view.homeVision ? /* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(Text, { color: theme.muted, children: fitText(view.homeVision, cw - 2) }) }) : null,
|
|
303
|
+
view.setupHint ? /* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", width: cw, children: /* @__PURE__ */ jsx2(Text, { color: theme.warning, children: fitText(view.setupHint, cw - 2) }) }) : null,
|
|
304
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, flexDirection: "column", width: cw, children: /* @__PURE__ */ jsx2(Composer, { view, onInput: controller.onInput, capability }) }),
|
|
305
|
+
/* @__PURE__ */ jsx2(Box, { marginTop: 1, justifyContent: "center", children: /* @__PURE__ */ jsx2(StatusTray, { status: view.status, theme, width: view.width }) }),
|
|
306
|
+
view.blocks.length > 0 ? /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, width: cw, children: view.blocks.map((block) => /* @__PURE__ */ jsx2(
|
|
307
|
+
ProductBlock,
|
|
308
|
+
{
|
|
309
|
+
block,
|
|
310
|
+
theme,
|
|
311
|
+
width: cw,
|
|
312
|
+
language: view.language
|
|
313
|
+
},
|
|
314
|
+
block.id
|
|
315
|
+
)) }) : null,
|
|
316
|
+
view.limitations.length > 0 ? /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, width: cw, children: view.limitations.map((item) => /* @__PURE__ */ jsx2(Text, { color: theme.muted, children: item }, item)) }) : null,
|
|
317
|
+
/* @__PURE__ */ jsx2(Box, { flexGrow: 2, minHeight: 0 })
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
function TaskLayout({
|
|
323
|
+
view,
|
|
324
|
+
theme,
|
|
325
|
+
controller,
|
|
326
|
+
capability
|
|
327
|
+
}) {
|
|
328
|
+
const noColor = view.themeMode === "no-color";
|
|
329
|
+
const cw = taskComposerMaxWidth(view.width);
|
|
330
|
+
const contentWidth = Math.max(8, view.width - 4);
|
|
331
|
+
const nativeTranscript = useNativeTranscriptWindow(view.blocks);
|
|
332
|
+
const expandedTranscriptBlock = view.ctrlOExpand?.active && view.ctrlOExpand.blockId ? view.blocks.find((block) => block.id === view.ctrlOExpand?.blockId) : void 0;
|
|
333
|
+
const [, setTick] = useState(0);
|
|
334
|
+
const hasProgress = !!(view.agentProgressTree || view.workflowProgressView);
|
|
335
|
+
useEffect(() => {
|
|
336
|
+
if (!hasProgress) return;
|
|
337
|
+
const timer = setInterval(() => setTick((t) => t + 1), 1e3);
|
|
338
|
+
return () => clearInterval(timer);
|
|
339
|
+
}, [hasProgress]);
|
|
340
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
341
|
+
/* @__PURE__ */ jsx2(
|
|
342
|
+
Static,
|
|
343
|
+
{
|
|
344
|
+
items: nativeTranscript.staticBlocks,
|
|
345
|
+
children: (block) => /* @__PURE__ */ jsx2(Box, { flexDirection: "column", paddingX: 2, children: /* @__PURE__ */ jsx2(
|
|
346
|
+
ProductBlock,
|
|
347
|
+
{
|
|
348
|
+
block,
|
|
349
|
+
theme,
|
|
350
|
+
width: contentWidth,
|
|
351
|
+
language: view.language
|
|
352
|
+
}
|
|
353
|
+
) }, block.id)
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ jsxs(
|
|
357
|
+
Box,
|
|
358
|
+
{
|
|
359
|
+
flexDirection: "column",
|
|
360
|
+
width: view.width,
|
|
361
|
+
height: view.height,
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", flexGrow: 1, minHeight: 0, children: [
|
|
364
|
+
/* @__PURE__ */ jsx2(Box, { flexGrow: 1, minHeight: 0 }),
|
|
365
|
+
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, children: [
|
|
366
|
+
expandedTranscriptBlock ? /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx2(
|
|
367
|
+
ProductBlock,
|
|
368
|
+
{
|
|
369
|
+
block: { ...expandedTranscriptBlock, ctrlOCollapsed: false },
|
|
370
|
+
theme,
|
|
371
|
+
width: contentWidth,
|
|
372
|
+
language: view.language
|
|
373
|
+
}
|
|
374
|
+
) }) : nativeTranscript.liveBlocks.length > 0 ? /* @__PURE__ */ jsx2(Box, { flexDirection: "column", children: nativeTranscript.liveBlocks.map((block) => /* @__PURE__ */ jsx2(
|
|
375
|
+
ProductBlock,
|
|
376
|
+
{
|
|
377
|
+
block,
|
|
378
|
+
theme,
|
|
379
|
+
width: contentWidth,
|
|
380
|
+
language: view.language
|
|
381
|
+
},
|
|
382
|
+
block.id
|
|
383
|
+
)) }) : null,
|
|
384
|
+
view.streamingAssistantText ? /* @__PURE__ */ jsx2(
|
|
385
|
+
Box,
|
|
386
|
+
{
|
|
387
|
+
marginTop: expandedTranscriptBlock || nativeTranscript.liveBlocks.length > 0 ? 1 : 0,
|
|
388
|
+
children: /* @__PURE__ */ jsx2(
|
|
389
|
+
StreamingMarkdown,
|
|
390
|
+
{
|
|
391
|
+
text: view.streamingAssistantText,
|
|
392
|
+
theme,
|
|
393
|
+
wrapWidth: contentWidth
|
|
394
|
+
}
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
) : null,
|
|
398
|
+
view.activity ? /* @__PURE__ */ jsx2(
|
|
399
|
+
Box,
|
|
400
|
+
{
|
|
401
|
+
marginTop: expandedTranscriptBlock || nativeTranscript.liveBlocks.length > 0 || view.streamingAssistantText ? 1 : 0,
|
|
402
|
+
children: /* @__PURE__ */ jsx2(
|
|
403
|
+
ActivityIndicator,
|
|
404
|
+
{
|
|
405
|
+
activity: view.activity,
|
|
406
|
+
theme,
|
|
407
|
+
tokenCount: estimateStreamingTokens(view.streamingAssistantText)
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
) : null,
|
|
412
|
+
view.taskSuggestions && view.taskSuggestions.length > 0 ? /* @__PURE__ */ jsx2(
|
|
413
|
+
TaskSuggestionBar,
|
|
414
|
+
{
|
|
415
|
+
suggestions: view.taskSuggestions,
|
|
416
|
+
cursor: view.taskSuggestionCursor ?? 0,
|
|
417
|
+
width: view.width,
|
|
418
|
+
noColor
|
|
419
|
+
}
|
|
420
|
+
) : null,
|
|
421
|
+
view.limitations.length > 0 ? /* @__PURE__ */ jsx2(Box, { flexDirection: "column", marginTop: 1, children: view.limitations.map((item) => /* @__PURE__ */ jsx2(Text, { color: theme.muted, children: item }, item)) }) : null
|
|
422
|
+
] }),
|
|
423
|
+
view.unseenMessageCount && view.unseenMessageCount > 0 ? /* @__PURE__ */ jsx2(
|
|
424
|
+
UnseenMessagePill,
|
|
425
|
+
{
|
|
426
|
+
count: view.unseenMessageCount,
|
|
427
|
+
language: view.language,
|
|
428
|
+
width: view.width
|
|
429
|
+
}
|
|
430
|
+
) : null
|
|
431
|
+
] }),
|
|
432
|
+
/* @__PURE__ */ jsxs(Box, { flexShrink: 0, flexDirection: "column", children: [
|
|
433
|
+
view.backgroundTaskOverlay && !view.permission ? /* @__PURE__ */ jsx2(
|
|
434
|
+
BackgroundTaskOverlay,
|
|
435
|
+
{
|
|
436
|
+
overlay: view.backgroundTaskOverlay,
|
|
437
|
+
width: contentWidth,
|
|
438
|
+
noColor
|
|
439
|
+
}
|
|
440
|
+
) : null,
|
|
441
|
+
view.configPanel ? /* @__PURE__ */ jsx2(
|
|
442
|
+
ConfigPanel,
|
|
443
|
+
{
|
|
444
|
+
panel: view.configPanel,
|
|
445
|
+
controller,
|
|
446
|
+
width: view.width,
|
|
447
|
+
noColor,
|
|
448
|
+
language: view.language
|
|
449
|
+
}
|
|
450
|
+
) : null,
|
|
451
|
+
/* @__PURE__ */ jsx2(NotificationStack, { notifications: view.notifications, theme }),
|
|
452
|
+
view.taskRuntimeSummary ? /* @__PURE__ */ jsx2(Box, { width: cw, marginTop: 1, children: /* @__PURE__ */ jsx2(
|
|
453
|
+
ProductBlock,
|
|
454
|
+
{
|
|
455
|
+
block: view.taskRuntimeSummary,
|
|
456
|
+
theme,
|
|
457
|
+
width: cw,
|
|
458
|
+
language: view.language
|
|
459
|
+
}
|
|
460
|
+
) }) : null,
|
|
461
|
+
view.taskListView ? /* @__PURE__ */ jsx2(Box, { paddingX: 2, marginBottom: 1, children: /* @__PURE__ */ jsx2(
|
|
462
|
+
TaskListView,
|
|
463
|
+
{
|
|
464
|
+
list: view.taskListView,
|
|
465
|
+
width: contentWidth,
|
|
466
|
+
noColor,
|
|
467
|
+
language: view.language
|
|
468
|
+
}
|
|
469
|
+
) }) : null,
|
|
470
|
+
view.agentProgressTree ? /* @__PURE__ */ jsx2(Box, { width: view.width, paddingX: 2, children: /* @__PURE__ */ jsx2(
|
|
471
|
+
AgentProgressTree,
|
|
472
|
+
{
|
|
473
|
+
tree: view.agentProgressTree,
|
|
474
|
+
width: contentWidth,
|
|
475
|
+
noColor,
|
|
476
|
+
language: view.language
|
|
477
|
+
}
|
|
478
|
+
) }) : null,
|
|
479
|
+
view.workflowProgressView ? /* @__PURE__ */ jsx2(Box, { width: view.width, paddingX: 2, children: /* @__PURE__ */ jsx2(
|
|
480
|
+
WorkflowProgressView,
|
|
481
|
+
{
|
|
482
|
+
workflow: view.workflowProgressView,
|
|
483
|
+
width: contentWidth,
|
|
484
|
+
noColor,
|
|
485
|
+
language: view.language
|
|
486
|
+
}
|
|
487
|
+
) }) : null,
|
|
488
|
+
/* @__PURE__ */ jsx2(Box, { flexDirection: "column", width: cw, paddingTop: 1, children: /* @__PURE__ */ jsx2(Composer, { view, onInput: controller.onInput, capability }) }),
|
|
489
|
+
view.taskFooter ? /* @__PURE__ */ jsx2(
|
|
490
|
+
StatusFooter,
|
|
491
|
+
{
|
|
492
|
+
footer: view.taskFooter,
|
|
493
|
+
theme,
|
|
494
|
+
width: view.width,
|
|
495
|
+
language: view.language,
|
|
496
|
+
modelDim: view.taskFooter.modelDim,
|
|
497
|
+
cacheTone: view.taskFooter.cacheTone
|
|
498
|
+
}
|
|
499
|
+
) : null
|
|
500
|
+
] })
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
)
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
var NATIVE_TRANSCRIPT_LIVE_BLOCKS = 6;
|
|
507
|
+
function useNativeTranscriptWindow(blocks) {
|
|
508
|
+
const liveStart = Math.max(0, blocks.length - NATIVE_TRANSCRIPT_LIVE_BLOCKS);
|
|
509
|
+
return {
|
|
510
|
+
staticBlocks: blocks.slice(0, liveStart),
|
|
511
|
+
liveBlocks: blocks.slice(liveStart)
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function resolvePanel(view, controller, width, noColor) {
|
|
515
|
+
if (view.helpPanel) {
|
|
516
|
+
return /* @__PURE__ */ jsx2(
|
|
517
|
+
HelpPanel,
|
|
518
|
+
{
|
|
519
|
+
panel: view.helpPanel,
|
|
520
|
+
controller,
|
|
521
|
+
width,
|
|
522
|
+
noColor,
|
|
523
|
+
language: view.language
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
if (view.btwPanel) {
|
|
528
|
+
return /* @__PURE__ */ jsx2(
|
|
529
|
+
BtwPanel,
|
|
530
|
+
{
|
|
531
|
+
panel: view.btwPanel,
|
|
532
|
+
controller,
|
|
533
|
+
width,
|
|
534
|
+
noColor,
|
|
535
|
+
language: view.language
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
if (view.sessionsPanel) {
|
|
540
|
+
return /* @__PURE__ */ jsx2(
|
|
541
|
+
SessionsPanel,
|
|
542
|
+
{
|
|
543
|
+
panel: view.sessionsPanel,
|
|
544
|
+
controller,
|
|
545
|
+
width,
|
|
546
|
+
noColor,
|
|
547
|
+
language: view.language
|
|
548
|
+
}
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
if (view.commandPanel) {
|
|
552
|
+
return /* @__PURE__ */ jsx2(
|
|
553
|
+
CommandPanel,
|
|
554
|
+
{
|
|
555
|
+
panel: view.commandPanel,
|
|
556
|
+
controller,
|
|
557
|
+
width,
|
|
558
|
+
noColor,
|
|
559
|
+
language: view.language
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
function ActivityIndicator({
|
|
566
|
+
activity,
|
|
567
|
+
theme,
|
|
568
|
+
tokenCount
|
|
569
|
+
}) {
|
|
570
|
+
const [frame, setFrame] = useState(0);
|
|
571
|
+
const [hidden, setHidden] = useState(false);
|
|
572
|
+
useEffect(() => {
|
|
573
|
+
if (activity.phase === "completed" || activity.phase === "error") {
|
|
574
|
+
const hideTimer = setTimeout(() => setHidden(true), 1200);
|
|
575
|
+
return () => clearTimeout(hideTimer);
|
|
576
|
+
}
|
|
577
|
+
setHidden(false);
|
|
578
|
+
return;
|
|
579
|
+
}, [activity.phase]);
|
|
580
|
+
useEffect(() => {
|
|
581
|
+
if (activity.phase === "completed" || activity.phase === "error" || activity.phase === "permission_waiting") {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
const timer = setInterval(() => setFrame((current) => current + 1), 100);
|
|
585
|
+
return () => clearInterval(timer);
|
|
586
|
+
}, [activity.phase]);
|
|
587
|
+
if (hidden) return null;
|
|
588
|
+
const colorMap = {
|
|
589
|
+
thinking: theme.status.running,
|
|
590
|
+
tool_running: theme.status.running,
|
|
591
|
+
permission_waiting: theme.status.blocked,
|
|
592
|
+
continuing: theme.status.info,
|
|
593
|
+
completed: theme.status.info,
|
|
594
|
+
error: theme.status.fail
|
|
595
|
+
};
|
|
596
|
+
const color = colorMap[activity.phase];
|
|
597
|
+
const noColor = theme.mode === "no-color";
|
|
598
|
+
const marker = activityMarker(activity.phase, frame, noColor);
|
|
599
|
+
const seconds = parseElapsedSeconds(activity.elapsed);
|
|
600
|
+
const slow = seconds >= 10 && activity.phase !== "permission_waiting";
|
|
601
|
+
const showTokenCount = seconds >= 30 && tokenCount !== void 0 && (activity.phase === "thinking" || activity.phase === "continuing");
|
|
602
|
+
const text = activityText(activity, tokenCount);
|
|
603
|
+
const slowText = slow ? slowActivityText(activity, tokenCount) : void 0;
|
|
604
|
+
const showStats = activity.phase === "tool_running" && (activity.totalLines || activity.totalBytes);
|
|
605
|
+
const isToolHeader = activity.phase === "tool_running" && activity.toolName;
|
|
606
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
607
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
608
|
+
isToolHeader ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
609
|
+
/* @__PURE__ */ jsxs(Text, { color: theme.toolRunning ?? color, children: [
|
|
610
|
+
marker,
|
|
611
|
+
" "
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsx2(Text, { bold: true, color: theme.toolRunning ?? color, children: activity.toolName }),
|
|
614
|
+
activity.toolTarget ? /* @__PURE__ */ jsxs(Text, { color: theme.muted, children: [
|
|
615
|
+
"(",
|
|
616
|
+
activity.toolTarget,
|
|
617
|
+
")"
|
|
618
|
+
] }) : null
|
|
619
|
+
] }) : /* @__PURE__ */ jsxs(Text, { color, bold: activity.phase === "thinking" && frame % 10 < 5, children: [
|
|
620
|
+
marker,
|
|
621
|
+
" ",
|
|
622
|
+
text
|
|
623
|
+
] }),
|
|
624
|
+
activity.elapsed ? /* @__PURE__ */ jsxs(
|
|
625
|
+
Text,
|
|
626
|
+
{
|
|
627
|
+
color: slow ? theme.warning ?? theme.status.partial : theme.muted,
|
|
628
|
+
dimColor: !slow,
|
|
629
|
+
children: [
|
|
630
|
+
" ",
|
|
631
|
+
"(",
|
|
632
|
+
activity.elapsed,
|
|
633
|
+
")"
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
) : null,
|
|
637
|
+
slowText ? /* @__PURE__ */ jsx2(Text, { color: theme.muted, dimColor: true, children: slowText }) : null,
|
|
638
|
+
showTokenCount ? /* @__PURE__ */ jsx2(Text, { color: theme.muted, dimColor: true, children: activity.language === "en-US" ? ` \xB7 ${tokenCount} tokens` : ` \xB7 ${tokenCount} tokens` }) : null
|
|
639
|
+
] }),
|
|
640
|
+
showStats ? /* @__PURE__ */ jsx2(Box, { children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
641
|
+
" ",
|
|
642
|
+
activity.totalLines ? activity.language === "en-US" ? `~${activity.totalLines} lines` : `~${activity.totalLines} \u884C` : null,
|
|
643
|
+
activity.totalLines && activity.totalBytes ? " \xB7 " : null,
|
|
644
|
+
activity.totalBytes ? formatFileSize(activity.totalBytes) : null
|
|
645
|
+
] }) }) : null
|
|
646
|
+
] });
|
|
647
|
+
}
|
|
648
|
+
function activityMarker(phase, frame, noColor) {
|
|
649
|
+
if (phase === "completed") return getStatusMarker("info", noColor);
|
|
650
|
+
if (phase === "error") return getStatusMarker("fail", noColor);
|
|
651
|
+
if (phase === "permission_waiting") return getStatusMarker("blocked", noColor);
|
|
652
|
+
if (noColor) return ["-", "\\", "|", "/"][frame % 4] ?? "-";
|
|
653
|
+
return frame % 6 < 3 ? "\u25CF" : " ";
|
|
654
|
+
}
|
|
655
|
+
function activityText(activity, tokenCount) {
|
|
656
|
+
if (tokenCount !== void 0 && tokenCount > 0 && (activity.phase === "thinking" || activity.phase === "continuing")) {
|
|
657
|
+
return activity.language === "en-US" ? "Generating answer\u2026" : "\u751F\u6210\u56DE\u7B54\u4E2D\u2026";
|
|
658
|
+
}
|
|
659
|
+
if (activity.phase !== "thinking") return activity.text;
|
|
660
|
+
if (activity.thinkingLabel) return activity.thinkingLabel;
|
|
661
|
+
return activity.text;
|
|
662
|
+
}
|
|
663
|
+
function slowActivityText(activity, tokenCount) {
|
|
664
|
+
const isEn = activity.language === "en-US";
|
|
665
|
+
if (activity.phase === "permission_waiting" || activity.phase === "completed" || activity.phase === "error") {
|
|
666
|
+
return void 0;
|
|
667
|
+
}
|
|
668
|
+
if (activity.phase === "tool_running") {
|
|
669
|
+
return isEn ? " \xB7 tool still running" : " \xB7 \u5DE5\u5177\u4ECD\u5728\u8FD0\u884C";
|
|
670
|
+
}
|
|
671
|
+
if (tokenCount !== void 0 && tokenCount > 0) {
|
|
672
|
+
return isEn ? " \xB7 still generating" : " \xB7 \u6301\u7EED\u751F\u6210";
|
|
673
|
+
}
|
|
674
|
+
if (activity.phase === "continuing") {
|
|
675
|
+
return isEn ? " \xB7 processing result" : " \xB7 \u5904\u7406\u7ED3\u679C\u4E2D";
|
|
676
|
+
}
|
|
677
|
+
return isEn ? " \xB7 waiting for model" : " \xB7 \u7B49\u5F85\u6A21\u578B";
|
|
678
|
+
}
|
|
679
|
+
function parseElapsedSeconds(elapsed) {
|
|
680
|
+
if (!elapsed) return 0;
|
|
681
|
+
const matches = [...elapsed.matchAll(/(\d+)\s*(h|m|s)/giu)];
|
|
682
|
+
if (matches.length === 0) return 0;
|
|
683
|
+
let seconds = 0;
|
|
684
|
+
for (const match of matches) {
|
|
685
|
+
const value = Number(match[1] ?? 0);
|
|
686
|
+
const unit = (match[2] ?? "s").toLowerCase();
|
|
687
|
+
seconds += unit === "h" ? value * 3600 : unit === "m" ? value * 60 : value;
|
|
688
|
+
}
|
|
689
|
+
return seconds;
|
|
690
|
+
}
|
|
691
|
+
function formatFileSize(bytes) {
|
|
692
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
693
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
694
|
+
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
695
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}GB`;
|
|
696
|
+
}
|
|
697
|
+
function estimateStreamingTokens(text) {
|
|
698
|
+
const trimmed = text?.trim();
|
|
699
|
+
if (!trimmed) return void 0;
|
|
700
|
+
return Math.max(1, Math.ceil(trimmed.length / 4));
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export {
|
|
704
|
+
ShellApp,
|
|
705
|
+
shouldUseInkShell,
|
|
706
|
+
renderInkShell,
|
|
707
|
+
resolveAlternateScreen,
|
|
708
|
+
isNoColorTerminal
|
|
709
|
+
};
|